Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tools/build_config/build_wheels.sh
169674 views
1
#!/bin/bash
2
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
# Copyright (C) 2008-2025 German Aerospace Center (DLR) and others.
4
# This program and the accompanying materials are made available under the
5
# terms of the Eclipse Public License 2.0 which is available at
6
# https://www.eclipse.org/legal/epl-2.0/
7
# This Source Code may also be made available under the following Secondary
8
# Licenses when the conditions for such availability set forth in the Eclipse
9
# Public License 2.0 are satisfied: GNU General Public License, version 2
10
# or later which is available at
11
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
14
# @file build_wheels.sh
15
# @author Michael Behrisch
16
# @author Robert Hilbrich
17
# @date 2019
18
19
# This script builds the wheels inside a docker container.
20
# An example call could look like: docker run --rm -v $PWD:/opt/sumo --workdir /opt/sumo manylinux2014_aarch64 tools/build_config/build_wheels.sh
21
# If we are behind a firewall (HTTPS_PROXY is set) we cannot install from the CentOS repos but we can use pip via the proxy
22
if test $# -ge 1; then
23
export HTTPS_PROXY=$1
24
fi
25
if test -z $HTTPS_PROXY; then
26
yum install -y epel-release
27
yum-config-manager --add-repo=https://download.opensuse.org/repositories/science:/dlr/CentOS_7/
28
yum install -y --nogpgcheck ccache libxerces-c-devel proj-devel fox16-devel bzip2-devel gl2ps-devel swig3 eigen3-devel
29
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
30
yum install -y geos311-devel
31
yum install -y https://packages.apache.org/artifactory/arrow/centos/$(cut -d: -f5 /etc/system-release-cpe | cut -d. -f1)/apache-arrow-release-latest.rpm
32
yum install -y arrow-devel parquet-devel # For Apache Parquet
33
pipx install -f patchelf==0.16.1.0 # see https://github.com/pypa/manylinux/issues/1421
34
fi
35
36
if test $# -ge 2; then
37
pushd ..
38
git clone https://github.com/PedestrianDynamics/jupedsim -b $2 --depth 1
39
mkdir jupedsim-build jupedsim-install
40
cd jupedsim-build
41
cmake -DCMAKE_INSTALL_PREFIX=$PWD/../jupedsim-install ../jupedsim
42
cmake --build . -j$(nproc)
43
cmake --install .
44
popd
45
fi
46
47
mkdir -p $HOME/.ccache
48
echo "hash_dir = false" >> $HOME/.ccache/ccache.conf
49
echo "base_dir = $PWD/_skbuild/linux-x86_64-3.8" >> $HOME/.ccache/ccache.conf
50
cp build_config/pyproject.toml .
51
py=/opt/python/cp312-cp312
52
$py/bin/python tools/build_config/version.py tools/build_config/setup-sumo.py ./setup.py
53
$py/bin/python -m build --wheel
54
mv dist/eclipse_sumo-* `echo dist/eclipse_sumo-* | sed 's/cp312-cp312/py2.py3-none/'`
55
auditwheel repair dist/eclipse_sumo*.whl
56
cp -a data tools/libsumo
57
for py in /opt/python/cp3[1789]*; do
58
rm dist/*.whl
59
pminor=`echo $py | sed 's,/opt/python/cp3,,;s/-.*//'`
60
echo "base_dir = $PWD/_skbuild/linux-x86_64-3.${pminor}" >> $HOME/.ccache/ccache.conf
61
$py/bin/python tools/build_config/version.py tools/build_config/setup-sumo.py ./setup.py
62
$py/bin/python -m build --wheel
63
$py/bin/python tools/build_config/version.py tools/build_config/setup-libsumo.py tools/setup.py
64
$py/bin/python -m build --wheel tools -o dist
65
auditwheel repair dist/libsumo*.whl
66
done
67
# clean up all temporary files except for _skbuild
68
rm -rf tools/*.egg-info tools/build_config/*.egg-info tools/build tools/libsumo/data pyproject.toml setup.py tools/setup.py data/locale
69
find tools -name __pycache__ | xargs rm -rf
70
# the resulting wheels are in wheelhouse but we keep also the dist and the _skbuild dir for inspection
71
# we make everything writable so that others can clean up
72
chmod -R a+w _skbuild dist wheelhouse
73
74