Re: [CMake] CheckFortranSourceCompiles alternative for cmake 2.8.12
HI again, I'm using TRY_COMPILE in a MPI Fortran project with CMake 2.8.11 to check if the mpi.mod file is compatible with the current Fortran compiler. The CMake code snippet is as follows: ... FIND_PATH(MPI_MOD_FOUND mpi.mod PATHS ${MPI_Fortran_INCLUDE_PATH}) IF(MPI_MOD_FOUND) TRY_COMPILE(FORTRAN_COMPILER_MATCH_MPI_MOD ${PROJECT_BINARY_DIR} ${SERIAL_TESTS_PATH}/try_compile_mpi_mod.f90 CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${MPI_Fortran_INCLUDE_PATH}" "-DLINK_LIBRARIES:STRING=${MPI_Fortran_LIBRARIES}") ... And the Fortan code of try_compile_mpi_mod.f90 is: program test use mpi end program this is the best choice to ensure the compatibility of current Fortran compiler and the Fortran compiler used to compile the linked MPI library? Thanks in advance. Best regards, Víctor 2016-02-23 12:46 GMT+01:00 victor sv: > Thanks Pter! > > Is the solution I was looking for. Great, it works as expected! :) > > > 2016-02-23 12:31 GMT+01:00 Petr Kmoch : > >> Hi Victor, >> >> have a look at the try_compile() command ( >> https://cmake.org/cmake/help/v2.8.12/cmake.html#command:try_compile ), >> especially the second signature (the one which takes SOURCES). >> >> Petr >> >> On Tue, Feb 23, 2016 at 11:56 AM, victor sv wrote: >> >>> Hi all, >>> >>> I've seen that in CMake 3.0 appeared the nice CheckFortranSourceCompiles >>> feature. >>> >>> Currently, common SO's like Ubuntu 14 includes CMake 2.8.12.2, but not >>> CMake 3.0 or higher. I would like to check if a very small Fortran test >>> program compiles using CMake 2.8.12.2, is this possible? how can i do that? >>> >>> Best regards, >>> Víctor. >>> >>> -- >>> >>> Powered by www.kitware.com >>> >>> Please keep messages on-topic and check the CMake FAQ at: >>> http://www.cmake.org/Wiki/CMake_FAQ >>> >>> Kitware offers various services to support the CMake community. For more >>> information on each offering, please visit: >>> >>> CMake Support: http://cmake.org/cmake/help/support.html >>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/cmake >>> >> >> > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] CheckFortranSourceCompiles alternative for cmake 2.8.12
Hi all, I've seen that in CMake 3.0 appeared the nice CheckFortranSourceCompiles feature. Currently, common SO's like Ubuntu 14 includes CMake 2.8.12.2, but not CMake 3.0 or higher. I would like to check if a very small Fortran test program compiles using CMake 2.8.12.2, is this possible? how can i do that? Best regards, Víctor. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] CheckFortranSourceCompiles alternative for cmake 2.8.12
Hi Victor, have a look at the try_compile() command ( https://cmake.org/cmake/help/v2.8.12/cmake.html#command:try_compile ), especially the second signature (the one which takes SOURCES). Petr On Tue, Feb 23, 2016 at 11:56 AM, victor svwrote: > Hi all, > > I've seen that in CMake 3.0 appeared the nice CheckFortranSourceCompiles > feature. > > Currently, common SO's like Ubuntu 14 includes CMake 2.8.12.2, but not > CMake 3.0 or higher. I would like to check if a very small Fortran test > program compiles using CMake 2.8.12.2, is this possible? how can i do that? > > Best regards, > Víctor. > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] CheckFortranSourceCompiles alternative for cmake 2.8.12
Thanks Pter! Is the solution I was looking for. Great, it works as expected! :) 2016-02-23 12:31 GMT+01:00 Petr Kmoch: > Hi Victor, > > have a look at the try_compile() command ( > https://cmake.org/cmake/help/v2.8.12/cmake.html#command:try_compile ), > especially the second signature (the one which takes SOURCES). > > Petr > > On Tue, Feb 23, 2016 at 11:56 AM, victor sv wrote: > >> Hi all, >> >> I've seen that in CMake 3.0 appeared the nice CheckFortranSourceCompiles >> feature. >> >> Currently, common SO's like Ubuntu 14 includes CMake 2.8.12.2, but not >> CMake 3.0 or higher. I would like to check if a very small Fortran test >> program compiles using CMake 2.8.12.2, is this possible? how can i do that? >> >> Best regards, >> Víctor. >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For more >> information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake >> > > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake