diff --git a/manywheel/build_common.sh b/manywheel/build_common.sh index 7ad15147a..ac3b2755c 100644 --- a/manywheel/build_common.sh +++ b/manywheel/build_common.sh @@ -360,14 +360,14 @@ for pkg in /$WHEELHOUSE_DIR/torch*linux*.whl /$LIBTORCH_HOUSE_DIR/libtorch*.zip; # set RPATH of _C.so and similar to $ORIGIN, $ORIGIN/lib find $PREFIX -maxdepth 1 -type f -name "*.so*" | while read sofile; do echo "Setting rpath of $sofile to ${C_SO_RPATH:-'$ORIGIN:$ORIGIN/lib'}" - $PATCHELF_BIN --set-rpath ${C_SO_RPATH:-'$ORIGIN:$ORIGIN/lib'} $sofile + $PATCHELF_BIN --set-rpath ${C_SO_RPATH:-'$ORIGIN:$ORIGIN/lib'} ${FORCE_RPATH:-} $sofile $PATCHELF_BIN --print-rpath $sofile done # set RPATH of lib/ files to $ORIGIN find $PREFIX/lib -maxdepth 1 -type f -name "*.so*" | while read sofile; do echo "Setting rpath of $sofile to ${LIB_SO_RPATH:-'$ORIGIN'}" - $PATCHELF_BIN --set-rpath ${LIB_SO_RPATH:-'$ORIGIN'} $sofile + $PATCHELF_BIN --set-rpath ${LIB_SO_RPATH:-'$ORIGIN'} ${FORCE_RPATH:-} $sofile $PATCHELF_BIN --print-rpath $sofile done diff --git a/manywheel/build_cuda.sh b/manywheel/build_cuda.sh index 1dc787709..ed8ab4cb5 100644 --- a/manywheel/build_cuda.sh +++ b/manywheel/build_cuda.sh @@ -283,6 +283,7 @@ elif [[ $CUDA_VERSION == "11.7" ]]; then CUDA_RPATHS=$(IFS=: ; echo "${CUDA_RPATHS[*]}") export C_SO_RPATH=$CUDA_RPATHS':$ORIGIN:$ORIGIN/lib' export LIB_SO_RPATH=$CUDA_RPATHS':$ORIGIN' + export FORCE_RPATH="--force-rpath" fi else echo "Unknown cuda version $CUDA_VERSION"