1 | # Makefile de GRISLI - compilo et options pour Cat (pc-226) |
---|
2 | # FT options de compilation |
---|
3 | # LK options de link |
---|
4 | |
---|
5 | # Rappel de quelques options interessantes |
---|
6 | #------------------------------------------- |
---|
7 | # faire imperativement attention a l'arithmetique |
---|
8 | # -fpe0 s'arrete sur les floating point exception (sauf underflow) |
---|
9 | # -CB Performs run-time checking on array subscript and character substring expressions |
---|
10 | # -g pour debug |
---|
11 | # -pg pour le profiling |
---|
12 | # -traceback permet de connaitre la ligne qui plante |
---|
13 | |
---|
14 | # faire man ifort pour plus d'infos |
---|
15 | # debug Segmentation Faults SIGSEGV : https://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors |
---|
16 | |
---|
17 | # le directory dans lequel sont les compilateurs et MKL |
---|
18 | # DIRLOCAL=/usr/local variable d'environnement a definir dans .bash_profile |
---|
19 | |
---|
20 | |
---|
21 | # lit le nom du fichier param pour lancer sur r2d2 par une commande : echo jobparam | LBQ.... |
---|
22 | JOB = 'job' |
---|
23 | |
---|
24 | # mettre debug à 1 pour compiler avec options strictes |
---|
25 | debug ?= 0 |
---|
26 | |
---|
27 | # compilation avec ifort : |
---|
28 | ifeq ($(ifort),1) |
---|
29 | |
---|
30 | # librairies |
---|
31 | NCDF_INC = -I$(NETCDFHOME)/include |
---|
32 | NCDF_LIB = -L$(NETCDFHOME)/lib -lnetcdf -lnetcdff |
---|
33 | |
---|
34 | # utilisation de MKL : |
---|
35 | ifeq ($(mkl_c), 1) |
---|
36 | MKL_LIB = -L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm # MKL parallele |
---|
37 | # MKL_LIB = -L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm # MKL sequentiel |
---|
38 | MKL_INC = -I$(MKLROOT)/include |
---|
39 | endif |
---|
40 | |
---|
41 | IFORT= ifort |
---|
42 | |
---|
43 | ARITHMi = -O2 -fp-model strict -fimf-use-svml=true -mcmodel=medium -fimf-arch-consistency=true -shared-intel -traceback -qopenmp # ==> version à conserver avec exactement même resultats que -O0 avec ifort2020 !!! # -warn unused |
---|
44 | # (normalement reproductible) |
---|
45 | |
---|
46 | ifeq ($(debug), 1) |
---|
47 | ARITHM = $(ARITHMi) -g -p -traceback -CB -warn all |
---|
48 | else |
---|
49 | ARITHM = $(ARITHMi) -diag-disable warn |
---|
50 | endif |
---|
51 | |
---|
52 | #ARITHM = -fp-model precise -warn all -CU -CA # options pour une meilleure arithmetique (normalement reproductible) |
---|
53 | # ARITHM = -03 # trop brutal ne pas utiliser |
---|
54 | |
---|
55 | FT = $(IFORT) $(ARITHM) $(MKL_INC) #-traceback -CB #-g #-pg # -g # -pg -ipo !aurel : j'ai enleve -CB |
---|
56 | FTf = $(FT) |
---|
57 | LK = $(IFORT) $(ARITHM) # -traceback -CB # -g #-pg #-g # -pg |
---|
58 | F_NETCDF = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) # -traceback -CB #-g #-pg -ipo # -g |
---|
59 | #FT = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) # -traceback -CB #-g #-pg -ipo # -g |
---|
60 | |
---|
61 | # compilation avec gfortran et librairie BLAS |
---|
62 | else |
---|
63 | |
---|
64 | # librairies |
---|
65 | LIBSYS = /usr/lib/x86_64-linux-gnu |
---|
66 | INCSYS = -I/usr/include # Ubuntu |
---|
67 | # INCSYS = /usr/lib64/gfortran/modules # Fedora |
---|
68 | NCDF_INC = $(INCSYS) |
---|
69 | NCDF_LIB = -L$(LIBSYS) -lnetcdff -lnetcdf |
---|
70 | |
---|
71 | IFORT= gfortran |
---|
72 | |
---|
73 | ARITHMi = -O2 -ffree-line-length-none -mtune=native -mfpmath=sse |
---|
74 | ARITHMf = -O2 -mtune=native -mfpmath=sse |
---|
75 | |
---|
76 | ifeq ($(debug), 1) |
---|
77 | ARITHM = $(ARITHMi) -g -pg -Wall -fno-align-commons -p -ggdb -ffpe-trap=invalid,zero,overflow,underflow -fbacktrace -fcheck=all |
---|
78 | else |
---|
79 | ARITHM = $(ARITHMi) |
---|
80 | endif |
---|
81 | |
---|
82 | # debug : -g -CB -fp-stack-check -check all |
---|
83 | FT = $(IFORT) $(ARITHM) -c |
---|
84 | FTf = $(IFORT) $(ARITHMf) -c |
---|
85 | LK = $(IFORT) $(ARITHM) |
---|
86 | F_NETCDF = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) |
---|
87 | endif |
---|
88 | |
---|
89 | |
---|
90 | |
---|