[CMake] cmake 2.6 and 2.8 find different fortran compilers with MPI?

Tim Gallagher tim.gallagher at gatech.edu
Mon Jul 2 17:59:22 EDT 2012


If you want it to find a particular compiler always, you should do: 

FC=<ifort or gfortran> cmake ... 

In other words, set the FC environment variable to the desired compiler. 

Likewise, FindMPI will find the first mpicc on your path. If that happens to be the ifort one, that's what you will get. If you have multiple compilers and multiple MPI installations, you might be better off installing the module system (http://linux.die.net/man/1/module) that is commonly used on HPC systems. This way you can ensure that only one installation of what you want is in your environment, and then you don't need to worry about manually setting things or putting things in your path in a particular order. 

Tim 

----- Original Message -----

From: "Eli Ateljevich" <eli at water.ca.gov> 
To: "CMake List" <cmake at cmake.org> 
Sent: Monday, July 2, 2012 5:20:34 PM 
Subject: [CMake] cmake 2.6 and 2.8 find different fortran compilers with MPI? 



Hi, 
I wonder if anyone can help me get a consistent Fortran build out of 2.6 and 2.8.8. I am using CMake 2.6 and 2.8, trying to come up with a compatible build. I had to rob some items from 2.8 to find things like MPI correctly and I have set the policies such that I believe they both use the same FindMPI.cmake. 

For some reason, my 2.6 installation “magically” found the Intel compiler ifort. I never did a set(CMAKE_Fortran_COMPILER). Version 2.8.8 does not do this and defaults to gfortran. The later FindMPI finds an Intel wrapper, not the gfortran version. 

Was this a bug fix or policy change? 
1. If this is a policy, can I manipulate it to make the two builds compatible 
2. What can I do about making the compiler and FindMPI consistent in general, 

Thanks very much, 
Eli 
-- 

Powered by www.kitware.com 

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html 

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ 

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120702/d113df82/attachment.htm>


More information about the CMake mailing list