-
Notifications
You must be signed in to change notification settings - Fork 1
/
vce-container.def
139 lines (128 loc) · 4.18 KB
/
vce-container.def
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
BootStrap: docker
From: archlinux:latest
%post
# run after base OS is installed
omnetpp_version="6.0.1"
veins_version="5.2"
sumo_version="v1_18_0"
# Convenience (`alias` in %environment doesn't seem to work):
echo "#!/usr/bin/env bash" > /usr/bin/ll
echo "ls -lah \$@" >> /usr/bin/ll
chmod +x /usr/bin/ll
pacman --noconfirm -Syuv
pacman --noconfirm -S \
bash-completion \
bear \
bison \
ccache \
clang \
cmake \
dotnet-sdk \
doxygen \
flex \
fox \
gcc \
gdal \
gdb \
git \
gl2ps \
gmock \
graphviz \
gtest \
gvim \
help2man \
jdk-openjdk \
libpcap \
libxml2 \
lldb \
make \
neovim \
net-tools \
openmpi \
openscenegraph \
proj \
protobuf \
python \
python-cookiecutter \
python-matplotlib \
python-pandas \
python-pip \
python-poetry \
python-scipy \
qt5-base \
qt5-svg \
sh \
swig \
tcl \
tmux \
perl \
unzip \
wget \
which \
xerces-c \
zeromq
# Clear cache:
# (--noconfirm will not work here because 'N' is the default.)
yes | pacman -Scc
# May raise `error: externally-managed-environment` if `--break-system-packages`
# is not provided.
# Avoid using pip for packages that are indeed available as system packages.
pip install --break-system-packages \
posix_ipc \
snakemake
# Install Godot to /opt/godot:
# Note: Godot 3.x depends on mono-msbuild, but 4.x allegedly doesn't.
# -> TODO: remove mono-msbuild when we eventually switch to 4.x
cd /opt
wget "https://downloads.tuxfamily.org/godotengine/3.6/beta2/mono/Godot_v3.6-beta2_mono_linux_headless_64.zip" \
-O godot.zip
unzip godot.zip
rm godot.zip
# Install OMNeT++ to /opt/omnetpp:
cd /opt
omnetpp_tgz="omnetpp-${omnetpp_version}-linux-x86_64.tgz"
wget "https://github.com/omnetpp/omnetpp/releases/download/omnetpp-${omnetpp_version}/omnetpp-${omnetpp_version}-linux-x86_64.tgz"
tar xf $omnetpp_tgz
mv omnetpp-${omnetpp_version} omnetpp
cd /opt/omnetpp
ls -lah
cp configure.user.dist configure.user
sed -i 's/#CXXFLAGS=.*/CXXFLAGS=-std=c++17/g' configure.user
bash -c "source setenv && ./configure && make -j$(nproc)"
rm ../$omnetpp_tgz
# Users must be able to write to ide/error.log.
# As a workaround for now, we'll patch bin/opp_ide to write to ide/log/error.log instead,
# symlink ide/log to /log, and assume a bind mount of /log to some writable host directory.
sed -i 's|error.log|log/error.log|g' /opt/omnetpp/bin/opp_ide
ln -s /log /opt/omnetpp/ide/log
# Install Veins to /opt/veins:
mkdir /opt/veins
cd /opt/veins
wget http://veins.car2x.org/download/veins-$veins_version.zip
unzip veins-$veins_version.zip
rm veins-$veins_version.zip
bash -c "cd /opt/omnetpp && source setenv && cd /opt/veins/veins-veins-$veins_version && source setenv && ./configure && make -j$(nproc)"
# Install SUMO to /opt/sumo:
git clone https://github.com/eclipse/sumo.git --depth 1 -b $sumo_version /opt/sumo/
export SUMO_HOME="/opt/sumo/"
mkdir /opt/sumo/build/cmake-build/
cd /opt/sumo/build/cmake-build
# cmake ../../
# Workaround for "C++ versions less than 14 are not supported" https://github.com/google/googletest/issues/3934
cmake -DCMAKE_CXX_STANDARD=14 ../../
make -j$(nproc)
rm -rf /opt/sumo/tests /opt/sumo/.git
%environment
export LC_ALL=C
export PATH=/opt/sumo/bin:$PATH
export SUMO_HOME=/opt/sumo/
# Tell OMNeT++ not to try to create /run/user/1000/ runtime directory:
export XDG_RUNTIME_DIR=/tmp/xdg-runtime-root
cd /opt/omnetpp && source /opt/omnetpp/setenv
cd /opt/veins/veins-veins-5.2 && source setenv
alias ll="ls -lah" # not working :/
%runscript
echo "This is the VCE container speaking. Please use 'apptainer shell' with me."
%labels
Author Lukas Stratmann <[email protected]>
Version 0.1.0