Changeset 3088 for BOL/script_install/install_lmdz.sh
- Timestamp:
- Nov 23, 2017, 6:18:30 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install_lmdz.sh
r3076 r3088 75 75 bench=1 76 76 pclinux=1 77 compiler=gfortran 77 78 SCM=0 78 79 # use the old orchidee interface without the calculation of z0h … … 110 111 111 112 -r "svn_release" : either the svn release number or "last" 113 114 -compiler gfortran|ifort|pgf90 (default: gfortran) 112 115 113 116 -parallel PARA : can be mpi_omp (mpi with openMP) or none (for sequential) … … 138 141 "-v") version=$2 ; shift ; shift ;; 139 142 "-r") svn=$2 ; shift ; shift ;; 143 "-compiler") compiler=$2 144 case $compiler in 145 "gfortran"|"ifort"|"pgf90") compiler=$2 ; shift ; shift ;; 146 *) echo "Only gfortran , ifort or pgf90 for the compiler option" ; exit 147 esac ;; 140 148 "-d") grid_resolution=$2 ; shift ; shift ;; 141 149 "-gprof") OPT_GPROF="-pg" ; shift ;; … … 157 165 if [ $parallel = none ] ; then sequential=1 ; else sequential=0 ; fi 158 166 159 160 compilo=gfortran # compilo=pgf90 or gfortran or ifort sur PC linux161 167 #Chemin pour placer le modele 162 168 if [ "$MODEL" = "" ] ; then MODEL=./LMDZ$version$svn ; fi … … 168 174 169 175 170 if [ $compil o= g95 ] ; then echo g95 is not supported anymore ; exit ; fi176 if [ $compiler = g95 ] ; then echo g95 is not supported anymore ; exit ; fi 171 177 172 178 ################################################################ … … 179 185 case ${hostname:0:5} in 180 186 181 ada33) compil o="ifort" ;187 ada33) compiler="ifort" ; 182 188 par_comp="ifort" ; 183 189 o_ins_make="-t ada" ; … … 186 192 arch=X64_ADA ;; 187 193 188 cicla) compil o="gfortran" ;194 cicla) compiler="gfortran" ; 189 195 if [ $parallel != none ] ; then 190 196 module load openmpi/1.4.5-gfortran ; … … 198 204 o_ins_make="-t g95" ;; 199 205 200 *) compilo="gfortran" ; 201 if [ $parallel = none -o -f /usr/bin/mpif90 ] ; then 206 *) if [ $parallel = none -o -f /usr/bin/mpif90 ] ; then 202 207 path_mpi=`which mpif90 | sed -e s:/mpif90::` ; 203 208 if [ -d /usr/lib64/openmpi ] ; then … … 206 211 root_mpi="/usr" 207 212 fi 208 # For Scientifique Linux at LMD :209 elif [ -f /usr/lib64/openmpi/1.4.5-gfortran/bin/mpif90 ] ; then213 # For Scientifique Linux with gfortran at LMD : 214 elif [ -f /usr/lib64/openmpi/1.4.5-gfortran/bin/mpif90 -a compiler = "gfortran" ] ; then 210 215 path_mpi=/usr/lib64/openmpi/1.4.5-gfortran/bin ; 211 216 root_mpi=/usr/lib64/openmpi/1.4.5-gfortran ; 217 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH 218 # For Scientifique Linux with ifort at LMD : 219 elif [ -f /usr/lib64/openmpi/1.4.5-ifort/bin/mpif90 -a compiler = "ifort" ] ; then 220 path_mpi=/usr/lib64/openmpi/1.4.5-ifort/bin ; 221 root_mpi=/usr/lib64/openmpi/1.4.5-ifort ; 222 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH 223 # For Scientifique Linux with pgf90 at LMD : 224 elif [ -f /usr/lib64/openmpi/1.4.5-ifort/bin/mpif90 -a compiler = "pgf90" ] ; then 225 path_mpi=/usr/lib64/openmpi/1.4.5-pgf/bin ; 226 root_mpi=/usr/lib64/openmpi/1.4.5-pgf ; 212 227 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH 213 228 else … … 222 237 esac 223 238 224 225 # MPI_FLAGS are the flags needed for compilation with MPI 226 #MPI_FLAGS="-I/usr/include/openmpi-x86_64 -fcray-pointer" 227 MPI_FLAGS="-fcray-pointer" 228 # MPI_LD are the flags needed for linking with MPI 229 MPI_LD="-L/usr/lib64/openmpi/lib -lmpi" 230 # OMP_FLAGS are the flags needed for compilation with OpenMP 231 OMP_FLAGS="-fopenmp -fcray-pointer" 232 # OMP_LD are the flags needed for linking with OpenMP 233 #OMP_LD="-fopenmp -L/usr/lib64 -lnuma" 234 OMP_LD="-fopenmp" 235 239 # Flags for parallelism: 240 if [ $parallel != none ] ; then 241 # MPI_LD are the flags needed for linking with MPI 242 MPI_LD="-L${root_mpi}/lib -lmpi" 243 if [ "$compiler" = "gfortran" ] ; then 244 # MPI_FLAGS are the flags needed for compilation with MPI 245 MPI_FLAGS="-fcray-pointer" 246 # OMP_FLAGS are the flags needed for compilation with OpenMP 247 OMP_FLAGS="-fopenmp -fcray-pointer" 248 # OMP_LD are the flags needed for linking with OpenMP 249 OMP_LD="-fopenmp" 250 elif [ "$compiler" = "ifort" ] ; then 251 MPI_FLAGS="" 252 OMP_FLAGS="-openmp" 253 OMP_LD="-openmp" 254 else # pgf90 255 MPI_FLAGS="" 256 OMP_FLAGS="-mp" 257 OMP_LD="-mp" 258 fi 259 fi 236 260 237 261 ##################################################################### … … 243 267 ##################################################################### 244 268 245 if [ "$compil o" = "gfortran" ] ; then269 if [ "$compiler" = "gfortran" ] ; then 246 270 gfortran=gfortran 247 271 gfortranv=`gfortran --version | \ … … 250 274 echo ERROR : Your gfortran compiler is too old 251 275 echo 'Please choose a new one (ifort) and change the line' 252 echo compil o=xxx276 echo compiler=xxx 253 277 echo in the install.sh script and rerun it 254 278 if [ `which gfortran44 | wc -w` -ne 0 ] ; then … … 258 282 fi 259 283 fi 260 compil o=$gfortran284 compiler=$gfortran 261 285 fi 262 286 ##################################################################### … … 275 299 echo '################################################################' 276 300 277 export FC=$compil o278 export F90=$compil o279 export F77=$compil o301 export FC=$compiler 302 export F90=$compiler 303 export F77=$compiler 280 304 export CPPFLAGS= 281 305 OPTIMNC=$OPTIM … … 286 310 287 311 288 if [ "$compil o" = "$gfortran" ] ; then312 if [ "$compiler" = "$gfortran" ] ; then 289 313 OPTIM='-O3' 290 314 OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=nan" … … 299 323 export fpp_flags="-P -C -traditional -ffreestanding" 300 324 301 elif [ $compil o= mpif90 ] ; then325 elif [ $compiler = mpif90 ] ; then 302 326 OPTIM='-O3' 303 327 OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all" … … 311 335 export CXX=g++ 312 336 313 elif [ $compil o= pgf90 ] ; then337 elif [ $compiler = pgf90 ] ; then 314 338 OPTIM='-O2 -Mipa -Munroll -Mnoframe -Mautoinline -Mcache_align' 315 339 OPTDEB='-g -Mdclchk -Mbounds -Mchkfpstk -Mchkptr -Minform=inform -Mstandard -Ktrap=fp -traceback' … … 326 350 compile_with_fcm=1 327 351 328 elif [ $compil o= ifort ] ; then352 elif [ $compiler = ifort ] ; then 329 353 OPTIM="-O2 -fp-model strict -ip -align all " 330 354 OPTDEV="-p -g -O2 -traceback -fp-stack-check -ftrapuv -check" … … 342 366 343 367 else 344 echo unexpected compiler $compil o; exit368 echo unexpected compiler $compiler ; exit 345 369 fi 346 370 … … 358 382 ioipsl=1 # no need to recompile ioipsl, already available 359 383 #netcdf="/smplocal/pub/NetCDF/4.1.3" 360 compil o="ifort"384 compiler="ifort" 361 385 fmod='module ' 362 386 if [ $real = r8 ] ; then OPTPREC="$OPTPREC -real-size 64 -DNC_DOUBLE" ; fi … … 397 421 398 422 399 for logiciel in csh wget tar gzip make $compil ogcc ; do423 for logiciel in csh wget tar gzip make $compiler gcc ; do 400 424 if [ "`which $logiciel`" = "" ] ; then 401 425 echo You must first install $logiciel on your system … … 410 434 end 411 435 eod 412 $compil ott.f90 -o a.out436 $compiler tt.f90 -o a.out 413 437 ./a.out >| tt 414 438 if [ "`cat tt | sed -e 's/ //g' `" != "coucou" ] ; then 415 echo problem installing with compiler $compil o; exit ; fi439 echo problem installing with compiler $compiler ; exit ; fi 416 440 \rm tt a.out tt.f90 417 441 fi … … 461 485 myget import/install_netcdf4_hdf5.bash 462 486 chmod u=rwx install_netcdf4_hdf5.bash 463 if [ "$compil o" = "gfortran" ] ; then487 if [ "$compiler" = "gfortran" ] ; then 464 488 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc -FC gfortran -CXX g++ -MPI $root_mpi 465 elif [ "$compil o" = "ifort" ] ; then489 elif [ "$compiler" = "ifort" ] ; then 466 490 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc -FC ifort -CXX icpc -MPI $root_mpi 467 elif [ "$compil o" = "pgf90" ] ; then491 elif [ "$compiler" = "pgf90" ] ; then 468 492 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc -FC pgf90 -CXX pgCC -MPI $root_mpi 469 493 else 470 echo "unexpected compiler $compil o" ; exit494 echo "unexpected compiler $compiler" ; exit 471 495 fi 472 496 fi # of if [ "$with_xios" = "n" ] … … 499 523 500 524 cp AA_make.gdef AA_make.orig 501 F_C="$compil o -c " ; if [ "$compilo" = "$gfortran" -o "$compilo" = "mpif90" ] ; then F_C="$compilo-c -cpp " ; fi502 if [ "$compil o" = "pgf90" ] ; then F_C="$compilo-c -Mpreprocess" ; fi525 F_C="$compiler -c " ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then F_C="$compiler -c -cpp " ; fi 526 if [ "$compiler" = "pgf90" ] ; then F_C="$compiler -c -Mpreprocess" ; fi 503 527 sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp 504 sed -e "s:F_L = g95:F_L = $compil o:" -e "s:F_C = g95 -c -cpp:F_C = $F_C": \528 sed -e "s:F_L = g95:F_L = $compiler:" -e "s:F_C = g95 -c -cpp:F_C = $F_C": \ 505 529 -e 's/g95.*.w_w.*.(F_D)/g95 w_w = '"$OPTIMGCM"'/' \ 506 530 -e 's:g95.*.NCDF_INC.*.$:g95 NCDF_INC= '"$ncdfdir"'/include:' \ … … 539 563 $make clean 540 564 $make 541 if [ "$compil o" = "$gfortran" -o "$compilo" = "mpif90" ] ; then # copy module files to lib565 if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then # copy module files to lib 542 566 cp -f *.mod ../../../lib 543 567 fi … … 566 590 cp AA_make.gdef AA_make.orig 567 591 sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp 568 sed -e "s:F_L = g95:F_L = $compil o:" -e "s:F_C = g95 -c:F_C = $compilo-c": \592 sed -e "s:F_L = g95:F_L = $compiler:" -e "s:F_C = g95 -c:F_C = $compiler -c": \ 569 593 -e 's/g95.*.w_w.*.(F_D)/g95 w_w = '"$OPTIMGCM"'/' \ 570 594 -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:' \ … … 618 642 veget_version=orchidee2.0 619 643 cd arch 620 sed -e s:"%COMPILER .*.$":"%COMPILER $compil o":1 \621 -e s:"%LINK .*.$":"%LINK $compil o":1 \644 sed -e s:"%COMPILER .*.$":"%COMPILER $compiler":1 \ 645 -e s:"%LINK .*.$":"%LINK $compiler":1 \ 622 646 -e s:"%FPP_FLAGS .*.$":"%FPP_FLAGS $fpp_flags":1 \ 623 647 -e s:"%PROD_FFLAGS .*.$":"%PROD_FFLAGS $OPTIM":1 \ … … 653 677 if [ ! -d $src_d ] ; then echo Problem orchidee : no $src_d ; exit ; fi 654 678 cd $src_d ; \rm -f *.mod make ; $make clean 655 $make ; if [ "$compil o" = "$gfortran" -o "$compilo" = "mpif90" ] ; then cp -f *.mod ../../../lib ; fi679 $make ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then cp -f *.mod ../../../lib ; fi 656 680 cd .. 657 681 done … … 697 721 698 722 if [ $real = r8 ] ; then FPP_DEF=NC_DOUBLE ; else FPP_DEF="" ; fi 699 sed -e s:"%COMPILER .*.$":"%COMPILER $compil o":1 \700 -e s:"%LINK .*.$":"%LINK $compil o":1 \723 sed -e s:"%COMPILER .*.$":"%COMPILER $compiler":1 \ 724 -e s:"%LINK .*.$":"%LINK $compiler":1 \ 701 725 -e s:"%PROD_FFLAGS .*.$":"%PROD_FFLAGS $OPTIM":1 \ 702 726 -e s:"%DEV_FFLAGS .*.$":"%DEV_FFLAGS $OPTDEV":1 \
Note: See TracChangeset
for help on using the changeset viewer.