Changeset 1590


Ignore:
Timestamp:
Nov 24, 2011, 9:30:06 AM (12 years ago)
Author:
Ehouarn Millour
Message:

Added possibility to compile with ifort.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install.sh

    r1589 r1590  
    3939
    4040
    41 real=r4
     41#real=r4
    4242real=r8
    4343
     
    5858veget=0
    5959bench=1
    60 ## compilo=pgf90 ou g95 ou gfortran sur PC linux
     60## compilo=pgf90 ou g95 ou gfortran ou ifort sur PC linux
    6161compilo=gfortran
    6262pclinux=1
     
    7777   if [ $real = r8 ] ; then OPTPREC="-fdefault-real-8 -DNC_DOUBLE" ; fi
    7878   OPTIM='-O3'
    79 else #pgf90
    80    if [ $real = r8 ] ; then echo "Option real 8 non disponible pour pgf90" ; exit ; fi
     79elif [ $compilo = pgf90 ] ; then
     80   if [ $real = r8 ] ; then OPTPREC="-r8 -DNC_DOUBLE" ; fi
    8181   OPTIM='-O2 -Munroll -Mnoframe -Mautoinline -Mcache_align'
     82   # with pgf90, compile with fcm
     83   compile_with_fcm=1
     84else
     85   # ifort
     86   if [ $real = r8 ] ; then OPTPREC="-real-size 64 -DNC_DOUBLE" ; fi
     87   OPTIM="-O2 -ip -mkl=sequential -align all -static "
     88   # with ifort, compile with fcm
     89   compile_with_fcm=1
    8290fi
    8391OPTIMGCM="$OPTIM $OPTPREC"
     
    220228   export F90=pgf90
    221229   export F90FLAGS="$OPTIMNC"
     230elif [ $compilo = ifort ] ; then
     231   export CPP="icc -E"
     232   export F77=ifort
     233   export FFLAGS="-O2 -ip -fpic -mcmodel=large"
     234   export F90=ifort
     235   export FCFLAGS="-O2 -ip -fpic -mcmodel=large"
     236   export CC=icc
     237   export CFLAGS="-O2 -ip -fpic -mcmodel=large"
     238   export CXX=icpc
     239   export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"
    222240else
    223241   echo Le compilateur $compilo pas prevu ; exit
     
    261279elif [ $compilo = g95 ] ; then
    262280  fmod='fmod='
     281elif [ $compilo = ifort ] ; then
     282  fmod='module '
    263283else # gfortran
    264284  fmod='I '
     
    366386-e 's/g95/gfortran/g' \
    367387-e 's/-fmod=/-I/g' \
     388-e 's/-fno-second-underscore//' -e 's/-fstatic//' \
     389-e 's/-lparallel//' \
     390-e 's/-lorglob//' \
     391-e 's/-ffixed-form//' -e 's/-ffree-form//' \
     392-e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIMGCM"\"'/' makegcm.orig >| makegcm
     393  elif [ $compilo = ifort ] ; then
     394sed \
     395-e 's:\#setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \
     396-e 's:\#setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \
     397-e 's:setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \
     398-e 's:setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \
     399-e 's/set FC_LINUX.*.$/set FC_LINUX='$compilo'/' \
     400-e 's/g95/ifort/g' \
     401-e 's/-fmod=/-module /g' \
    368402-e 's/-fno-second-underscore//' -e 's/-fstatic//' \
    369403-e 's/-lparallel//' \
     
    405439cd arch
    406440# fichier arch-local.path
    407 echo "NETCDF_LIBDIR=\"-L/${ncdfdir}/lib -lnetcdf\"" > arch-local.path
    408 echo "NETCDF_INCDIR=-I/${ncdfdir}/include" >> arch-local.path
     441echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdf\"" > arch-local.path
     442echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path
    409443echo 'IOIPSL_INCDIR=$LMDGCM/../../lib' >> arch-local.path
    410444echo 'IOIPSL_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
     
    415449sed -e s:"%COMPILER            pgf95":"%COMPILER            g95":1 \
    416450    -e s:"%LINK                pgf95":"%LINK                g95":1 \
    417     -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         ":1 \
    418     -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTIMGCM":1 \
     451    -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         $OPTIM":1 \
     452    -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTPREC":1 \
    419453   arch-linux-32bit.fcm > arch-local.fcm
    420454   if [ $real = r8 ] ; then
     
    426460sed -e s:"%COMPILER            pgf95":"%COMPILER            gfortran":1 \
    427461    -e s:"%LINK                pgf95":"%LINK                gfortran":1 \
    428     -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         ":1 \
    429     -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTIMGCM":1 \
     462    -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         $OPTIM":1 \
     463    -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTPREC":1 \
    430464   arch-linux-32bit.fcm > arch-local.fcm
    431465   if [ $real = r8 ] ; then
     
    436470elif [ $compilo = pgf90 ] ; then
    437471sed -e s:"-Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2":" ":1 \
    438     -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         ":1 \
    439     -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTIMGCM":1 \
     472    -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         $OPTIM":1 \
     473    -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTPREC":1 \
    440474   arch-linux-32bit.fcm > arch-local.fcm
    441    if [ $real = r8] ; then
     475   if [ $real = r8 ] ; then
     476     sed -e s:"%FPP_DEF             ":"%FPP_DEF             NC_DOUBLE":1 \
     477     arch-local.fcm > arch-local.fcm.new
     478     mv -f arch-local.fcm.new arch-local.fcm
     479   fi
     480elif [ $compilo = ifort ] ; then
     481sed -e s:"%COMPILER            pgf95":"%COMPILER            ifort":1 \
     482    -e s:"%LINK                pgf95":"%LINK                ifort":1 \
     483    -e s:"-Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2":" ":1 \
     484    -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         $OPTIM":1 \
     485    -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTPREC":1 \
     486    -e s:"%DEBUG_FFLAGS        -g -O0 -Kieee -Ktrap=fp -Mbounds":"%DEBUG_FFLAGS        -g -no-ftz -traceback -ftrapuv -fp-stack-check -check":1 \
     487   arch-linux-32bit.fcm > arch-local.fcm
     488   if [ $real = r8 ] ; then
    442489     sed -e s:"%FPP_DEF             ":"%FPP_DEF             NC_DOUBLE":1 \
    443490     arch-local.fcm > arch-local.fcm.new
     
    470517        ./makelmdz_fcm -d ${grid_resolution} -arch local -v $ok_veget gcm
    471518else
    472 # Compilation avec makegcm
     519# Compilation avec makegcm:
     520#       3 times! because some dependecies are not well resolved with makegcm
    473521        ./makegcm -d ${grid_resolution} -v $ok_veget gcm
    474522        ./makegcm -d ${grid_resolution} -v $ok_veget gcm
Note: See TracChangeset for help on using the changeset viewer.