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

gcc 4.9 fdiagnostics-color

asked 2016-02-18 03:03:38 -0500

VictorLamoine gravatar image

updated 2016-02-18 06:22:56 -0500

I'm using gcc 4.9.3 and the fdiagnostics-color switch to produce colored output warning / error messages. It works in a simple C++ CMake project but the output of catkin_make is not colored.

The flag is in the CMAKE_CXX_FLAGS CMake cache:

$ cat build/CMakeCache.txt | grep CXX_FLAGS:
CMAKE_CXX_FLAGS:STRING='-fdiagnostics-color  '

How do I get colored output from catkin_make? I don't want to use colorgcc.

Edit 1:

Using make VERBOSE=1 I can tell the flag is here:

/usr/lib/ccache/c++   -fdiagnostics-color        CMakeFiles/bezier_application.dir/src/bezier_application.cpp.o  -o /home/dell/MEGAsync/catkin_workspace/devel/lib/bezier_application/bezier_application -rdynamic /home/dell/MEGAsync/catkin_workspace/devel/lib/libbezier_library.so /opt/ros/indigo/lib

Note that my non-catkin projects use ccache too and gets colored output.

edit retag flag offensive close merge delete

Comments

Just to check what's going wrong: Try catkin_make with VERBOSE=1 to see the g++ calls and if these get passed the flag.

dornhege gravatar image dornhege  ( 2016-02-18 04:50:29 -0500 )edit

I edited my question to add more info. The flag is here as expected.

VictorLamoine gravatar image VictorLamoine  ( 2016-02-18 06:23:28 -0500 )edit

Try with -fdiagnostics-color=always. Maybe it will help.

yasagitov gravatar image yasagitov  ( 2016-02-18 07:28:01 -0500 )edit

Are you running both cmake and catkin_make under the same user?

yasagitov gravatar image yasagitov  ( 2016-02-18 07:31:34 -0500 )edit

always does not help. Yes, a non root user.

VictorLamoine gravatar image VictorLamoine  ( 2016-02-18 07:53:39 -0500 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2016-04-03 05:41:40 -0500

VictorLamoine gravatar image

updated 2018-07-10 07:16:48 -0500

This happened because I was overwriting the CMAKE_CXX_FLAGS flag in my CMakeLists.txt:

Old CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
set (CMAKE_CXX_FLAGS "-fPIC")
project(bezier_library)

Instead of set, use add_compile_options:

add_compile_options("-fPIC")
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-02-18 03:03:38 -0500

Seen: 679 times

Last updated: Jul 10 '18