-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathbuild_linux.sh
More file actions
39 lines (33 loc) · 1.72 KB
/
build_linux.sh
File metadata and controls
39 lines (33 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -ex
CUDA_VERSION="${1:?Specify cuda version, e.g. cpu, cu130}"
PYTHON_VERSION="${2:?Specify python version, e.g. 3.14}"
TORCH_VERSION="${3:?Specify torch version, e.g. 2.11.0}"
echo "CUDA_VERSION: ${CUDA_VERSION}"
echo "PYTHON_VERSION: ${PYTHON_VERSION//./}"
echo "TORCH_VERSION: ${TORCH_VERSION}"
source ./.github/workflows/cuda/Linux-env.sh ${CUDA_VERSION}
echo "FORCE_CUDA: ${FORCE_CUDA}"
echo "TORCH_CUDA_ARCH_LIST: ${TORCH_CUDA_ARCH_LIST}"
export CIBW_BUILD="cp${PYTHON_VERSION//./}-manylinux_x86_64"
# pyg-lib doesn't have torch as a dependency, so we need to explicitly install it when running tests.
if [[ "${TORCH_VERSION}" == "2.12.0" ]]; then
export CIBW_BEFORE_BUILD="pip install ninja wheel setuptools && pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/${CUDA_VERSION}"
export CIBW_BEFORE_TEST="pip install pytest && pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/${CUDA_VERSION}"
else
export CIBW_BEFORE_BUILD="pip install ninja wheel setuptools && pip install torch==${TORCH_VERSION} --index-url https://download.pytorch.org/whl/${CUDA_VERSION}"
export CIBW_BEFORE_TEST="pip install pytest && pip install torch==${TORCH_VERSION} --index-url https://download.pytorch.org/whl/${CUDA_VERSION}"
fi
if [[ "${CUDA_VERSION}" == "cu"* ]]; then
# Use CUDA-pre-installed image
export CIBW_MANYLINUX_X86_64_IMAGE=akihironitta/manylinux:${CUDA_VERSION}
else
export CIBW_MANYLINUX_X86_64_IMAGE=quay.io/pypa/manylinux_2_28_x86_64
fi
rm -rf Testing libpyg.so build dist outputs # for local testing
python -m cibuildwheel --output-dir dist
ls -ahl dist/
python -m auditwheel show dist/*.whl
unzip dist/*.whl -d debug/
ldd debug/libpyg.so
readelf -d debug/libpyg.so