<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>HI again,<br><br></div>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. <br><br></div>The CMake code snippet is as follows:<br><br>...<br>    FIND_PATH(MPI_MOD_FOUND mpi.mod  PATHS ${MPI_Fortran_INCLUDE_PATH})<br>    IF(MPI_MOD_FOUND)<br>        TRY_COMPILE(FORTRAN_COMPILER_MATCH_MPI_MOD <br>                    ${PROJECT_BINARY_DIR} <br>                    ${SERIAL_TESTS_PATH}/try_compile_mpi_mod.f90   <br>                    CMAKE_FLAGS<br>                        "-DINCLUDE_DIRECTORIES:STRING=${MPI_Fortran_INCLUDE_PATH}"<br>                        "-DLINK_LIBRARIES:STRING=${MPI_Fortran_LIBRARIES}")<br>...<br><br></div>And the Fortan code of try_compile_mpi_mod.f90 is:<br><br></div>program test<br></div>use mpi<br></div>end program<br><br></div>this is the best choice to ensure the compatibility of current Fortran compiler and the Fortran compiler used to compile the linked MPI library?<br><br></div>Thanks in advance.<br><br></div>Best regards,<br></div>Víctor<br><div><div><div><div><div><div><div><div><div><br><br></div></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-23 12:46 GMT+01:00 victor sv <span dir="ltr"><<a href="mailto:victorsv@gmail.com" target="_blank">victorsv@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks Pter!<br><br></div>Is the solution I was looking for. Great, it works as expected! :)<br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-02-23 12:31 GMT+01:00 Petr Kmoch <span dir="ltr"><<a href="mailto:petr.kmoch@gmail.com" target="_blank">petr.kmoch@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Victor,<br><br></div>have a look at the try_compile() command ( <a href="https://cmake.org/cmake/help/v2.8.12/cmake.html#command:try_compile" target="_blank">https://cmake.org/cmake/help/v2.8.12/cmake.html#command:try_compile</a> ), especially the second signature (the one which takes SOURCES).<br><br></div>Petr<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Tue, Feb 23, 2016 at 11:56 AM, victor sv <span dir="ltr"><<a href="mailto:victorsv@gmail.com" target="_blank">victorsv@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div><div><div>Hi all,<br><br></div>I've seen that in CMake 3.0 appeared the nice CheckFortranSourceCompiles feature.<br><br></div>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?<br><br></div>Best regards,<br></div>Víctor.<br></div>
<br></div></div>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>