OpenBLAS
OpenBLAS copied to clipboard
Makefiles need to turn off optimizations for DEBUG=1
It makes it challenging to debug issues when optimizations are turned on and using gdb. All optimizations should be set to -O0 for DEBUG=1.
I guess that depends on target on compiler, at least "-O2 -g" is a valid combination of options and it has been that way "forever". You can set COMMON_OPT=-O0 if needed.
Yes, it is a valid combo but within gdb you can not inspect a lot of variables when any optimization is turned on.
Every time I want to use gdb, I have to manually modify the optimization flags in Makefile.system and Makefile.power.
It would be nice to not have to do this. I'll probably submit a PR later with the changes to Makefile.power
Something like this
ifeq ($(DEBUG), 1)
OPT_FLAGF = -O0
OPT_FLAG1 = -O0
OPT_FLAG2 = -O0
else
OPT_FLAGF = -Ofast
OPT_FLAG1 = -O1
OPT_FLAG2 = -O2
endif
OK. Makefile.power is different from the other Makefile.<arch> in this regard, which is probably not a good idea anyway.
should be fixed by #4979