[CMake] FindMPI uses wrong fortran include path
Hi, If I call FindMPI, it successfully finds Intel MPI, including all the proper include paths etc. However, when I compile MPI code, I get an error message saying that the mod file (called by "use mpi" in the code) was not compiled by this compiler. The problem appears to be that the Intel compiler suite installed both gfortran and ifort versions of the mod files in different include directories like this: INTELROOT/ linux/mpi/intel64/include/gfortran/mpi.mod linux/mpi/intel64/include/mpi.mod where the first mod is the gfortran mod, and the second is the intel mod. Following the call to FindMPI(), the variable MPI_Fortran_INCLUDE_PATH contains both, with the gfortran directory first. If I do this: include_directories(${MPI_Fortran_INCLUDE_PATH}) I get the failure I mentioned, presumably because the compiler tries to use the gfortran mod first. So is there a way to tell the build system to ignore the gfortran mod? I cannot assume that the order or contents of MPI_Fortran_INCLUDE_PATH. Thanks -- 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] FindMPI uses wrong fortran include path
This seems to be the same issue discussed here: https://cmake.org/pipermail/cmake-developers/2014-December/023831.html which refers to a bug marked fixed here: http://www.cmake.org/Bug/view.php?id=15182 However, I'm still getting the issue in 3.5.0-rc1 On Wed, Feb 10, 2016 at 12:24 PM, Jack Stalnakerwrote: > Hi, > > If I call FindMPI, it successfully finds Intel MPI, including all the > proper include paths etc. However, when I compile MPI code, I get an error > message saying that the mod file (called by "use mpi" in the code) was not > compiled by this compiler. The problem appears to be that the Intel > compiler suite installed both gfortran and ifort versions of the mod files > in different include directories like this: > > INTELROOT/ > linux/mpi/intel64/include/gfortran/mpi.mod > linux/mpi/intel64/include/mpi.mod > > where the first mod is the gfortran mod, and the second is the intel mod. > Following the call to FindMPI(), the variable MPI_Fortran_INCLUDE_PATH > contains both, with the gfortran directory first. If I do this: > > include_directories(${MPI_Fortran_INCLUDE_PATH}) > > I get the failure I mentioned, presumably because the compiler tries to > use the gfortran mod first. > > So is there a way to tell the build system to ignore the gfortran mod? I > cannot assume that the order or contents of MPI_Fortran_INCLUDE_PATH. > > Thanks > -- 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] FindMPI uses wrong fortran include path
Hey, at a rough read i think i had the same sort of issue. For us, the FindMPI detected "MPI_Fortran_INCLUDE_PATH" correctly - however, what did matter in our case was the order those paths have been used in CMake. as example: target_include_directories(yourtarget ${MPI_C_INCLUDE_PATH} ${MPI_Fortran_INCLUDE_PATH}) instead of target_include_directories(yourtarget ${MPI_Fortran_INCLUDE_PATH} ${MPI_C_INCLUDE_PATH}) makes all the difference in our case. so check if there are maybe even dependent libraries that have the C/CXX include path set first etc. maybe this helps :-) On 11.02.2016 09:19, Jack Stalnaker wrote: This seems to be the same issue discussed here: https://cmake.org/pipermail/cmake-developers/2014-December/023831.html which refers to a bug marked fixed here: http://www.cmake.org/Bug/view.php?id=15182 However, I'm still getting the issue in 3.5.0-rc1 On Wed, Feb 10, 2016 at 12:24 PM, Jack Stalnaker> wrote: Hi, If I call FindMPI, it successfully finds Intel MPI, including all the proper include paths etc. However, when I compile MPI code, I get an error message saying that the mod file (called by "use mpi" in the code) was not compiled by this compiler. The problem appears to be that the Intel compiler suite installed both gfortran and ifort versions of the mod files in different include directories like this: INTELROOT/ linux/mpi/intel64/include/gfortran/mpi.mod linux/mpi/intel64/include/mpi.mod where the first mod is the gfortran mod, and the second is the intel mod. Following the call to FindMPI(), the variable MPI_Fortran_INCLUDE_PATH contains both, with the gfortran directory first. If I do this: include_directories(${MPI_Fortran_INCLUDE_PATH}) I get the failure I mentioned, presumably because the compiler tries to use the gfortran mod first. So is there a way to tell the build system to ignore the gfortran mod? I cannot assume that the order or contents of MPI_Fortran_INCLUDE_PATH. Thanks -- Dr. Daniel Wirtz Dipl. Math. Dipl. Inf. SRC SimTech Pfaffenwaldring 5a, D-70569 Stuttgart +49 (711) 685-60044 -- 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