Skip to content

Commit

Permalink
Merge pull request #49 from ExCALIBUR-NEPTUNE/bugfix/downstream-find-…
Browse files Browse the repository at this point in the history
…mpi-c

move placement of find mpi
  • Loading branch information
will-saunders-ukaea authored Nov 24, 2023
2 parents 81f42ae + b3f0806 commit dbba6e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ if(ENABLE_NESO_PARTICLES_TESTS)
message(STATUS "Set CMAKE_BUILD_TYPE=RelWithDebInfo")
endif()

# find MPI
find_package(MPI REQUIRED)

# find NESO-Particles config
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}")
find_package(NESO-PARTICLES REQUIRED)
Expand Down
9 changes: 7 additions & 2 deletions cmake/neso-particles-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ else()
message(STATUS "Using NESO_PARTICLES_DEVICE_TYPE_CPU")
endif()

set(HDF5_PREFER_PARALLEL TRUE)
# required for some versions of hdf5
enable_language(C)
find_package(HDF5 QUIET)

# find/re-find MPI with MPI_C
find_package(MPI REQUIRED)

# now look for HDF5
set(HDF5_PREFER_PARALLEL TRUE)
find_package(HDF5 QUIET)
if(HDF5_FOUND AND HDF5_IS_PARALLEL)
message(STATUS "HDF5 found")
add_definitions(-DNESO_PARTICLES_HDF5)
Expand Down
2 changes: 0 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ endif()
set(EXECUTABLE testNESOParticles)
set(TEST_MAIN ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)

find_package(MPI REQUIRED)

# List test source files
file(GLOB TEST_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/test_*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/*_test.cpp)
Expand Down

0 comments on commit dbba6e7

Please sign in to comment.