Reputation: 22448
I am trying to build the Trilinos library on Mac OS X 10.6.8, basically following the instructions on this page and the CMake Quickstart document included with Trilinos.
In order to build it with CMake, the instructions recommend setting up a directory, e.g. /usr/local/trilinos, creating a ./do-configure script in it and running it. My script is:
EXTRA_ARGS=$@
cmake \
-D CMAKE_BUILD_TYPE:STRING=DEBUG \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
$EXTRA_ARGS \
${TRILINOS_HOME}
Running this script starts the configuration, until an error appears. The verbose output can be found here: http://pastebin.com/abrEghD7
I think the relevant part of the message is:
-- Verifying Fortran/CXX Compiler Compatibility - Failed
CMake Error at /usr/local/Cellar/cmake/2.8.7/share/cmake/Modules/FortranCInterface.cmake:284 (message):
The Fortran compiler:
/usr/local/bin/gfortran
and the CXX compiler:
/usr/bin/c++
failed to compile a simple test project using both languages. The output
was:
However, I cannot explain why the script blames the Fortran and C++ compilers. I have tested the Fortran compiler with "Hello World", and used the C++ compiler of OS X for entire projects. As far as I can tell, both compilers work properly.
Can anyone guess what might be wrong?
EDIT: Seems like it is some compatibility issue, not a problem with the indivual compilers.
Upvotes: 1
Views: 1196
Reputation: 10967
Where did you get gfortran from? Builds from most sources don't support mac specific extensions like -arch
which might make problems trying to combine both of them. Or they might just be different versions (if you're gfortran is much newer than your g++ they might be trying to pull in incompatible runtime versions).
In the numerical python community (which depends a lot on fortran) the recommended source for OS X is the binary from here. This is matched to the XCode gcc version and supports the Mac specific extensions.
Upvotes: 1
Reputation: 1897
When I compile paraview. I set my CXX compiler to g++
and not the standard c++
as cmake does. Because otherwise I see a similar error.
Upvotes: 1