[CMake] Fwd: 64 bit flags
I did forget the ML. -- Forwarded message -- From: Eric Noulard eric.noul...@gmail.com Date: 2011/9/9 Subject: Re: [CMake] 64 bit flags To: pellegrini pellegr...@ill.fr 2011/9/9 pellegrini pellegr...@ill.fr: Hello everybody, I have a Fortran project that is currently built (using gfortran, g95 or ifort) on 32 bits machines but that might need quite soon to be built on 64 bit machines as well. Does cmake automatically detect the processor architecture and add the 64 bit flag at configuration time or do I have to declare those flags through, for example, a '-D option ? CMake chose the default target architecture of your compiler so if the default target ofthe compiler is 64bits no need for special flags. To be more clear: If I compile some code on a 32bits host the compiler (C, Fortran or whatever) usually produce 32bits binaries If I compile some code on a 64 bits host the compiler (C, Fortran or whatever) usually produce 64bits binaries So CMake detect the compiler (C; Fortran, ...) and do not care about 32/64 bits issue. Now if YOUR code as 32/64 bits specific zone then you need an appropriate macro whose definition may be done by you (in CMakeLists.txt) by testing the value of CMAKE_SIZEOF_VOID_P. Now some platform like Mac OS support multi-arch binaries and if you crawl the mail archive you'll find discussion about that. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ 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
Re: [CMake] Fwd: 64 bit flags
Thanks a lot Eric for the clear explanation. Eric Eric Noulard a écrit : I did forget the ML. -- Forwarded message -- From: Eric Noulard eric.noul...@gmail.com Date: 2011/9/9 Subject: Re: [CMake] 64 bit flags To: pellegrini pellegr...@ill.fr 2011/9/9 pellegrini pellegr...@ill.fr: Hello everybody, I have a Fortran project that is currently built (using gfortran, g95 or ifort) on 32 bits machines but that might need quite soon to be built on 64 bit machines as well. Does cmake automatically detect the processor architecture and add the 64 bit flag at configuration time or do I have to declare those flags through, for example, a '-D option ? CMake chose the default target architecture of your compiler so if the default target ofthe compiler is 64bits no need for special flags. To be more clear: If I compile some code on a 32bits host the compiler (C, Fortran or whatever) usually produce 32bits binaries If I compile some code on a 64 bits host the compiler (C, Fortran or whatever) usually produce 64bits binaries So CMake detect the compiler (C; Fortran, ...) and do not care about 32/64 bits issue. Now if YOUR code as 32/64 bits specific zone then you need an appropriate macro whose definition may be done by you (in CMakeLists.txt) by testing the value of CMAKE_SIZEOF_VOID_P. Now some platform like Mac OS support multi-arch binaries and if you crawl the mail archive you'll find discussion about that. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Eric Pellegrini Calcul Scientifique Institut Laue-Langevin Grenoble, France ___ 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