Skip to content

Instantly share code, notes, and snippets.

@johnstcn
Last active April 10, 2021 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnstcn/aec57312ec95921a82bf15b019ecb472 to your computer and use it in GitHub Desktop.
Save johnstcn/aec57312ec95921a82bf15b019ecb472 to your computer and use it in GitHub Desktop.
provision sumo + veins on ubuntu 20.04
#!/bin/bash
set -euo pipefail
set -x
# Install deps
sudo apt-get update -y && sudo apt-get install -y git wget sumo build-essential gcc g++ bison flex perl python python3 qt5-default libqt5opengl5-dev tcl-dev tk-dev libxml2-dev zlib1g-dev default-jre doxygen graphviz libpcap-dev openmpi-bin libopenmpi-dev openscenegraph-plugin-osgearth libosgearth-dev
mkdir -p ~/src && cd ~/src
# Fetch omnetpp
if [[ ! -d ~/src/omnetpp-5.6.2 ]]; then
wget -q -O - 'https://github.com/omnetpp/omnetpp/releases/download/omnetpp-5.6.2/omnetpp-5.6.2-src-linux.tgz' | tar -xzvf -
fi
# omnetpp configure script complains if we don't do this
export PATH=/home/vagrant/src/omnetpp-5.6.2/bin:$PATH
echo "export PATH=/home/vagrant/src/omnetpp-5.6.2/bin:\$PATH" | tee -a ~/.bashrc
if ! command -v opp_run &>/dev/null; then
# build omnetpp
cd omnetpp-5.6.2
./configure
make -j$(nproc)
fi
# fetch veins
if [[ ! -d ~/src/veins ]]; then
cd ~/src && git clone https://github.com/sommer/veins/
fi
# build veins
cd ~/src/veins
git checkout master
./configure
make -j$(nproc)
# fetch plexe
if [[ ! -d ~/src/plexe ]]; then
cd ~/src && git clone https://github.com/michele-segata/plexe
fi
# build plexe
cd ~/src/plexe
./configure --with-veins=${HOME}/src/veins
make -j$(nproc)
# vim: set ts=4 sw=4 expandtab:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu2004"
config.vm.provision "shell" do |shell|
shell.privileged = false
shell.path = "provision.sh"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment