cmake: x86_64-conda_cos6-linux-gnu-cc does not exist (compiler tool)
whenever i try to use cmake i get this problem:
Base path: /home/waretf/catkin_ws Source space: /home/waretf/catkin_ws/src Build space: /home/waretf/catkin_ws/build Devel space: /home/waretf/catkin_ws/devel Install space: /home/waretf/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/waretf/catkin_ws/build"
####
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown CMake Error in CMakeLists.txt: The CMAKE_C_COMPILER:
/home/waretf/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
CMake Error in CMakeLists.txt: The CMAKE_CXX_COMPILER:
/home/waretf/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred! See also "/home/waretf/catkin_ws/build/CMakeFiles/CMakeOutput.log". See also "/home/waretf/catkin_ws/build/CMakeFiles/CMakeError.log". Makefile:320: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1 Invoking "make cmake_check_build_system" failed
I don't have anaconda installed so i don't know why is this happening. Any help would be appreciated
What is the output of
echo $CC
andecho $CXX
when run in your terminal?It outputs nothing
Have you ever had Conda installed on this machine?
Is this a fresh workspace? Does removing the
build
anddevel
folders, opening a new terminal and restartingcatkin_make
help?What is the output of
which cc
andwhich c++
?Note that this is not really a ROS problem, but a general system configuration issue.
It would be better to post those on fora such as Ask Ubuntu.
which cc outputs: /usr/bin/cc which c++ ouputs: /usr/bin/c++
I have never worked with cmake before, so I didn't know where to put my question i'll try and post it somewhere else.
Thanks for your help :)
Something is causing CMake to pick up
/home/waretf/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc
as the default C compiler (and a similar path to a C++ compiler). We checkedCC
,CXX
and the output ofwhich
. All of which seem to be what we'd expect for a regular system.One more thing to check: what is the output of
ls -al /usr/bin/cc
andls -al /usr/bin/c++
?Output:
Ah, this is most likely your problem then.
At some point, you did have Conda installed, and it (or you) changed the default compilers for C and C++ to use it. Probably using
update-alternatives
.Please see this AskUbuntu question to learn how to use
update-alternatives
to configure it to use the default compilers again.But this does confirm my earlier assumption that this is a system configuration issue. Not something to do with Catkin or ROS.