Color for compiler errors
When building OpenFOAM-based code, I notice that GCC does not use any color (which is the default behavior), making it sometimes difficult to read error messages. I am not sure which compilation rule could be overriding the default behavior or why, but I can get color if I pass -fdiagnostics-color=always
to the compiler options.
Questions:
- Is this explicitly disabled for some reason? I can imagine that some terminals don't interpret colors by default.
- Where would it be the most appropriate to set this for:
- my system (globally)? An environment variable for extra compiler flags would be very useful.
- my OpenFOAM-based code? We typically have
EXE_INC
(meant for includes) andLIB_LIBS
(meant for the libraries). Is there anything else?
- If revisiting (1) is worth it: does it make sense enabling colorization by default in OpenFOAM for GCC?