source: branches/GRISLIv3/SOURCES/Fichiers-parametres/Makefile.tof-lsce3130.inc @ 497

Last change on this file since 497 was 497, checked in by dumas, 5 weeks ago

Makefile : NETCDFHOME directory for LSCE

File size: 3.4 KB
Line 
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....
22JOB = 'job'
23
24# mettre debug à 1 pour compiler avec options strictes
25debug ?= 0
26
27# compilation avec ifort :
28ifeq ($(ifort),1)
29
30# librairies
31        NETCDFHOME = /usr/local/install/netcdf-4.3.2
32        NCDF_INC  = -I$(NETCDFHOME)/include
33        NCDF_LIB  = -L$(NETCDFHOME)/lib -lnetcdf -lnetcdff
34
35# utilisation de MKL :
36        ifeq ($(mkl_c), 1)
37                MKL_LIB = -L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm  # MKL parallele
38#               MKL_LIB =  -L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm           # MKL sequentiel
39                MKL_INC = -I$(MKLROOT)/include
40        endif
41
42        IFORT= ifort
43
44        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
45                                                                      # (normalement reproductible)
46                                                                     
47    ifeq ($(debug), 1)
48                ARITHM    = $(ARITHMi) -g -p -traceback -CB -warn all
49        else
50                ARITHM    = $(ARITHMi) -diag-disable warn
51        endif
52               
53#ARITHM    =  -fp-model precise -warn all -CU -CA # options pour une meilleure arithmetique (normalement reproductible)
54# ARITHM = -03                    # trop brutal ne pas utiliser
55
56        FT        = $(IFORT) $(ARITHM) $(MKL_INC) #-traceback   -CB  #-g #-pg  # -g # -pg -ipo !aurel : j'ai enleve -CB
57        FTf       = $(FT)
58        LK        = $(IFORT) $(ARITHM) # -traceback   -CB # -g  #-pg   #-g #  -pg
59        F_NETCDF  = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) # -traceback  -CB   #-g #-pg -ipo # -g
60        #FT        = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) # -traceback  -CB  #-g #-pg -ipo # -g
61       
62# compilation avec gfortran et librairie BLAS
63else
64
65# librairies
66        NETCDFHOME = /usr
67        LIBSYS = $(NETCDFHOME)/lib  # Ubuntu
68#       LIBSYS = /usr/lib/x86_64-linux-gnu  # Ubuntu
69        INCSYS = -I $(NETCDFHOME)/include  #Ubuntu
70#       INCSYS = -I/usr/include  # Ubuntu
71#       INCSYS = /usr/lib64/gfortran/modules  # Fedora
72        NCDF_INC  = $(INCSYS)
73        NCDF_LIB  = -L$(LIBSYS) -lnetcdff -lnetcdf
74
75        IFORT= gfortran
76
77        ARITHMi    = -O2 -ffree-line-length-none -mtune=native -mfpmath=sse
78        ARITHMf    = -O2 -mtune=native -mfpmath=sse
79
80        ifeq ($(debug), 1)
81                ARITHM  = $(ARITHMi) -g -pg -Wall -fno-align-commons -p -ggdb -ffpe-trap=invalid,zero,overflow,underflow -fbacktrace -fcheck=all
82        else
83                ARITHM = $(ARITHMi)
84        endif
85
86# debug : -g -CB -fp-stack-check -check all
87        FT        = $(IFORT) $(ARITHM) -c
88        FTf       = $(IFORT) $(ARITHMf) -c
89        LK        = $(IFORT) $(ARITHM)
90        F_NETCDF  = $(IFORT) $(ARITHM) -c -I$(NCDF_INC)
91endif
92
93
94
Note: See TracBrowser for help on using the repository browser.