AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

Error while building AirSim

Open huytd-pi opened this issue 3 years ago • 3 comments

Bug report

  • AirSim Version/#commit: v1.7.0
  • UE/Unity version: 4.25
  • autopilot version: PX4
  • OS Version:Ubuntu 18.04

I do AirSim build on linux, processes I follow steps like this path: https://microsoft.github.io/AirSim/build_linux/ I followed the steps one by one until the AirSim build step got an error. Every time I run the build, there is a different message like: make: *** [cmTC_9d0d3/fast] Error 2 make: *** [cmTC_fb769/fast] Error 2

huytd@huytd-HP:~/Project/Drone/AirSim/AirSim$ ./setup.sh

  • set -e +++ dirname ./setup.sh ++ cd . ++ pwd
  • SCRIPT_DIR=/home/huytd/Project/Drone/AirSim/AirSim
  • pushd /home/huytd/Project/Drone/AirSim/AirSim
  • downloadHighPolySuv=true
  • MIN_CMAKE_VERSION=3.10.0 ++ uname
  • '[' Linux == Darwin ']'
  • DEBUG=false
  • [[ 0 -gt 0 ]] ++ uname
  • '[' Linux == Darwin ']'
  • sudo apt-get update [sudo] password for huytd: Hit:1 http://vn.archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://vn.archive.ubuntu.com/ubuntu bionic-updates InRelease
    Hit:3 http://vn.archive.ubuntu.com/ubuntu bionic-backports InRelease
    Hit:4 https://download.docker.com/linux/ubuntu bionic InRelease
    Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease
    Hit:6 https://linux.teamviewer.com/deb stable InRelease
    Hit:7 https://download.mono-project.com/repo/ubuntu stable-bionic InRelease
    Hit:8 https://packages.microsoft.com/repos/ms-teams stable InRelease
    Hit:9 http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu focal InRelease Hit:10 http://security.ubuntu.com/ubuntu bionic-security InRelease
    Hit:11 http://packages.ros.org/ros/ubuntu bionic InRelease
    Hit:12 http://packages.osrfoundation.org/gazebo/ubuntu-stable bionic InRelease Hit:13 http://ppa.launchpad.net/bablu-boy/nutty/ubuntu bionic InRelease
    Hit:14 http://ppa.launchpad.net/bamboo-engine/ibus-bamboo/ubuntu bionic InRelease Hit:15 https://librealsense.intel.com/Debian/apt-repo bionic InRelease
    Hit:16 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease
    Hit:17 http://ppa.launchpad.net/elementary-os/stable/ubuntu bionic InRelease
    Hit:18 http://ppa.launchpad.net/maateen/battery-monitor/ubuntu bionic InRelease Hit:19 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu bionic InRelease
    Hit:20 http://ppa.launchpad.net/saiarcot895/flightgear/ubuntu bionic InRelease Hit:21 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic InRelease Hit:22 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic InRelease
    Reading package lists... Done
  • sudo apt-get -y install --no-install-recommends lsb-release rsync software-properties-common wget libvulkan1 vulkan-utils Reading package lists... Done Building dependency tree
    Reading state information... Done lsb-release is already the newest version (9.20170808ubuntu1). rsync is already the newest version (3.1.2-2.1ubuntu1.4). software-properties-common is already the newest version (0.96.24.32.18). wget is already the newest version (1.19.4-1ubuntu2.2). libvulkan1 is already the newest version (1.1.70+dfsg1-1ubuntu0.18.04.1). vulkan-utils is already the newest version (1.1.70+dfsg1-1ubuntu0.18.04.1). 0 upgraded, 0 newly installed, 0 to remove and 66 not upgraded. ++ lsb_release -rs ++ cut -d. -f1
  • VERSION=18
  • '[' 18 -lt 17 ']'
  • sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev Reading package lists... Done Building dependency tree
    Reading state information... Done Note, selecting 'clang-8-doc' for regex 'clang++-8' Note, selecting 'python-clang-8' for regex 'clang++-8' Note, selecting 'clang-8' for regex 'clang++-8' Note, selecting 'clang-8-examples' for regex 'clang++-8' Note, selecting 'libclang-8-dev' for regex 'clang++-8' clang-8 is already the newest version (1:8-3~ubuntu18.04.2). clang-8-doc is already the newest version (1:8-3~ubuntu18.04.2). clang-8-examples is already the newest version (1:8-3~ubuntu18.04.2). libc++-8-dev is already the newest version (1:8-3~ubuntu18.04.2). libc++abi-8-dev is already the newest version (1:8-3~ubuntu18.04.2). libclang-8-dev is already the newest version (1:8-3~ubuntu18.04.2). python-clang-8 is already the newest version (1:8-3~ubuntu18.04.2). 0 upgraded, 0 newly installed, 0 to remove and 66 not upgraded.
  • which cmake /usr/local/bin/cmake ++ cmake --version ++ head -n1 ++ awk '{print $NF}' ++ cut -d ' ' -f3
  • cmake_ver=3.20.0 ++ uname
  • '[' Linux == Darwin ']'
  • [[ -n '' ]]
  • sudo apt-get install -y build-essential unzip Reading package lists... Done Building dependency tree
    Reading state information... Done build-essential is already the newest version (12.4ubuntu1). unzip is already the newest version (6.0-21ubuntu1.1). 0 upgraded, 0 newly installed, 0 to remove and 66 not upgraded.
  • version_less_than_equal_to 3.20.0 3.10.0 ++ printf '%s\n' 3.20.0 3.10.0 ++ sort -V ++ head -n 1
  • test 3.10.0 = 3.20.0
  • echo 'Already have good version of cmake: 3.20.0' Already have good version of cmake: 3.20.0
  • '[' '!' -d external/rpclib/rpclib-2.3.0 ']'
  • true
  • '[' '!' -d Unreal/Plugins/AirSim/Content/VehicleAdv ']'
  • '[' '!' -d Unreal/Plugins/AirSim/Content/VehicleAdv/SUV/v1.2.0 ']'
  • echo 'Installing Eigen library...' Installing Eigen library...
  • '[' '!' -d AirLib/deps/eigen3 ']'
  • echo 'Eigen is already installed.' Eigen is already installed.
  • popd
  • set +x

