Changeset 64 for trunk/SOURCES


Ignore:
Timestamp:
05/18/16 10:42:30 (8 years ago)
Author:
dumas
Message:

Only one Makefile compatible with ifort and gfortran

Location:
trunk/SOURCES
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SOURCES/Fichiers-parametres/Makefile.tof-lsce3130.inc

    r62 r64  
    1919 
    2020# lit le nom du fichier param pour lancer sur r2d2 par une commande :   echo jobparam | LBQ.... 
    21  
    2221JOB = 'job' 
    2322 
     23# mettre debug à 1 pour compiler avec options strictes 
     24debug ?= 0 
     25 
     26# compilation avec ifort : 
     27ifeq ($(ifort),1) 
    2428 
    2529# librairies 
     30        NCDF_INC  = $(NETCDFHOME)/include 
     31        NCDF_LIB  = -L$(NETCDFHOME)/lib -lnetcdf -lnetcdff 
    2632 
    27 NCDF_INC  = $(NETCDFHOME)/include 
    28 NCDF_LIB  = -L$(NETCDFHOME)/lib -lnetcdf -lnetcdff 
     33# utilisation de MKL : 
     34        ifeq ($(mkl_c), 1) 
     35                MKL_LIB = -L$MKLROOT/lib/em64t -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread 
     36                export $MKL_LIB 
     37        endif 
    2938 
     39        IFORT= ifort 
    3040 
    31 #MKL_LIB   = -L$(DIRLOCAL)/intel/mkl9/lib/32 -lmkl_lapack -lmkl_ia32 -lguide -lpthread 
    32 #MKL_LIB  = -L$(DIRLOCAL)/intel/mkl10/lib/32  -lmkl -lguide -lpthread #  -lmklapack 
    33  
    34 ifeq ($(mkl_c), 1) 
    35     MKL_LIB = -L$MKLROOT/lib/em64t -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread 
    36     export $MKL_LIB 
    37 endif 
    38  
    39 IFORT= ifort 
    40  
    41 ARITHM    = -O2 -fp-model precise  -heap-arrays -traceback -mcmodel=medium -diag-disable warn #  -warn -traceback   -CB  -g  # options pour une meilleure arithmetique 
     41        ARITHMi    = -O2 -fp-model precise  -heap-arrays -traceback -mcmodel=medium -diag-disable warn #  -warn -traceback   -CB  -g  # options pour une meilleure arithmetique 
    4242                                                                      # (normalement reproductible) 
     43    ifeq ($(debug), 1) 
     44                ARITHM    = $(ARITHMi) -CB -g -traceback -warn all 
     45        else 
     46                ARITHM    = $(ARITHMi) 
     47        endif 
     48                 
    4349#ARITHM    =  -fp-model precise -warn all -CU -CA # options pour une meilleure arithmetique (normalement reproductible) 
    4450# ARITHM = -03                    # trop brutal ne pas utiliser 
    4551 
     52        FT        = $(IFORT) $(ARITHM) #-traceback   -CB  #-g #-pg  # -g # -pg -ipo !aurel : j'ai enleve -CB 
     53        LK        = $(IFORT) $(ARITHM) -i_dynamic # -traceback   -CB # -g  #-pg   #-g #  -pg 
     54        NETCDFINCLUDE = -I$(NCDF_INC) 
     55        F_NETCDF  = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) # -traceback  -CB   #-g #-pg -ipo # -g 
     56        #FT        = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) # -traceback  -CB  #-g #-pg -ipo # -g 
     57         
     58# compilation avec gfortran et librairie BLAS 
     59else 
    4660 
     61# librairies 
     62        LIBSYS = /usr/lib 
     63#       INCSYS = /usr/include  # Ubuntu 
     64        INCSYS = /usr/lib64/gfortran/modules  # Fedora 
     65        NCDF_INC  = $(INCSYS) 
     66        NCDF_LIB  = -L$(LIBSYS) -lnetcdff -lnetcdf 
    4767 
    48 FT        = $(IFORT) $(ARITHM) #-traceback   -CB  #-g #-pg  # -g # -pg -ipo !aurel : j'ai enleve -CB 
    49 LK        = $(IFORT) $(ARITHM)  -i_dynamic   # -traceback   -CB # -g  #-pg   #-g #  -pg 
    50 NETCDFINCLUDE = -I$(NCDF_INC) 
    51 F_NETCDF  = $(IFORT) $(ARITHM) -c  -I$(NCDF_INC) # -traceback  -CB   #-g #-pg -ipo # -g 
    52 #FT        = $(IFORT) $(ARITHM) -c  -I$(NCDF_INC) # -traceback  -CB  #-g #-pg -ipo # -g 
    53 F_90      = -w90 
     68        IFORT= gfortran 
     69 
     70        ARITHMi    = -O2 -ffree-line-length-none -mtune=native -mfpmath=sse 
     71 
     72        ifeq ($(debug), 1) 
     73                ARITHM  = $(ARITHMi) -g -pg -Wall -fno-align-commons -p -ggdb -ffpe-trap=invalid,zero,overflow,underflow -fbacktrace -fcheck=all 
     74        else 
     75                ARITHM = $(ARITHMi) 
     76        endif 
     77 
     78# debug : -g -CB -fp-stack-check -check all 
     79        FT        = $(IFORT) $(ARITHM) -c 
     80        LK        = $(IFORT) $(ARITHM) 
     81        NETCDFINCLUDE = -I$(NCDF_INC) 
     82        F_NETCDF  = $(IFORT) $(ARITHM) -c -I$(NCDF_INC) 
     83endif 
    5484 
    5585 
    5686 
    57  
  • trunk/SOURCES/Makefile

    r34 r64  
    1414# Choice for librairies (mkl_c = 1 = MKL,  = 0 = BLAS) 
    1515# NOTA: mkl_c = 1 with ifort = 0 ignores the MKL and uses BLAS anyhow 
    16 mkl_c ?= 1 
     16mkl_c ?= 0 
    1717 
    18 ifeq ($(ifort),1) 
     18#ifeq ($(ifort),1) 
    1919  include Fichiers-parametres/Makefile.tof-lsce3130.inc 
    20 else 
    21   include Fichiers-parametres/Makefile.dmr-lsce3027.inc 
    22 endif 
     20#else 
     21#  include Fichiers-parametres/Makefile.dmr-lsce3027.inc 
     22#endif 
    2323 
    2424#     Compilation (le corps du Makefile) 
    2525#------------------------------------------- 
    2626 
    27 ifeq ($(ifort),1) 
     27#ifeq ($(ifort),1) 
    2828  include Makefile.grisli.inc 
    29 else 
    30   include Makefile.grisli-gfortran.inc 
    31 endif 
     29#else 
     30#  include Makefile.grisli-gfortran.inc 
     31#endif 
  • trunk/SOURCES/Makefile.grisli.inc

    r62 r64  
    303303 
    304304ifeq ($(mkl_c), 0) 
    305 Liste_BLAS = LAPACK/band.o LAPACK/reduc.o \ 
    306         BLAS/isamax.o BLAS/lsame.o BLAS/scopy.o \ 
    307         BLAS/slamch.o BLAS/slabad.o BLAS/slange.o \ 
    308         BLAS/slassq.o BLAS/sgeqrf.o BLAS/sormqr.o \ 
    309         BLAS/strmv.o BLAS/slarft.o \ 
    310         BLAS/ilaslr.o BLAS/ilaslc.o BLAS/strmm.o \ 
    311         BLAS/slarfb.o BLAS/slapy2.o BLAS/slarfg.o BLAS/slarf.o \ 
    312         BLAS/sgeqr2.o BLAS/sorm2r.o BLAS/snrm2.o \ 
    313         BLAS/slaqps.o BLAS/slaqp2.o BLAS/sgeqp3.o \ 
    314         BLAS/slaset.o BLAS/slaisnan.o BLAS/sisnan.o \ 
    315         BLAS/slascl.o BLAS/sdot.o BLAS/slaic1.o \ 
    316         BLAS/slarzb.o BLAS/slarzt.o \ 
    317         BLAS/saxpy.o BLAS/slarz.o BLAS/sormr3.o \ 
    318         BLAS/sormrz.o BLAS/slatrz.o BLAS/stzrzf.o BLAS/sgelsy.o \ 
    319         BLAS/sgbmv.o BLAS/sgemm.o BLAS/sgemv.o  BLAS/sger.o \ 
    320         BLAS/sscal.o BLAS/sswap.o BLAS/stbsv.o \ 
    321         BLAS/strsm.o BLAS/xerbla.o 
     305Liste_BLAS = band.o reduc.o \ 
     306        isamax.o lsame.o scopy.o \ 
     307        slamch.o slabad.o slange.o \ 
     308        slassq.o sgeqrf.o sormqr.o \ 
     309        strmv.o slarft.o \ 
     310        ilaslr.o ilaslc.o strmm.o \ 
     311        slarfb.o slapy2.o slarfg.o slarf.o \ 
     312        sgeqr2.o sorm2r.o snrm2.o \ 
     313        slaqps.o slaqp2.o sgeqp3.o \ 
     314        slaset.o slaisnan.o sisnan.o \ 
     315        slascl.o sdot.o slaic1.o \ 
     316        slarzb.o slarzt.o \ 
     317        saxpy.o slarz.o sormr3.o \ 
     318        sormrz.o slatrz.o stzrzf.o sgelsy.o \ 
     319        sgbmv.o sgemm.o sgemv.o  sger.o \ 
     320        sscal.o sswap.o stbsv.o \ 
     321        strsm.o xerbla.o 
    322322 
    323323endif 
     
    400400# BLAS : 
    401401%.o : BLAS/%.f 
    402         $(FT) $(NETCDFINCLUDE) -c BLAS/$*.f 
    403          
    404 # Reduc et band: 
    405 band.o : LAPACK/band.f 
    406         $(FT) $(NETCDFINCLUDE) -c $*.f 
    407 reduc.o : LAPACK/reduc.f 
    408         $(FT) $(NETCDFINCLUDE) -c $*.f 
     402        $(FT) -c BLAS/$*.f 
     403         
     404# Reduc et band:    
     405%.o : LAPACK/%.f 
     406        $(FT) -c LAPACK/$*.f 
    409407 
    410408 
     
    431429        $(Liste_ANT15-LBq) \ 
    432430        $(diagnoshelf) $(Liste_Netcdf) \ 
    433         $(routines_communes) steps_time_loop.o $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) 
     431        $(routines_communes) steps_time_loop.o $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) 
    434432 
    435433Recul_ice2sea : $(Dim_ANT15-LBq) $(mod_dim_communs)  \ 
     
    451449        $(Liste_ANT15-LBq) \ 
    452450        $(diagnoshelf) $(Liste_Netcdf) \ 
    453         $(routines_communes) steps_time_loop.o $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) 
     451        $(routines_communes) steps_time_loop.o $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) 
    454452 
    455453 
     
    464462        $(mod_ell)  $(Liste_mismip_3D_5) \ 
    465463        $(Liste_Netcdf) $(Liste_mismip_post_ncdf) $(diagnoshelf) \ 
    466         $(routines_communes) steps_time_loop.o $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) 
     464        $(routines_communes) steps_time_loop.o $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) 
    467465 
    468466Grice2sea : $(Dim_GrIce2sea) $(mod_dim_communs)   \ 
     
    474472        $(diagnoshelf) \ 
    475473        $(Liste_Netcdf) \ 
    476         $(routines_communes) steps_time_loop.o $(routine_elliptiques)  
     474        $(routines_communes) steps_time_loop.o \ 
     475        $(routine_elliptiques) \ 
     476        $(Liste_BLAS) 
    477477 
    478478        $(LK) -o ../bin/Grice2sea \ 
     
    486486        $(Liste_Netcdf) \ 
    487487        $(routines_communes) steps_time_loop.o \ 
    488         $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) 
     488        $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) $(Liste_BLAS) 
    489489 
    490490Grice2sea_iterbeta : $(Dim_GrIce2sea) $(mod_dim_communs)   \ 
     
    497497        $(Liste_Netcdf) \ 
    498498        $(routines_communes) steps_time_loop_avec_iterbeta.o \ 
    499         $(routine_elliptiques)  
     499        $(routine_elliptiques) \ 
     500        $(Liste_BLAS) 
    500501 
    501502        $(LK) -o ../bin/Grice2sea_iterbeta \ 
     
    509510        $(Liste_Netcdf) \ 
    510511        $(routines_communes) steps_time_loop_avec_iterbeta.o \ 
    511         $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) 
     512        $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) $(Liste_BLAS) 
    512513 
    513514Hemin-40 : $(Dim_hemin40) $(mod_dim_communs) \ 
     
    533534        $(Liste_Netcdf) \ 
    534535        $(routines_communes) steps_time_loop.o \ 
    535         $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) $(Liste_BLAS) 
     536        $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) $(Liste_BLAS) 
    536537 
    537538Hemin-15 : $(Dim_hemin15) $(mod_dim_communs) \ 
     
    544545        $(Liste_Netcdf) \ 
    545546        $(routines_communes) steps_time_loop.o \ 
    546         $(routine_elliptiques) 
     547        $(routine_elliptiques) \ 
     548        $(Liste_BLAS) 
    547549 
    548550        $(LK) -o  ../bin/Hemin-15 \ 
     
    556558        $(Liste_Netcdf) \ 
    557559        $(routines_communes) steps_time_loop.o \ 
    558         $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) 
     560        $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) $(Liste_BLAS) 
    559561 
    560562Greeneem15 : $(Dim_greeneem15) $(mod_dim_communs) \ 
     
    567569        $(Liste_Netcdf) \ 
    568570        $(routines_communes) steps_time_loop.o \ 
    569         $(routine_elliptiques)  
     571        $(routine_elliptiques) \ 
     572        $(Liste_BLAS) 
    570573 
    571574        $(LK) -o ../bin/Greeneem15 \ 
     
    579582        $(Liste_Netcdf) \ 
    580583        $(routines_communes) steps_time_loop.o \ 
    581         $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) 
     584        $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) $(Liste_BLAS) 
    582585 
    583586Ant-40 : $(Dim_Ant40) $(mod_dim_communs) \ 
     
    603606        $(Liste_Netcdf) \ 
    604607        $(routines_communes) steps_time_loop.o \ 
    605         $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) $(Liste_BLAS) 
     608        $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) $(Liste_BLAS) 
    606609         
    607610Snowball : $(Dim_Snowball) $(mod_dim_communs) \ 
     
    627630        $(Liste_Netcdf) \ 
    628631        $(routines_communes) steps_time_loop.o \ 
    629         $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) $(Liste_BLAS) 
     632        $(routine_elliptiques) $(NCDF_LIB) $(MKL_LIB) $(Liste_BLAS) 
    630633         
    631634         
Note: See TracChangeset for help on using the changeset viewer.