Hi,
I have a Fortran project that needs to link to Microsft's MPI libraries -
msmpi.lib and msmpifec.lib but the MPI_Fortran_LIBRARIES variable returned
by FindMPI listst just the first one. As a result, my CMakeLists.txt looks
like
cmake_minimum_required(VERSION 2.8)
project(ExampleMPI Fortran)
find_package(MPI REQUIRED)
include_directories(${MPI_Fortran_INCLUDE_PATH})
include_directories(${MPI_Fortran_INCLUDE_PATH}/x64) # mpifptr.h
add_executable(exmpi test.f90)
# MS MPI requires two libraries to be linked - msmpi.lib and msmpifec.lib
# Currently, cmake only returns the location of msmpi.lib in
# MPI_Fortran_LIBRARIES. So, we need to manually add msmpifec.lib
get_filename_component(mpi_lib_dir ${MPI_Fortran_LIBRARIES} DIRECTORY)
target_link_libraries(ssmpi ${MPI_Fortran_LIBRARIES}
${mpi_lib_dir}/msmpifec.lib)
Shouldn't the locations of both those libraries be included in
MPI_Fortran_LIBRARIES?
Thank you,
Purnendu.
--
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