Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manywheel/build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ replace_needed_sofiles() {
find $1 -name '*.so*' | while read sofile; do
origname=$2
patchedname=$3
if [[ "$origname" != "$patchedname" ]]; then
if [[ "$origname" != "$patchedname" ]] || [[ "$DESIRED_CUDA" == *"rocm"* ]]; then
set +e
$PATCHELF_BIN --print-needed $sofile | grep $origname 2>&1 >/dev/null
origname=$($PATCHELF_BIN --print-needed $sofile | grep "$origname*")
ERRCODE=$?
set -e
if [ "$ERRCODE" -eq "0" ]; then
Expand Down
17 changes: 13 additions & 4 deletions manywheel/build_libtorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ fname_with_sha256() {
fi
}

fname_without_so_number() {
LINKNAME=$(echo $1 | sed -e 's/\.so.*/.so/g')
echo "$LINKNAME"
}

make_wheel_record() {
FPATH=$1
if echo $FPATH | grep RECORD >/dev/null 2>&1; then
Expand Down Expand Up @@ -277,8 +282,12 @@ for pkg in /$LIBTORCH_HOUSE_DIR/libtorch*.zip; do
if [[ "$filepath" != "$destpath" ]]; then
cp $filepath $destpath
fi

patchedpath=$(fname_with_sha256 $destpath)

if [[ "$DESIRED_CUDA" == *"rocm"* ]]; then
patchedpath=$(fname_without_so_number $destpath)
else
patchedpath=$(fname_with_sha256 $destpath)
fi
patchedname=$(basename $patchedpath)
if [[ "$destpath" != "$patchedpath" ]]; then
mv $destpath $patchedpath
Expand All @@ -292,9 +301,9 @@ for pkg in /$LIBTORCH_HOUSE_DIR/libtorch*.zip; do
find $PREFIX -name '*.so*' | while read sofile; do
origname=${DEPS_SONAME[i]}
patchedname=${patched[i]}
if [[ "$origname" != "$patchedname" ]]; then
if [[ "$origname" != "$patchedname" ]] || [[ "$DESIRED_CUDA" == *"rocm"* ]]; then
set +e
$PATCHELF_BIN --print-needed $sofile | grep $origname 2>&1 >/dev/null
origname=$($PATCHELF_BIN --print-needed $sofile | grep "$origname*")
ERRCODE=$?
set -e
if [ "$ERRCODE" -eq "0" ]; then
Expand Down
Loading