Ignore:
Timestamp:
Mar 5, 2013, 10:00:50 AM (11 years ago)
Author:
Ehouarn Millour
Message:

Update of "install.sh" script to make it work on Ada.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install.sh

    r1710 r1731  
    102102   # ifort
    103103   if [ $real = r8 ] ; then OPTPREC="-real-size 64 -DNC_DOUBLE" ; fi
    104    OPTIM="-O2 -ip -mkl=sequential -align all -static "
     104   OPTIM="-O2 -fp-model strict -ip -align all "
    105105   # with ifort, compile with fcm
    106106   compile_with_fcm=1
     
    116116
    117117##########################################################################
    118 # If installing on know machines such as NEC Brodie
     118# If installing on know machines such as IBM x3750 (Ada)
    119119# at IDRIS, don't check for available software and don"t install netcdf
    120 if [ $hostname = brodie ] ; then
    121 netcdf=0
    122 check_linux=0
    123 pclinux=0
     120if [ $hostname = ada338 ] ; then
     121  netcdf=0 # no need to recompile netcdf, alreday available
     122  check_linux=0
     123  pclinux=0
     124  ioipsl=0 # no need to recompile ioipsl, already available
     125  #netcdf="/smplocal/pub/NetCDF/4.1.3"
     126  compilo="ifort"
     127  fmod='module '
     128  if [ $real = r8 ] ; then OPTPREC="-real-size 64 -DNC_DOUBLE" ; fi
     129  OPTIM="-O2 -fp-model strict -ip -axAVX,SSE4.2 -align all "
     130  OPTIMGCM="$OPTIM $OPTPREC"
    124131fi
    125132##########################################################################
     
    266273make check
    267274make install
    268 fi
     275fi # of if [ $netcdf = 1 ]
    269276
    270277echo OK2 ioipsl=$ioipsl
    271278echo '##########################################################'
    272 echo Installing MODIPSL, the installation package manager for the
    273 echo IPSL models and tools
     279echo 'Installing MODIPSL, the installation package manager for the '
     280echo 'IPSL models and tools'
    274281echo '##########################################################'
    275282
     
    281288
    282289if [ $ioipsl = 1 ] ; then
    283 cd $MODEL/modipsl
    284 \rm -r lib/*
    285 
    286 cd util
    287 
    288 if [ $compilo = pgf90 ] ; then
    289   fmod='module '
    290 elif [ $compilo = g95 ] ; then
    291   fmod='fmod='
    292 elif [ $compilo = ifort ] ; then
    293   fmod='module '
    294 else # gfortran
    295   fmod='I '
    296 fi
    297 cp AA_make.gdef AA_make.orig
    298 sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
    299 sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $compilo -c": \
    300 -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
    301 -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
    302 -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdf:' \
    303 -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
    304 -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
    305 tmp >| AA_make.gdef
    306 
    307 
    308 if [ "$use_shell" = "ksh" ] ; then
     290  cd $MODEL/modipsl
     291  \rm -r lib/*
     292
     293  cd util
     294
     295  if [ $compilo = pgf90 ] ; then
     296    fmod='module '
     297  elif [ $compilo = g95 ] ; then
     298    fmod='fmod='
     299  elif [ $compilo = ifort ] ; then
     300    fmod='module '
     301  else # gfortran
     302    fmod='I '
     303  fi
     304  cp AA_make.gdef AA_make.orig
     305  sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
     306  sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $compilo -c": \
     307  -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
     308  -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
     309  -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdf:' \
     310  -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
     311  -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
     312  tmp >| AA_make.gdef
     313
     314
     315  if [ "$use_shell" = "ksh" ] ; then
     316    if [ "$pclinux" = 1 ] ; then
     317       ./ins_make -t g95 # We use lines for g95 even for the other compilers
     318    fi
     319  else # bash
     320    sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash
     321    chmod u=rwx ins_make.bash
     322    if [ "$pclinux" = 1 ] ; then
     323    ./ins_make.bash -t g95 # We use lines for g95 even for the other compilers
     324    else
     325    ./ins_make.bash
     326    fi
     327  fi # of if [ "$use_shell" = "ksh" ]
     328
     329  echo '##########################################################'
     330  echo 'Compiling IOIPSL, the interface library with Netcdf'
     331  echo '##########################################################'
     332
     333  cd $MODEL/modipsl/modeles/IOIPSL/src
     334  if [ "$use_shell" = "bash" ] ; then
     335    cp Makefile Makefile.ksh
     336    sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
     337  fi
    309338  if [ "$pclinux" = 1 ] ; then
    310      ./ins_make -t g95 # We use lines for g95 even for the other compilers
    311   fi
    312 else # bash
    313   sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash
    314   chmod u=rwx ins_make.bash
    315   if [ "$pclinux" = 1 ] ; then
    316   ./ins_make.bash -t g95 # We use lines for g95 even for the other compilers
    317   else
    318   ./ins_make.bash
    319   fi
    320 fi
    321 
    322 echo '##########################################################'
    323 echo Compiling IOIPSL, the interface library with Netcdf
    324 echo '##########################################################'
    325 
    326 cd $MODEL/modipsl/modeles/IOIPSL/src
    327 if [ "$use_shell" = "bash" ] ; then
    328   cp Makefile Makefile.ksh
    329   sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
    330 fi
    331 if [ "$pclinux" = 1 ] ; then
    332   # Build IOIPSL modules and library
    333   make clean
     339    # Build IOIPSL modules and library
     340    make clean
     341    make
     342    if [ $compilo = gfortran ] ; then # copy module files to lib
     343      cp -f *.mod ../../../lib
     344    fi
     345    # Build IOIPSL tools (ie: "rebuild", if present)
     346    if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then
     347      cd $MODEL/modipsl/modeles/IOIPSL/tools
     348      # adapt Makefile & rebuild script if in bash
     349      if [ "$use_shell" = "bash" ] ; then
     350        cp Makefile Makefile.ksh
     351        sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
     352        cp rebuild rebuild.ksh
     353        sed -e 's:/bin/ksh:/bin/bash:g' \
     354            -e 's:print -u2:echo:g' \
     355            -e 's:print:echo:g' rebuild.ksh > rebuild
     356      fi
     357      make clean
     358      make
     359    fi
     360  fi # of if [ "$pclinux" = 1 ]
     361
     362else # of if [ $ioipsl = 1 ]
     363  if [ $hostname = ada338 ] ; then
     364    cd $MODEL/modipsl
     365    cd util
     366
     367    cp AA_make.gdef AA_make.orig
     368    sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
     369    sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $compilo -c": \
     370    -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
     371    -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= -I/smplocal/pub/HDF5/1.8.9/seq/include -I/smplocal/pub/NetCDF/4.1.3/include:' \
     372    -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L/smplocal/pub/NetCDF/4.1.3/lib -lnetcdff -lnetcdf:' \
     373    -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
     374    -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
     375    tmp >| AA_make.gdef
     376
     377    ./ins_make -t g95 # We use lines for g95 even for the other compilers
     378
     379    # on Ada, IOIPSL is already installed in ~rpsl035/IOIPSL_PLUS
     380    # so link it to current settings
     381    cd $MODEL/modipsl/modeles/
     382    \rm -r -f IOIPSL
     383    ln -s ~rpsl035/IOIPSL_PLUS IOIPSL
     384    cd ..
     385    ln -s ~rpsl035/IOIPSL_PLUS/modipsl/bin/* bin/
     386    ln -s ~rpsl035/IOIPSL_PLUS/modipsl/lib/* lib/
     387
     388  fi # of if [ $hostname = ada338 ]
     389fi # of if [ $ioipsl = 1 ]
     390
     391if [ "$veget" = 1 ] ; then
     392  echo '########################################################'
     393  echo 'Compiling ORCHIDEE, the continental surfaces model '
     394  echo '########################################################'
     395  cd $MODEL/modipsl/modeles/ORCHIDEE
     396  cd src_parameters
     397  # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
     398
     399  \cp reqdprec.$real reqdprec.f90
    334400  make
    335401  if [ $compilo = gfortran ] ; then # copy module files to lib
    336402    cp -f *.mod ../../../lib
    337403  fi
    338   # Build IOIPSL tools (ie: "rebuild", if present)
    339   if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then
    340     cd $MODEL/modipsl/modeles/IOIPSL/tools
    341     # adapt Makefile & rebuild script if in bash
    342     if [ "$use_shell" = "bash" ] ; then
    343       cp Makefile Makefile.ksh
    344       sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
    345       cp rebuild rebuild.ksh
    346       sed -e 's:/bin/ksh:/bin/bash:g' \
    347           -e 's:print -u2:echo:g' \
    348           -e 's:print:echo:g' rebuild.ksh > rebuild
    349     fi
    350     make clean
    351     make
    352   fi
    353 else
    354   # we're on brodie
    355   sxgmake clean
    356   sxgmake
    357 fi
    358 
    359 if [ "$veget" = 1 ] ; then
    360 echo '########################################################'
    361 echo Compiling ORCHIDEE, the continental surfaces model
    362 echo '########################################################'
    363 cd $MODEL/modipsl/modeles/ORCHIDEE
    364 cd src_parameters
    365 # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
    366 
    367 
    368 \cp reqdprec.$real reqdprec.f90
    369 make
    370 if [ $compilo = gfortran ] ; then # copy module files to lib
    371   cp -f *.mod ../../../lib
    372 fi
    373 cd ../src_stomate
    374 make
    375 if [ $compilo = gfortran ] ; then # copy module files to lib
    376   cp -f *.mod ../../../lib
    377 fi
    378 cd ../src_sechiba
    379 make
    380 if [ $compilo = gfortran ] ; then # copy module files to lib
    381   cp -f *.mod ../../../lib
    382 fi
    383 fi
    384 fi
    385 
     404  cd ../src_stomate
     405  make
     406  if [ $compilo = gfortran ] ; then # copy module files to lib
     407    cp -f *.mod ../../../lib
     408  fi
     409  cd ../src_sechiba
     410  make
     411  if [ $compilo = gfortran ] ; then # copy module files to lib
     412    cp -f *.mod ../../../lib
     413  fi
     414fi # of if [ "$veget" = 1 ]
    386415
    387416# Ehouarn: it may be directory LMDZ4 or LMDZ5 depending on tar file...
    388417if [[ -d $MODEL/modipsl/modeles/LMDZ4 ]] ; then
    389418  echo '##########################################################'
    390   echo 'Compilation de LMDZ4'
     419  echo 'Compiling LMDZ4'
    391420  echo '##########################################################'
    392421  cd $MODEL/modipsl/modeles/LMDZ4
     
    541570echo "bld::tool::SHELL   $whereisthatshell" >> bld.cfg
    542571
     572fi # of if [ "$pclinux" = 1 ]
     573
     574
     575cd $MODEL/modipsl/modeles/LMDZ?
     576
    543577### Modify makelmdz_fcm and makelmdz to use ORCHIDEE in the bench:
    544578### remove liborglob.a and libparallel.a
     
    552586    makelmdz.orig > makelmdz
    553587
    554 fi # of if [ "$pclinux" = 1 ]
    555588
    556589##################################################################
     
    558591##################################################################
    559592ok_veget=false
    560 if [ "$veget" = 1 ] ; then $ok_veget = true; fi
     593if [ "$veget" = 1 ] ; then $ok_veget = true ; fi
    561594if [ $compile_with_fcm = 1 ] ; then
    562595# Compile with makelmdz_fcm
     596   if [ "$pclinux" = 1 ] ; then
    563597        ./makelmdz_fcm -d ${grid_resolution} -arch local -v $ok_veget gcm
     598   else
     599   # we are on Ada
     600        ./makelmdz_fcm -d ${grid_resolution} -arch X64_ADA -v $ok_veget gcm
     601   fi
    564602else
    565603# Comple with makegcm:
     
    570608fi
    571609
    572 if [ -f gcm.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq_orch.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq.e ]  ; then
    573 echo '##########################################################'
    574 echo Compilation successfull !!
    575 echo '##########################################################'
    576 else
    577 echo Compilation failed !!
     610if [ -f gcm.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq_orch.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq.e ] ; then
     611echo '##########################################################'
     612echo 'Compilation successfull !! '
     613echo '##########################################################'
     614else
     615echo 'Compilation failed !!'
    578616exit
    579617fi
     
    587625
    588626echo '##########################################################'
    589 echo Running a test run
     627echo ' Running a test run '
    590628echo '##########################################################'
    591629
     
    607645fi
    608646
    609 if [ $hostname = brodie ] ; then
    610 echo to run the bench, you must log on to Brodie01
    611 echo and then change directory to `pwd`/BENCH${grid_resolution}
    612 echo and run the gcm
    613 exit
    614 fi
    615 
    616647cd BENCH${grid_resolution}
    617648./bench.sh > bench.out  2>&1
Note: See TracChangeset for help on using the changeset viewer.