Changeset 2030
- Timestamp:
- May 2, 2014, 9:12:40 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install.sh
r1911 r2030 32 32 ########################################################################### 33 33 34 echo install.sh DEBUT `date` 34 35 set -e 35 36 … … 66 67 ##################################################################### 67 68 # Test for old gfortran compilers 69 # If the compiler is too old (older than 4.3.x) we test if the 70 # temporary gfortran44 patch is available on the computer in which 71 # case the compiler is changed from gfortran to gfortran44 72 # Must be aware than parallelism can not be activated in this case 73 ##################################################################### 74 68 75 if [ $compilo = gfortran ] ; then 76 gfortran=gfortran 69 77 gfortranv=`gfortran --version | \ 70 78 head -1 | awk ' { print $NF } ' | awk -F. ' { print $1 * 10 + $2 } '` … … 74 82 echo compilo=xxx 75 83 echo in the install.sh script and rerun it 76 exit 84 if [ `which gfortran44 | wc -w` -ne 0 ] ; then 85 gfortran=gfortran44 86 else 87 echo gfotran trop vieux ; exit 88 fi 77 89 fi 90 compilo=$gfortran 78 91 fi 79 92 ##################################################################### … … 93 106 if [ $real = r8 ] ; then OPTPREC="-r8 -DNC_DOUBLE" ; fi 94 107 OPTIM='-i4 -O3' 95 elif [ $compilo = gfortran ] ; then108 elif [ $compilo = $gfortran ] ; then 96 109 if [ $real = r8 ] ; then OPTPREC="-fdefault-real-8 -DNC_DOUBLE" ; fi 97 110 OPTIM='-O3' … … 173 186 if [ $pclinux = 1 ] ; then 174 187 cd $MODEL 175 cat <<eod > tt.f90188 cat <<eod > tt.f90 176 189 print*,'coucou' 177 190 end … … 189 202 190 203 204 191 205 if [ $getlmdzor = 1 ] ; then 192 206 echo '##########################################################' … … 195 209 cd $MODEL 196 210 wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/modipsl.$version.tar.gz 211 echo install.sh wget_OK `date` 197 212 gunzip modipsl.$version.tar.gz 198 213 tar xvf modipsl.$version.tar … … 230 245 export CC=gcc 231 246 export CXX=g++ 232 elif [ $compilo = gfortran ] ; then233 export FC= gfortran234 export F90= gfortran247 elif [ $compilo = $gfortran ] ; then 248 export FC=$gfortran 249 export F90=$gfortran 235 250 export F90FLAGS=" -ffree-form $OPTIMNC" 236 251 export FFLAGS=" $OPTIMNC" … … 262 277 fi 263 278 279 sed -e 's/gfortran/'$gfortran'/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure 264 280 localdir=`pwd -P` 265 281 ./configure --prefix=$localdir 282 sed -e 's/gfortran/'$gfortran'/g' Makefile >| tmp ; mv -f tmp Makefile 266 283 make check 267 284 make install 285 echo install.sh netcdf_OK `date` 268 286 fi # of if [ $netcdf = 1 ] 287 269 288 270 289 #======================================================================================= … … 283 302 if [ $ioipsl = 1 ] ; then 284 303 cd $MODEL/modipsl 285 rm -rf lib/* 286 304 \rm -rf lib/* 287 305 cd util 288 306 … … 297 315 fi 298 316 cp AA_make.gdef AA_make.orig 299 F_C="$compilo -c " ; if [ $compilo = gfortran ] ; then F_C="$compilo -c -cpp " ; fi317 F_C="$compilo -c " ; if [ $compilo = $gfortran ] ; then F_C="$compilo -c -cpp " ; fi 300 318 sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp 301 319 sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $F_C": \ … … 339 357 make clean 340 358 make 341 if [ $compilo = gfortran ] ; then # copy module files to lib359 if [ $compilo = $gfortran ] ; then # copy module files to lib 342 360 cp -f *.mod ../../../lib 343 361 fi … … 386 404 387 405 fi # of if [ ${hostname:0:5} = ada33 ] 406 echo install.sh ioipsl_OK `date` 388 407 fi # of if [ $ioipsl = 1 ] 408 389 409 390 410 #============================================================================ … … 413 433 if [ ! -d $src_d ] ; then echo Problem orchidee : no $src_d ; exit ; fi 414 434 cd $src_d ; \rm -f *.mod make ; make clean 415 make ; if [ $compilo = gfortran ] ; then cp -f *.mod ../../../lib ; fi435 make ; if [ $compilo = $gfortran ] ; then cp -f *.mod ../../../lib ; fi 416 436 cd .. 417 437 done 438 echo install.sh orchidee_OK `date` 418 439 fi # of if [ "$veget" = 1 ] 440 419 441 420 442 #============================================================================ … … 436 458 sed -e "$nl s/ PROGRA/PROGRA/" create_make_gcm.orig >| create_make_gcm 437 459 438 #mv -f tmp crea439 if [ "$pclinux" = 1 ] ; then440 if [ $compilo = gfortran ] ; then441 sed \442 -e 's:\#setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \443 -e 's:\#setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \444 -e 's:setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \445 -e 's:setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \446 -e 's/set FC_LINUX.*.$/set FC_LINUX='$compilo'/' \447 -e 's/g95/gfortran/g' \448 -e 's/-fmod=/-I/g' \449 -e 's/-fno-second-underscore//' -e 's/-fstatic//' \450 -e 's/-lparallel//' \451 -e 's/-lnetcdff//g' \452 -e 's/-lorglob//' \453 -e 's/-ffixed-form//' -e 's/-ffree-form//' \454 -e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIMGCM"\"'/' makegcm.orig >| makegcm455 elif [ $compilo = ifort ] ; then456 sed \457 -e 's:\#setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \458 -e 's:\#setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \459 -e 's:setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \460 -e 's:setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \461 -e 's/set FC_LINUX.*.$/set FC_LINUX='$compilo'/' \462 -e 's/g95/ifort/g' \463 -e 's/-fmod=/-module /g' \464 -e 's/-fno-second-underscore//' -e 's/-fstatic//' \465 -e 's/-lparallel//' \466 -e 's/-lnetcdff//g' \467 -e 's/-lorglob//' \468 -e 's/-ffixed-form//' -e 's/-ffree-form//' \469 -e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIMGCM"\"'/' makegcm.orig >| makegcm470 else # g95 or pgf90471 sed \472 -e 's:\#setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \473 -e 's:\#setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \474 -e 's:setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \475 -e 's:setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \476 -e 's/set FC_LINUX.*.$/set FC_LINUX='$compilo'/' \477 -e 's/-fno-second-underscore//' -e 's/-fstatic//' \478 -e 's/-lparallel//' \479 -e 's/-lnetcdff//g' \480 -e 's/-lorglob//' \481 -e 's/-ffixed-form//' -e 's/-ffree-form//' \482 -e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIMGCM"\"'/' makegcm.orig >| makegcm483 fi484 else485 sed \486 -e 's/-lparallel//' \487 -e 's/-lorglob//' \488 -e 's/-lsxorglob//' \489 -e 's/-lsxparallel//' \490 -e 's/-lsxioipsl/-lioipsl/g' \491 makegcm.orig >| makegcm492 fi493 494 chmod +x makegcm495 460 496 461 ########################################################### … … 523 488 mv -f arch-local.fcm.new arch-local.fcm 524 489 fi 525 elif [ $compilo = gfortran ] ; then526 sed -e s:"%COMPILER pgf95":"%COMPILER gfortran":1 \527 -e s:"%LINK pgf95":"%LINK gfortran":1 \490 elif [ $compilo = $gfortran ] ; then 491 sed -e s:"%COMPILER pgf95":"%COMPILER $gfortran":1 \ 492 -e s:"%LINK pgf95":"%LINK $gfortran":1 \ 528 493 -e s:"%PROD_FFLAGS -fast":"%PROD_FFLAGS $OPTIM":1 \ 529 494 -e s:"%DEV_FFLAGS -g -O1":"%DEV_FFLAGS -Wall -fbounds-check":1 \ … … 576 541 # Compile LMDZ 577 542 ################################################################## 543 echo install.sh avant_compilation `date` 578 544 #ok_veget=false 579 545 #if [ "$veget" = 1 ] ; then ok_veget=true ; fi … … 585 551 ./$makelmdz -d ${grid_resolution} -arch X64_ADA -v $veget_version gcm 586 552 fi 553 echo install.sh apres_compilation `date` 554 587 555 588 556 if [ -f gcm.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq_orch.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq.e ] ; then … … 606 574 echo '##########################################################' 607 575 608 rm -rf BENCH${grid_resolution}576 \rm -rf BENCH${grid_resolution} 609 577 bench=bench_lmdz_${grid_resolution} 578 echo install.sh avant_chargement_bench `date` 610 579 wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/$bench.tar.gz 580 echo install.sh apres_chargement_bench `date` 611 581 gunzip $bench.tar.gz 612 582 tar xvf $bench.tar … … 623 593 fi 624 594 595 625 596 cd BENCH${grid_resolution} 626 597 ./bench.sh > bench.out 2>&1 627 598 599 628 600 echo '##########################################################' 629 601 echo ' Bench results ' … … 631 603 632 604 cat ./bench.out 605 echo install.sh FIN_du_BENCH `date` 633 606 634 607 echo '##########################################################' … … 637 610 echo 'or ./bench.sh' 638 611 echo '##########################################################' 612 613 if [ $gfortran = gfortran44 ] ; then 614 echo Your gfortran compiler was too old so that the model was automatically 615 echo compiled with gfortran44 instead. It can not be used in parallel mode. 616 echo You can change the compiler at the begining of the install.sh 617 echo script and reinstall. 618 fi
Note: See TracChangeset
for help on using the changeset viewer.