Skip to content

Commit f530635

Browse files
committed
Fixes for rocm install
1 parent cc534ee commit f530635

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

script/install-rocm/customize.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ def preprocess(i):
4343
projects = 'clang;lld;compiler-rt;clang-tools-extra'
4444
runtimes = 'libcxx;libcxxabi;openmp'
4545

46+
q = "'"
4647
cmake_cmd = (
4748
f'cmake {os.path.join(src_path, "llvm")} -GNinja'
4849
f' -DCMAKE_BUILD_TYPE=Release'
4950
f' -DCMAKE_INSTALL_PREFIX={build_install_prefix}'
50-
f' -DLLVM_ENABLE_PROJECTS=\"{projects}\"'
51-
f' -DLLVM_ENABLE_RUNTIMES=\"{runtimes}\"'
52-
f' -DLLVM_TARGETS_TO_BUILD={targets}'
51+
f' -DLLVM_ENABLE_PROJECTS={q}{projects}{q}'
52+
f' -DLLVM_ENABLE_RUNTIMES={q}{runtimes}{q}'
53+
f' -DLLVM_TARGETS_TO_BUILD={q}{targets}{q}'
5354
f' -DLLVM_ENABLE_RTTI=ON'
5455
f' -DLLVM_INSTALL_UTILS=ON'
5556
f' -DLLVM_ENABLE_ASSERTIONS=OFF'
@@ -132,11 +133,16 @@ def postprocess(i):
132133

133134
search_dirs = []
134135
for prefix in search_prefixes:
136+
# Standard package installs: /opt/rocm/bin, /opt/rocm-*/bin
135137
prefix_opt = os.path.join(prefix, 'opt')
136138
if os.path.isdir(prefix_opt):
137139
for p in [os.path.join(prefix_opt, 'rocm', 'bin')] + sorted(glob.glob(os.path.join(prefix_opt, 'rocm-*', 'bin')), reverse=True):
138140
if os.path.isdir(p) and p not in search_dirs:
139141
search_dirs.append(p)
142+
# Untar installs: <prefix>/rocm-*/bin (no opt/ subdirectory)
143+
for p in sorted(glob.glob(os.path.join(prefix, 'rocm-*', 'bin')), reverse=True):
144+
if os.path.isdir(p) and p not in search_dirs:
145+
search_dirs.append(p)
140146

141147
print(f" install_prefix = {install_prefix}")
142148
print(f" cur_dir = {cur_dir}")

script/install-rocm/run-rhel.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ if [[ ${major_version} -ge 7 ]]; then
2222
if [[ "${install_prefix}" == "/" ]]; then
2323
sudo bash "${runfile_path}" deps=install target="/" rocm postrocm
2424
else
25-
bash "${runfile_path}" deps=skip target="${install_prefix}" rocm postrocm
25+
# Use untar for non-root installs (no sudo required)
26+
# Creates ${install_prefix}/rocm-${MLC_VERSION}/ with all ROCm components
27+
bash "${runfile_path}" untar "${install_prefix}"
2628
fi
2729
test $? -eq 0 || exit 1
2830

script/install-rocm/run-ubuntu.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ if [[ ${major_version} -ge 7 ]]; then
3232
if [[ "${install_prefix}" == "/" ]]; then
3333
sudo bash "${runfile_path}" deps=install target="/" rocm postrocm
3434
else
35-
bash "${runfile_path}" deps=skip target="${install_prefix}" rocm postrocm
35+
# Use untar for non-root installs (no sudo required)
36+
# Creates ${install_prefix}/rocm-${MLC_VERSION}/ with all ROCm components
37+
bash "${runfile_path}" untar "${install_prefix}"
3638
fi
3739
test $? -eq 0 || exit 1
3840

0 commit comments

Comments
 (0)