-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
SUMO compilation
This page explains how to recompile the SUMO dependency on every platforms. SUMO is an open source microscopic and continuous road traffic simulation package used by the sumo interface to generate traffic in any Webots simulation.
Get Sumo 1.13 from precompiled package and create the target package: https://sourceforge.net/projects/sumo/files/sumo
Reference: http://sumo.dlr.de/wiki/Installing
Ubuntu 20.04
# Recommended: sudo apt-get autoremove libxerces-c3.2 libxerces-c-dev libfox-1.6-0 libfox-1.6-dev
sudo add-apt-repository ppa:sumo/stable
sudo apt-get update
sudo apt-get install sumo sumo-tools
cd $HOME/software
mkdir sumo-1.13-Ubuntu_20.04
cd sumo-1.13-Ubuntu_20.04
mkdir bin
cp /usr/bin/duarouter bin/
cp /usr/bin/netconvert bin/
cp /usr/bin/netedit bin/
cp /usr/bin/sumo bin/
cp /usr/bin/sumo-gui bin/
# other dependencies
cp /usr/bin/activitygen bin/
cp /usr/bin/dfrouter bin/
cp /usr/bin/emissionsDrivingCycle bin/
cp /usr/bin/emissionsMap bin/
cp /usr/bin/jtrrouter bin/
cp /usr/bin/marouter bin/
cp /usr/bin/netgenerate bin/
cp /usr/bin/od2trips bin/
cp /usr/bin/polyconvert bin/
# To make it work on Ubuntu 22.04 we also need these libraries
cp /usr/lib/libarmadillo.so.9 bin/
cp /usr/lib/x86_64-linux-gnu/libaec.so.0 bin/
cp /usr/lib/x86_64-linux-gnu/libarpack.so.2 bin/
cp /usr/lib/x86_64-linux-gnu/libblas.so.3 bin/
cp /usr/lib/x86_64-linux-gnu/libCharLS.so.2 bin/
cp /usr/lib/x86_64-linux-gnu/libcfitsio.so.8 bin/
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 bin/
cp /usr/lib/x86_64-linux-gnu/libdap.so.25 bin/
cp /usr/lib/x86_64-linux-gnu/libdapclient.so.6 bin/
cp /usr/lib/x86_64-linux-gnu/libepsilon.so.1 bin/
cp /usr/lib/x86_64-linux-gnu/libFOX-1.6.so.0 bin/
cp /usr/lib/x86_64-linux-gnu/libfreexl.so.1 bin/
cp /usr/lib/x86_64-linux-gnu/libfyba.so.0 bin/
cp /usr/lib/x86_64-linux-gnu/libfygm.so.0 bin/
cp /usr/lib/x86_64-linux-gnu/libfyut.so.0 bin/
cp /usr/lib/x86_64-linux-gnu/libgdal.so.26 bin/
cp /usr/lib/x86_64-linux-gnu/libgeos.so.3.10.2 bin/
cp /usr/lib/x86_64-linux-gnu/libgeos_c.so.1 bin/
cp /usr/lib/x86_64-linux-gnu/libgeotiff.so.5 bin/
cp /usr/lib/x86_64-linux-gnu/libgfortran.so.5 bin/
cp /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.103 bin/
cp /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100 bin/
cp /usr/lib/x86_64-linux-gnu/libjson-c.so.4 bin/
cp /usr/lib/x86_64-linux-gnu/libkmlbase.so.1 bin/
cp /usr/lib/x86_64-linux-gnu/libkmldom.so.1 bin/
cp /usr/lib/x86_64-linux-gnu/libkmlengine.so.1 bin/
cp /usr/lib/x86_64-linux-gnu/liblapack.so.3 bin/
cp /usr/lib/x86_64-linux-gnu/libminizip.so.1 bin/
cp /usr/lib/x86_64-linux-gnu/libmysqlclient.so.21 bin/
cp /usr/lib/x86_64-linux-gnu/libnetcdf.so.15 bin/
cp /usr/lib/x86_64-linux-gnu/libodbc.so.2 bin/
cp /usr/lib/x86_64-linux-gnu/libodbcinst.so.2 bin/
cp /usr/lib/x86_64-linux-gnu/libopenblas.so.0 bin/
cp /usr/lib/x86_64-linux-gnu/libpoppler.so.97 bin/
cp /usr/lib/x86_64-linux-gnu/libproj.so.15 bin/
cp /usr/lib/x86_64-linux-gnu/libpq.so.5 bin/
cp /usr/lib/x86_64-linux-gnu/libqhull.so.7 bin/
cp /usr/lib/x86_64-linux-gnu/libspatialite.so.7 bin/
cp /usr/lib/x86_64-linux-gnu/libsuperlu.so.5 bin/
cp /usr/lib/x86_64-linux-gnu/libsz.so.2 bin/
cp /usr/lib/x86_64-linux-gnu/liburiparser.so.1 bin/
cp /usr/lib/x86_64-linux-gnu/libxerces-c-3.2.so bin/
cp /usr/lib/x86_64-linux-gnu/libwebp.so.6 bin/
cp /usr/lib/libdfalt.so.0 bin/
cp /usr/lib/libgdal.so.26 bin/
cp /usr/lib/libmfhdfalt.so.0 bin/
cp /usr/lib/libogdi.so.4 bin/
mkdir tools
cp -R /usr/share/sumo/tools/traci tools/
cp -R /usr/share/sumo/tools/sumolib tools/
cp /usr/share/sumo/tools/randomTrips.py tools/
mkdir data
cp -R /usr/share/sumo/data/3D data/
cp -R /usr/share/sumo/data/emissions data/
cp -R /usr/share/sumo/data/typemap data/
cp -R /usr/share/sumo/data/xsd data/
sudo apt-get autoremove sumo sumo-tools
cd $HOME/software
tar -cvjSf sumo-1.13-Ubuntu_20.04.tar.bz2 sumo-1.13-Ubuntu_20.04
Reference: https://sumo.dlr.de/docs/Installing/MacOS_Build.html
Download Sumo sources (sumo-src-1.13.0.tar.gz) in $HOME/software/sumo-1.13.0 from:
https://sourceforge.net/projects/sumo/files/sumo/version%201.13.0/
cd $HOME/software/sumo-1.13.0
brew update
brew install Caskroom/cask/xquartz
brew install gdal
brew install proj
brew install xerces-c
brew install homebrew/x11/fox
brew uninstall --ignore-dependencies python # python is a dependency of gdal, we prefer to use the Python of the system
mkdir build/cmake-build
cd build/cmake-build
cmake ../..
cmake --build . --parallel $(sysctl -n hw.ncpu)
mkdir sumo-1.13.0-mac
cp -r bin sumo-1.13.0-mac/bin
cp -r data sumo-1.13.0-mac/data
mkdir sumo-1.13.0-mac/tools
cp -r tools/traci sumo-1.13.0-mac/tools/traci
cp -r tools/sumolib sumo-1.13.0-mac/tools/sumolib
cp tools/randomTrips.py sumo-1.13.0-mac/tools
# find dependencies
cd bin
otool -L duarouter netedit netconvert sumo sumo-gui | grep /usr/local | sed -e 's/ (.*//;s/^\s*//' | sort | uniq
cd ..
# copy the dependencies returned by the above command:
cp /usr/local/opt/ffmpeg/lib/libavcodec.59.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/ffmpeg/lib/libavdevice.59.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/ffmpeg/lib/libavformat.59.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/ffmpeg/lib/libavutil.57.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/ffmpeg/lib/libswscale.6.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/fox/lib/libFOX-1.6.0.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/gdal/lib/libgdal.31.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/gl2ps/lib/libgl2ps.1.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/jpeg/lib/libjpeg.9.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/libtiff/lib/libtiff.5.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/proj/lib/libproj.25.dylib sumo-1.13.0-mac/bin
cp /usr/local/opt/xerces-c/lib/libxerces-c-3.2.dylib sumo-1.13.0-mac/bin
chmod u+w sumo-1.13.0-mac/bin/*dylib*
# create deps.py as described below
cd sumo-1.13.0-mac/bin
python deps.py
cd ../..
tar -czvf sumo-1.13.0-mac.tar.gz sumo-1.13.0-mac
# File: deps.py
from subprocess import call
import os
executables = [
"sumo",
"sumo-gui",
"netconvert",
"netedit",
"duarouter"
]
libraries = [
"/usr/local/opt/ffmpeg/lib/libavcodec.59.dylib",
"/usr/local/opt/ffmpeg/lib/libavdevice.59.dylib",
"/usr/local/opt/ffmpeg/lib/libavformat.59.dylib",
"/usr/local/opt/ffmpeg/lib/libavutil.57.dylib",
"/usr/local/opt/ffmpeg/lib/libswscale.6.dylib",
"/usr/local/opt/fox/lib/libFOX-1.6.0.dylib",
"/usr/local/opt/gdal/lib/libgdal.31.dylib",
"/usr/local/opt/gl2ps/lib/libgl2ps.1.dylib",
"/usr/local/opt/jpeg/lib/libjpeg.9.dylib",
"/usr/local/opt/libtiff/lib/libtiff.5.dylib",
"/usr/local/opt/proj/lib/libproj.25.dylib",
"/usr/local/opt/xerces-c/lib/libxerces-c-3.2.dylib"
]
def command(cmd):
print cmd
call(cmd.split())
for lA in libraries:
lAName = os.path.basename(lA)
command("install_name_tool -id @loader_path/%s %s" % (lAName, lAName))
for lB in libraries:
lBName = os.path.basename(lB)
command("install_name_tool -change %s @loader_path/%s %s" % (lB, lBName, lAName))
for executable in executables:
for l in libraries:
lName = os.path.basename(l)
command("install_name_tool -change %s @loader_path/%s %s" % (l, lName, executable))
Download Sumo windows 64bits precompiled package (sumo-win64-0.30.0.zip) and extract it in $HOME/software/sumo-0.30.0 from:
https://sourceforge.net/projects/sumo/files/sumo/version%200.30.0/
cd $HOME/software/sumo-win64-0.30.0/sumo-0.30.0
mkdir sumo-0.30-windows
cp -r bin sumo-0.30-windows/bin
cp -r data sumo-0.30-windows/data
mkdir sumo-0.30-windows/tools
cp -r tools/traci sumo-0.30-windows/tools/traci
cp -r tools/sumolib sumo-0.30-windows/tools/sumolib
cp tools/randomTrips.py sumo-0.30-windows/tools
cp tools/route2trips.py sumo-0.30-windows/tools
zip -r sumo-0.30-windows.zip sumo-0.30-windows
Finally upload the file on the ftp.