-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup_cross_build.sh
More file actions
208 lines (179 loc) · 8.13 KB
/
setup_cross_build.sh
File metadata and controls
208 lines (179 loc) · 8.13 KB
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
#!/bin/bash
# script to install cross-development environment on a laptop
# This should let people build robot (roboRIO) code on a laptop
# Install toolchain
sudo add-apt-repository ppa:wpilib/toolchain
sudo add-apt-repository ppa:wpilib/toolchain-beta
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install git libc6-i386 curl jstest-gtk gradle oracle-java8-installer frc-toolchain meshlab cmake libprotobuf-dev libprotoc-dev protobuf-compiler ninja-build sip-dev python-empy libtinyxml2-dev libeigen3-dev libpython2.7-dev
#mkdir -p ~/Downloads
#cd ~/Downloads
#wget http://mirror.csclub.uwaterloo.ca/eclipse/oomph/epp/neon/R/eclipse-inst-linux64.tar.gz
#tar -xzvf eclipse-inst-linux64.tar.gz
#cd eclipse-installer
#./eclipse-inst
# follow installer prompts : select C++ development environment when prompted
# start eclipse, install plugins :
# Help -> Install new software -> Add
# Name: FRC Plugins
# Location: http://first.wpi.edu/FRC/roborio/release/eclipse/
# Click OK
# Expand the WPILib Robot Development repo and choose to install the Robot C++ Development plugin.
# Follow/confirm the wizard/prompts
# ~/eclipse/cpp-neon/eclipse/eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://first.wpi.edu/FRC/roborio/release/eclipse/,http://cmakeed.sourceforge.net/eclipse/ -installIU edu.wpi.first.wpilib.plugins.cpp.feature.feature.group
# Install CTRE libraries for TalonSRX controller
# included in above for now but keep handy
# for upgrading if needed
#
# Even more obsolete now - 2018 beta uses v5.x.x and seems to be
# installed automatically?
#cd
#wget http://www.ctr-electronics.com//downloads/lib/CTRE_Phoenix_FRCLibs_NON-WINDOWS_v5.5.1.0.zip
#mkdir ctre
#cd ctre
#unzip ../CTRE_FRCLibs_NON-WINDOWS_v5.5.1.0.zip
#cp -r cpp ~/wpilib/user
#cd ..
#rm -rf ctre CTRE_FRCLibs_NON-WINDOWS_v5.5.1.0.zip
# Install navX-MXP libraries
cd
wget https://www.kauailabs.com/public_files/navx-mxp/navx-mxp-libs.zip
mkdir navx
cd navx
unzip ../navx-mxp-libs.zip
rsync -a roborio/cpp/ ~/wpilib/user/cpp/
cd ..
rm -rf navx navx-mxp-libs.zip
# Get ros for RoboRIO libraries
cd /usr/arm-frc-linux-gnueabi
sudo tar -xjf ~/2018RobotCode/roscore_roborio_2018.tar.bz2
cd
rm roscore_roborio_2018.tar.bz2
# Clone 2018RobotCode repo
cd
git clone https://github.com/FRC900/2018RobotCode.git
# Install roboRIO packages into the cross-root
sudo perl ~/2018RobotCode/install_cross_package.pl
# Build/install cross version of console_bridge
cd
git clone https://github.com/ros/console_bridge
cd console_bridge
git checkout 0.3.2
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/2018RobotCode/zebROS_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..
sudo make -j4 install
cd
sudo rm -rf console_bridge
# Build and install Poco libraries
cd
wget https://pocoproject.org/releases/poco-1.7.9/poco-1.7.9p1.tar.gz
tar xzf poco-1.7.9p1.tar.gz
cd poco-1.7.9p1/
CROSS_COMPILE=arm-frc-linux-gnueabi- ./configure --no-tests --no-samples --omit=Data/ODBC,Data/MySQL --minimal --prefix=/usr/arm-frc-linux-gnueabi/usr/local --static --cflags="-fPIC"
sudo CROSS_COMPILE=arm-frc-linux-gnueabi- make -j4 install
cd
sudo rm -rf poco-1.7.9p1.tar.gz poco-1.7.9p1
#Hack in a cmake file for Eigen3
sudo mkdir -p /usr/arm-frc-linux-gnueabi/usr/lib/cmake/eigen3
sudo cp /usr/lib/cmake/eigen3/Eigen3Config.cmake /usr/arm-frc-linux-gnueabi/usr/lib/cmake/eigen3
# Build and instll SIP libraries
cd
wget https://downloads.sourceforge.net/project/pyqt/sip/sip-4.17/sip-4.17.tar.gz
tar -xzvf sip-4.17.tar.gz
cd sip-4.17
python configure.py CC=arm-frc-linux-gnueabi-gcc CXX=arm-frc-linux-gnueabi-g++ LINK=arm-frc-linux-gnueabi-g++ LINK_SHLIB=arm-frc-linux-gnueabi-g++ --sysroot=/usr/arm-frc-linux-gnueabi --incdir=/usr/arm-frc-linux-gnueabi/usr/include/python2.7 STRIP=arm-frc-linux-gnueabi-strip
#edit siplib/Makefile to change CPP flags include to -I/usr/arm-frc-linux-gnueabi/usr/include/python2.7
sed -i '/^CPPFLAGS/ s_include_usr/include_' siplib/Makefile
sudo make -j8 install
cd
sudo rm -rf sip-4.17.tar.gz sip-4.17
# Build and install tinyxml
wget https://github.com/leethomason/tinyxml2/archive/6.0.0.tar.gz
tar -xzvf 6.0.0.tar.gz
cd tinyxml2-6.0.0
#cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/2018RobotCode/zebROS_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi -DCMAKE_POSITION_INDEPENDENT_CODE=ON .
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/2018RobotCode/zebROS_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_STATIC_LIBS:BOOL=ON -DBUILD_TESTS:BOOL=OFF .
sudo make -j8 install
cd
rm -rf 6.0.0.tar.gz tinyxml2-6.0.0
# Different code uses different versions of tinyxml
cd
wget https://downloads.sourceforge.net/project/tinyxml/tinyxml/2.6.2/tinyxml_2_6_2.zip
unzip tinyxml_2_6_2.zip
cd tinyxml
wget https://gist.githubusercontent.com/TNick/7960323/raw/3046ecda1d4d54d777c407f43ac357846a192e05/TinyXML-CmakeLists.txt
mv TinyXML-CmakeLists.txt CMakeLists.txt
#add a line to CMakeLists.txt :
sed -i "14i set_target_properties(tinyxml PROPERTIES PUBLIC_HEADER \"tinyxml.h;tinystr.h\")" CMakeLists.txt
#add a line to tinyxml.h before line 46 :
sed -i '45i #define TIXML_USE_STL' tinyxml.h
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/2018RobotCode/zebROS_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi -DCMAKE_POSITION_INDEPENDENT_CODE=ON .
sudo make -j8 install
cd
sudo rm -rf tinyxml_2_6_2.zip tinyxml
# Build and install google flags library
cd
wget https://github.com/gflags/gflags/archive/v2.2.1.tar.gz
tar -xzvf v2.2.1.tar.gz
cd gflags-2.2.1
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/2018RobotCode/zebROS_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi -DCMAKE_POSITION_INDEPENDENT_CODE=ON .
sudo make -j4 install
cd
sudo rm -rf v2.2.1.tar.gz gflags-2.2.1
# Build and install google logging libraries
cd
wget https://github.com/google/glog/archive/v0.3.5.tar.gz
tar -xzvf v0.3.5.tar.gz
cd glog-0.3.5/
CFLAGS="-O2 -fPIC -mcpu=cortex-a9 -mfpu=neon" CXXFLAGS="-O2 -fPIC -mcpu=cortex-a9 -mfpu=neon" LDFLAGS="-fPIC" ./configure --host=arm-frc-linux-gnueabi --prefix=/usr/arm-frc-linux-gnueabi/usr/local
sudo make -j8 install
cd
sudo rm -rf v0.3.5.tar.gz glog-0.3.5
# Build and install qhull libraries
cd
wget http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz
tar -xzvf qhull-2015-src-7.2.0.tgz
cd qhull-2015.2/
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/2018RobotCode/zebROS_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi .
sudo make -j8 install
cd
sudo rm -rf qhull-2015-src-7.2.0.tgz qhull-2015.2
# Build and install assimp libraries
cd
git clone https://github.com/assimp/assimp.git
cd assimp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/2018RobotCode/zebROS_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi ..
sudo make -j8 install
cd
sudo rm -rf assimp
# Build and install UUID libraries
cd
wget https://downloads.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz
tar -xzvf libuuid-1.0.3.tar.gz
cd libuuid-1.0.3
CFLAGS="-O2" CXXFLAGS="-O2" ./configure --host=arm-frc-linux-gnueabi --prefix=/usr/arm-frc-linux-gnueabi/usr/local
sudo make install
cd
sudo rm -rf libuuid-1.0.3.tar.gz libuuid-1.0.3
# Build and install yaml-cpp
# TODO : see if this is necesssry since it is also
# built as part of the cross-ros package
git clone https://github.com/jbeder/yaml-cpp.git
cd yaml-cpp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/2018RobotCode/zebROS_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS:BOOL=OFF ..
sudo make -j8 install
cd
sudo rm -rf yaml-cpp
#cd
#git clone https://github.com/rdiankov/collada-dom.git
#cd collada-dom
#cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/2018RobotCode/zebROS_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi .
#sudo make -j8 install
#cd
#sudo rm -rf collada-dom