[CMake] Re: Fortran Flags

Baptiste Derongs baptiste.derongs at gmail.com
Thu Nov 29 05:22:18 EST 2007


Hum...sorry for that, too fast on the keyboard...

> Hello all,
>
> I'm currently trying to compile some fortran programs. I need to pass
> them some flags (actually mpif90 script flags).

I give flags by setting CMAKE_Fortran_FLAGS variable.

I looked at CMakeFiles/<my executable>.dir/flags.txt, it looks good.
But then I get somme errors during linking step, 'undefined
reference'. It only apperars during the build of the final executable
from objects files.

So I looked in build.make file, and I see that during this step, the
command is :

ifort <FLAGS> $(OBJECTS) -o <Final executable>

And when I try this command by my self, it returns the same errors, to
get my executable the right order is :

ifort $(OBJECT) <FLAGS> -o <Final executable>

Is there something to set in my Cmake file to get the right order ?

Regards

Baptiste


More information about the CMake mailing list