Skip to content

Commit

Permalink
fix more rpath stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Nov 15, 2024
1 parent 60a5100 commit 5a40507
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ if (INSTALLATION_MODE STREQUAL "prefix")
set_target_properties(chpl chpldoc ChplFrontendShared
PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/chapel/${CHPL_MAJOR_VERSION}.${CHPL_MINOR_VERSION}/compiler")
# TODO: handle rpath for mimalloc in prefix installs
install(TARGETS chpl
RUNTIME DESTINATION bin)
install(TARGETS chpldoc OPTIONAL
Expand All @@ -401,10 +402,23 @@ else()
set(CHPL_INSTALL_RPATH "@executable_path/../../lib/compiler/${CHPL_HOST_BIN_SUBDIR}")
endif()

if (CHPL_HOST_MEM STREQUAL "mimalloc")
if (CHPL_HOST_MIMALLOC STREQUAL "bundled")
if(APPLE)
set(CHPL_INSTALL_RPATH "${CHPL_INSTALL_RPATH};@executable_path/../../third-party/mimalloc/install/${CHPL_HOST_MIMALLOC_UNIQ_CFG_PATH}/lib")
else()
# TODO: this adds both lib and lib64 but should only add the correct one
set(CHPL_INSTALL_RPATH "${CHPL_INSTALL_RPATH};$ORIGIN/../../third-party/mimalloc/install/${CHPL_HOST_MIMALLOC_UNIQ_CFG_PATH}/lib;$ORIGIN/../../third-party/mimalloc/install/${CHPL_HOST_MIMALLOC_UNIQ_CFG_PATH}/lib64")
endif()
elseif (CHPL_HOST_MIMALLOC STREQUAL "system")
set(CHPL_INSTALL_RPATH "${CHPL_INSTALL_RPATH};${MIMALLOC_LIBRARY_DIR}")
endif()
endif()

set_target_properties(chpl chpldoc ChplFrontendShared
PROPERTIES
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH ${CHPL_INSTALL_RPATH})
INSTALL_RPATH "${CHPL_INSTALL_RPATH}")
endif()

install(TARGETS chpl
Expand Down

0 comments on commit 5a40507

Please sign in to comment.