Adding fixes for slurm linking and uncommon slurm node attributes
This commit is contained in:
@@ -17,14 +17,15 @@ include(cmake/Catch2.cmake)
|
||||
option(DAGGY_ENABLE_SLURM "add support for SLURM executor" ON)
|
||||
|
||||
if (DAGGY_ENABLE_SLURM)
|
||||
find_library(SLURM_LIB libslurm.a slurm REQUIRED)
|
||||
find_library(SLURM_LIB libslurm.so libslurm.a slurm REQUIRED)
|
||||
find_path(SLURM_INCLUDE_DIR "slurm/slurm.h" REQUIRED)
|
||||
|
||||
if (SLURM_LIB MATCHES ".*\.a")
|
||||
add_library(slurm STATIC IMPORTED)
|
||||
else()
|
||||
SET_TARGET_PROPERTIES(slurm PROPERTIES INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/")
|
||||
else ()
|
||||
add_library(slurm SHARED IMPORTED)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
set_target_properties(slurm PROPERTIES IMPORTED_LOCATION ${SLURM_LIB})
|
||||
target_include_directories(slurm INTERFACE ${SLURM_INCLUDE_DIR})
|
||||
@@ -32,6 +33,20 @@ if (DAGGY_ENABLE_SLURM)
|
||||
target_link_libraries(slurm INTERFACE dl resolv)
|
||||
endif ()
|
||||
|
||||
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
|
||||
# add the automatically determined parts of the RPATH
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
|
||||
add_subdirectory(daggy)
|
||||
add_subdirectory(tests)
|
||||
add_subdirectory(utils)
|
||||
|
||||
Reference in New Issue
Block a user