-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathinstall.sh
executable file
·152 lines (127 loc) · 3.8 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
set -e
# ---------------------------------------
# Install precompiled 3rd party libraries
# ---------------------------------------
if [[ "$OSTYPE" == "linux-gnu" ]]; then
sudo apt-get install curl cmake libeigen3-dev libtinyxml2-dev libjsoncpp-dev libhiredis-dev libglfw3-dev xorg-dev freeglut3-dev libasound2-dev libusb-1.0-0-dev redis-server
# Install gcc 5 for Ubuntu 14.04:
# sudo add-apt-repository ppa:ubuntu-toolchain-r/test
# sudo apt-get update
# sudo apt-get install gcc-5 g++-5
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install cmake eigen redis hiredis tinyxml2 jsoncpp glfw3
fi
mkdir -p external
cd external
# ------------
# Install RBDL
# ------------
curl -L https://bitbucket.org/rbdl/rbdl/get/default.zip -o rbdl-2.5.0.zip
unzip rbdl-2.5.0.zip
mv rbdl-rbdl-849d2aee8f4c rbdl
cd rbdl
if [ ! -f CMakeLists.txt.bkp ]; then
cp CMakeLists.txt CMakeLists.txt.bkp
cat <<EOF >> CMakeLists.txt
# ------------------------
# Custom packaging for SAI
#
# Exposes RBDL to find_package(RBDL)
# ------------------------
# Get library binaries
IF (RBDL_BUILD_STATIC)
SET(EXPORT_TARGET_RBDL rbdl-static)
SET(EXPORT_TARGET_RBDL_URDF rbdl_urdfreader-static)
ELSE (RBDL_BUILD_STATIC)
SET(EXPORT_TARGET_RBDL rbdl)
SET(EXPORT_TARGET_RBDL_URDF rbdl_urdfreader)
ENDIF ()
GET_PROPERTY(RBDL_LIB TARGET \${EXPORT_TARGET_RBDL} PROPERTY LOCATION)
IF (RBDL_BUILD_ADDON_URDFREADER)
GET_PROPERTY(RBDL_URDF_LIB TARGET \${EXPORT_TARGET_RBDL_URDF} PROPERTY LOCATION)
ENDIF (RBDL_BUILD_ADDON_URDFREADER)
# Export package
EXPORT(TARGETS \${EXPORT_TARGET_RBDL} FILE \${PROJECT_BINARY_DIR}/RBDLTargets.cmake)
EXPORT(PACKAGE RBDL)
# Set config variables
SET(CONF_INCLUDE_DIRS
\${CMAKE_CURRENT_SOURCE_DIR}/..
\${CMAKE_CURRENT_SOURCE_DIR}/include
\${CMAKE_CURRENT_BINARY_DIR}/include
)
SET(CONF_LIBRARY \${RBDL_LIB})
SET(CONF_URDF_LIBRARY \${RBDL_URDF_LIB})
# Write config file
CONFIGURE_FILE(RBDLConfig.cmake.in "\${PROJECT_BINARY_DIR}/RBDLConfig.cmake" @ONLY)
INCLUDE(CMakePackageConfigHelpers)
WRITE_BASIC_PACKAGE_VERSION_FILE(
"\${CMAKE_CURRENT_BINARY_DIR}/RBDLConfigVersion.cmake"
VERSION \${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
EOF
cat <<EOF > RBDLConfig.cmake.in
# ------------------------
# Custom packaging for SAI
#
# Exports RBDL_INCLUDE_DIRS, RBDL_LIB, and RBDL_URDF_LIB
# ------------------------
get_filename_component(RBDL_CMAKE_DIR "\${CMAKE_CURRENT_LIST_FILE}" PATH)
set(RBDL_INCLUDE_DIR "@CONF_INCLUDE_DIRS@")
set(RBDL_LIBRARIES "@CONF_LIBRARY@")
set(RBDL_URDFREADER_LIBRARIES "@CONF_URDF_LIBRARY@")
if(NOT TARGET rbdl AND NOT RBDL_BINARY_DIR)
include("\${RBDL_CMAKE_DIR}/RBDLTargets.cmake")
endif()
EOF
fi
mkdir -p build_rel
cd build_rel
cmake -DCMAKE_BUILD_TYPE=Release -DRBDL_BUILD_ADDON_URDFREADER=ON -DRBDL_USE_ROS_URDF_LIBRARY=OFF ..
make -j4
cd ../..
# --------------
# Install Chai3d
# --------------
# TODO: Make this a git submodule
git clone https://github.com/chai3d/chai3d chai3d
# curl -L http://www.chai3d.org/download/chai3d-3.2.0-CMake.zip -o chai3d-3.2.0.zip
# unzip chai3d-3.2.0.zip
# mv chai3d-3.2.0 chai3d
cd chai3d
mkdir build_rel
cd build_rel
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
cd ../..
cd ..
# --------------------
# Build SAI Simulation
# --------------------
cd sai2-simulation
mkdir -p build_rel
cd build_rel
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
cd ../..
# ----------------
# Build SAI Common
# ----------------
cd sai2-common
git submodule update --init --recursive
mkdir -p build_rel
cd build_rel
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
cd ../..
# -------------------
# Install NatNetLinux
# -------------------
# TODO: Test
cd external/NatNetLinux.git
git submodule update --init
cd ../..
if [[ "$OSTYPE" == "linux-gnu" ]]; then
sudo apt-get install libboost-all-dev
fi