carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.59k stars 3.73k forks source link

Facing error while running make PythonAPI command in Ubuntu #7451

Open vigneshrl opened 7 months ago

vigneshrl commented 7 months ago

CARLA version:0.9.15 Platform/OS: Ubuntu 20.04 Problem I'm experiencing: I'm facing error when I run the make PythonAPI command

This is the error I'm getting - CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake:49 (message): Could not find compiler set in environment variable CC:

/home/vignesh/UnrealEngine//Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang. Call Stack (most recent call first): CMakeLists.txt:2 (project)

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! See also "/home/vignesh/carla/Build/rpclib-v2.2.1_c5-c10-libcxx-build/CMakeFiles/CMakeOutput.log". make: *** [Util/BuildTools/Linux.mk:142: setup] Error 1

I tried exporting the paths of the clang and clang++ and also added in the bashrc file. For some reason the clang version I installed was 10 and the in the paths it is showing clang-16.0. I have been struggling with this error. Has anyone faced this issue before , how to resolve this?? Please Help!! Thanks

PatrickPromitzer commented 7 months ago

You need this 2 lines to change the default clang version

sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-10/bin/clang++ 180 &&
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-10/bin/clang 180

https://carla.readthedocs.io/en/latest/build_linux/#software-requirements

You can try to install clang-8 and set it as default (you need to change the version number in the commands) For me clang-8 worked.