Skip to content

Commit 1c44806

Browse files
committed
Update CI scripts + magnum
1 parent e67168f commit 1c44806

File tree

7 files changed

+110
-22
lines changed

7 files changed

+110
-22
lines changed

ci/install_dart_latest.sh

+37-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
mkdir -p ~/.deps
2-
cd ~/.deps
3-
4-
python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
5-
mkdir -p ~/.dart_install/$python_dist_dir
6-
71
# Select Compiler
82
if [ "$COMPILER" = "gcc" ]; then
93
export CC=/usr/bin/gcc && export CXX=/usr/bin/g++
@@ -12,26 +6,58 @@ if [ "$COMPILER" = "clang" ]; then
126
export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
137
fi
148

9+
PREFIX=/usr
10+
DEPS_FOLDER=~/.deps
11+
DART_TAG=v6.13.1
12+
SUDOCMD=sudo
13+
14+
PREFIX=${1:-$PREFIX}
15+
DEPS_FOLDER=${2:-$DEPS_FOLDER}
16+
DART_TAG=${3:-$DART_TAG}
17+
SUDOCMD=${4:-$SUDOCMD}
18+
19+
python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
20+
${SUDOCMD} mkdir -p ${PREFIX}/$python_dist_dir
21+
22+
mkdir -p ${DEPS_FOLDER}
23+
cd ${DEPS_FOLDER}
24+
25+
if [ ! -d "dart" ]
26+
then
1527
git clone https://github.com/dartsim/dart.git
28+
fi
1629
cd dart
1730
git checkout $DART_TAG
18-
mkdir build
31+
git pull
32+
mkdir -p build
1933
cd build
2034

2135
# Build DART
2236
if [ "$BUILD_PYTHON" = "ON" ]; then
23-
cmake -DDART_BUILD_DARTPY=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/home/runner/.dart_install ..
37+
cmake -DDART_TREAT_WARNINGS_AS_ERRORS=OFF -DDART_BUILD_DARTPY=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
2438
else
25-
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/home/runner/.dart_install ..
39+
cmake -DDART_TREAT_WARNINGS_AS_ERRORS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
2640
fi
2741
make -j4
28-
sudo make install
42+
${SUDOCMD} make install
2943

44+
# We are inside the CI
45+
if [ "$PREFIX" = "/home/runner/.dart_install" ]; then
3046
sudo ldconfig
3147
cd $CI_HOME
3248

3349
# Hack for dartpy installation
3450
python_file=/usr/lib/python3/dist-packages/dartpy.cpython-310-x86_64-linux-gnu.so
3551
if [ -f "$python_file" ]; then
36-
cp $python_file ~/.dart_install/$python_dist_dir
52+
cp $python_file ${PREFIX}/$python_dist_dir
53+
fi
54+
55+
else
56+
# Hack for dartpy installation
57+
python_dot_version=$(python -c "import sys; print('.'.join(str(s) for s in sys.version_info[:2]))")
58+
python_version=$(python -c "import sys; print(''.join(str(s) for s in sys.version_info[:2]))")
59+
python_global_install=/usr/lib/python${python_dot_version}/site-packages/dartpy.cpython-${python_version}-x86_64-linux-gnu.so
60+
if [ -f "$python_global_install" ]; then
61+
${SUDOCMD} mv $python_global_install ${PREFIX}/$python_dist_dir
62+
fi
3763
fi

ci/install_magnum.sh

+56-11
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
77
fi
88

99
PREFIX=/usr
10+
DEPS_FOLDER=~/.deps
11+
SUDOCMD=sudo
1012

1113
PREFIX=${1:-$PREFIX}
14+
DEPS_FOLDER=${2:-$DEPS_FOLDER}
15+
SUDOCMD=${3:-$SUDOCMD}
1216

1317
unameOut="$(uname -s)"
1418
case "${unameOut}" in
@@ -30,43 +34,84 @@ if [ "$machine" == "Mac" ]; then
3034
PNGIMPORTER=OFF
3135
fi
3236

33-
mkdir -p ~/.deps
34-
cd ~/.deps
37+
mkdir -p ${DEPS_FOLDER}
38+
cd ${DEPS_FOLDER}
3539
# install Corrade
40+
if [ ! -d "corrade" ]
41+
then
3642
git clone https://github.com/mosra/corrade.git
3743
cd corrade
38-
mkdir build && cd build
44+
else
45+
cd corrade
46+
git pull
47+
fi
48+
mkdir -p build && cd build
3949
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
4050
make -j
41-
sudo make install
51+
${SUDOCMD} make install
4252
cd ../..
4353

