[CMake] Mixing C++ and Fortran
Arjen Markus
arjen.markus at wldelft.nl
Wed Jan 30 02:42:18 EST 2008
Javier Gonzalez wrote:
>
>>Good Fortran support is relatively new to CMake. In fact, CVS CMake
>>is really the only version that handles all the Fortran depend stuff
>>reliably. CMake relies on the compiler to provide the correct run
>>time libraries. If you build with a C++ compiler, it will
>>automatically link in the run time libraries for C++ that go with that
>>compiler. If you link with a fortran compiler, it will get the run
>>time libraries for the fortran compiler. So, CMake has not had to
>>"care" about system runtime libraries. It is easy to mix C with
>>anything because both Fortran and C++ always link in the C runtime
>>libraries by default. Anyway, it is what it is. If you figure
>>something out, we could add it to the cmake modules directory.
>>
>>-Bill
>>_______________________________________________
>>CMake mailing list
>>CMake at cmake.org
>>http://www.cmake.org/mailman/listinfo/cmake
>>
>>
>>
>Just so that everyone knows. I have the same problem and trying to solve
>it was how I got to the problem I emailed a couple of days ago (about
>libgfortran). What I'm doing is finding the library and adding it
>directly. That can be a pain if you have many potential fortran
>compilers, I guess.
>
>
Most compilers have some option to show what is actually going on at each
step. That should be helpful in finding out which libraries are to be used.
For instance: -v works splendidly for the GCC family of compilers (which
includes g95, although not an official part of GCC). A worrisome thing is,
that the collection of libraries may vary, depending on the compile options.
I do hope some practical solution will be found.
Regards,
Arjen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080130/860b3482/attachment.html
More information about the CMake
mailing list