File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -279,9 +279,9 @@ replace_needed_sofiles() {
279
279
find $1 -name ' *.so*' | while read sofile; do
280
280
origname=$2
281
281
patchedname=$3
282
- if [[ " $origname " != " $patchedname " ]]; then
282
+ if [[ " $origname " != " $patchedname " ]] || [[ " $DESIRED_CUDA " == * " rocm " * ]] ; then
283
283
set +e
284
- $ PATCHELF_BIN --print-needed $sofile | grep $origname 2>&1 > /dev/null
284
+ origname= $( $ PATCHELF_BIN --print-needed $sofile | grep " $origname * " )
285
285
ERRCODE=$?
286
286
set -e
287
287
if [ " $ERRCODE " -eq " 0" ]; then
Original file line number Diff line number Diff line change @@ -228,6 +228,11 @@ fname_with_sha256() {
228
228
fi
229
229
}
230
230
231
+ fname_without_so_number () {
232
+ LINKNAME=$( echo $1 | sed -e ' s/\.so.*/.so/g' )
233
+ echo " $LINKNAME "
234
+ }
235
+
231
236
make_wheel_record () {
232
237
FPATH=$1
233
238
if echo $FPATH | grep RECORD > /dev/null 2>&1 ; then
@@ -277,8 +282,12 @@ for pkg in /$LIBTORCH_HOUSE_DIR/libtorch*.zip; do
277
282
if [[ " $filepath " != " $destpath " ]]; then
278
283
cp $filepath $destpath
279
284
fi
280
-
281
- patchedpath=$( fname_with_sha256 $destpath )
285
+
286
+ if [[ " $DESIRED_CUDA " == * " rocm" * ]]; then
287
+ patchedpath=$( fname_without_so_number $destpath )
288
+ else
289
+ patchedpath=$( fname_with_sha256 $destpath )
290
+ fi
282
291
patchedname=$( basename $patchedpath )
283
292
if [[ " $destpath " != " $patchedpath " ]]; then
284
293
mv $destpath $patchedpath
@@ -292,9 +301,9 @@ for pkg in /$LIBTORCH_HOUSE_DIR/libtorch*.zip; do
292
301
find $PREFIX -name ' *.so*' | while read sofile; do
293
302
origname=${DEPS_SONAME[i]}
294
303
patchedname=${patched[i]}
295
- if [[ " $origname " != " $patchedname " ]]; then
304
+ if [[ " $origname " != " $patchedname " ]] || [[ " $DESIRED_CUDA " == * " rocm " * ]] ; then
296
305
set +e
297
- $ PATCHELF_BIN --print-needed $sofile | grep $origname 2>&1 > /dev/null
306
+ origname= $( $ PATCHELF_BIN --print-needed $sofile | grep " $origname * " )
298
307
ERRCODE=$?
299
308
set -e
300
309
if [ " $ERRCODE " -eq " 0" ]; then
You can’t perform that action at this time.
0 commit comments