I want to use the gfortran diagnostics-color however I cannot see any colors.
I used this command
/home/cdim/Local/gcc-4.9.2/bin/gfortran -ffree-form -J./build/lib- -g -fdiagnostics-color=always -Wall -o ./bin/test_larsa.x ./utests/test_larsa.f ./lib/larsa.f
Related
Trying to compile C++ program using developerstudio12.6 CC on Solaris intel i386.
compiler do not show errors or warnings but fails.
Possible to figure why CC do not show any warnings or errors - what is possibly going wrong?
developerstudio12.6/bin/CC -mt -xtarget=native -m32 -g -errwarn=%all -O -DNDEBUG -c xml_test.cc -I<some include> -I<some other include> -o xml_test.o
echo $?
2
Using -verbose=template => similar output, no debug lines
Using -# or verbose=diags=> Huge amount of output but no error lines
### CC: Note: NLSPATH = `/opt/developerstudio12.6/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat`
### command line files and options (expanded):
### -mt=yes -xtarget=native -xchip=broadwell -xcache=32/64/8/2:256/64/8/2:30720/64/20/24 -xarch=avx2_i -m32 -xdebuginfo=line,param,variable,tagtype,codetag,decl -xglobalize=yes -xpatchpadding=fix -Qoption driver -dconditional=yes -xkeep_unref=funcs,vars -verbose=diags -O3 -DNDEBUG -c xml_test.cc -I<some include> -I<some include> -oxml_test.o
/opt/developerstudio12.6/lib/compilers/bin/ccfe -D__SunOS_5_11 -D__SunOS_RELEASE=0x051100 -D__SUNPRO_CC=0x5150 -D__unix -D__SVR4__ -D__svr4__ -D__SVR4 -D__sun -D__sun__ -D__SunOS -D__i386 -D__i386__ -D__ORDER_LITTLE_ENDIAN__=1234 -D__ORDER_BIG_ENDIAN__=4321 -D__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__ -D__BUILTIN_VA_ARG_INCR -Dunix -Dsun -Di386 -D__FP_FAST_FMA__ -D__FP_FAST_FMAF__ -D_REENTRANT -D__SUN_PREFETCH -D__SUNPRO_CC_COMPAT=5 -I<some include> -I<some include> -I-xbuiltin -I/opt/developerstudio12.6/lib/compilers/include/CC/Cstd -I/opt/developerstudio12.6/lib/compilers/include/CC -I/opt/developerstudio12.6/lib/compilers/include/cc -DNDEBUG -ptf /tmp/ccfe.1620226479.15666.03.%1.%2 -ptx /opt/developerstudio12.6/bin/CC -ptk "-mt=yes -xtarget=native -m32 -xdebuginfo=line,param,decl,variable,tagtype,codetag -xglobalize=yes -xpatchpadding=fix -xkeep_unref=funcs,vars -verbose=diags -O3 -DNDEBUG -c -I<some include> -I<some include> " -compat=5 -xglobalize=yes -xdebuginfo=line,param,variable,tagtype,codetag,decl -instlib=/opt/developerstudio12.6/lib/compilers/libCstd.a -xdbggen=dwarf+usedonly+incl+line+param+variable+tagtype+codetag+decl -xF=%none -xbuiltin=%default -xldscope=global -xivdep=loop -xdepend -O3 -xarrayloc xml_test.cc -ptb xml_test.o -o /tmp/ccfe.1620226479.15666.01.ir 2> /tmp/ccfe.1620226479.15666.02.err
/opt/developerstudio12.6/lib/compilers/stdlibfilt -stderr < /tmp/ccfe.1620226479.15666.02.err
Your NLSPATH environment variable is incorrect.
/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat refers to /opt/lib/locale/%L/LC_MESSAGES/%N.cat instead of /opt/developerstudio12.6/lib/locale/%L/LC_MESSAGES/%N.cat because you have an extra .. element in it.
I fixed the issue just a while back by adding -filt=%none to the compiler options:
-mt -xtarget=native -m32 -filt=%none -g2 -verbose=template -errtags -library=iostream
I want to add these santizers to VS Code.
g++ -std=c++17 -Wshadow -Wall -o "%e" "%f" -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG
I'm using ubuntu. Help me how to do it.
I’m running Netbeans 7.4 on Mavericks. In order to be able to use gdb, compilation with the -ggdb flag seems to be necessary. However, even though I specify it through the Project’s Properties/Additional Options wizard, Netbeans also emits -g during compilation. Unfortunately, it turns out that this behavior has an adverse effect when the debugging session commences. Is there any way to force Netbeans not to also emit -g?
Output during compilation:
g++ -m64 -ggdb -c -g -Werror -std=c++11 -MMD -MP -MF "build/Debug/macport_GNU-MacOSX/main.o.d" -o build/Debug/macport_GNU-MacOSX/main.o main.cpp
mkdir -p dist/Debug/macport_GNU-MacOSX
g++ -m64 -ggdb -o dist/Debug/macport_GNU-MacOSX/executable build/Debug/macport_GNU-MacOSX/main.o
Alexander.Simon#oracle.com responded here [1] to set "Development Mode" to "No Flags", then specify -ggdb in the "Additional Options".
1 - https://netbeans.org/projects/cnd/lists/users/archive/2014-02/message/12
I'm building a package which provides many makefiles, each makefile has hard coded in side something like
CFLAGS = -g -O2 -Wall ...
CXXFLAGS = -g -O2 -Wall ...
I want to discard -g option but I don't want to edit all makefiles (even not automatically with sed or something similar). The configure script which comes with the package doesn't have enable/disable debug option but I can pass it CFLAGS and CXXFLAGS variables and it concatenates their values to the CFLAGS and CXXFLAGS variables respectively which include the -g option.
Is there an option which will discard -g in case it is specified? Something like
gcc -option-im-looking-for -g file.c -o file
Will build the binary file without debug symbols. I don't want to strip the binary, I want it to be created stripped.
You could negate the effect of -g by adding -g0. Saying
gcc -g -g0 foo.c -o file.o
would produce a binary identical to one obtained by saying
gcc foo.c -o foo.o
Quoting man gcc:
-glevel
...
Level 0 produces no debug information at all. Thus, -g0 negates
-g.
You don't need to edit makefiles. Just override the variables on the command line:
$ cat Makefile
CFLAGS = -g -Wall
all:
echo $(CFLAGS)
$ make
echo -g -Wall
-g -Wall
$ make CFLAGS=-Wall
echo -Wall
-Wall
When compiling my code I run into an issue as follows:
io.cpp:21: undefined reference to `PQconnectdb'
as well as all other instances of missing postgres function calls occurring in my code. Obviously this is a linking problem, I'm just not sure what the link issue is.
I'm compiling with the following:
mpiCC -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ decisioning_mpi.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ io.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ calculations.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ rules.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ Instrument.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ Backtest_Parameter_CPO.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ Backtest_Trade_CPO.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ Data_Bar.cpp
mpiCC -o decisioning_mpi -O2 -g -Wall -Werror -L/usr/lib -lm -lpq decisioning_mpi.o
io.o calculations.o rules.o Instrument.o Backtest_Parameter_CPO.o Backtest_Trade_CPO.o Data_Bar.o
It should be noted that this is the correct directory for libpq-fe.h and that I'm linking pq, so I'm not exactly sure why the postgres functions aren't linking correctly. I'm running Ubuntu 12.04 and installed psql (PostgreSQL) 9.1.6 from synaptic. As well I'll short circuit this, I am using #include "libpq-fe.h".
Any ideas on how I can get this linking issue resolved?
put -L/usr/lib/ -lm -lpq in the end of link command, the linker can then find the symbols
mpiCC -o decisioning_mpi -O2 -g -Wall -Werror decisioning_mpi.o io.o \
calculations.o rules.o Instrument.o Backtest_Parameter_CPO.o \
Backtest_Trade_CPO.o Data_Bar.o -L/usr/lib -lm -lpq
GCC Link Reference:
http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html