cmake: x86_64-conda_cos6-linux-gnu-cc does not exist (compiler tool)

asked 2019-11-22 16:15:15 -0600

waretf gravatar image

updated 2019-11-23 07:11:56 -0600

gvdhoorn gravatar image

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

edit retag flag offensive close merge delete

Comments

What is the output of echo $CC and echo $CXX when run in your terminal?

gvdhoorn gravatar imagegvdhoorn ( 2019-11-23 07:12:32 -0600 )edit

It outputs nothing

waretf gravatar imagewaretf ( 2019-11-25 00:10:55 -0600 )edit

Have you ever had Conda installed on this machine?

Is this a fresh workspace? Does removing the build and devel folders, opening a new terminal and restarting catkin_make help?

What is the output of which cc and which c++?

gvdhoorn gravatar imagegvdhoorn ( 2019-11-25 03:54:15 -0600 )edit

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.

gvdhoorn gravatar imagegvdhoorn ( 2019-11-25 03:54:52 -0600 )edit

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 :)

waretf gravatar imagewaretf ( 2019-11-26 05:37:22 -0600 )edit

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 checked CC, CXX and the output of which. 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 and ls -al /usr/bin/c++?

gvdhoorn gravatar imagegvdhoorn ( 2019-11-26 05:57:49 -0600 )edit

Output:

$ ls -al /usr/bin/cc
lrwxrwxrwx 1 root root 20 Jul 31 15:31 /usr/bin/cc -> /etc/alternatives/cc
$ ls -al /usr/bin/c++
lrwxrwxrwx 1 root root 21 Jul 31 15:31 /usr/bin/c++ -> /etc/alternatives/c++
waretf gravatar imagewaretf ( 2019-11-27 02:19:15 -0600 )edit

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.

gvdhoorn gravatar imagegvdhoorn ( 2019-11-27 02:43:32 -0600 )edit