From f9d8463deed2248eea6bd9bfade64c620f18bd2d Mon Sep 17 00:00:00 2001 From: Rajat Singhal Date: Mon, 13 Apr 2020 23:11:33 +0530 Subject: [PATCH 1/2] Remove gcc build option from setup and build.sh --- build.sh | 50 +++++++------------------------------------------ setup.sh | 57 ++++++++++++++------------------------------------------ 2 files changed, 21 insertions(+), 86 deletions(-) diff --git a/build.sh b/build.sh index 4850d09dc8..952b739657 100755 --- a/build.sh +++ b/build.sh @@ -7,23 +7,8 @@ pushd "$SCRIPT_DIR" >/dev/null set -e set -x -MIN_GCC_VERSION=6.0.0 -gccBuild=false function version_less_than_equal_to() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; } -# Parse command line arguments -while [[ $# -gt 0 ]] -do -key="$1" - -case $key in - --gcc) - gccBuild=true - shift # past argument - ;; -esac -done - # check for rpclib if [ ! -d "./external/rpclib/rpclib-2.2.1" ]; then echo "ERROR: new version of AirSim requires newer rpclib." @@ -42,35 +27,14 @@ else CMAKE=$(which cmake) fi -# set up paths of cc and cxx compiler -if $gccBuild; then - # variable for build output - build_dir=build_gcc_debug - # gcc tools - if ! which gcc; then - echo "ERROR: run setup.sh to install a good version of gcc." - exit 1 - else - gcc_ver=$(gcc -dumpfullversion) - fi - - if version_less_than_equal_to $gcc_ver $MIN_GCC_VERSION; then - export CC="gcc-6" - export CXX="g++-6" - else - export CC="gcc" - export CXX="g++" - fi +# variable for build output +build_dir=build_debug +if [ "$(uname)" == "Darwin" ]; then + export CC=/usr/local/opt/llvm@8/bin/clang + export CXX=/usr/local/opt/llvm@8/bin/clang++ else - # variable for build output - build_dir=build_debug - if [ "$(uname)" == "Darwin" ]; then - export CC=/usr/local/opt/llvm@8/bin/clang - export CXX=/usr/local/opt/llvm@8/bin/clang++ - else - export CC="clang-8" - export CXX="clang++-8" - fi + export CC="clang-8" + export CXX="clang++-8" fi #install EIGEN library diff --git a/setup.sh b/setup.sh index 5d05a5998a..06d707e95d 100755 --- a/setup.sh +++ b/setup.sh @@ -5,9 +5,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd "$SCRIPT_DIR" >/dev/null downloadHighPolySuv=true -gccBuild=false MIN_CMAKE_VERSION=3.10.0 -MIN_GCC_VERSION=6.0.0 function version_less_than_equal_to() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; } # Parse command line arguments @@ -20,51 +18,24 @@ case $key in downloadHighPolySuv=false shift # past value ;; - --gcc) - gccBuild=true - shift # past argument - ;; esac done -if $gccBuild; then - # gcc tools - if ! which gcc; then - # GCC not installed - gcc_ver=0 - else - gcc_ver=$(gcc -dumpfullversion) - fi - - if version_less_than_equal_to $gcc_ver $MIN_GCC_VERSION; then - if [ "$(uname)" == "Darwin" ]; then # osx - brew update - brew install gcc-6 g++-6 - else - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt-get -y update - sudo apt-get install -y gcc-6 g++-6 - fi - else - echo "Already have good version of gcc: $gcc_ver" - fi -else - # llvm tools - if [ "$(uname)" == "Darwin" ]; then # osx - brew update - brew tap llvm-hs/homebrew-llvm - brew install llvm@8 - else #linux - #install clang and build tools - VERSION=$(lsb_release -rs | cut -d. -f1) - # Since Ubuntu 17 clang is part of the core repository - # See https://packages.ubuntu.com/search?keywords=clang-8 - if [ "$VERSION" -lt "17" ]; then - wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-get update - fi - sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev +# llvm tools +if [ "$(uname)" == "Darwin" ]; then # osx + brew update + brew tap llvm-hs/homebrew-llvm + brew install llvm@8 +else #linux + #install clang and build tools + VERSION=$(lsb_release -rs | cut -d. -f1) + # Since Ubuntu 17 clang is part of the core repository + # See https://packages.ubuntu.com/search?keywords=clang-8 + if [ "$VERSION" -lt "17" ]; then + wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo apt-get update fi + sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev fi #give user perms to access USB port - this is not needed if not using PX4 HIL From 42df1843c8ad9dc9f0c6574fea4eaae8d6e1a2fc Mon Sep 17 00:00:00 2001 From: Rajat Singhal Date: Mon, 13 Apr 2020 23:15:16 +0530 Subject: [PATCH 2/2] [docs] Remove GCC build info --- docs/build_linux.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/build_linux.md b/docs/build_linux.md index 264299073b..006ecac82e 100644 --- a/docs/build_linux.md +++ b/docs/build_linux.md @@ -40,13 +40,6 @@ Please see instructions [here](https://github.com/Microsoft/AirSim/blob/master/d ./build.sh ``` - Optionally, if you need GCC binaries for some other reason, you can simply add gcc to the setup and build invocation, like this: - - ```bash - ./setup.sh --gcc - ./build.sh --gcc - ``` - ### Build Unreal Environment Finally, you will need an Unreal project that hosts the environment for your vehicles. AirSim comes with a built-in "Blocks Environment" which you can use, or you can create your own. Please see [setting up Unreal Environment](unreal_proj.md).