Skip to content

Commit

Permalink
find MPI ourselves - mold doesn't use default lib search paths
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Nov 30, 2023
1 parent e33c542 commit 4d23de0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions res/cmake/dep/samrai.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ else()
message("SAMRAI HAS BEEN FOUND")
message(${SAMRAI_INCLUDE_DIRS})
endif()

find_package(MPI REQUIRED)
foreach(LIB ${MPI_LIBRARY})
get_filename_component(MPI_LIBRARY_PATH ${LIB} DIRECTORY)
endforeach()
message("MPI_C_LIBRARIES " ${MPI_LIBRARY_PATH})
2 changes: 2 additions & 0 deletions res/cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ function(print_phare_options)
message("build with ccache (if found) in devMode : " ${withCcache})
message("build with LLNL Caliper : " ${withCaliper})

message("MPI_LIBRARY_PATH : " ${MPI_LIBRARY_PATH})

if(${devMode})
message("PHARE_EXEC_LEVEL_MIN : " ${PHARE_EXEC_LEVEL_MIN})
message("PHARE_EXEC_LEVEL_MAX : " ${PHARE_EXEC_LEVEL_MAX})
Expand Down
2 changes: 1 addition & 1 deletion src/amr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ add_library(${PROJECT_NAME} ${SOURCES_INC} ${SOURCES_CPP})
target_compile_options(${PROJECT_NAME} PRIVATE ${PHARE_WERROR_FLAGS})
set_property(TARGET ${PROJECT_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION ${PHARE_INTERPROCEDURAL_OPTIMIZATION})


target_link_directories(${PROJECT_NAME} PUBLIC ${MPI_LIBRARY_PATH})
target_link_libraries(${PROJECT_NAME} PUBLIC
phare_core
SAMRAI_algs
Expand Down

0 comments on commit 4d23de0

Please sign in to comment.