Skip to content

Commit 007d3a1

Browse files
committed
[Task] : Add pytorch stable version specific audit_wheel.
1 parent 168b798 commit 007d3a1

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

build_tools/python_deploy/build_macos_packages.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function run() {
5959
torch-mlir-ext)
6060
clean_wheels torch_mlir_ext "$python_version"
6161
build_torch_mlir_ext torch_mlir_ext "$python_version"
62-
run_audit_wheel torch_mlir_ext "$python_version"
62+
run_audit_wheel_ext torch_mlir_ext "$python_version"
6363
;;
6464
torch-mlir)
6565
clean_wheels torch_mlir "$python_version"
@@ -120,7 +120,7 @@ function clean_wheels() {
120120
rm -f "$output_dir"/"${wheel_basename}"-*-"${python_version//./}"-*.whl
121121
}
122122

123-
function run_audit_wheel() {
123+
function run_audit_wheel_ext() {
124124
set +x
125125
local wheel_basename="$1"
126126
local python_version="$2"
@@ -141,4 +141,24 @@ function run_audit_wheel() {
141141
fi
142142
}
143143

144+
function run_audit_wheel() {
145+
set +x
146+
local wheel_basename="$1"
147+
local python_version="$2"
148+
generic_wheel=$(ls "$output_dir"/"${wheel_basename}"-* | grep "${python_version//./}")
149+
echo "Looking for $generic_wheel"
150+
if [ -f "$generic_wheel" ]; then
151+
echo "$generic_wheel found. Delocating it.."
152+
rm -rf "$output_dir"/test_venv
153+
python"${python_version}" -m venv "$output_dir"/test_venv
154+
source "$output_dir"/test_venv/bin/activate
155+
python"${python_version}" -m pip install -U pip
156+
python"${python_version}" -m pip install -r "$repo_root"/build-requirements.txt
157+
python"${python_version}" -m pip install "$generic_wheel"
158+
DYLD_LIBRARY_PATH="$output_dir"/test_venv/lib/python"${python_version}"/site-packages/torch/lib delocate-wheel -v "$generic_wheel"
159+
deactivate
160+
rm -rf "$output_dir"/test_venv
161+
fi
162+
}
163+
144164
run

0 commit comments

Comments
 (0)