-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·664 lines (608 loc) · 21.4 KB
/
install.sh
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
#!/bin/bash
#
# This script (a) documents the install procces and (b) installs the SHERPA World Model
# software components if invoked as stated in the "Usage" section.
#
#
# Usage
# ------
#
# Call this script:
#
# Default install:
#
# ./install.sh -i
#
# OR:
#
# ./install.sh --help
#
# to retrive the folllowing usage information
#
# Usage: ./install.sh -i [--no-sudo] [--no-ros] [--workspace-path=PATH] [--install-path=PATH] [-h|--help] [-j=VALUE]
# E.g. : ./install.sh -i --workspace-path=../
#
# -i Mandatory! Perform actual installation.
# -h|--help Display this help and exit
# --no-sudo In case the system has no sudo command available.
# --no-ros In case the system has no ROS (Hydro/Indigo) installation.
# --workspace-path=PATH Path to where libraries and bulild. Default is ../
# --install-path=PATH Path to where libraries and modeles are installed (make install) into.
# (except for brics_3d). Default is /usr/local
# -j=VALUE used for make -jVAULE
#
#
#
# Preface
# -------
# The core software library is the BRICS_3D perception and modeling library
# which contains an implementation of the "Robot Scene Graph (RSG)".
# The RSG is used as a mechanism to represent and exchange world model data.
#
# An instance of an RSG is embedded into a "World Model Agent". It is written
# in C++ and can be queried with its respective API.
#
# A SHERPA World Model as deployed on a robot has one World Model Agent
# plus a set of communication componetns like ZMQ or ROS. The components
# are realized with the Microblox (UBX) framework that allows to represent
# the appliation in a system coposition model (.utc file).
#
# In a nutshell the following dependencies need to be satisfied:
#
# * the BRICS_3D library with all its dependencies including
# Boost, Eigen3, HDF5 (deprecated), Libvariant for JSON, graphviz for debugging (optional)
# * the UBX framework
# * the BRICS_3D integration into the UBX framework (brics_3d_function_blocks
# and ubx_robotscenegraph)
# * UBX modules for ZMQ and Zyre including dependencies (CZMQ)
# * UBX modules for ROS (optional)
#
#
#
# Environment Variables
# ---------------------
#
# Please make sure the following environment variables are set.
# The variables are also discussed in the individual installation step sections.
#
# Variables for Microblox:
#
#
# | Name | Description |
# | ------------- | ----------- |
# | UBX_ROOT | Points to the installation folder of UBX. Used within the CMake scripts to discover the UBX library. |
# | UBX_MODULES | Points to the the place where the UBX types, blocks etc. are installed. Used to load the types and modules at run-time |
#
# Dependencies to BRICS_3D and HDF5:
#
#
# | Name | Description |
# | ------------- | ----------- |
# | BRICS_3D_DIR | Points to the installation folder of BRICS_3D. Used within the CMake scripts to discover the BRICS_3D library. |
# | FBX_MODULES | Points to the the root folder of the BRICS_3D function blocks. Used to discover the rsg lua scripts. |
# | HDF5_ROOT | Points to the installation folder of HDF5. Use it in case it is not into installed to the default folders (/usr/local). |
#
# example:
# export HDF5_ROOT=/opt/hdf5-1.8.13
#
#
# Compatibility
# -------------
# This script has been succesfully tested on the following systems:
#
# * Ubuntu 12.04
# * Ubuntu 14.04
#
#
# Authors
# -------
# * Sebastian Blumenthal ([email protected])
# * Nico Huebel ([email protected])
#
show_usage() {
cat << EOF
Usage: ./${0##*/} -i [--no-sudo] [--no-ros] [--workspace-path=PATH] [--install-path=PATH] [-h|--help] [-j=VALUE]
E.g. : ./${0##*/} -i --workspace-path=../
-i Mandatory! Perform actual installation.
-h|--help Display this help and exit
--no-sudo In case the system has no sudo command available.
--no-ros In case the system has no ROS (Hydro/Indigo) installation.
--workspace-path=PATH Path to where libraries and bulild. Default is ../
--install-path=PATH Path to where libraries and modeles are installed (make install) into.
(except for brics_3d). Default is /usr/local
-j=VALUE used for make -jVAULE
EOF
}
# Error handling
exec 3>&1 4>&2
trap 'exec 2>&4 1>&3; echo "ERROR occured. See install_err.log for details."; cd ${SCRIPT_DIR}; return 1' ERR SIGHUP SIGINT SIGQUIT SIGILL SIGABRT SIGTERM
exec > >(tee -a install.log) 2> >(tee -a install_err.log >&2)
#exec 1> install.log
#exec 2> install_err.log
rm -f install.log install_err.log
set -e
# Any subsequent(*) commands which fail will cause the shell script to exit immediately
# Default values
SUDO="sudo"
USE_ROS="TRUE"
WORKSPACE_DIR="../" # one above ubx_robotscenegraph to avoid a nested installation
INSTALL_DIR="/usr/local/"
J="-j1"
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# There should be at least one parameter.
if (( $# < 1 )); then
show_usage
exit 1
fi
# Handle command line options
while :; do
case $1 in
-i)
echo "Installing software."
;;
-h|-\?|--help) # Call a "show_help" function to display a synopsis, then exit.
show_usage
exit
;;
--no-sudo)
SUDO=""
;;
--no-ros)
USE_ROS="FALSE"
;;
--workspace-path) # Takes an option argument, ensuring it has been specified.
if [ -n "$2" ]; then
WORKSPACE_DIR=$2
shift
else
printf 'ERROR: "--workspace-path" requires a non-empty option argument.\n' >&2
exit 1
fi
;;
--workspace-path=?*)
WORKSPACE_DIR=${1#*=} # Delete everything up to "=" and assign the remainder.
;;
--workspace-path=) # Handle the case of an empty --file=
printf 'ERROR: "--workspace-path" requires a non-empty option argument.\n' >&2
exit 1
;;
--install-path) # Takes an option argument, ensuring it has been specified.
if [ -n "$2" ]; then
INSTALL_DIR=$2
shift
else
printf 'ERROR: "--install-path" requires a non-empty option argument.\n' >&2
exit 1
fi
;;
--install-path=?*)
INSTALL_DIR=${1#*=} # Delete everything up to "=" and assign the remainder.
;;
--install-path=) # Handle the case of an empty --file=
printf 'ERROR: "--install-path" requires a non-empty option argument.\n' >&2
exit 1
;;
-j) # Takes an option argument, ensuring it has been specified.
if [ -n "$2" ]; then
J="-j${2}"
shift
else
printf 'ERROR: "-j" requires a non-empty option argument.\n' >&2
exit 1
fi
;;
-j=?*)
J_TMP=${1#*=} # Delete everything up to "=" and assign the remainder.
J="-j${J_TMP}"
;;
-j=) # Handle the case of an empty --file=
printf 'ERROR: "-j" requires a non-empty option argument.\n' >&2
exit 1
;;
--) # End of all options.
shift
break
;;
-?*)
printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2
;;
*) # Default case: If no more options then break out of the loop.
break
esac
shift
done
echo "[Parameter] Sudo command is set to: ${SUDO}"
echo "[Parameter] USE_ROS is set to: ${USE_ROS}"
echo "[Parameter] WORKSPACE_DIR is set to: ${WORKSPACE_DIR}"
echo "[Parameter] INSTALL_DIR is set to: ${INSTALL_DIR}"
echo "[Parameter] Parallel build parameter for make is set to: ${J}"
#exit
# Go to workspace
cd ${WORKSPACE_DIR}
echo ""
echo "### Generic system dependencies for compiler, revision control, etc. ###"
# Thie fist one is commented out because is install on most system already.
#sudo apt-get install \
# git \
# mercurial \
# cmake \
# build-essential \
# libtool \
# automake \
# libtool \
# pkg-config
####################### BRICS_3D ##########################
echo ""
echo "### Dependencies for the BRICS_3D libraries ###"
echo "Boost:"
${SUDO} apt-get update
${SUDO} apt-get install -y libboost-dev \
libboost-thread-dev \
libboost-regex-dev
echo "Eigen 3:"
${SUDO} apt-get install -y libeigen3-dev
echo "Lib Cppunit for unit tests (optional):"
${SUDO} apt-get install -y libcppunit-dev
echo "Lib Xerces for loading Open Street Maps"
${SUDO} apt-get install -y libxerces-c-dev
echo "Lib yaml" #Reqired for installation on SHERPA Wasp (Odroid U3)
${SUDO} apt-get install -y libyaml-dev
echo "JSON library for the Mediator and Zyre UBX bridge"
${SUDO} apt-get install -y libjansson-dev uuid-dev
echo "GDAL library for DEM files"
${SUDO} apt-get install -y libgdal-dev
echo "HDF5: " # (deprecated)
# This one is alway a bit tricky since there are many compile time
# options avialable and version changes have API breaks.
# So far tested with verisons 1.8.9(minimum), 1.8.12 and 1.8.13.
# Note the option HDF5_1_8_12_OR_HIGHER must be set if a verison
# 1.8.12 or higher is used due to API incompatibilities.
if [ ! -d hdf5-1.8.13 ]; then
# wget www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.13/src/hdf5-1.8.13.tar.gz
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.13/src/hdf5-1.8.13.tar.gz
tar -xvf hdf5-1.8.13.tar.gz
fi
cd hdf5-1.8.13/
#NOTE: on Ubutnu 12.04 the CMake versions do not match. You can fix this by altering the HDF5 CMake files:
grep "2.8.11" -l -r . | xargs sed -i 's/cmake_minimum_required (VERSION 2.8.11)/cmake_minimum_required (VERSION 2.8.7)/g'
mkdir build -p
cd build
cmake -DHDF5_BUILD_CPP_LIB=true -DHDF5_BUILD_HL_LIB=true -DBUILD_SHARED_LIBS=true -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
# A note on the used flags: the C++ API and the High Level (HL) APIs are used. The latter
# one allows to use HDF5 in a kind of messaging mode as we do. Furthermore, the CMake
# scripts of BRICS_3D are searching for shared libraries so we have to activate it in the
# build process.
make ${J}
${SUDO} make install
#echo "export HDF5_ROOT=/usr/local" >> ~/.bashrc
export HDF5_ROOT=${INSTALL_DIR}
cd ..
cd ..
echo "Libvariant (JSON)"
if [ ! -d libvariant ]; then
hg clone https://bitbucket.org/gallen/libvariant
fi
cd libvariant
mkdir build -p
cd build
cmake ..
cmake -DBUILD_SHARED_LIBS=true -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
# Note that UBX modules need the -fPIC flag, thus we have to enable the shared flag for Libvariant.
make ${J}
${SUDO} make install
cd ..
cd ..
echo ""
echo "### Compile and install BRICS_3D ###"
# In case the HDF5 library is alredy pre-installed
# in another location you can use the environment
# variables HDF5_ROOT to point to another intallation location
if [ ! -d brics_3d ]; then
git clone https://github.com/brics/brics_3d.git
cd brics_3d
else
cd brics_3d
git pull origin master
fi
mkdir build -p && cd build
cmake -DEIGEN_INCLUDE_DIR=/usr/include/eigen3 -DUSE_HDF5=true -DHDF5_1_8_12_OR_HIGHER=true -DUSE_JSON=true -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
# A note on the used flags: For some reason the CMake find script has problems to find Eigen3 thus we currently
# have to provide the path as a flag. HDF5 and JSON support has to be enabled because it is not a default option.
# Furthermore, as we are using HDF5 1.8.13 we have to enable the HDF5_1_8_12_OR_HIGHER flag to account for
# major changes in the HDF5 API.
make ${J}
cd ..
#echo "export BRICS_3D_DIR=$PWD" >> ~/.bashrc
export BRICS_3D_DIR=$PWD
#The BRICS_3D_DIR environment variable is needed for the other (below) modules to find BRICS_3D properly.
#source ~/.bashrc .
cd ..
####################### Microblox #########################
echo ""
echo "### Dependencies for Microblox (UBX) framework. ###"
echo "Clang compiler:"
${SUDO} apt-get install clang
echo "Luajit 2.0.2:"
# NOTE Luajit needs to have at least verison 2.0.2 otherwise
# hard to trace errors will appear.
if [ ! -d LuaJIT-2.0.2 ]; then
wget luajit.org/download/LuaJIT-2.0.2.tar.gz
tar -xvf LuaJIT-2.0.2.tar.gz
fi
cd LuaJIT-2.0.2
make ${J}
${SUDO} make install
#${SUDO} ln -s /usr/local/bin/luajit /usr/local/bin/lua
${SUDO} ldconfig
cd ..
echo ""
echo "### Compile and install UBX. ###"
if [ ! -d microblx ]; then
git clone https://github.com/UbxTeam/microblx.git
fi
cd microblx
source env.sh
# This sourcing of env.sh is important and is often overlooked during manual compilation.
# It does configure a lot of LUA variables to make the UBX system models work.
make
#echo "export UBX_ROOT=$PWD" >> ~/.bashrc
export UBX_ROOT="${PWD}"
echo "UBX_ROOT=${UBX_ROOT}"
# The UBX_ROOT environment variable is needed for the other (below) modules to find UBX properly.
#echo "export UBX_MODULES=${INSTALL_DIR}/lib/ubx" >> ~/.bashrc
export UBX_MODULES="${INSTALL_DIR}/lib/ubx"
# The UBX_MODULES variable points to the place where the UBX types, blocks etc. are installed.
# It is used to load the types and modules at run-time. we set it to the UBX default folder.
#source ~/.bashrc .
cd ..
################ Communication modules #########################
echo ""
echo "### ZMQ communication modules ###"
echo "CZMQ dependencies:"
if [ ! -d libsodium ]; then
git clone https://github.com/jedisct1/libsodium.git
fi
cd libsodium
./autogen.sh
./configure
make ${J}
${SUDO} make install
${SUDO} ldconfig
cd ..
echo "ZMQ library:"
# Wee need a stable verison of libzmq du to incompatibilities with Zyre.
# Unfortunately there are no tags github so we have to use a tar ball.
#git clone https://github.com/zeromq/libzmq.git
#cd libzmq
if [ ! -d zeromq-4.1.2 ]; then
wget http://download.zeromq.org/zeromq-4.1.2.tar.gz
tar -xvf zeromq-4.1.2.tar.gz
fi
cd zeromq-4.1.2
./autogen.sh
./configure --with-libsodium=no --prefix=${INSTALL_DIR}
make ${J}
${SUDO} make install
${SUDO} ldconfig
cd ..
echo "CZMQ library:"
#git clone https://github.com/zeromq/czmq
#cd czmq
if [ ! -d czmq-3.0.2 ]; then
wget https://github.com/zeromq/czmq/archive/v3.0.2.tar.gz
tar zxvf v3.0.2.tar.gz
fi
cd czmq-3.0.2/
./autogen.sh
./configure --prefix=${INSTALL_DIR}
make ${J}
${SUDO} make install
${SUDO} ldconfig
cd ..
echo "Zyre library:"
if [ ! -d zyre-1.1.0 ]; then
wget https://github.com/zeromq/zyre/archive/v1.1.0.tar.gz
tar zxvf v1.1.0.tar.gz
fi
cd zyre-1.1.0/
sh ./autogen.sh
./configure --prefix=${INSTALL_DIR}
make ${J}
${SUDO} make install
${SUDO} ldconfig
cd ..
echo "CZMQ-UBX bridge"
# In case ZMQ or CZMQ libraries are alredy pre-installed
# in another location you can use the environment
# variables ZMQ_ROOT or CZMQ_ROOT to point to other
# intallation locations
if [ ! -d ubx ]; then
git clone https://github.com/blumenthal/ubx
cd ubx/czmq_bridge
else
cd ubx/czmq_bridge
git pull origin master
fi
mkdir build -p
cd build
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
make ${J}
# Per default the UBX modules are installed to /usr/local
# this can be adjusted be setting the CMake variable
# CMAKE_INSTALL_PREFIX to another folder. Of course the
# the UBX_MODULES environment variable has to be adopted
# to this new prefix: <my_install_prefix_path>/ubx/lib.
# Please install all UBX modules into one folder.
${SUDO} make install
cd ..
cd ..
cd ..
echo "ZYRE-UBX bridge"
# In case ZMQ or CZMQ libraries are alredy pre-installed
# in another location you can use the environment
# variables ZMQ_ROOT or CZMQ_ROOT to point to other
# intallation locations
if [ ! -d ubx ]; then
git clone https://github.com/blumenthal/ubx
cd ubx/zyre_bridge
else
cd ubx/zyre_bridge
git pull origin master
fi
mkdir build -p
cd build
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
make ${J}
# Per default the UBX modules are installed to /usr/local
# this can be adjusted be setting the CMake variable
# CMAKE_INSTALL_PREFIX to another folder. Of course the
# the UBX_MODULES environment variable has to be adopted
# to this new prefix: <my_install_prefix_path>/ubx/lib.
# Please install all UBX modules into one folder.
${SUDO} make install
cd ..
cd ..
cd ..
####################### ROS (optional) #######################
if [ "$USE_ROS" = "TRUE" ]; then
echo "### ROS (Hydro) communication modules ###"
#echo "ROS-Hydro:"
#${SUDO} sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
#wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | ${SUDO} apt-key add -
#${SUDO} apt-get update
#${SUDO} apt-get install ros-hydro-ros-base
#echo "source /opt/ros/hydro/setup.bash" >> ~/.bashrc
#source ~/.bashrc
echo "UBX-ROS bridge:"
if [ ! -d microblx_ros_bridge ]; then
git clone https://bitbucket.org/blumenthal/microblx_ros_bridge.git
cd microblx_ros_bridge
else
cd microblx_ros_bridge
git pull origin blumenthal
fi
git fetch && git checkout blumenthal
mkdir build -p
cd build
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
make
# Per default the UBX modules are installed to /usr/local
# this can be adjusted be setting the CMake variable
# CMAKE_INSTALL_PREFIX to another folder. Of course the
# the UBX_MODULES environment variable has to be adopted
# to this new prefix: <my_install_prefix_path>/ubx/lib
# Please install all UBX modules into one folder.
${SUDO} make install
cd ..
cd ..
fi
######### BRICS_3D integration into the UBX framework ###########
echo ""
echo "### BRICS_3D integration into the UBX framework ###"
echo "brics_3d_function_blocks:"
# In case the BRICS_3D library is alredy installed
# in another location you can use the environment
# variable BRICS_3D_DIR to point to another installation location.
# The same applies to HDF5 (HDF5_ROOT) as well.
if [ ! -d brics_3d_function_blocks ]; then
git clone https://github.com/blumenthal/brics_3d_function_blocks.git
cd brics_3d_function_blocks
else
cd brics_3d_function_blocks
git pull origin master
fi
mkdir build -p
cd build
cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DUSE_FBX=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
# In case you retrive a "Could NOT find BRICS_3D" delete the
# CMake cache and try again. Sometimes the FindBRICS_3D script
# keeps the variables BRICS_3D_NOT_FOUND though the system is setup correctly.
make ${J}
# Per default the UBX modules are installed to /usr/local
# this can be adjusted be setting the CMake variable
# CMAKE_INSTALL_PREFIX to another folder. Of course the
# the UBX_MODULES environment variable has to be adopted
# to this new prefix: <my_install_prefix_path>/ubx/lib.
# Please install all UBX modules into one folder.
${SUDO} make install
cd ..
#echo "export FBX_MODULES=$PWD" >> ~/.bashrc
export FBX_MODULES="${PWD}"
# The FBX_MODULES environment variable is needed for the other (below)
# modules to find the BRICS_3D function blocks and typs.
#source ~/.bashrc .
cd ..
echo "ubx_robotscenegraph"
# Note we do not need necessarily need to check it out because this script is (currently) contained
# in ubx_robotscenegraph. Though, for the sake of completness we try to repeat it here.
#
if [ -d ubx_robotscenegraph ]; then
echo "Folder ubx_robotscenegraph exists already. Pulling updates instead."
cd ubx_robotscenegraph
git pull origin master
else
echo "Cloning a fresh copy of ubx_robotscenegraph."
git clone https://github.com/blumenthal/ubx_robotscenegraph
cd ubx_robotscenegraph
fi
mkdir build -p
cd build
# In case the BRICS_3D library is alredy installed
# in another location you can use the environment
# variable BRICS_3D_DIR to point to another installation location.
# The same applies to HDF5 (HDF5_ROOT) as well.
cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DEIGEN_INCLUDE_DIR=/usr/include/eigen3 -DHDF5_1_8_12_OR_HIGHER=true -DUSE_JSON=true -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
# Please note that we have to apply the same compile time flags
# and environemnt variables that have been used to compile the brics_3d library.
# In case you retrive a "Could NOT find BRICS_3D" delete the
# CMake cache and try again. Sometimes the FindBRICS_3D script
# keeps the variables BRICS_3D_NOT_FOUND though the system is setup correctly.
make ${J}
# Per default the UBX modules are installed to /usr/local
# this can be adjusted be setting the CMake variable
# CMAKE_INSTALL_PREFIX to another folder. Of course the
# the UBX_MODULES environment variable has to be adopted
# to this new prefix: <my_install_prefix_path>/ubx/lib.
# Please install all UBX modules into one folder.
${SUDO} make install
cd ..
cd ..
echo "libswmzyre client library"
# Optional client C library with convenience functions.
# Since it is part of the ubx_robotscenegraph repository,
# we do not need to pull from git again.
cd ubx_robotscenegraph/examples/zyre
mkdir build -p
cd build
cmake ..
${SUDO} make install
cd ../../../..
cd ${SCRIPT_DIR} # go back
echo ""
echo "Done."
echo ""
echo ""
echo ""
echo ""
echo "############################ATTENTION###############################"
echo " ATTENTION: Please add the following environment variables:"
echo ""
echo "echo \"export HDF5_ROOT=${HDF5_ROOT}\" >> ~/.bashrc"
echo "echo \"export UBX_ROOT=${UBX_ROOT}\" >> ~/.bashrc"
echo "echo \"export UBX_MODULES=${UBX_MODULES}\" >> ~/.bashrc"
echo "echo \"export BRICS_3D_DIR=${BRICS_3D_DIR}\" >> ~/.bashrc"
echo "echo \"export FBX_MODULES=${FBX_MODULES}\" >> ~/.bashrc"
echo "source ~/.bashrc ."
echo ""
echo "####################################################################"
echo "In case the ROS communication modules are used also start roscore:"
echo " cd ./ubx_robotscenegraph"
echo " roscore& "
echo " ./swm_launch.sh"
echo ""
echo "Then enter the following command and hit enter:"
echo " p()"
echo "####################################################################"
echo ""
set +e
echo "SUCCESS"