A segmentation fault in GRAPES-3DVAR has been tortured me for several weeks. Tracing the error layers by layers, I actually getting familiar with the code flow.
Compared with the print
, write
, or other breakpoint debug tricks, the final hit was done by the debug mode of the compiler. The used debug flags are as follows:
FCDEBUG = -O0 -check bounds -g -traceback
-O0
The optimization option level with O0 will turn off every optimizations.-check bounds
This is a quite important flag, which will check if the query beyond an array’s boundary. If true, using this flag will throw an segfault with exactly which array crashes. Our problem solved with the assistance of -check bounds
option (This option will severally influence the efficiency).-g -traceback
This option will throw a stack traceback of the error, helping to locate which line crashes the program.Updated 2019-08-06
The following environmental variable controll the grep highlight color.
export GREP_OPTIONS='--color=auto' GREP_COLOR='31'
Argument -n
will show line number in grep results. Thus alias for the command is useful.
alias grep='grep -n'
Write them into your .bashrc
, source and then enjoy it!
Updated 2019-07-19
Now I start my internship! Totally new vision into regional modeling and data assimilation. When deal with the radar data, I need to compile a software SOLO2.
As mentioned in the github page:
Soloii can be built and run on a 64-bit Linux or OS X machine, although it will explicitly build a 32-bit binary.
It is quite a job to install every lib in the ia32 mode. Note that CentOS 6/7 uses i686 as the suffix to mark the ia32 version, and both the lib itself and lib-devel need to be installed.
When $make, we still got some warnings like
skipping incompatible /usr/lib64/libncurses.so when searching for -lncurses
That is not actually a problem unless an error happens.
Updated 2019-07-15