Skip to content

Commit 48030d4

Browse files
authored
Uses RPATH instead of RUNPATH so that user strictly uses pypi libs (#1150)
1 parent 4b485e0 commit 48030d4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

manywheel/build_common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,14 @@ for pkg in /$WHEELHOUSE_DIR/torch*linux*.whl /$LIBTORCH_HOUSE_DIR/libtorch*.zip;
360360
# set RPATH of _C.so and similar to $ORIGIN, $ORIGIN/lib
361361
find $PREFIX -maxdepth 1 -type f -name "*.so*" | while read sofile; do
362362
echo "Setting rpath of $sofile to ${C_SO_RPATH:-'$ORIGIN:$ORIGIN/lib'}"
363-
$PATCHELF_BIN --set-rpath ${C_SO_RPATH:-'$ORIGIN:$ORIGIN/lib'} $sofile
363+
$PATCHELF_BIN --set-rpath ${C_SO_RPATH:-'$ORIGIN:$ORIGIN/lib'} ${FORCE_RPATH:-} $sofile
364364
$PATCHELF_BIN --print-rpath $sofile
365365
done
366366

367367
# set RPATH of lib/ files to $ORIGIN
368368
find $PREFIX/lib -maxdepth 1 -type f -name "*.so*" | while read sofile; do
369369
echo "Setting rpath of $sofile to ${LIB_SO_RPATH:-'$ORIGIN'}"
370-
$PATCHELF_BIN --set-rpath ${LIB_SO_RPATH:-'$ORIGIN'} $sofile
370+
$PATCHELF_BIN --set-rpath ${LIB_SO_RPATH:-'$ORIGIN'} ${FORCE_RPATH:-} $sofile
371371
$PATCHELF_BIN --print-rpath $sofile
372372
done
373373

manywheel/build_cuda.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ elif [[ $CUDA_VERSION == "11.7" ]]; then
283283
CUDA_RPATHS=$(IFS=: ; echo "${CUDA_RPATHS[*]}")
284284
export C_SO_RPATH=$CUDA_RPATHS':$ORIGIN:$ORIGIN/lib'
285285
export LIB_SO_RPATH=$CUDA_RPATHS':$ORIGIN'
286+
export FORCE_RPATH="--force-rpath"
286287
fi
287288
else
288289
echo "Unknown cuda version $CUDA_VERSION"

0 commit comments

Comments
 (0)