forked from KitwareMedical/VTKPythonPackage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_vtk_wheel.sh
executable file
·75 lines (66 loc) · 2.06 KB
/
build_vtk_wheel.sh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# DEBUG
echo USING_DOCKER $USING_DOCKER
echo PYTHON $PYTHON
# Clone the VTK repo and checkout desired release
git clone https://gitlab.kitware.com/vtk/vtk.git
cd vtk
git checkout -b v9.2.2 tags/v9.2.2
cd ..
# Make a directory for the build
mkdir vtk_build
cd vtk_build
# Basic config (big, lots of dependencies)
#FLAGS="-DVTK_WHEEL_BUILD=ON -DVTK_PYTHON_VERSION=3 -DVTK_WRAP_PYTHON=ON"
# Minimal config (small, doesn't depend on OpenGL, MPI, etc)
FLAGS="-DCMAKE_BUILD_TYPE='Release' \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DVTK_PYTHON_VERSION=3 \
-DVTK_WRAP_PYTHON=ON \
-DVTK_WHEEL_BUILD=ON \
-DVTK_GROUP_ENABLE_Imaging=NO \
-DVTK_GROUP_ENABLE_MPI=NO \
-DVTK_GROUP_ENABLE_Qt=NO \
-DVTK_GROUP_ENABLE_StandAlone=NO \
-DVTK_GROUP_ENABLE_Views=NO \
-DVTK_GROUP_ENABLE_Web=NO \
-DVTK_MODULE_ENABLE_VTK_CommonCore=YES \
-DVTK_MODULE_ENABLE_VTK_CommonExecutionModel=YES \
-DVTK_MODULE_ENABLE_VTK_CommonMath=YES \
-DVTK_MODULE_ENABLE_VTK_CommonMisc=YES \
-DVTK_MODULE_ENABLE_VTK_CommonSystem=YES \
-DVTK_MODULE_ENABLE_VTK_CommonTransforms=YES \
-DVTK_MODULE_ENABLE_VTK_IOCore=YES \
-DVTK_MODULE_ENABLE_VTK_IOLegacy=YES \
-DVTK_MODULE_ENABLE_VTK_IOParallelXML=YES \
-DVTK_MODULE_ENABLE_VTK_IOXML=YES \
-DVTK_MODULE_ENABLE_VTK_IOXMLParser=YES \
-DVTK_MODULE_ENABLE_VTK_ParallelCore=YES"
# Ninja build
cmake -GNinja \
$FLAGS \
../vtk
ninja
# Makefile build (if no ninja)
#cmake -G"Unix Makefiles" \
# $FLAGS \
# ../vtk
#make
# If running in a Docker container use Python specifed by $PYTHON variable
if [ $USING_DOCKER -eq 1 ]
then
$PYTHON setup.py bdist_wheel
else
python setup.py bdist_wheel
fi
# Use auditwheel to produce manylinux wheel
# For some reason auditwheel can't find libvtksys-9.2.so
OS=$(uname)
if [ $OS == "linux" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/vtk_build/build/lib.linux-x86_64-3.11/vtkmodules
auditwheel repair dist/*.whl
elif [ $OS == "Darwin" ]; then
python -m pip install delocate
delocate-wheel -v dist/*.whl
fi