[CMake] rdynamic and fpp flags failing

Brad King brad.king at kitware.com
Tue Oct 6 12:12:00 EDT 2009


Hi Jason,

I'm keeping this dicussion on-list so it goes in the archives.

 > I see two flag errors in the CMakeError.log file, one is for fpp and
 > the other is(buried, just near the end) for rdynamic. I also can add
 > this about my fortran compiler; it's called ftn and its actually a
 > wrapper script located at /opt/cray/xt-asyncpe/3.4.4/bin/ftn (im on
 > a cray).

Is this a cross-compiling environment?

 >
 > Below is the entire output
 >
 > slemons at seal:~/cmake_test> which ftn
 > /opt/cray/xt-asyncpe/3.4.4/bin/ftn
 > slemons at seal:~/cmake_test> ls
 > CMakeLists.txt  hello.f90
 > slemons at seal:~/cmake_test> cmake CMakeLists.txt
 > -- The Fortran compiler identification is unknown

This problem causes the rest of the failures.

Look in the directory

   /home/users/slemons/cmake_test/CMakeFiles/CompilerIdFortran

for the file

   CMakeFortranCompilerId.F

Try building it with your compiler:

   /opt/cray/xt-asyncpe/3.4.4/bin/ftn CMakeFortranCompilerId.F

Do you get an executable?  If so, what is the output of running it?
What is the output of the command "strings" on it?  Try the same tests
with pgf95 because it should work with that compiler too.

 > -- Check for working Fortran compiler: /opt/pgi/9.0.4/linux86-64/9.0-4/bin/pgf95
 > -- Check for working Fortran compiler: /opt/pgi/9.0.4/linux86-64/9.0-4/bin/pgf95 -- broken
[snip]
 > I couldn't figure out why it would look in
 > /opt/pgi/9.0.4/linux86-64/9.0-4/bin/pgf95 when the wrapper for ftn
 > is at /opt/cray/xt-asyncpe/3.4.4/bin/ftn so I removed everything in
 > my directory(except hello and CMakeLists.txt, just as before) and
 > did

If you don't specify a compiler CMake starts searching for known
compiler executable names in unspecified order.

 >
 > cmake -D CMAKE_Fortran_COMPILER:STRING="/opt/cray/xt-asyncpe/3.4.4/bin/ftn" CMakeLists.txt
 >
[snip]
 > The output to the screen and the CMakeError.log of that run are
 > attached, but it didn't work either. Its strange that even after
 > telling cmake where my fortran compiler is, it still can't seem to
 > find it.

It is finding the compiler you specify.  From your log:

   -- The Fortran compiler identification is unknown
   -- Check for working Fortran compiler: /opt/cray/xt-asyncpe/3.4.4/bin/ftn

It is trying to use ftn.

 > Is there another way to force Cmake to use a certain compiler?

Set "FC=/opt/cray/xt-asyncpe/3.4.4/bin/ftn" in your environment before
running CMake.  This is not much different from setting the variable
CMAKE_Fortran_COMPILER with -D though.

-Brad


More information about the CMake mailing list