No problem. It sounds like you are going through the exact same pains and 
questions we went through when we set up our research CFD code with CMake a 
year ago. 

Likewise, the CC and CXX environment variables control the other compilers, if 
you use them. It's okay to use gcc or g++ with ifort, so long as ifort is used 
to link things. But sometimes you may want the entire Intel suite to be used, 
so you may want to set the CC and CXX variables in your modulefile also. 

Tim 

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

From: "Eli Ateljevich" <e...@water.ca.gov> 
To: "tim gallagher" <tim.gallag...@gatech.edu> 
Cc: "CMake List" <cmake@cmake.org> 
Sent: Monday, July 2, 2012 6:09:59 PM 
Subject: RE: [CMake] cmake 2.6 and 2.8 find different fortran compilers with 
MPI? 



Thanks Tim. We do have the module system set up including the compiler, so I’ll 
make sure it defines FC. 





From: Tim Gallagher [mailto:tim.gallag...@gatech.edu] 
Sent: Monday, July 02, 2012 2:59 PM 
To: Ateljevich, Eli 
Cc: CMake List 
Subject: Re: [CMake] cmake 2.6 and 2.8 find different fortran compilers with 
MPI? 


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" <e...@water.ca.gov> 
To: "CMake List" <cmake@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 

--

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

Reply via email to