Skip to content

add python-dev package #13

add python-dev package

add python-dev package #13

Workflow file for this run

name: Build wheels
on:
push:
branches:
- ci/build-wheels
jobs:
build-wheels:
name: Build (${{ matrix.os.name }}-${{ matrix.os.version }}, CUDA ${{ matrix.cuda }}, py${{ matrix.python }})
runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }}
strategy:
fail-fast: false
matrix:
include:
# Linux
- os: {name: "ubuntu", version: "22.04"}
cuda: "12.0.1"
python: "3.12"
# Windows
- os: {name: "windows", version: "latest"}
cuda: "12.0.1"
python: "3.12"
steps:
- name: Check out source
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build wheel auditwheel
# ================ LINUX ================
- name: Build wheel on Linux (CUDA ${{ matrix.cuda }})
if: runner.os == 'Linux'
run: |
docker run --rm -i \
-v $PWD:/src \
-w /src \
nvidia/cuda:${{ matrix.cuda }}-devel-${{ matrix.os.name }}${{ matrix.os.version }} \
bash -euxo pipefail << 'EOF'
export DEBIAN_FRONTEND=noninteractive
echo "=== System info ==="
uname -a
nvcc --version || true
echo "=== Installing tools ==="
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y python${{ matrix.python }} python${{ matrix.python }}-venv python${{ matrix.python }}-dev python3-pip cmake tzdata patchelf
echo "=== Creating virtual environment ==="
python${{ matrix.python }} -m venv /venv
source /venv/bin/activate
python${{ matrix.python }} --version || true
pip install --upgrade pip
pip install build wheel auditwheel
echo "=== Starting wheel build ==="
python${{ matrix.python }} -m build --wheel
echo "=== dist contents ==="
find dist -maxdepth 2 -type f || echo "dist is empty"
echo "=== Running auditwheel ==="
auditwheel repair dist/*.whl -w repaired/
echo "=== repaired contents ==="
find repaired -maxdepth 2 -type f || echo "repaired is empty"
EOF
# ================ WINDOWS ================
- name: Install CUDA Toolkit (Windows)
if: runner.os == 'Windows'
uses: Jimver/cuda-toolkit@v0.2.35
with:
cuda: ${{ matrix.cuda }}
- name: Build wheel on Windows (CUDA ${{ matrix.cuda }})
if: runner.os == 'Windows'
env:
CUDA_PATH: ${{ env.CUDA_PATH }}
run: |
cmake --version
nvcc --version
python --version
python -m pip install --upgrade pip build wheel
python -m build --wheel
# ================ UPLOAD ================
- name: Upload wheel artifacts
uses: actions/upload-artifact@v7
with:
name: mumaxplus-${{ matrix.os.name }}-${{ matrix.os.version }}-cuda${{ matrix.cuda }}-py${{ matrix.python }}
path: |
dist/mumaxplus-*.whl
repaired/mumaxplus-*.whl