[CMake] cmake do not read my ifort compiler fllags - correct version
Hello everybody, I would like to set my own compiler flags to compile a library using intel fortran compiler. To do so, I created in my Src/ directory a "Compiler/Intel-Fortran.cmake" file that contains my preferences such as: SET(CMAKE_BUILD_TYPE_INIT Release) SET(CMAKE_Fortran_FLAGS_INIT "") SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /check /traceback /nologo") SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /nologo /Qvec-report0") SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /nologo /Qvec-report0") SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /nologo /traceback /debug:full") SET(CMAKE_Fortran_MODDIR_FLAG "-module ") SET(CMAKE_Fortran_VERBOSE_FLAG "-v") but, when running cmake and then nmake, the compiler flags used are not the ones I set but the default ones. I do not understand because I used to do the same with g95 and it worked perfectly. By the way, the flags used seem to be the ones set in the "Modules/Platform/Windows-ifort.cmake" cmake distribution, as if that file was parsed instead of mine ! However, when I put a message("hello") inside my file, it appears when building the cmake files. would you have any idea ? thanks Eric -- Eric Pellegrini Calcul Scientifique Insitut 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 -- Eric Pellegrini Calcul Scientifique Insitut 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
Re: [CMake] cmake do not read my ifort compiler fllags - correct version
On Wed, 2010-09-29 at 12:06 +0200, pellegrini wrote: > Hello everybody, > > I would like to set my own compiler flags to compile a library using > intel fortran compiler. > > To do so, I created in my Src/ directory a > "Compiler/Intel-Fortran.cmake" file that contains my preferences such as: > > SET(CMAKE_BUILD_TYPE_INIT Release) > SET(CMAKE_Fortran_FLAGS_INIT "") > SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /check /traceback /nologo") > SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /nologo /Qvec-report0") > SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /nologo /Qvec-report0") > SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /nologo /traceback > /debug:full") > SET(CMAKE_Fortran_MODDIR_FLAG "-module ") > SET(CMAKE_Fortran_VERBOSE_FLAG "-v") > > but, when running cmake and then nmake, the compiler flags used are not > the ones I set but the default ones. I do not > understand because I used to do the same with g95 and it worked > perfectly. By the way, the flags used seem to be the ones > set in the "Modules/Platform/Windows-ifort.cmake" cmake distribution, > as if that file was parsed instead of mine ! However, when I put a > message("hello") inside my file, it appears when building the cmake files. > > would you have any idea ? > > thanks > > Eric > Hi Eric, Just when exactly do you set these variables. As the name of these variables suggest, these are initialisation variables. When CMake processes the PROJECT() command, it also configures the compilers that you define there (C and C++ by default). After that, none of the changes you make to these *_INIT variables will be picked up. HTH, Marcel Loose. ___ 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] cmake do not read my ifort compiler fllags - correct version
Marcel Loose a écrit : On Wed, 2010-09-29 at 12:06 +0200, pellegrini wrote: Hello everybody, I would like to set my own compiler flags to compile a library using intel fortran compiler. To do so, I created in my Src/ directory a "Compiler/Intel-Fortran.cmake" file that contains my preferences such as: SET(CMAKE_BUILD_TYPE_INIT Release) SET(CMAKE_Fortran_FLAGS_INIT "") SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /check /traceback /nologo") SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /nologo /Qvec-report0") SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /nologo /Qvec-report0") SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /nologo /traceback /debug:full") SET(CMAKE_Fortran_MODDIR_FLAG "-module ") SET(CMAKE_Fortran_VERBOSE_FLAG "-v") but, when running cmake and then nmake, the compiler flags used are not the ones I set but the default ones. I do not understand because I used to do the same with g95 and it worked perfectly. By the way, the flags used seem to be the ones set in the "Modules/Platform/Windows-ifort.cmake" cmake distribution, as if that file was parsed instead of mine ! However, when I put a message("hello") inside my file, it appears when building the cmake files. would you have any idea ? thanks Eric Hi Eric, Just when exactly do you set these variables. As the name of these variables suggest, these are initialisation variables. When CMake processes the PROJECT() command, it also configures the compilers that you define there (C and C++ by default). After that, none of the changes you make to these *_INIT variables will be picked up. HTH, Marcel Loose. Hi Marcel, In fact my CMakeLists.txt file starts with the following lines: cmake_minimum_required(VERSION 2.6.2) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) project(my_project Fortran) in that case I have the problem described previously e.g. the Compiler/G95-Fortran.cmake file is actually parsed but its contents not used. If I try in the following order: cmake_minimum_required(VERSION 2.6.2) project(my_project Fortran) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) the file is even not parsed at all. -- Eric Pellegrini Calcul Scientifique Insitut 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