Skip to content

Commit

Permalink
Merge pull request #1578 from zenotech/cmake_mpi
Browse files Browse the repository at this point in the history
Call find_package(MPI) to locate MPI paths and link to libdispatch if…
  • Loading branch information
WardF authored Dec 18, 2019
2 parents 29d070c + c5d1e4b commit 3acf69c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ SET(MAX_DEFAULT_CACHE_SIZE 67108864 CACHE STRING "Default maximum cache size.")
SET(NETCDF_LIB_NAME "" CACHE STRING "Default name of the netcdf library.")
SET(TEMP_LARGE "." CACHE STRING "Where to put large temp files if large file tests are run.")
SET(NCPROPERTIES_EXTRA "" CACHE STRING "Specify extra pairs for _NCProperties.")
SET(MPIEXEC "mpiexec" CACHE STRING "Command to run MPI programs if parallel tests are run.")

IF(NOT NETCDF_LIB_NAME STREQUAL "")
SET(MOD_NETCDF_NAME ON)
Expand Down Expand Up @@ -1004,10 +1003,7 @@ IF(ENABLE_PARALLEL4 AND ENABLE_NETCDF_4)
SET(USE_PARALLEL OFF CACHE BOOL "")
MESSAGE(STATUS "Cannot find HDF5 library built with parallel support. Disabling parallel build.")
ELSE()
IF(MSVC)
FIND_PACKAGE(MPI REQUIRED)
INCLUDE_DIRECTORIES(${MPI_C_INCLUDE_PATH})
ENDIF()
FIND_PACKAGE(MPI REQUIRED)
SET(HDF5_PARALLEL ON CACHE BOOL "")
SET(USE_PARALLEL ON CACHE BOOL "")
SET(USE_PARALLEL4 ON CACHE BOOL "")
Expand Down
2 changes: 2 additions & 0 deletions libdispatch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ IF(ENABLE_BYTERANGE)
ENDIF(ENABLE_BYTERANGE)

add_library(dispatch OBJECT ${libdispatch_SOURCES})
target_include_directories(dispatch PUBLIC ${MPI_C_INCLUDE_PATH})
target_link_libraries(dispatch PUBLIC ${MPI_C_LIBRARIES})

FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
Expand Down

0 comments on commit 3acf69c

Please sign in to comment.