4454
# install Magnum
55+
if [ ! -d "magnum" ]
56+
then
4557
git clone https://github.com/mosra/magnum.git
4658
cd magnum
47-
mkdir build && cd build
59+
else
60+
cd magnum
61+
git pull
62+
fi
63+
mkdir -p build && cd build
4864
# Ubuntu/OSX
49-
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMAGNUM_WITH_AUDIO=ON -DMAGNUM_WITH_DEBUGTOOLS=ON -DMAGNUM_WITH_GL=ON -DMAGNUM_WITH_MESHTOOLS=ON -DMAGNUM_WITH_PRIMITIVES=ON -DMAGNUM_WITH_SCENEGRAPH=ON -DMAGNUM_WITH_SHADERS=ON -DMAGNUM_WITH_TEXT=ON -DMAGNUM_WITH_TEXTURETOOLS=ON -DMAGNUM_WITH_TRADE=ON -DMAGNUM_WITH_GLFWAPPLICATION=ON -${WINDOWLESS}=ON -DMAGNUM_WITH_OPENGLTESTER=ON -DMAGNUM_WITH_ANYAUDIOIMPORTER=ON -DMAGNUM_WITH_ANYIMAGECONVERTER=ON -DMAGNUM_WITH_ANYIMAGEIMPORTER=ON -DMAGNUM_WITH_ANYSCENEIMPORTER=ON -DMAGNUM_WITH_MAGNUMFONT=ON -DMAGNUM_WITH_OBJIMPORTER=ON -DMAGNUM_WITH_TGAIMPORTER=ON -DMAGNUM_WITH_WAVAUDIOIMPORTER=ON -DMAGNUM_TARGET_EGL=${EGLTARGET} -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
65+
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMAGNUM_WITH_AUDIO=ON -DMAGNUM_WITH_DEBUGTOOLS=ON -DMAGNUM_WITH_GL=ON -DMAGNUM_WITH_MESHTOOLS=ON -DMAGNUM_WITH_PRIMITIVES=ON -DMAGNUM_WITH_SCENEGRAPH=ON -DMAGNUM_WITH_SHADERS=ON -DMAGNUM_WITH_TEXT=ON -DMAGNUM_WITH_TEXTURETOOLS=ON -DMAGNUM_WITH_TRADE=ON -DMAGNUM_WITH_SDL2APPLICATION=ON -DMAGNUM_WITH_GLFWAPPLICATION=ON -${WINDOWLESS}=ON -DMAGNUM_WITH_OPENGLTESTER=ON -DMAGNUM_WITH_ANYAUDIOIMPORTER=ON -DMAGNUM_WITH_ANYIMAGECONVERTER=ON -DMAGNUM_WITH_ANYIMAGEIMPORTER=ON -DMAGNUM_WITH_ANYSCENEIMPORTER=ON -DMAGNUM_WITH_MAGNUMFONT=ON -DMAGNUM_WITH_OBJIMPORTER=ON -DMAGNUM_WITH_TGAIMPORTER=ON -DMAGNUM_WITH_WAVAUDIOIMPORTER=ON -DMAGNUM_TARGET_EGL=${EGLTARGET} -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
5066
make -j
51-
sudo make install
67+
${SUDOCMD} make install
5268
cd ../..
5369

70+
# install Magnum Bindings
71+
if [ ! -d "magnum-bindings" ]
72+
then
73+
git clone https://github.com/mosra/magnum-bindings.git
74+
cd magnum-bindings
75+
else
76+
cd magnum-bindings
77+
git pull
78+
fi
79+
mkdir -p build && cd build
80+
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMAGNUM_WITH_GLFWAPPLICATION=ON -${WINDOWLESS}=ON -DMAGNUM_TARGET_EGL=${EGLTARGET} -DMAGNUM_WITH_PYTHON=ON -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
81+
make -j
82+
${SUDOCMD} make install
83+
cd src/python
84+
${SUDOCMD} python setup.py install --root=${PREFIX} --prefix=''
85+
cd ../../../..
86+
5487
# install MagnumPlugins
88+
if [ ! -d "magnum-plugins" ]
89+
then
5590
git clone https://github.com/mosra/magnum-plugins.git
5691
cd magnum-plugins
57-
mkdir build && cd build
92+
else
93+
cd magnum-plugins
94+
git pull
95+
fi
96+
mkdir -p build && cd build
5897
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMAGNUM_WITH_ASSIMPIMPORTER=ON -DMAGNUM_WITH_DDSIMPORTER=ON -DMAGNUM_WITH_JPEGIMPORTER=ON -DMAGNUM_WITH_OPENGEXIMPORTER=ON -DMAGNUM_WITH_PNGIMPORTER=${PNGIMPORTER} -DMAGNUM_WITH_TINYGLTFIMPORTER=ON -DMAGNUM_WITH_STBTRUETYPEFONT=ON -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
5998
make -j
60-
sudo make install
99+
${SUDOCMD} make install
61100
cd ../..
62101

