Re: [CMake] fortran flags in a c++ linked executable

2009-04-01 Thread Denis Scherbakov
Elena, Try to compile and link by hand. For example - write one CPP, one F90, then compile them with flags you want and link them with flags you want. After you find out, what you need, you may start experimenting with CMake flags. gmake VERBOSE=1 can help you alot to see what is happening

Re: [CMake] fortran flags in a c++ linked executable

2009-04-01 Thread Arjen Markus
Isn't that a compiler flag? You would have to specify that at compile time, not link time. Regards, Arjen On 2009-04-01 01:33, James C. Sutherland wrote: Alin, Thank you for your patience. I now have this set via set( CMAKE_EXE_LINKER_FLAGS -mbig-endian ) However, this does not seem to

Re: [CMake] fortran flags in a c++ linked executable

2009-04-01 Thread Martin Apel
James C. Sutherland wrote: Let me try this again. I have a f90 subroutine that performs file IO. I would like to link that with a C++ driver. If I use a fortran driver, I am able to set the binary format via set( CMAKE_Fortran_FLAGS -fconvert=big-endian ) This results in file IO

[CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C . Sutherland
I am trying to compile a mixed f90/C++ program linked with g++. The fortran compiler flags don't seem to be automatically passed through to the g++ linker. For example, I want to do: set( CMAKE_Fortran_FLAGS -fconvert=big-endian ) When I do this for a fortran program (linked with

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread Alin M Elena
Hi, Should not the flag be passed to the linker? So in this case the linker flags are read from the c++ compiler flags? regards, Alin -- __ If the Universities will not study useless subjects, who will?

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C. Sutherland
Should not the flag be passed to the linker? So in this case the linker flags are read from the c++ compiler flags? I tried adding add_definitions( ${CMAKE_Fortran_FLAGS} ) But the g++ linker complained about an unrecognized option (the - fconvert=big-endian option). When

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread Alin M Elena
Hi, g++ knows of -mbig-endian not -f Anyhow is just a thought. Alin -- __ If the Universities will not study useless subjects, who will? G. F. FitzGerald, Nature, 45/46, 392 (1892)

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread Denis Scherbakov
If you want to pass something to g++ linker, you should do this with -Wl,--my-special-flag Denis Should not the flag be passed to the linker? So in this case the linker flags are read from the c++ compiler flags? I tried adding add_definitions( ${CMAKE_Fortran_FLAGS} ) But

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C. Sutherland
g++ knows of -mbig-endian not -f g++ --help -v provides no information on any endian operations.___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C. Sutherland
Let me try this again. I have a f90 subroutine that performs file IO. I would like to link that with a C++ driver. If I use a fortran driver, I am able to set the binary format via set( CMAKE_Fortran_FLAGS -fconvert=big-endian ) This results in file IO in big-endian format. When

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread Alin M Elena
man g++ add_definition is a preprocessor directive not linking flag Alin -- __ If the Universities will not study useless subjects, who will? G. F. FitzGerald, Nature, 45/46, 392 (1892)

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C. Sutherland
Alin, Thank you for your patience. I now have this set via set( CMAKE_EXE_LINKER_FLAGS -mbig-endian ) However, this does not seem to affect the reading of the big-endian binary file (which is in read in fortran). Perhaps I am still not setting it properly? James On Mar 31,