microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.25k stars 4.52k forks source link

Error while building AirSim #4507

Open huytd-pi opened 2 years ago

huytd-pi commented 2 years ago

Bug report

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: [cmTC9d0d3/fast] Error 2 _make: [cmTCfb769/fast] Error 2

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


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!

jonyMarino commented 2 years ago

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

jclee0109 commented 1 year ago

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.

rishi1906 commented 9 months ago

@jclee0109 Thanks alot -gcc resolved the issue