29 | | = How to ... = |
| 29 | = How to find a segmentation error = |
| 30 | |
| 31 | |
| 32 | === Compilation for checking array dimension === |
| 33 | |
| 34 | 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. |
| 35 | |
| 36 | open the make file AA_make.gdef in the utility folder |
| 37 | {{{ |
| 38 | emacs ../util/AA_make.gdef |
| 39 | }}} |
| 40 | |
| 41 | adjust the settings of the compiler by adding 'check bounds'. The example is for a compilation on obelix |
| 42 | {{{ |
| 43 | #-Q- lxiv8 F_O = -O -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) |
| 44 | }}} |
| 45 | |
| 46 | remove the previous make file |
| 47 | {{{ |
| 48 | ./modeles/ORCHIDEE_OL/make clean |
| 49 | }}} |
| 50 | |
| 51 | install the new make file with the 'check bounds' option |
| 52 | {{{ |
| 53 | ./../../util/ins_make |
| 54 | }}} |
| 55 | |
| 56 | and compile |
| 57 | {{{ |
| 58 | ./../modeles/ORCHIDEE_OL/make |
| 59 | }}} |