AirSim setup completed successfully!


huytd@huytd-HP:~/Project/Drone/AirSim/AirSim$ ./build.sh

  • debug=false

  • gcc=false

  • [[ 0 -gt 0 ]]

  • RPC_VERSION_FOLDER=rpclib-2.3.0

  • '[' '!' -d ./external/rpclib/rpclib-2.3.0 ']'

  • '[' -d ./cmake_build ']' ++ which cmake

  • CMAKE=/usr/local/bin/cmake

  • false

  • build_dir=build_release ++ uname

  • '[' Linux == Darwin ']'

  • false

  • export CC=clang-8

  • CC=clang-8

  • export CXX=clang++-8

  • CXX=clang++-8

  • [[ ! -d ./AirLib/deps/eigen3/Eigen ]]

  • echo 'putting build in build_release folder, to clean, just delete the directory...' putting build in build_release folder, to clean, just delete the directory...

  • [[ -f ./cmake/CMakeCache.txt ]]

  • [[ -d ./cmake/CMakeFiles ]]

  • [[ ! -d build_release ]]

  • mkdir -p build_release

  • CMAKE_VARS= ++ uname

  • '[' Linux == Darwin ']'

  • pushd build_release

  • false

  • folder_name=Release

  • /usr/local/bin/cmake ../cmake -DCMAKE_BUILD_TYPE=Release -- The C compiler identification is Clang 8.0.0 -- The CXX compiler identification is Clang 8.0.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/clang-8 - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compiler: /usr/bin/clang++-8 -- Check for working CXX compiler: /usr/bin/clang++-8 - broken CMake Error at /usr/local/share/cmake-3.20/Modules/CMakeTestCXXCompiler.cmake:59 (message): The C++ compiler

    "/usr/bin/clang++-8"

    is not able to compile a simple test program.

    It fails with the following output:

    Change Dir: /home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make -f Makefile cmTC_52478/fast && /usr/bin/make -f CMakeFiles/cmTC_52478.dir/build.make CMakeFiles/cmTC_52478.dir/build make[1]: Entering directory '/home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_52478.dir/testCXXCompiler.cxx.o /usr/bin/clang++-8 -MD -MT CMakeFiles/cmTC_52478.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_52478.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_52478.dir/testCXXCompiler.cxx.o -c /home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx Linking CXX executable cmTC_52478 /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_52478.dir/link.txt --verbose=1 /usr/bin/clang++-8 CMakeFiles/cmTC_52478.dir/testCXXCompiler.cxx.o -o cmTC_52478 /usr/bin/ld: cannot find -lstdc++ clang: error: linker command failed with exit code 1 (use -v to see invocation) CMakeFiles/cmTC_52478.dir/build.make:99: recipe for target 'cmTC_52478' failed make[1]: *** [cmTC_52478] Error 1 make[1]: Leaving directory '/home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeTmp' Makefile:127: recipe for target 'cmTC_52478/fast' failed make: *** [cmTC_52478/fast] Error 2

    CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred! See also "/home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeOutput.log". See also "/home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeError.log".

  • popd ~/Project/Drone/AirSim/AirSim ~/Project/Drone/AirSim/AirSim
  • rm -r build_release
  • exit 1

