ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You can check which compiler is being used by looking at the message when you run catkin_make.

If you get the following message, you are probably using gcc and LLVM g++.

-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is Clang 4.0.0

ref: http://wiki.ros.org/ROS/Tutorials/BuildingPackages

To change the compiler and options, add the following to the CMakeList.txt file

set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
set(CMAKE_C_COMPILER "/usr/bin/clang")
set(CMAKE_CXX_FLAGS "-O2")
set(CMAKE_C_FLAGS "-O2")

ref: https://answers.ros.org/question/56398/run-catkin-make-with-custom-compiler/?answer=156461