Skip to content

Commit cd7bd86

Browse files
Kathleen Wangleokoppel
authored andcommitted
Updates to install scripts (#290)
* Update install scripts * Change to robotics-wavelab PPA This PPA installs things to /opt/wavelab to avoid accidentally interfering with other software. By default, add /opt/wavelab to CMAKE_PREFIX_PATH (with CMake option to disable) * Add script to install opencv 3.2.0 * Remove install.bash Remove install.bash for reasons discussed in the PR. Mainly, it _seems_ like a magic one-size-fits-all solution for all users but may do unexpected things. Where desired, dependencies can be installed using the individual scripts. * Update instructions and dependencies list in README - Add notes about dependency scripts and about opencv build issue
1 parent 6bb395d commit cd7bd86

7 files changed

Lines changed: 160 additions & 86 deletions

File tree

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ addons:
1919
- libpcl-dev
2020
- libopencv-dev
2121
- libceres-dev
22-
- libkindr-dev
2322
- clang-format-3.8
2423

2524
before_script:

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ OPTION(BUILD_BENCHMARKS
3636

3737

3838
# Find all dependencies here, and ensure they have IMPORTED targets
39-
39+
# The install scripts install some dependencies in /opt/wavelab
40+
OPTION(APPEND_OPT_WAVELAB "Append /opt/wavelab to CMAKE_PREFIX_PATH" ON)
41+
IF(APPEND_OPT_WAVELAB)
42+
MESSAGE(STATUS "Adding /opt/wavelab to CMAKE_PREFIX_PATH")
43+
LIST(APPEND CMAKE_PREFIX_PATH "/opt/wavelab")
44+
ENDIF()
4045
# Require Eigen 3.2.92, also called 3.3 beta-1, since it's in xenial
4146
FIND_PACKAGE(Eigen3 3.2.92 REQUIRED)
4247
FIND_PACKAGE(Boost 1.54.0 COMPONENTS system filesystem)

README.md

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,84 @@ This library contains reusable code for:
1111

1212
## Requirements
1313

14+
`libwave` is divided into modules which can be built separately.
15+
Each has its own dependecies.
16+
17+
| Module | Dependencies |
18+
| ------------------ | ------------ |
19+
| wave\_benchmark | wave\_containers, wave\_geometry, wave\_utils |
20+
| wave\_containers | Eigen, Boost |
21+
| wave\_controls | Eigen |
22+
| wave\_geography | Eigen, GeographicLib |
23+
| wave\_geometry | Eigen, Boost |
24+
| wave\_gtsam | wave\_utils, gtsam |
25+
| wave\_kinematics | wave\_utils, wave\_controls |
26+
| wave\_matching | wave\_utils, Boost, PCL |
27+
| wave\_optimization | wave\_utils, wave\_kinematics, wave\_vision, Ceres |
28+
| wave\_utils | Eigen, yaml-cpp |
29+
| wave\_vision | wave\_utils, wave\_kinematics, wave\_containers, Boost Filesystem, OpenCV (calib3d, features2d, highgui, imgproc, videoio) |
30+
31+
32+
The following versions are the minimum we test against.
33+
Some earlier versions may work, but are not tested.
34+
1435
- Boost 1.54
1536
- Ceres 1.13
1637
- Eigen 3.3.2
17-
- Kindr 1.0.4
1838
- OpenCV 3.2.0
1939
- PCL 1.8
2040
- yaml-cpp 0.5.1
21-
- CMake 2.8.3
22-
- GCC 5.4
41+
- gtsam
42+
- GeographicLib 1.49
2343

24-
The above versions are the minimum we test against.
25-
Some earlier versions may work, but are not tested.
26-
For convenience, we provide a script which installs these dependencies (except
27-
GCC) on Ubuntu 14.04 or Ubuntu 16.04, in `scripts/install/install_deps.bash`.
44+
Building libwave requires CMake 3.2 and a C++11 compiler (tested on GCC 5.4).
2845

29-
## Install
46+
### Installing dependencies
47+
The basic set of dependencies can be installed with the Ubuntu package manager
48+
using the command
3049

31-
Execute the following in the terminal where you want libwave to reside:
50+
sudo apt-get install libboost-dev libyaml-cpp-dev libeigen3-dev \
51+
build-essential cmake
3252

33-
curl -L https://git.io/vyKXR > install.bash && bash install.bash
53+
For convenience, scripts to install other dependencies on Ubuntu 16.04 are
54+
provided in `scripts/install`. **Note**: the scripts are not tested on a wide
55+
variety of systems. They may be incompatible with other packages installed on
56+
your system.
3457

35-
**Or** you can perform the installation manually:
58+
## Install from source
3659

37-
# clone repo
38-
git clone https://github.com/wavelab/libwave.git
39-
cd libwave
60+
Clone the repo with submodules:
4061

41-
# initialize git submodules
42-
git submodule init
43-
git submodule update
62+
git clone --recursive https://github.com/wavelab/libwave.git
4463

45-
# install dependencies
46-
bash scripts/install/install_deps.bash
64+
Install the dependencies required for the modules you want to build, as
65+
described above. Then build using CMake:
4766

48-
# compile libwave
67+
cd libwave
4968
mkdir -p build
5069
cd build
5170
cmake ..
52-
make
71+
make -j8
72+
73+
By default, all libraries whose dependencies are found will be built. Individual
74+
libraries can be disabled using CMake options. For example,
75+
76+
cmake .. -DBUILD_wave_vision=OFF
77+
78+
will disable building `wave_vision`.
5379

54-
Install libwave with `make install`. Alternatively, you can enable the
80+
Install libwave by running `make install`. Alternatively, you can enable the
5581
`EXPORT_BUILD` option in CMake, which will make the libwave build directory
5682
searchable by CMake without installation.
5783

5884

85+
**Known issue with OpenCV**: `wave_vision` may
86+
[fail to build](https://github.com/wavelab/libwave/issues/267) if OpenCV 2 is
87+
installed in the default system directory on Ubuntu 16.04 (and OpenCV 3 is
88+
installed elsewhere). A workaround is to remove OpenCV 2 via
89+
`sudo apt remove libopencv-dev`.
90+
91+
5992
## Use with CMake
6093

6194
One libwave has been either installed or exported by CMake, it can be used in

scripts/install/install.bash

Lines changed: 0 additions & 57 deletions
This file was deleted.

scripts/install/install_deps.bash

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ echo
99

1010
# Echo the commands before running them
1111
set -x
12-
sudo apt-add-repository ppa:lkoppel/robotics
12+
sudo add-apt-repository ppa:lkoppel/robotics-wavelab
1313
sudo apt-get update
1414

1515
sudo apt-get install cmake \
1616
libboost-dev \
1717
libyaml-cpp-dev \
1818
libeigen3-dev \
19-
libpcl-dev \
20-
libopencv-dev \
21-
libceres-dev \
22-
libkindr-dev
19+
libpcl1.8-dev \
20+
libceres-wavelab-dev
2321

2422
set +x
2523
echo

scripts/install/install_gtsam.bash

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
set -e # exit on first error
3+
4+
DEPS_DIR="/tmp/wave_dependencies"
5+
6+
main()
7+
{
8+
install_gtsam
9+
}
10+
11+
make_with_progress()
12+
{
13+
if [ -z "$CONTINUOUS_INTEGRATION" ]; then
14+
local awk_arg="-W interactive"
15+
fi
16+
# Run make, printing a character for every 10 lines
17+
make "$@" | awk ${awk_arg} 'NR%5==1 { printf ".", $0}'
18+
echo "done"
19+
}
20+
21+
install_gtsam()
22+
{
23+
GTSAM_DIR="gtborg-gtsam-250a03943591"
24+
FILE="250a03943591.zip"
25+
URL="https://bitbucket.org/gtborg/gtsam/get/250a03943591.zip"
26+
27+
if (ldconfig -p | grep -q libgtsam.so.4 ); then
28+
echo "gtsam is already installed."
29+
else
30+
echo "Installing gtsam ..."
31+
mkdir -p "$DEPS_DIR"
32+
cd "$DEPS_DIR"
33+
wget "$URL"
34+
unzip "$FILE"
35+
rm -rf "$FILE"
36+
37+
cd "$GTSAM_DIR"
38+
mkdir -p BUILD
39+
cd BUILD
40+
cmake ..
41+
42+
make_with_progress -j$(nproc)
43+
sudo make install > /dev/null
44+
fi
45+
}
46+
47+
main
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
set -e # exit on first error
3+
4+
DEPS_DIR="/tmp/wave_dependencies"
5+
6+
main()
7+
{
8+
install_opencv
9+
}
10+
11+
make_with_progress()
12+
{
13+
if [ -z "$CONTINUOUS_INTEGRATION" ]; then
14+
local awk_arg="-W interactive"
15+
fi
16+
# Run make, printing a character for every 10 lines
17+
make "$@" | awk ${awk_arg} 'NR%5==1 { printf ".", $0}'
18+
echo "done"
19+
}
20+
21+
install_opencv()
22+
{
23+
VERSION="3.3.1"
24+
URL="https://github.com/opencv/opencv/archive/$VERSION.zip"
25+
OPENCV_DIR="opencv-$VERSION"
26+
FILE="$VERSION.zip"
27+
28+
local RETVAL=$(pkg-config --atleast-version=$VERSION opencv)
29+
if [ "$RETVAL" == "0" ]; then
30+
echo "opencv version $(pkg-config --modversion opencv) is already installed."
31+
else
32+
echo "Installing opencv version $VERSION ..."
33+
mkdir -p "$DEPS_DIR"
34+
cd "$DEPS_DIR"
35+
wget "$URL"
36+
unzip "$FILE"
37+
rm -rf "$FILE"
38+
39+
cd "$OPENCV_DIR"
40+
mkdir -p BUILD
41+
cd BUILD
42+
cmake ..
43+
44+
make_with_progress -j$(nproc)
45+
sudo make install > /dev/null
46+
fi
47+
}
48+
49+
main

0 commit comments

Comments
 (0)