### try to build again, but still error

huytd@huytd-HP:~/Project/Drone/AirSim/AirSim$ ./build.sh

  • debug=false

  • gcc=false

  • [[ 0 -gt 0 ]]

  • RPC_VERSION_FOLDER=rpclib-2.3.0

  • '[' '!' -d ./external/rpclib/rpclib-2.3.0 ']'

  • '[' -d ./cmake_build ']' ++ which cmake

  • CMAKE=/usr/local/bin/cmake

  • false

  • build_dir=build_release ++ uname

  • '[' Linux == Darwin ']'

  • false

  • export CC=clang-8

  • CC=clang-8

  • export CXX=clang++-8

  • CXX=clang++-8

  • [[ ! -d ./AirLib/deps/eigen3/Eigen ]]

  • echo 'putting build in build_release folder, to clean, just delete the directory...' putting build in build_release folder, to clean, just delete the directory...

  • [[ -f ./cmake/CMakeCache.txt ]]

  • [[ -d ./cmake/CMakeFiles ]]

  • [[ ! -d build_release ]]

  • mkdir -p build_release

  • CMAKE_VARS= ++ uname

  • '[' Linux == Darwin ']'

  • pushd build_release

  • false

  • folder_name=Release

  • /usr/local/bin/cmake ../cmake -DCMAKE_BUILD_TYPE=Release -- The C compiler identification is Clang 8.0.0 -- The CXX compiler identification is Clang 8.0.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/clang-8 - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compiler: /usr/bin/clang++-8 -- Check for working CXX compiler: /usr/bin/clang++-8 - broken CMake Error at /usr/local/share/cmake-3.20/Modules/CMakeTestCXXCompiler.cmake:59 (message): The C++ compiler

    "/usr/bin/clang++-8"

    is not able to compile a simple test program.

    It fails with the following output:

    Change Dir: /home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make -f Makefile cmTC_c8dc5/fast && /usr/bin/make -f CMakeFiles/cmTC_c8dc5.dir/build.make CMakeFiles/cmTC_c8dc5.dir/build make[1]: Entering directory '/home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_c8dc5.dir/testCXXCompiler.cxx.o /usr/bin/clang++-8 -MD -MT CMakeFiles/cmTC_c8dc5.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_c8dc5.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_c8dc5.dir/testCXXCompiler.cxx.o -c /home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx Linking CXX executable cmTC_c8dc5 /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c8dc5.dir/link.txt --verbose=1 /usr/bin/clang++-8 CMakeFiles/cmTC_c8dc5.dir/testCXXCompiler.cxx.o -o cmTC_c8dc5 /usr/bin/ld: cannot find -lstdc++ clang: error: linker command failed with exit code 1 (use -v to see invocation) CMakeFiles/cmTC_c8dc5.dir/build.make:99: recipe for target 'cmTC_c8dc5' failed make[1]: *** [cmTC_c8dc5] Error 1 make[1]: Leaving directory '/home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeTmp' Makefile:127: recipe for target 'cmTC_c8dc5/fast' failed make: *** [cmTC_c8dc5/fast] Error 2

    CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred! See also "/home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeOutput.log". See also "/home/huytd/Project/Drone/AirSim/AirSim/build_release/CMakeFiles/CMakeError.log".

  • popd ~/Project/Drone/AirSim/AirSim ~/Project/Drone/AirSim/AirSim
  • rm -r build_release
  • exit 1

I really appreciate everyone helping me fix this error!

huytd-pi avatar Apr 29 '22 05:04 huytd-pi

Hi and welcome @huytd-pi! See if this post can help you.

jonyMarino avatar May 09 '22 19:05 jonyMarino

Hello @huytd-pi! I just met the same problem as you. I thought that clang compiler didn't work well in our environment (I don't have any idea about the specific reason..) Anyway, so I changed the compiler as gcc using ./build.sh --gcc and it works.

I hope you can fix your problem as well. Thanks.

jclee0109 avatar Nov 11 '22 02:11 jclee0109

@jclee0109 Thanks alot -gcc resolved the issue

rishi1906 avatar Nov 25 '23 13:11 rishi1906