Skip to content

Commit

Permalink
Add RPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
fpetrini15 committed Oct 25, 2024
1 parent fbcd1f5 commit 5048e9e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ FetchContent_Declare(
# RHEL base container has multiple version of Python installed. By default
# it seems like pybind will pickup v3.6, so we specifically assign it to
# search for 3.12 here.
set(RHEL_BUILD OFF)
if(LINUX)
file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE")
if(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
set(RHEL_BUILD ON)
set(PYBIND11_PYTHON_VERSION 3.12)
endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
endif(LINUX)
Expand Down Expand Up @@ -278,6 +280,23 @@ target_compile_options(
)
target_compile_definitions(triton-python-backend-stub PRIVATE TRITON_PB_STUB)

# RHEL assets are not released in a container environment nor do the current
# Python lib versions in the manylinux base container match those currently
# available for RHEL8 package managers. Therefore, we package the correct
# python libs in the backend folder and adjust the stub executable to look
# in its own folder at runtime.
if(RHEL_BUILD)
set_target_properties(
triton-python-backend-stub
PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH_USE_LINK_PATH FALSE
INSTALL_RPATH "$\{ORIGIN\}"
)
endif(RHEL_BUILD)


# For WIN32 do not link Threads and DL_LIBS
if(WIN32)
target_link_libraries(
Expand Down

0 comments on commit 5048e9e

Please sign in to comment.