Skip to content

Commit

Permalink
Merge pull request easybuilders#21673 from boegel/20241016104618_new_…
Browse files Browse the repository at this point in the history
…pr_dorado061

fix failing RPATH sanity check for recent dorado easyconfigs using `foss/2023a` toolchain
  • Loading branch information
Micket authored Oct 21, 2024
2 parents 1ae50e0 + d02928d commit 069208e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ checksums = [
builddependencies = [
('binutils', '2.40'),
('CMake', '3.26.3'),
('patchelf', '0.18.0'),
]

dependencies = [
Expand Down Expand Up @@ -70,6 +71,22 @@ configopts += "-DDORADO_LIBTORCH_DIR=$EBROOTPYTORCH/lib "
# in function `_GLOBAL__sub_I_mutex.cc': mutex.cc:(.text.startup+0x17): undefined reference to `pthread_atfork'
configopts += '-DCMAKE_C_FLAGS="$CFLAGS -pthread" '

# disable CMake fiddling with RPATH when EasyBuild is configured to use RPATH linking
configopts += "$(if %(rpath_enabled)s; then "
configopts += "echo '-DCMAKE_SKIP_INSTALL_RPATH=YES -DCMAKE_SKIP_RPATH=YES'; fi) "

# CUDA libraries that are copied to installdir need to be patched to have an RPATH section
# when EasyBuild is configured to use RPATH linking (required to pass RPATH sanity check);
# by default, CMake sets RUNPATH to '$ORIGIN' rather than RPATH (but that's disabled above)
postinstallcmds = [
"if %(rpath_enabled)s; then "
" for lib in $(ls %(installdir)s/lib/lib{cu,nv}*.so*); do "
" echo setting RPATH in $lib;"
" patchelf --force-rpath --set-rpath '$ORIGIN' $lib;"
" done;"
"fi",
]

sanity_check_paths = {
'files': ['bin/dorado'],
'dirs': [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ checksums = [
builddependencies = [
('binutils', '2.40'),
('CMake', '3.26.3'),
('patchelf', '0.18.0'),
]

dependencies = [
Expand Down Expand Up @@ -77,7 +78,23 @@ _copts = [
'-DCMAKE_C_FLAGS="$CFLAGS -pthread"',
]

configopts = ' '.join(_copts)
configopts = ' '.join(_copts) + ' '

# disable CMake fiddling with RPATH when EasyBuild is configured to use RPATH linking
configopts += "$(if %(rpath_enabled)s; then "
configopts += "echo '-DCMAKE_SKIP_INSTALL_RPATH=YES -DCMAKE_SKIP_RPATH=YES'; fi) "

# CUDA libraries that are copied to installdir need to be patched to have an RPATH section
# when EasyBuild is configured to use RPATH linking (required to pass RPATH sanity check);
# by default, CMake sets RUNPATH to '$ORIGIN' rather than RPATH (but that's disabled above)
postinstallcmds = [
"if %(rpath_enabled)s; then "
" for lib in $(ls %(installdir)s/lib/lib{cu,nv}*.so*); do "
" echo setting RPATH in $lib;"
" patchelf --force-rpath --set-rpath '$ORIGIN' $lib;"
" done;"
"fi",
]

sanity_check_paths = {
'files': ['bin/dorado'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ checksums = [
builddependencies = [
('binutils', '2.40'),
('CMake', '3.26.3'),
('patchelf', '0.18.0'),
]

dependencies = [
Expand Down Expand Up @@ -76,7 +77,23 @@ _copts = [
'-DCMAKE_C_FLAGS="$CFLAGS -pthread"',
]

configopts = ' '.join(_copts)
configopts = ' '.join(_copts) + ' '

# disable CMake fiddling with RPATH when EasyBuild is configured to use RPATH linking
configopts += "$(if %(rpath_enabled)s; then "
configopts += "echo '-DCMAKE_SKIP_INSTALL_RPATH=YES -DCMAKE_SKIP_RPATH=YES'; fi) "

# CUDA libraries that are copied to installdir need to be patched to have an RPATH section
# when EasyBuild is configured to use RPATH linking (required to pass RPATH sanity check);
# by default, CMake sets RUNPATH to '$ORIGIN' rather than RPATH (but that's disabled above)
postinstallcmds = [
"if %(rpath_enabled)s; then "
" for lib in $(ls %(installdir)s/lib/lib{cu,nv}*.so*); do "
" echo setting RPATH in $lib;"
" patchelf --force-rpath --set-rpath '$ORIGIN' $lib;"
" done;"
"fi",
]

sanity_check_paths = {
'files': ['bin/dorado'],
Expand Down

0 comments on commit 069208e

Please sign in to comment.