63102
# install MagnumIntegration
103+
if [ ! -d "magnum-integration" ]
104+
then
64105
git clone https://github.com/mosra/magnum-integration.git
65106
cd magnum-integration
66-
mkdir build && cd build
107+
else
108+
cd magnum-integration
109+
git pull
110+
fi
111+
mkdir -p build && cd build
67112
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMAGNUM_WITH_DART=ON -DMAGNUM_WITH_EIGEN=ON -DCMAKE_INSTALL_PREFIX=${PREFIX} -DDART_DIR=$DART_DIR ..
68113
make -j
69-
sudo make install
114+
${SUDOCMD} make install
70115
cd ../..
71116

72117
if [ "$PREFIX" = "/usr" ]; then

waf_tools/corrade.py

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def find_in_string(data, text):
4848
includes_check = [conf.options.corrade_install_dir + '/include']
4949
libs_check = [conf.options.corrade_install_dir + '/lib']
5050
bins_check = [conf.options.corrade_install_dir + '/bin']
51+
elif conf.options.magnum:
52+
includes_check = [conf.options.magnum + '/include']
53+
libs_check = [conf.options.magnum + '/lib']
54+
bins_check = [conf.options.magnum + '/bin']
5155

5256
requested_components = kw.get('components', None)
5357
if requested_components == None:

waf_tools/magnum.py

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ def fatal(required, msg):
134134
includes_check = [conf.options.magnum_install_dir + '/include'] + includes_check
135135
libs_check = [conf.options.magnum_install_dir + '/lib'] + libs_check
136136
bins_check = [conf.options.magnum_install_dir + '/bin'] + bins_check
137+
elif conf.options.magnum:
138+
includes_check = [conf.options.magnum + '/include'] + includes_check
139+
libs_check = [conf.options.magnum + '/lib'] + libs_check
140+
bins_check = [conf.options.magnum + '/bin'] + bins_check
137141

138142
requested_components = kw.get('components', None)
139143
if requested_components == None:

waf_tools/magnum_integration.py

+4
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ def find_in_string(data, text):
107107
includes_check = [conf.options.magnum_integration_install_dir + '/include'] + includes_check
108108
libs_check = [conf.options.magnum_integration_install_dir + '/lib'] + libs_check
109109
bins_check = [conf.options.magnum_integration_install_dir + '/bin'] + bins_check
110+
elif conf.options.magnum:
111+
includes_check = [conf.options.magnum + '/include'] + includes_check
112+
libs_check = [conf.options.magnum + '/lib'] + libs_check
113+
bins_check = [conf.options.magnum + '/bin'] + bins_check
110114

111115
# OSX/Mac uses .dylib and GNU/Linux .so
112116
suffix = 'dylib' if conf.env['DEST_OS'] == 'darwin' else 'so'

waf_tools/magnum_plugins.py

+4
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ def find_in_string(data, text):
113113
includes_check = [conf.options.magnum_plugins_install_dir + '/include'] + includes_check
114114
libs_check = [conf.options.magnum_plugins_install_dir + '/lib'] + libs_check
115115
bins_check = [conf.options.magnum_plugins_install_dir + '/bin'] + bins_check
116+
elif conf.options.magnum:
117+
includes_check = [conf.options.magnum + '/include'] + includes_check
118+
libs_check = [conf.options.magnum + '/lib'] + libs_check
119+
bins_check = [conf.options.magnum + '/bin'] + bins_check
116120

117121
# OSX/Mac uses .dylib and GNU/Linux .so
118122
suffix = 'dylib' if conf.env['DEST_OS'] == 'darwin' else 'so'

wscript

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def options(opt):
4545
opt.add_option('--python', action='store_true', help='compile python bindings', dest='pybind')
4646
opt.add_option('--no-robot_dart', action='store_true', help='only install the URDF library (utheque) / deactivate RobotDART', dest='utheque_only')
4747
opt.add_option('--no-pic', action='store_true', help='do not compile with position independent code', dest='no_pic')
48+
opt.add_option('--magnum', type='string', help='path to all magnum related deps installation path', dest='magnum')
4849

4950

5051
def configure(conf):

0 commit comments

Comments
 (0)