-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathinstall_sumo.sh
executable file
·60 lines (46 loc) · 1.62 KB
/
install_sumo.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
#!/bin/bash
# Script to install SUMO on Centos 8
current_dir="$(pwd)"
# Get install dir from input if it exists
if [ $# -gt 0 ]; then
install_dir="$1/INSTALLDIR"
else
install_dir="$(pwd)/INSTALLDIR"
fi
echo "Creating install directory..."
mkdir -p "$install_dir"
cd "$install_dir"
echo "Downloading SUMO from larosterna website..."
if [ ! -e "$install_dir/sumo-standalone-Qt4-2.7.9.tgz" ]; then
wget https://www.larosterna.com/packages/sumo-standalone-Qt4-2.7.9.tgz
fi
tar zxvf sumo-standalone-Qt4-2.7.9.tgz
echo "Adding missing librairies..."
echo "--> libgortran"
sudo dnf update -y
sudo dnf install -y compat-libgfortran-48
echo "--> libpng12 (Not working!!!)"
sudo dnf install -y libpng12
echo "--> libglu"
sudo dnf install -y mesa-libGLU
echo "--> xvfb"
sudo dnf install -y xorg-x11-server-Xvfb
echo "Set Tetgen path in dwfsumo.conf..."
if [ ! -e "~/.config/larosterna/dwfsumo.conf" ]; then
mkdir -p ~/.config/larosterna
echo "[General]" >> ~/.config/larosterna/dwfsumo.conf
echo "tetgenpath=$install_dir/sumo-2.7.9/bin/tetgen" >> ~/.config/larosterna/dwfsumo.conf
else
if ! grep "tetgenpath" ~/.config/larosterna/dwfsumo.conf ; then
echo "tetgenpath=$install_dir/sumo-2.7.9/bin/tetgen" >> ~/.config/larosterna/dwfsumo.conf
else
sed -i "s|tetgenpath.*|tetgenpath=$install_dir/sumo-2.7.9/bin/tetgen|" ~/.config/larosterna/dwfsumo.conf
fi
fi
# Add sumo to PATH in bashrc
sumo_run_path="$install_dir"/sumo-2.7.9/bin
echo \# SUMO Path >> ~/.bashrc
echo export SUMO_RUN=\""$sumo_run_path"\" >> ~/.bashrc
echo export PATH=\"\$PATH:\$SUMO_RUN\" >> ~/.bashrc
source ~/.bashrc
cd "$current_dir"