Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/build_config/install_dependencies.sh
194321 views
1
#!/bin/bash
2
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
# Copyright (C) 2025-2026 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 install_dependencies.sh
15
# @author Michael Behrisch
16
# @date 2025-12-15
17
18
# This script installs all standard SUMO dependencies (without OpenSceneGraph and ffmpeg)
19
# on macOS and some standard Linux distros. It tries not to ask any questions and messes
20
# directly with your system so it is most useful in an isolated environment (container / CI).
21
22
FOX_VERSION=1.6.59
23
JUPEDSIM_VERSION=1.3.1
24
25
# Check for macOS
26
if [[ "$(uname)" == "Darwin" ]]; then
27
ID="macOS"
28
else
29
source /etc/os-release
30
fi
31
32
SCRIPT_DIR=$(dirname $0)
33
case "$ID" in
34
macOS)
35
brew update && brew bundle --file=$SCRIPT_DIR/Brewfile --no-upgrade
36
SUDO=sudo
37
;;
38
ubuntu|debian)
39
export DEBIAN_FRONTEND=noninteractive
40
apt-get -qq update
41
apt-get -y install $(cat $SCRIPT_DIR/build_req_deb.txt)
42
# Adding parquet support libraries
43
curl -LO https://packages.apache.org/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
44
apt-get -y install ./apache-arrow-apt-source-latest-*.deb
45
rm ./apache-arrow-apt-source-latest-*.deb
46
apt-get -qq update
47
apt-get -y install libarrow-dev libparquet-dev
48
;;
49
centos)
50
if [[ "$VERSION_ID" == "7" ]]; then
51
# this is only tested with quay.io/pypa/manylinux2014_x86_64 and will probably not work with vanilla CentOS
52
# GDAL cannot be added because the build fails with dependency problems with sqlite3
53
yum install -y epel-release
54
yum-config-manager --add-repo=https://download.opensuse.org/repositories/science:/dlr/CentOS_7/
55
yum install -y --nogpgcheck ccache libxerces-c-devel proj-devel fox16-devel bzip2-devel gl2ps-devel swig3 eigen3-devel geos-devel
56
yum install -y https://packages.apache.org/artifactory/arrow/centos/7/apache-arrow-release-latest.rpm
57
yum install -y arrow-devel parquet-devel # For Apache Parquet
58
else
59
echo "CentOS version other than 7 detected: $VERSION_ID"
60
fi
61
;;
62
almalinux)
63
# this is only tested with quay.io/pypa/manylinux_2_28_x86_64 and will probably not work with vanilla almalinux
64
dnf install -y epel-release
65
dnf -y update
66
dnf install -y ccache xerces-c-devel proj-devel bzip2-devel gl2ps-devel swig gdal-devel eigen3-devel geos-devel
67
# fox dependencies
68
dnf install -y libX11-devel libXft-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel mesa-libGLU-devel freetype-devel fontconfig-devel libjpeg-turbo-devel libpng-devel
69
# installing arrow / parquet
70
dnf install -y https://packages.apache.org/artifactory/arrow/almalinux/$(echo $VERSION_ID | cut -f1 -d.)/apache-arrow-release-latest.rpm
71
dnf install -y arrow-devel parquet-devel
72
cd /opt
73
# building fox from source
74
curl -LO http://www.fox-toolkit.org/ftp/fox-$FOX_VERSION.tar.gz
75
tar xf fox-$FOX_VERSION.tar.gz
76
cd fox-$FOX_VERSION
77
./configure --disable-static --enable-shared
78
make -j$(nproc)
79
make install
80
cd ..
81
rm -rf fox-$FOX_VERSION.tar.gz fox-$FOX_VERSION
82
;;
83
*)
84
echo "Unknown or unsupported OS: $ID"
85
;;
86
esac
87
88
# building jupedsim from source
89
curl -LO https://github.com/PedestrianDynamics/jupedsim/archive/refs/tags/v$JUPEDSIM_VERSION.tar.gz
90
tar xf v$JUPEDSIM_VERSION.tar.gz
91
cmake -B jupedsim-build -DCMAKE_BUILD_TYPE=Release jupedsim-$JUPEDSIM_VERSION
92
cmake --build jupedsim-build -j2
93
$SUDO cmake --install jupedsim-build
94
rm -rf v$JUPEDSIM_VERSION.tar.gz jupedsim-$JUPEDSIM_VERSION jupedsim-build
95
96
if [[ "$ID" != "macOS" ]]; then
97
# see https://github.com/pypa/manylinux/issues/1421
98
pipx install -f patchelf==0.16.1.0
99
fi
100
101