-
Notifications
You must be signed in to change notification settings - Fork 0
/
openrave_container.def
214 lines (192 loc) · 5.8 KB
/
openrave_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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
BootStrap: docker
From: ubuntu:trusty
%files
src /usr/project/catkin/src
requirements.txt /usr/project/python/requirements.txt
requirements_networking.txt /usr/project/python/requirements_networking.txt
openrave_pybind_cmakelists.txt /usr/project/openrave_pybind_cmakelists.txt
%post -c /bin/bash
apt-get update
# Tzdata
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y tzdata
# Basic requirements
apt-get install -y \
git \
cmake \
doxygen \
g++ \
build-essential \
checkinstall \
curl \
wget \
gnupg \
ca-certificates \
software-properties-common \
libreadline-gplv2-dev \
libncursesw5-dev \
libssl-dev \
libsqlite3-dev \
tk-dev \
libgdbm-dev \
libc6-dev \
libbz2-dev
# Python 2.7.12 and Pip
curl https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz --output Python-2.7.12.tgz
tar xzf Python-2.7.12.tgz
cd Python-2.7.12
./configure --enable-shared --enable-unicode=ucs4
LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
make
make install
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
python get-pip.py
pip install --upgrade pip
cd ..
rm -rf Python-2.7.12*
# ROS install
echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
apt-get update
apt-get install -y ros-indigo-desktop
rosdep init
rosdep update
# OpenRAVE install (from https://github.com/crigroup/openrave-installation.git)
## Dependencies
apt-add-repository -y ppa:imnmfotmal/libccd
apt-get update
apt-get install -y \
ann-tools \
libann-dev \
libassimp-dev \
libavcodec-dev \
libavformat-dev \
libeigen3-dev \
libfaac-dev \
libflann-dev \
libfreetype6-dev \
liblapack-dev \
libglew-dev \
libgsm1-dev \
libmpfi-dev \
libmpfr-dev \
liboctave-dev \
libode-dev \
libogg-dev \
libpcre3-dev \
libqhull-dev \
libswscale-dev \
libtinyxml-dev \
libvorbis-dev \
libx264-dev \
libxml2-dev \
libxvidcore-dev \
libbz2-dev \
octave \
mlocate \
qt4-dev-tools \
zlib-bin \
libsoqt-dev-common \
libsoqt4-dev \
collada-dom-dev \
libccd \
libpcrecpp0 \
liblog4cxx10-dev \
libqt4-dev \
libboost-all-dev \
libboost-python-dev \
libutil-freebsd-dev
pip install numpy==1.16.6
## OpenSceneGraph
OSG_COMMIT=1f89e6eb1087add6cd9c743ab07a5bce53b2f480
echo ""
echo "Installing OpenSceneGraph 3.4 from source (Commit ${OSG_COMMIT})..."
echo ""
mkdir -p git; cd git
git clone https://github.com/openscenegraph/OpenSceneGraph.git
cd OpenSceneGraph; git reset --hard ${OSG_COMMIT}
mkdir build; cd build
cmake ..
make -j `nproc`
make install
make install_ld_conf
cd ../..
## FCL - The Flexible Collision Library
echo ""
echo "Installing FCL 0.5.0 from source..."
echo ""
git clone https://github.com/flexible-collision-library/fcl
cd fcl; git reset --hard 0.5.0
mkdir build; cd build
cmake .. -DFCL_BUILD_TESTS=OFF
make -j `nproc`
make install
cd ../..
## OpenRAVE
pip install --upgrade --user sympy==0.7.1
RAVE_COMMIT=7c5f5e27eec2b2ef10aa63fbc519a998c276f908
echo ""
echo "Installing OpenRAVE 0.9 from source (Commit ${RAVE_COMMIT})..."
echo ""
git clone https://github.com/rdiankov/openrave.git
cd openrave; git reset --hard ${RAVE_COMMIT}
cp /usr/project/openrave_pybind_cmakelists.txt python/bindings/CMakeLists.txt
mkdir build; cd build
cmake -DODE_USE_MULTITHREAD=ON -DOSG_DIR=/usr/local/lib64/ ..
make -j `nproc`
make install
cd ../../..
rm -rf git/
# Install catkin + project dependencies
apt-get install -y \
python-catkin-tools \
python-wstool \
ros-indigo-srdfdom \
ros-indigo-ros-controllers \
ros-indigo-ros-control \
libnewmat10ldbl \
libnewmat10-dev \
ros-indigo-trac-ik-python \
libxml2-dev \
libxslt-dev
# Catkin build since rosdep dependencies are required
cd /usr/project/catkin
wstool init src
catkin init
catkin config --extend /opt/ros/indigo
rosdep update
rosdep install -y -r --ignore-src --rosdistro=indigo --from-paths src
# More dependencies (rosdep messes up the versions, so they need to be here)
apt-get install -y \
libogre-1.8-dev \
ros-indigo-rviz
pip install catkin-tools==0.6.1 catkin-pkg==0.4.13
catkin build
# Since env section uses sh instead of bash, source the setup file here
# and just pass the commands to export the new env variables.
printenv >>tmp_init_env
. devel/setup.bash
printenv >>tmp_final_env
echo "set -a" >>$SINGULARITY_ENVIRONMENT
grep -vf tmp_init_env tmp_final_env >>$SINGULARITY_ENVIRONMENT
echo "set +a" >>$SINGULARITY_ENVIRONMENT
rm tmp_init_env tmp_final_env
# nlopt install
git clone https://github.com/stevengj/nlopt.git
cd nlopt
git checkout v2.6.2
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=OFF ..
make
make install
cd ..
rm -rf nlopt
# Clean
apt-get clean
rm -rf /var/lib/apt/lists/*
# Python packages
pip install -r /usr/project/python/requirements.txt
pip install -r /usr/project/python/requirements_networking.txt
%environment
# To fix issue with python shared libraries
export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}