wiki:Documentation/UserGuide/SegmentationFault

How to find a segmentation error

Compilation for checking array dimension

Segmentation errors indicate issues with the memory which are often caused by ill-defined array dimensions. The dimension of your arrays can be checked by changing the settings of the compiler. Note that compiling will take longer but that running the code will take a lot longer! Run the code on a single point test-case to avoid wasting computing resources.

open the make file AA_make.gdef in the utility folder

emacs ../util/AA_make.gdef

adjust the settings of the compiler by adding 'check bounds'. The example is for a compilation on obelix

#-Q- lxiv8    F_O = -O -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR)

The compilation could also be set to check for dependencies by adding 'traceback'. The example is for a compilation on obelix

#-Q- lxiv8    F_O = -O -check bounds -traceback $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR)

remove the previous make file

  /modeles/ORCHIDEE_OL/make clean

install the new make file with the 'check bounds' option

./../../util/ins_make

and compile

  /../modeles/ORCHIDEE_OL/make
Last modified 6 years ago Last modified on 10/24/12 11:51:24