Skip to content

Commit 3e27cef

Browse files
Extract both devel and non-devel rpms and copy headers as well
1 parent 84a0c70 commit 3e27cef

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

common/install_rocm_miopen_rpm.sh

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,34 @@
33
set -ex
44

55
# Create the tmp dir to extract into
6-
EXTRACTDIR_ROOT=/extract_miopen_rpm
6+
EXTRACTDIR_ROOT=/extract_miopen_rpms
77
mkdir -p ${EXTRACTDIR_ROOT}
88
echo "Creating temporary directory for rpm download..."
99

10+
MIOPEN_RPM_SOURCE_ARRAY=($MIOPEN_RPM_SOURCE)
1011
# Fail if rpm source is not available
11-
if ! wget -P ${EXTRACTDIR_ROOT} ${MIOPEN_RPM_SOURCE}; then
12+
#if [[ ! wget -P ${EXTRACTDIR_ROOT} ${MIOPEN_RPM_SOURCE_ARRAY[0]} ]] || [[ ! wget -P ${EXTRACTDIR_ROOT} ${MIOPEN_RPM_SOURCE_ARRAY[1]} ]]; then
13+
if ! wget -P ${EXTRACTDIR_ROOT} ${MIOPEN_RPM_SOURCE_ARRAY[0]} || ! wget -P ${EXTRACTDIR_ROOT} ${MIOPEN_RPM_SOURCE_ARRAY[1]}; then
1214
echo 'ERROR: Failed to download MIOpen package.'
1315
exit 1
1416
fi
1517
echo "MIOpen package download complete..."
1618

1719
# Extract rpm in EXTRACT_DIR
1820
cd ${EXTRACTDIR_ROOT}
19-
miopen_rpm=$(ls *.rpm)
20-
rpm2cpio ${miopen_rpm} | cpio -idmv
21-
22-
# Copy libMIOpen.so.1 over existing
23-
source_file=$(ls opt/rocm*/lib/libMIOpen.so.1.0*)
24-
dest_file=$(ls /opt/rocm-${ROCM_VERSION}*/lib/libMIOpen.so.1.0*)
25-
if [ -e ${source_file} ] && [ -e ${dest_file} ]; then
26-
echo "Source .so: ${source_file}"
27-
echo "Dest .so: ${dest_file}"
28-
cp $source_file $dest_file
29-
else
30-
echo 'ERROR: either the source or destination path for libMIOpen.so.1.0 does not exist'
31-
exit 1
32-
fi
33-
# Copy db files over existing
34-
source="opt/rocm*/share/miopen/db/*"
35-
dest="/opt/rocm-${ROCM_VERSION}*/share/miopen/db/"
36-
# Use backslash to run cp in (non-aliased) non-interactive mode
37-
\cp -R $source $dest
21+
miopen_rpms=$(ls *.rpm)
22+
for miopen_rpm in ${miopen_rpms}; do
23+
rpm2cpio ${miopen_rpm} | cpio -idmv
24+
done
3825

26+
# Copy libMIOpen.so, headers and db files over existing
27+
files="lib/ include/ share/miopen/db/"
28+
for file in $files; do
29+
source="opt/rocm*/${file}/*"
30+
dest="/opt/rocm/${file}"
31+
# Use backslash to run cp in (non-aliased) non-interactive mode
32+
\cp -dR $source $dest
33+
done
3934
echo "libMIOpen so file from RPM copied to existing MIOpen install..."
4035

4136
# Clean up extracted dir

0 commit comments

Comments
 (0)