Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLAMEGPU_BUILD_PYTHON_PATCHELF defaults to ON #1261

Open
ptheywood opened this issue Nov 26, 2024 · 0 comments
Open

FLAMEGPU_BUILD_PYTHON_PATCHELF defaults to ON #1261

ptheywood opened this issue Nov 26, 2024 · 0 comments

Comments

@ptheywood
Copy link
Member

I appear to have made FLAMEGPU_BUILD_PYTHON_PATCHELF default to ON at some point

option(FLAMEGPU_BUILD_PYTHON_PATCHELF "Use PATCHELF to remove a runtime dependency on libnvrtc-builtins.so" ON)

and if patchelf is not found then a fatal error is emitted rather than a simple warning / falling back to not being enabled.

if (FLAMEGPU_BUILD_PYTHON_PATCHELF AND NOT WIN32)
find_program(PATCHELF patchelf)
if (PATCHELF)
add_custom_command(
TARGET ${PYTHON_SWIG_TARGET_NAME}
POST_BUILD
COMMAND patchelf --remove-needed libnvrtc-builtins.so.${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR} $<TARGET_FILE_NAME:${PYTHON_SWIG_TARGET_NAME}>
COMMENT "Patching $<TARGET_FILE_NAME:${PYTHON_SWIG_TARGET_NAME}> ELF to not depend upon libnvrtc-builtins.so.${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}"
)
else()
message(FATAL_ERROR "patchelf could not be found, but is required by FLAMEGPU_BUILD_PYTHON_PATCHELF=ON. Please ensure that patchelf is installed and on your path.")
endif()
endif()

Defaulting to off is probably the simplest improvement, as CI should be opting into this.

Should probably document the option too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant