forked from versatran01/dsol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_deps.sh
66 lines (57 loc) · 2.16 KB
/
build_deps.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
#!/bin/bash
if [ -z "$SLAM_OPENSOURCE_ROOT" ]
then
echo "Please configure SLAM workspace first, missing env variable $SLAM_OPENSOURCE_ROOT"
exit
fi
mkdir $SLAM_OPENSOURCE_ROOT/dsol
# create 3rdparty in dsol
mkdir 3rdparty && cd 3rdparty
# # googletest
# git clone https://github.com/google/googletest.git
# cd googletest
# mkdir build && cd build
# cmake -DCMAKE_INSTALL_PREFIX=$SLAM_OPENSOURCE_ROOT/dsol ..
# make -j8 && make install
# cd ../..
# gflags
# git clone --branch v2.2.2 https://github.com/gflags/gflags.git
# cd gflags
# mkdir build && cd build
# cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$SLAM_OPENSOURCE_ROOT/dsol ..
# make -j8 && make install
# cd ../..
# glog
git clone --depth 1 --branch v0.6.0 https://github.com/google/glog.git
cd glog
cmake -S . -B build -G "Unix Makefiles" -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH=$SLAM_OPENSOURCE_ROOT/dsol -DCMAKE_INSTALL_PREFIX=$SLAM_OPENSOURCE_ROOT/dsol ..
cd build && make install
cd ../..
# fmt
git clone --depth 1 --branch 8.1.0 https://github.com/fmtlib/fmt.git
cd fmt
mkdir build && cd build
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_CXX_STANDARD=17 -DFMT_TEST=False -DCMAKE_INSTALL_PREFIX=$SLAM_OPENSOURCE_ROOT/dsol ..
make install
cd ../..
# abseil
git clone --depth 1 --branch 20220623.0 https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
mkdir build && cd build
cmake -DABSL_BUILD_TESTING=OFF -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=$SLAM_OPENSOURCE_ROOT/dsol ..
make install
cd ../..
# sophus
git clone https://github.com/strasdat/Sophus.git
cd Sophus
mkdir build && cd build
git checkout 785fef3
cmake -DBUILD_SOPHUS_TESTS=OFF -DBUILD_SOPHUS_EXAMPLES=OFF -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=$SLAM_OPENSOURCE_ROOT/dsol ..
make install
cd ../..
# benchmark
git clone --depth 1 --branch v1.6.2 https://github.com/google/benchmark.git
cd benchmark
cmake -E make_directory "build"
cmake -E chdir "build" cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$SLAM_OPENSOURCE_ROOT/dsol ..
cmake --build "build" --config Release --target install