[4] | 1 | # Makefile de GRISLI avec gfortran |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | # FT options de compilation |
---|
| 5 | # LK options de link |
---|
| 6 | |
---|
| 7 | # Rappel de quelques options interessantes |
---|
| 8 | #------------------------------------------- |
---|
| 9 | # faire imperativement attention a l'arithmetique |
---|
| 10 | |
---|
| 11 | # -fbacktrace |
---|
| 12 | # Specify that, when a runtime error is encountered or a deadly |
---|
| 13 | # signal is emitted (segmentation fault, illegal instruction, bus |
---|
| 14 | # error or floating-point exception), the Fortran runtime library |
---|
| 15 | # should output a backtrace of the error. This option only has |
---|
| 16 | # influence for compilation of the Fortran main program. |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | # -fbounds-check |
---|
| 20 | # Enable generation of run-time checks for array subscripts and |
---|
| 21 | # against the declared minimum and maximum values. It also checks |
---|
| 22 | # array indices for assumed and deferred shape arrays against the |
---|
| 23 | # actual allocated bounds and ensures that all string lengths are |
---|
| 24 | # equal for character array constructors without an explicit typespec. |
---|
| 25 | # |
---|
| 26 | # -fcheck=bounds idem mais plus de possibilites dans le check |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | # Some checks require that -fbounds-check is set for the compilation |
---|
| 30 | # of the main program. |
---|
| 31 | |
---|
| 32 | # -ffree-line-length-n |
---|
| 33 | # Set column after which characters are ignored in typical free-form |
---|
| 34 | # lines in the source file. The default value is 132. n may be none, |
---|
| 35 | # meaning that the entire line is meaningful. -ffree-line-length-0 |
---|
| 36 | # means the same thing as -ffree-line-length-none. |
---|
| 37 | |
---|
| 38 | # -ffpe-trap=zero,overflow,underflow |
---|
| 39 | # tells Fortran to trap the listed floating point errors (fpe). Having |
---|
| 40 | # zero on the list means that if you divide by zero the code will die |
---|
| 41 | # rather than setting the result to +INFINITY and |
---|
| 42 | # continuing. Similarly, if overflow is on the list it will halt if |
---|
| 43 | # you try to store a number larger than can be stored for the type of |
---|
| 44 | # real number you are using because the exponent is too large. |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | # le directory dans lequel sont les compilateurs et MKL |
---|
| 50 | # DIRLOCAL=/usr/local variable d'environnement a definir dans .bash_profile |
---|
| 51 | |
---|
| 52 | # la version d'Aurelien, mais il faut changer le netcdf |
---|
| 53 | #DIRLOCAL=/site |
---|
| 54 | #NETCDFHOME=/site/netcdf |
---|
| 55 | #HDF5_HOME=/site/hdf5 |
---|
| 56 | |
---|
| 57 | # librairies |
---|
| 58 | |
---|
| 59 | NCDF_INC = /usr/include |
---|
| 60 | NCDF_LIB = -L/usr/lib -lnetcdff -lnetcdf |
---|
| 61 | # -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | MKL_LIB = -L/usr/local/lib -llapack -lblas # Misha |
---|
| 65 | |
---|
| 66 | export $MKL_LIB, $NCDF_INC, $NCDF_LIB |
---|
| 67 | |
---|
| 68 | ARITHM = -O3 -mtune=core2 -mfpmath=sse -ffpe-trap=zero,overflow # -fbacktrace -fcheck=bound |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | IFORT = gfortran |
---|
| 72 | |
---|
| 73 | #echo '-I$(NCDF_INC)' |
---|
| 74 | #echo $(NCDF_LIB) |
---|
| 75 | |
---|
| 76 | FT = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) $(NCDF_LIB) $(MKL_LIB) |
---|
| 77 | |
---|
| 78 | LK = $(IFORT) $(ARITHM) -I$(NCDF_INC) $(NCDF_LIB) $(MKL_LIB) |
---|
| 79 | |
---|
| 80 | F_NETCDF = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) $(NCDF_LIB) $(MKL_LIB) |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | |
---|
| 84 | Micha= -lsz -lm -lz # options Micha |
---|
| 85 | # -lsz pourrait etre (szlib) un outil de compression hdf5 mais n'est pas installe (non libre) |
---|
| 86 | # -lz pourrait etre (zlib) un outi de compression netcdf et est installe |
---|
| 87 | # -lm ??? |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | # les otions -m sont celles de gcc, voir aussi |
---|
| 91 | # http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options |
---|