forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcc_build.sh
55 lines (46 loc) · 1.65 KB
/
gcc_build.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
# This script is for building AirSim with GCC-6
# You should NOT use this with Unreal.
# If you want bits that work in Unreal you need to use ../build.sh
# For pre-requisite tools needed to run this script see
# https://github.com/Microsoft/AirSim/blob/master/docs/build_linux.md
# First get the location of this script, it is assumed you already cloned "main" and you are running the
# script from that repo. It will then put everything else in a ROS workspace at "../catkin_ws"
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
pushd $SCRIPTPATH
# update the rpclib git submodule
pushd ..
git submodule update --init --recursive
#install EIGEN library
if [[ ! -d './AirLib/deps/eigen3/Eigen' ]]; then
echo "downloading eigen..."
wget http://bitbucket.org/eigen/eigen/get/3.3.2.zip
unzip 3.3.2.zip -d temp_eigen
mkdir -p AirLib/deps/eigen3
mv temp_eigen/eigen*/Eigen AirLib/deps/eigen3
rm -rf temp_eigen
rm 3.3.2.zip
fi
popd
if [ -f "CMakeCache.txt" ]; then
rm CMakeCache.txt
fi
if [ -d "CMakeFiles" ]; then
rm -rf CMakeFiles
fi
GCCARGS="-D CMAKE_BUILD_TYPE=Debug"
GCCVERSION=$(gcc -v 2>&1 | sed -n "/^gcc version/p" | sed -e "s/^gcc version \([0-9]\)/\1/g" | cut -d"." -f1)
if [ $GCCVERSION -lt 5 ]; then
GCCARGS="$GCCARGS -D CMAKE_C_COMPILER=gcc-6 -D CMAKE_CXX_COMPILER=g++-6"
fi
cmake $GCCARGS CMakeLists.txt
make
pushd ..
mkdir -p AirLib/lib/x64/Debug
mkdir -p AirLib/deps/rpclib
mkdir -p AirLib/deps/MavLinkCom
rsync -a --delete cmake/output/lib/ AirLib/lib/x64/Debug
rsync -a --delete external/rpclib/include AirLib/deps/rpclib
rsync -a --delete MavLinkCom/include AirLib/deps/MavLinkCom
rsync -a --delete AirLib Unreal/Plugins/AirSim/Source
popd