-
Notifications
You must be signed in to change notification settings - Fork 18
/
install_deps.sh
executable file
·78 lines (69 loc) · 1.58 KB
/
install_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
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
set -euo pipefail # strict mode
IFS=$'\n\t'
BASE_DIR=$(cd $(dirname "$0"); pwd)
LOCAL_DEPS_DIR="${BASE_DIR}/deps/local"
rm -rf "${LOCAL_DEPS_DIR}"
cd deps
mkdir -p "${LOCAL_DEPS_DIR}/lib"
mkdir -p "${LOCAL_DEPS_DIR}/include"
# Add the local lib folder to the search path. This is important because glog
# searches for libgflags.
export LD_LIBRARY_PATH="${LOCAL_DEPS_DIR}/lib${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
# Set to true to run autoconf and automake (sometimes necessary in Mac OS-X).
RUN_AUTOTOOLS=true
# Install gflags.
echo ""
echo "Installing gflags..."
tar -zxf gflags-2.0-no-svn-files.tar.gz
cd gflags-2.0
if ${RUN_AUTOTOOLS}
then
rm missing
aclocal
autoconf
automake --add-missing
fi
./configure --prefix=${LOCAL_DEPS_DIR} && make && make install
cd ..
echo "Done."
# Install glog.
echo ""
echo "Installing glog..."
tar -zxf glog-0.3.2.tar.gz
cd glog-0.3.2
if ${RUN_AUTOTOOLS}
then
rm missing
aclocal
autoconf
automake --add-missing
fi
./configure --prefix=${LOCAL_DEPS_DIR} --with-gflags=${LOCAL_DEPS_DIR} \
&& make && make install
cd ..
echo "Done."
# Install ad3.
echo ""
echo "Installing ad3..."
rm -rf AD3-2.0.2
tar -zxf AD3-2.0.2.tar.gz
cd AD3-2.0.2
make
cp ad3/libad3.a "${LOCAL_DEPS_DIR}/lib"
mkdir -p "${LOCAL_DEPS_DIR}/include/ad3"
cp -r ad3/*.h "${LOCAL_DEPS_DIR}/include/ad3"
cd ..
# Install eigen
echo ""
echo "Installing Eigen..."
rm -rf eigen
hg clone https://bitbucket.org/eigen/eigen/ -r 346ecdb
cd eigen
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX="${LOCAL_DEPS_DIR}"
make install
cd ../..
rm -rf eigen
echo "Done."