Skip to content

Build VTK from source #24

Build VTK from source

Build VTK from source #24

Workflow file for this run

name: Build VTK from source
on:
workflow_dispatch
env:
PYTHONUTF8: 1
jobs:
build:
name: Build with wrapper for Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-20.04', 'macos-11', 'macos-14', 'windows-2019' ]
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
steps:
- name: Checkout project
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup Python Env
shell: bash -l {0}
# The `bdist_wheel` command requires the `wheel` package
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade wheel
python3 -m pip freeze
- name: Ubuntu Deps
shell: bash -l {0}
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt install -y build-essential cmake mesa-common-dev mesa-utils freeglut3-dev python3-dev python3-venv git-core ninja-build cmake wget libglvnd0 libglvnd-dev
fi
- name: Build Wheel from Scratch
shell: bash -l {0}
run: |
pip3 install --upgrade setuptools
mkdir -p ./vtk/build
curl -L https://www.vtk.org/files/release/9.2/VTK-9.2.6.tar.gz --output VTK-9.2.6.tar.gz # Update this for newer releases of VTK
ls
ls ./vtk
cat VTK-9.2.6.tar.gz
tar -zxf VTK-9.2.6.tar.gz --directory ./vtk/
cd ./vtk/build
cmake -GNinja -DVTK_WHEEL_BUILD=ON -DVTK_WRAP_PYTHON=ON -DCMAKE_BUILD_TYPE=Release ../VTK-9.2.6
ninja
python3 setup.py bdist_wheel
cd ../../
find ./ -iname *.whl
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: cadquery-vtk-${{ matrix.os }}-cp${{ matrix.python-version }}
path: vtk/build/dist/*.whl