Changeset 2031
- Timestamp:
- May 2, 2014, 9:13:38 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install.sh
r2030 r2031 33 33 34 34 echo install.sh DEBUT `date` 35 35 36 set -e 36 37 … … 48 49 version=20130716.trunk 49 50 version=testing 51 compilo=gfortran # compilo=pgf90 or g95 or gfortran or ifort sur PC linux 50 52 51 53 #Chemin pour placer le modele 52 54 MODEL=./LMDZ$version 55 53 56 54 57 getlmdzor=1 … … 62 65 bench=1 63 66 pclinux=1 64 compilo=gfortran # compilo=pgf90 or g95 or gfortran or ifort sur PC linux 67 68 # choose the resolution for the bench runs 69 # grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE) 70 # 96x71x19 standard configuration 71 grid_resolution=48x36x19 72 73 ## compile_with_fcm=1 : use makelmdz_fcm, possible a of version 20111103.trunk (LMDZ5/trunk rev 1578) 74 ## compile_with_fcm=0 : use makelmdz 75 compile_with_fcm=0 65 76 66 77 … … 94 105 95 106 96 ## compile_with_fcm=1 : use makelmdz_fcm, possible a of version 20111103.trunk (LMDZ5/trunk rev 1578)97 ## compile_with_fcm=0 : use makelmdz98 compile_with_fcm=099 100 107 OPTPREC="" 101 108 echo '################################################################' … … 103 110 echo '################################################################' 104 111 112 OPTIMNC=$OPTIM 113 export FC=$compilo 114 export F90=$compilo 115 export F77=$compilo 116 export CPPFLAGS= 117 BASE_LD= 105 118 if [ $compilo = g95 ] ; then 119 # Set the appropriate compilation options 120 OPTIM='-i4 -O3' 121 OPTDEB="-g -O0 -Wall -ftrace=full -fbounds-check -freal=nan" 122 OPTDEV="-g -O1 -Wall" 123 fmod='fmod=' 124 BASE_LD="" 106 125 if [ $real = r8 ] ; then OPTPREC="-r8 -DNC_DOUBLE" ; fi 107 OPTIM='-i4 -O3' 126 export F90FLAGS=" -cpp -ffree-form $OPTIMNC" 127 export FFLAGS=" -cpp $OPTIMNC" 128 export CPPFLAGS=-Df2cFortran 129 export CC=gcc 130 export CXX=g++ 108 131 elif [ $compilo = $gfortran ] ; then 132 OPTIM='-O3' 133 OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all" 134 OPTDEV="-Wall -fbounds-check" 135 fmod='I ' 109 136 if [ $real = r8 ] ; then OPTPREC="-fdefault-real-8 -DNC_DOUBLE" ; fi 137 export F90FLAGS=" -ffree-form $OPTIMNC" 138 export FFLAGS=" $OPTIMNC" 139 export CC=gcc 140 export CXX=g++ 141 elif [ $compilo = mpif90 ] ; then 110 142 OPTIM='-O3' 143 OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all" 144 OPTDEV="-Wall -fbounds-check" 145 BASE_LD="-lblas" 146 fmod='I ' 147 if [ $real = r8 ] ; then OPTPREC="-fdefault-real-8 -DNC_DOUBLE -fcray-pointer" ; fi 148 export F90FLAGS=" -ffree-form $OPTIMNC" 149 export FFLAGS=" $OPTIMNC" 150 export CC=gcc 151 export CXX=g++ 111 152 elif [ $compilo = pgf90 ] ; then 153 OPTIM='-O2 -Munroll -Mnoframe -Mautoinline -Mcache_align' 154 fmod='module ' 112 155 if [ $real = r8 ] ; then OPTPREC="-r8 -DNC_DOUBLE" ; fi 113 OPTIM='-O2 -Munroll -Mnoframe -Mautoinline -Mcache_align' 114 # with pgf90, compile with fcm 156 export CPPFLAGS="-DNDEBUG -DpgiFortran" 157 export CC=pgcc 158 export CFLAGS="-Msignextend" 159 export CXX=pgCC 160 export CXXFLAGS="-Msignextend" 161 export FFLAGS="$OPTIMNC" 162 export F90FLAGS="$OPTIMNC" 115 163 compile_with_fcm=1 116 else 117 # ifort 164 elif [ $compilo = ifort ] ; then 165 OPTIM="-O2 -fp-model strict -ip -align all " 166 OPTDEV="-p -g -O2 -traceback -fp-stack-check -ftrapuv -check" 167 OPTDEB="-g -no-ftz -traceback -ftrapuv -fp-stack-check -check" 168 fmod='module ' 118 169 if [ $real = r8 ] ; then OPTPREC="-real-size 64 -DNC_DOUBLE" ; fi 119 OPTIM="-O2 -fp-model strict -ip -align all " 120 # with ifort, compile with fcm 170 export CPP="icc -E" 171 export FFLAGS="-O2 -ip -fpic -mcmodel=large" 172 export FCFLAGS="-O2 -ip -fpic -mcmodel=large" 173 export CC=icc 174 export CFLAGS="-O2 -ip -fpic -mcmodel=large" 175 export CXX=icpc 176 export CXXFLAGS="-O2 -ip -fpic -mcmodel=large" 121 177 compile_with_fcm=1 122 fi 178 else 179 echo unexpected compiler $compilo ; exit 180 fi 181 123 182 OPTIMGCM="$OPTIM $OPTPREC" 124 125 # choose the resolution for the bench runs126 # grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE)127 # 96x71x19 standard configuration128 grid_resolution=48x36x19129 183 130 184 hostname=`hostname` … … 199 253 200 254 ########################################################################### 201 202 203 204 205 255 if [ $getlmdzor = 1 ] ; then 206 256 echo '##########################################################' … … 234 284 235 285 cd netcdf-4.0.1 236 237 OPTIMNC=$OPTIM238 if [ $compilo = g95 ] ; then239 # Set the appropriate compilation options240 export FC=g95241 export F90=g95242 export F90FLAGS=" -cpp -ffree-form $OPTIMNC"243 export FFLAGS=" -cpp $OPTIMNC"244 export CPPFLAGS=-Df2cFortran245 export CC=gcc246 export CXX=g++247 elif [ $compilo = $gfortran ] ; then248 export FC=$gfortran249 export F90=$gfortran250 export F90FLAGS=" -ffree-form $OPTIMNC"251 export FFLAGS=" $OPTIMNC"252 export CPPFLAGS=253 export CC=gcc254 export CXX=g++255 elif [ $compilo = pgf90 ] ; then256 export CPPFLAGS="-DNDEBUG -DpgiFortran"257 export CC=pgcc258 export CFLAGS="-Msignextend"259 export CXX=pgCC260 export CXXFLAGS="-Msignextend"261 export FC=pgf90262 export FFLAGS="$OPTIMNC"263 export F90=pgf90264 export F90FLAGS="$OPTIMNC"265 elif [ $compilo = ifort ] ; then266 export CPP="icc -E"267 export F77=ifort268 export FFLAGS="-O2 -ip -fpic -mcmodel=large"269 export F90=ifort270 export FCFLAGS="-O2 -ip -fpic -mcmodel=large"271 export CC=icc272 export CFLAGS="-O2 -ip -fpic -mcmodel=large"273 export CXX=icpc274 export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"275 else276 echo unexpected compiler $compilo ; exit277 fi278 286 279 287 sed -e 's/gfortran/'$gfortran'/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure … … 303 311 cd $MODEL/modipsl 304 312 \rm -rf lib/* 313 305 314 cd util 306 315 307 if [ $compilo = pgf90 ] ; then308 fmod='module '309 elif [ $compilo = g95 ] ; then310 fmod='fmod='311 elif [ $compilo = ifort ] ; then312 fmod='module '313 else # gfortran314 fmod='I '315 fi316 316 cp AA_make.gdef AA_make.orig 317 F_C="$compilo -c " ; if [ $compilo = $gfortran] ; then F_C="$compilo -c -cpp " ; fi317 F_C="$compilo -c " ; if [ "$compilo" = "$gfortran" -o "$compilo" = "mpif90" ] ; then F_C="$compilo -c -cpp " ; fi 318 318 sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp 319 319 sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $F_C": \ … … 340 340 fi # of if [ "$use_shell" = "ksh" ] 341 341 342 #======================================================================================= 342 343 echo '##########################################################' 343 344 echo 'Compiling IOIPSL, the interface library with Netcdf' … … 357 358 make clean 358 359 make 359 if [ $compilo = $gfortran] ; then # copy module files to lib360 if [ "$compilo" = "$gfortran" -o "$compilo" = "mpif90" ] ; then # copy module files to lib 360 361 cp -f *.mod ../../../lib 361 362 fi … … 433 434 if [ ! -d $src_d ] ; then echo Problem orchidee : no $src_d ; exit ; fi 434 435 cd $src_d ; \rm -f *.mod make ; make clean 435 make ; if [ $compilo = $gfortran] ; then cp -f *.mod ../../../lib ; fi436 make ; if [ "$compilo" = "$gfortran" -o "$compilo" = "mpif90" ] ; then cp -f *.mod ../../../lib ; fi 436 437 cd .. 437 438 done … … 452 453 fi 453 454 454 #============================================================================455 # Traitement momentanne a cause d'un bug dans makegcm456 cp create_make_gcm create_make_gcm.orig457 nl=`sed -n -e /PROGRAM/= create_make_gcm.orig | tail -1`458 sed -e "$nl s/ PROGRA/PROGRA/" create_make_gcm.orig >| create_make_gcm459 460 461 455 ########################################################### 462 456 # For those who want to use fcm to compile via : … … 464 458 ############################################################ 465 459 466 if [ "$pclinux" = 1 ] ; then 460 if [ "$pclinux" = "1" ] ; then 461 467 462 # create local 'arch' files (if on Linux PC): 468 463 cd arch 469 464 # arch-local.path file 470 465 echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdf\"" > arch-local.path 466 echo OK3 471 467 echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path 472 468 echo 'IOIPSL_INCDIR=$LMDGCM/../../lib' >> arch-local.path … … 475 471 echo 'ORCH_LIBDIR=$LMDGCM/../../lib' >> arch-local.path 476 472 # arch-local.fcm file (adapted from arch-linux-32bit.fcm) 477 if [ $compilo = g95 ] ; then 478 sed -e s:"%COMPILER pgf95":"%COMPILER g95":1 \ 479 -e s:"%LINK pgf95":"%LINK g95":1 \ 480 -e s:"%PROD_FFLAGS -fast":"%PROD_FFLAGS $OPTIM":1 \ 481 -e s:"%DEV_FFLAGS -g -O1":"%DEV_FFLAGS -g -O1 -Wall":1 \ 482 -e s:"%DEBUG_FFLAGS -g -O0 -Kieee -Ktrap=fp -Mbounds":"%DEBUG_FFLAGS -g -O0 -Wall -ftrace=full -fbounds-check -freal=nan":1 \ 483 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTPREC":1 \ 484 arch-linux-32bit.fcm > arch-local.fcm 485 if [ $real = r8 ] ; then 486 sed -e s:"%FPP_DEF ":"%FPP_DEF NC_DOUBLE":1 \ 487 arch-local.fcm > arch-local.fcm.new 488 mv -f arch-local.fcm.new arch-local.fcm 489 fi 490 elif [ $compilo = $gfortran ] ; then 491 sed -e s:"%COMPILER pgf95":"%COMPILER $gfortran":1 \ 492 -e s:"%LINK pgf95":"%LINK $gfortran":1 \ 493 -e s:"%PROD_FFLAGS -fast":"%PROD_FFLAGS $OPTIM":1 \ 494 -e s:"%DEV_FFLAGS -g -O1":"%DEV_FFLAGS -Wall -fbounds-check":1 \ 495 -e s:"%DEBUG_FFLAGS -g -O0 -Kieee -Ktrap=fp -Mbounds":"%DEBUG_FFLAGS -g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all":1 \ 496 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTPREC":1 \ 497 arch-linux-32bit.fcm > arch-local.fcm 498 if [ $real = r8 ] ; then 499 sed -e s:"%FPP_DEF ":"%FPP_DEF NC_DOUBLE":1 \ 500 arch-local.fcm > arch-local.fcm.new 501 mv -f arch-local.fcm.new arch-local.fcm 502 fi 503 elif [ $compilo = pgf90 ] ; then 504 sed -e s:"-Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2":" ":1 \ 505 -e s:"%PROD_FFLAGS -fast":"%PROD_FFLAGS $OPTIM":1 \ 506 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTPREC":1 \ 507 arch-linux-32bit.fcm > arch-local.fcm 508 if [ $real = r8 ] ; then 509 sed -e s:"%FPP_DEF ":"%FPP_DEF NC_DOUBLE":1 \ 510 arch-local.fcm > arch-local.fcm.new 511 mv -f arch-local.fcm.new arch-local.fcm 512 fi 513 elif [ $compilo = ifort ] ; then 514 sed -e s:"%COMPILER pgf95":"%COMPILER ifort":1 \ 515 -e s:"%LINK pgf95":"%LINK ifort":1 \ 516 -e s:"-Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2":" ":1 \ 517 -e s:"%PROD_FFLAGS -fast":"%PROD_FFLAGS $OPTIM":1 \ 518 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTPREC":1 \ 519 -e s:"%DEV_FFLAGS -g -O1":"%DEV_FFLAGS -p -g -O2 -traceback -fp-stack-check -ftrapuv -check":1 \ 520 -e s:"%DEBUG_FFLAGS -g -O0 -Kieee -Ktrap=fp -Mbounds":"%DEBUG_FFLAGS -g -no-ftz -traceback -ftrapuv -fp-stack-check -check":1 \ 521 arch-linux-32bit.fcm > arch-local.fcm 522 if [ $real = r8 ] ; then 523 sed -e s:"%FPP_DEF ":"%FPP_DEF NC_DOUBLE":1 \ 524 arch-local.fcm > arch-local.fcm.new 525 mv -f arch-local.fcm.new arch-local.fcm 526 fi 527 else 528 echo Unexpected compiler $compilo ; exit 529 fi # of if [ $compilo = g95 ] elif [ $compilo = pgf90 ] 473 474 if [ $real = r8 ] ; then FPP_DEF=NC_DOUBLE ; else FPP_DEF="" ; fi 475 sed -e s:"%COMPILER .*.$":"%COMPILER $compilo":1 \ 476 -e s:"%LINK .*.$":"%LINK $compilo":1 \ 477 -e s:"%PROD_FFLAGS .*.$":"%PROD_FFLAGS $OPTIM":1 \ 478 -e s:"%DEV_FFLAGS .*.$":"%DEV_FFLAGS $OPTDEV":1 \ 479 -e s:"%DEBUG_FFLAGS .*.$":"%DEBUG_FFLAGS $OPTDEB":1 \ 480 -e s:"%BASE_FFLAGS .*.$":"%BASE_FFLAGS $OPTPREC":1 \ 481 arch-linux-32bit.fcm > arch-local.fcm 482 530 483 cd .. 531 484 ### Adapt "bld.cfg" (add the shell): … … 542 495 ################################################################## 543 496 echo install.sh avant_compilation `date` 544 #ok_veget=false545 #if [ "$veget" = 1 ] ; then ok_veget=true ; fi546 497 if [ $compile_with_fcm = 1 ] ; then makelmdz=makelmdz_fcm ; else makelmdz=makelmdz ; fi 547 if [ "$pclinux" = 1 ] ; then 548 ./$makelmdz -d ${grid_resolution} -arch local -v $veget_version gcm 549 else 550 # we are on Ada 551 ./$makelmdz -d ${grid_resolution} -arch X64_ADA -v $veget_version gcm 552 fi 498 499 ./$makelmdz -d ${grid_resolution} -v $veget_version gcm 553 500 echo install.sh apres_compilation `date` 554 501 … … 611 558 echo '##########################################################' 612 559 613 if [ $gfortran = gfortran44] ; then560 if [ "$gfortran" = "gfortran44" ] ; then 614 561 echo Your gfortran compiler was too old so that the model was automatically 615 562 echo compiled with gfortran44 instead. It can not be used in parallel mode.
Note: See TracChangeset
for help on using the changeset viewer.