From f8a93111b40b22d943ea5944d8665bffad1dcb51 Mon Sep 17 00:00:00 2001 From: JOAN VINYALS YLLA CATALA Date: Wed, 26 Jun 2024 17:20:48 +0200 Subject: [PATCH 1/2] Make cmake install rpath --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3412f91..28b6f6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,8 @@ if(BUILD_C_FORTRAN) set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod) endif() +SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + add_library(${PROJECT_NAME} SHARED) set(NESMIK_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include) -- GitLab From 2ae6a63188d63041ae5a561e9ed9946d077a5f74 Mon Sep 17 00:00:00 2001 From: Valentin Seitz Date: Wed, 26 Jun 2024 17:30:16 +0200 Subject: [PATCH 2/2] Added guards --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28b6f6d..9be69e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,10 +13,13 @@ list (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") option(ENABLE_EXTRAE "Enable Extrae" OFF) option(ENABLE_DLB "Enable DLB" OFF) -# Install depending options +# other options options option(BUILD_C_FORTRAN "Enable C and Fortran Interfaces" ON) option(SPLIT_FORTRAN_LIBRARY "Split the fortran symbols into a special library (nesmik_f) - EXPERIMENTAL" OFF) -option(GEN_BINDINGS "Use Shroud to Generate C/Fortran interface" OFF) +option(GEN_BINDINGS "Use Shroud to Generate C/Fortran interface - EXPERIMENTAL" OFF) + +# Install options +option(INSTALL_WITH_RPATH "RPATH the build depencies for e.g dlb into the shared object, if not you have to provide symbols at loading time" OFF) # Other options option(WITH_MPI "Compile with MPI" OFF) @@ -28,7 +31,9 @@ if(BUILD_C_FORTRAN) set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod) endif() -SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +if(INSTALL_WITH_RPATH) + SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +endif() add_library(${PROJECT_NAME} SHARED) -- GitLab