-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild-wheels-linux.sh
More file actions
executable file
·59 lines (46 loc) · 2.13 KB
/
build-wheels-linux.sh
File metadata and controls
executable file
·59 lines (46 loc) · 2.13 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
set -e -x
test $# = 2 || exit 1
VERSION="$1"
ABI="$2"
PLATFORM=manylinux2014_x86_64
PYTAG=${ABI/m/}
TAG=${PYTAG}-${ABI}-${PLATFORM}
PYVERD=${ABI:2:1}.${ABI:3}
SCRIPT=`readlink -f "$0"`
SCRIPTPATH=`dirname "$SCRIPT"`
export PATH=/opt/python/${PYTAG}-${ABI}/bin/:$PATH
cd /tmp
# configuration
git clone --depth 1 -b V`echo ${VERSION}|sed "s|\.|_|g"` https://github.com/SalomePlatform/configuration.git
# medcoupling
pip install scipy
git clone --depth 1 -b V`echo ${VERSION}|sed "s|\.|_|g"` https://github.com/SalomePlatform/medcoupling.git
cmake -LAH -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PWD/install \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DCONFIGURATION_ROOT_DIR=$PWD/configuration \
-DPYTHON_EXECUTABLE=/opt/python/${PYTAG}-${ABI}/bin/python \
-DPYTHON_INCLUDE_DIR=/opt/python/${PYTAG}-${ABI}/include/python${PYVERD} -DPYTHON_LIBRARY=dummy \
-DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DMEDCOUPLING_USE_64BIT_IDS=ON \
-DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-B build_medcoupling -S medcoupling
cmake --build build_medcoupling --target install
cd install/lib/python*/site-packages
rm -rf __pycache__
# write metadata
mkdir medcoupling-${VERSION}.dist-info
sed "s|@PACKAGE_VERSION@|${VERSION}|g" ${SCRIPTPATH}/METADATA.in > medcoupling-${VERSION}.dist-info/METADATA
python ${SCRIPTPATH}/write_distinfo.py medcoupling ${VERSION} ${TAG}
# create archive
zip -r medcoupling-${VERSION}-${TAG}.whl *.py *.so medcoupling-${VERSION}.dist-info
auditwheel show medcoupling-${VERSION}-${TAG}.whl
auditwheel repair medcoupling-${VERSION}-${TAG}.whl -w /io/wheelhouse/
# test
cd /tmp
pip install medcoupling --pre --no-index -f /io/wheelhouse
python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()"
python -c "import medcoupling as mc; assert mc.MEDCouplingHasNumPyBindings()"
python -c "import medcoupling as mc; assert mc.MEDCouplingHasSciPyBindings()"
python -c "import medcoupling as mc; assert mc.MEDCouplingSizeOfIDs() == 64"
python ./medcoupling/src/MEDCoupling_Swig/MEDCouplingNumPyTest.py