mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
Enable xpu runtime pypi packages as dependencies of XPU CD wheels both for Linux and Windows. Fixes https://github.com/pytorch/pytorch/issues/135867 Works for https://github.com/pytorch/pytorch/issues/139722 and https://github.com/pytorch/pytorch/issues/114850 Pull Request resolved: https://github.com/pytorch/pytorch/pull/141135 Approved by: https://github.com/atalman
61 lines
1.6 KiB
Bash
Executable File
61 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
export TH_BINARY_BUILD=1
|
|
export USE_CUDA=0
|
|
|
|
# Keep an array of cmake variables to add to
|
|
if [[ -z "$CMAKE_ARGS" ]]; then
|
|
# These are passed to tools/build_pytorch_libs.sh::build()
|
|
CMAKE_ARGS=()
|
|
fi
|
|
if [[ -z "$EXTRA_CAFFE2_CMAKE_FLAGS" ]]; then
|
|
# These are passed to tools/build_pytorch_libs.sh::build_caffe2()
|
|
EXTRA_CAFFE2_CMAKE_FLAGS=()
|
|
fi
|
|
|
|
WHEELHOUSE_DIR="wheelhousecpu"
|
|
LIBTORCH_HOUSE_DIR="libtorch_housecpu"
|
|
if [[ -z "$PYTORCH_FINAL_PACKAGE_DIR" ]]; then
|
|
if [[ -z "$BUILD_PYTHONLESS" ]]; then
|
|
PYTORCH_FINAL_PACKAGE_DIR="/remote/wheelhousecpu"
|
|
else
|
|
PYTORCH_FINAL_PACKAGE_DIR="/remote/libtorch_housecpu"
|
|
fi
|
|
fi
|
|
mkdir -p "$PYTORCH_FINAL_PACKAGE_DIR" || true
|
|
|
|
OS_NAME=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
|
|
if [[ "$OS_NAME" == *"CentOS Linux"* ]]; then
|
|
LIBGOMP_PATH="/usr/lib64/libgomp.so.1"
|
|
elif [[ "$OS_NAME" == *"Red Hat Enterprise Linux"* ]]; then
|
|
LIBGOMP_PATH="/usr/lib64/libgomp.so.1"
|
|
elif [[ "$OS_NAME" == *"AlmaLinux"* ]]; then
|
|
LIBGOMP_PATH="/usr/lib64/libgomp.so.1"
|
|
elif [[ "$OS_NAME" == *"Ubuntu"* ]]; then
|
|
if [[ "$(uname -m)" == "s390x" ]]; then
|
|
LIBGOMP_PATH="/usr/lib/s390x-linux-gnu/libgomp.so.1"
|
|
else
|
|
LIBGOMP_PATH="/usr/lib/x86_64-linux-gnu/libgomp.so.1"
|
|
fi
|
|
fi
|
|
|
|
DEPS_LIST=(
|
|
"$LIBGOMP_PATH"
|
|
)
|
|
|
|
DEPS_SONAME=(
|
|
"libgomp.so.1"
|
|
)
|
|
|
|
rm -rf /usr/local/cuda*
|
|
|
|
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
|
if [[ -z "$BUILD_PYTHONLESS" ]]; then
|
|
BUILD_SCRIPT=build_common.sh
|
|
else
|
|
BUILD_SCRIPT=build_libtorch.sh
|
|
fi
|
|
source ${SOURCE_DIR}/${BUILD_SCRIPT}
|