Ad: http://www.mail-archive.com/cmake@cmake.org/msg34968.html

Dear Bill,

------------------------------------------
By default, the current CMAKE_Fortran_LINK_EXECUTABLE consists of several 
variables:

"<CMAKE_Fortran_COMPILER>  <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> 
<OBJECTS>  -o <TARGET>
 <LINK_LIBRARIES>"

We would like to know how to restrict the CMAKE_<compiler>_LINK_EXECUTABLE 
parameter to selected variables only: "<LINK_FLAGS>  <OBJECTS>  -o <TARGET>  
<LINK_LIBRARIES>"
----------------------------------------

The problem lies with the (recent stable) g95 compiler: the linking step with 
the optimization flag, -ffast-math ,  reports missing  object crtfastmath.o in 
the g95-set.

Linking Fortran executable dirac.x
/usr/bin/g95    -fno-second-underscore -i8 -O3 -ffast-math -fsloppy-char 
CMakeFiles/dirac.x.dir/dft/fun-pz81.c.o...
.
.
.... CMakeFiles/dirac.x.dir/eri/fck3ftuv.F.o 
CMakeFiles/dirac.x.dir/pdpack/gpblas.F.o  -o dirac.x  
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5 lib/libxcfun.a
ld: crtfastmath.o: No such file: No such file or directory

If one could avoid the <CMAKE_Fortran_LINK_FLAGS>( -fno-second-underscore -i8 
-O3 -ffast-math -fsloppy-char) parameter in the linking step, containing the 
problematic -ffast-math, one would get the executable without problem. The 
"-ffast-math"flag  works for compilation of fortran source codes, but is 
unsuitable for g95-linking in this case.

Best, Miro

_______________________________________________
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