@@ -99,10 +99,10 @@ mkdir -p "$whl_tmp_dir"
9999
100100if [[ -n " $CROSS_COMPILE_ARM64 " || $( uname -m) == " arm64" ]]; then
101101 mac_version=' macosx_11_0_arm64'
102- libtorch_arch=' - arm64- '
102+ libtorch_arch=' arm64'
103103else
104104 mac_version=' macosx_10_9_x86_64'
105- libtorch_arch=' '
105+ libtorch_arch=' x86_64 '
106106fi
107107
108108# Create a consistent wheel package name to rename the wheel to
266266 cp -r " $( pwd) /any_wheel/torch/lib/include" " $( pwd) /libtorch/"
267267 fi
268268 cp -r " $( pwd) /any_wheel/torch/share/cmake" " $( pwd) /libtorch/share/"
269- if [[ " ${libtorch_arch} " != " -arm64- " ]]; then
269+ if [[ " ${libtorch_arch} " == " x86_64 " ]]; then
270270 if [[ -x " $( pwd) /any_wheel/torch/.dylibs/libiomp5.dylib" ]]; then
271271 cp -r " $( pwd) /any_wheel/torch/.dylibs/libiomp5.dylib" " $( pwd) /libtorch/lib/"
272272 else
@@ -278,7 +278,12 @@ else
278278 echo $PYTORCH_BUILD_VERSION > libtorch/build-version
279279 echo " $( pushd $pytorch_rootdir && git rev-parse HEAD) " > libtorch/build-hash
280280
281- zip -rq " $PYTORCH_FINAL_PACKAGE_DIR /libtorch-macos${libtorch_arch} -$PYTORCH_BUILD_VERSION .zip" libtorch
282- cp " $PYTORCH_FINAL_PACKAGE_DIR /libtorch-macos${libtorch_arch} -$PYTORCH_BUILD_VERSION .zip" \
283- " $PYTORCH_FINAL_PACKAGE_DIR /libtorch-macos${libtorch_arch} -latest.zip"
281+ zip -rq " $PYTORCH_FINAL_PACKAGE_DIR /libtorch-macos-${libtorch_arch} -$PYTORCH_BUILD_VERSION .zip" libtorch
282+ cp " $PYTORCH_FINAL_PACKAGE_DIR /libtorch-macos-${libtorch_arch} -$PYTORCH_BUILD_VERSION .zip" \
283+ " $PYTORCH_FINAL_PACKAGE_DIR /libtorch-macos-${libtorch_arch} -latest.zip"
284+ if [[ " ${libtorch_arch} " == " x86_64" ]]; then
285+ # For backward compatibility make unarched latest to point to x86_64
286+ cp " $PYTORCH_FINAL_PACKAGE_DIR /libtorch-macos-${libtorch_arch} -$PYTORCH_BUILD_VERSION .zip" \
287+ " $PYTORCH_FINAL_PACKAGE_DIR /libtorch-macos-latest.zip"
288+ fi
284289fi
0 commit comments