Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Clang is now used to build Chrome for Windows"

46 views
Skip to first unread message

Lynn McGuire

unread,
Mar 7, 2018, 1:35:37 PM3/7/18
to
"Clang is now used to build Chrome for Windows"
http://blog.llvm.org/2018/03/clang-is-now-used-to-build-chrome-for.html

"Clang is the first-ever open-source C++ compiler that’s ABI-compatible
with Microsoft Visual C++ (MSVC) – meaning you can build some parts of
your program (for example, system libraries) with the MSVC compiler
(“cl.exe”), other parts with Clang, and when linked together (either by
MSVC’s linker, “link.exe”, or LLD, the LLVM project’s linker – see
below) the parts will form a working program."

Hey, neat ! I need to check Clang on their Fortran 77 compiler status.
I want to slowly transition our F77 code to C++ in Visual Studio and
this might fit the bill.

Hat tip to:

http://www.osnews.com/story/30220/Clang_is_now_used_to_build_Chrome_for_Windows

Lynn

Chris M. Thomasson

unread,
Mar 7, 2018, 8:05:26 PM3/7/18
to
Interesting. Thank you for the post.

Christian Gollwitzer

unread,
Mar 8, 2018, 2:36:23 AM3/8/18
to
Am 07.03.18 um 19:35 schrieb Lynn McGuire:
> "Clang is now used to build Chrome for Windows"
>    http://blog.llvm.org/2018/03/clang-is-now-used-to-build-chrome-for.html
>
> "Clang is the first-ever open-source C++ compiler that’s ABI-compatible
> with Microsoft Visual C++ (MSVC) – meaning you can build some parts of
> your program (for example, system libraries) with the MSVC compiler
> (“cl.exe”), other parts with Clang, and when linked together (either by
> MSVC’s linker, “link.exe”, or LLD, the LLVM project’s linker – see
> below) the parts will form a working program."
>
> Hey, neat !  I need to check Clang on their Fortran 77 compiler status.
> I want to slowly transition our F77 code to C++ in Visual Studio and
> this might fit the bill.

I don't think you need clang for that, gcc (gfortran or g77) should do
it. For a C <-> Fortran bridge you only need compatibility for C ABI
functions, and there gcc is compatible with VC++ for long time. Only in
case of C++, i.e. name mangling, exceptions etc., you would need clang.

Another option for pure F77 code is f2c which translates F77 into C, and
then you can trivially compile and link it with C++ code. Apart from
strange calling conventions (every parameter, even an integer, is passed
by pointer) this works fairly well. I'm using this in a project to call
out to LAPACK functions.

Christian

Lynn McGuire

unread,
Mar 8, 2018, 5:05:13 PM3/8/18
to
My calculation engine is about 800K lines of F77+ code with about 10,000
lines of C++ code. I need the Visual Studio C++ compiler on Windows to
get rid of a nasty little bug that we have in some system sensitive code.

I would not use f2c to convert F77 code to C. You get horribly mangled
code. The Fable F77 to C++ code looks much cleaner. Fable does have a
weirdism in that it converts all common block variables to a single huge
global variable and passes that around through the argument list. With
my 300+ common blocks, that might be difficult to debug.
http://cci.lbl.gov/fable/

Lynn

Thanks,
Lynn

Tim Prince

unread,
Mar 8, 2018, 5:55:31 PM3/8/18
to
If their reference Fortran code is as unmaintainable as they say, it's
difficult to believe that automatic translation can fix that. We don't
have much Fortran left which fits their restriction to fixed form F77,
although I have kept my tools around which translate limited f90 back to
f66. Still, it might be good occasionally to have an alternative to
f2c. I guess they have to drop their past goal of putting a great deal
of effort to translate so as to support systems with minimal tools, now
that they need python and c++, and you won't find them on a system which
lacks gfortran.

--
Tim Prince
0 new messages