Changeset 1589 for BOL/script_install/install.sh
- Timestamp:
- Nov 22, 2011, 4:00:48 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install.sh
r1588 r1589 26 26 # Pré-requis : g95/pgf90/gfortran, ksh, wget , gunzip, tar, ... (à compléter) 27 27 # 28 # Modif 18/11/2011 29 # changement pour l'option real 8. 30 # On compile avec -r8 (ou équivalent) et -DNC_DOUBLE pour le GCM 31 # mais avec -r4 netcdf. La variable real est initialisée à 32 # r4 ou r8 en début de script. 33 # 28 34 ########################################################################### 29 35 … … 32 38 echo '################################################################' 33 39 40 41 real=r4 42 real=r8 34 43 35 44 # ATTENTION !!!! Pour des versions anterieures a octobre 2009, utiliser … … 57 66 compile_with_fcm=0 58 67 68 OPTPREC="" 59 69 echo '################################################################' 60 70 echo Choix des options de compilation 61 71 echo '################################################################' 72 62 73 if [ $compilo = g95 ] ; then 63 OPTIM='-i4 -r8 -O3' 74 if [ $real = r8 ] ; then OPTPREC="-r8 -DNC_DOUBLE" ; fi 75 OPTIM='-i4 -O3' 64 76 elif [ $compilo = gfortran ] ; then 65 OPTIM='-O3 -fdefault-real-8' 77 if [ $real = r8 ] ; then OPTPREC="-fdefault-real-8 -DNC_DOUBLE" ; fi 78 OPTIM='-O3' 66 79 else #pgf90 80 if [ $real = r8 ] ; then echo "Option real 8 non disponible pour pgf90" ; exit ; fi 67 81 OPTIM='-O2 -Munroll -Mnoframe -Mautoinline -Mcache_align' 68 82 fi 83 OPTIMGCM="$OPTIM $OPTPREC" 69 84 70 85 # choix de la resolution pour le bench … … 177 192 cd netcdf-4.0.1 178 193 194 OPTIMNC=$OPTIM 179 195 if [ $compilo = g95 ] ; then 180 196 # On modifie les options de compilation 181 197 export FC=g95 182 198 export F90=g95 183 export F90FLAGS=" -cpp -ffree-form $OPTIM "184 export FFLAGS=" -cpp $OPTIM "199 export F90FLAGS=" -cpp -ffree-form $OPTIMNC" 200 export FFLAGS=" -cpp $OPTIMNC" 185 201 export CPPFLAGS=-Df2cFortran 186 202 export CC=gcc … … 189 205 export FC=gfortran 190 206 export F90=gfortran 191 export F90FLAGS=" -ffree-form $OPTIM "192 export FFLAGS=" $OPTIM "207 export F90FLAGS=" -ffree-form $OPTIMNC" 208 export FFLAGS=" $OPTIMNC" 193 209 export CPPFLAGS= 194 210 export CC=gcc … … 201 217 export CXXFLAGS="-Msignextend" 202 218 export FC=pgf90 203 export FFLAGS="$OPTIM "219 export FFLAGS="$OPTIMNC" 204 220 export F90=pgf90 205 export F90FLAGS="$OPTIM "221 export F90FLAGS="$OPTIMNC" 206 222 else 207 223 echo Le compilateur $compilo pas prevu ; exit … … 251 267 sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp 252 268 sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $compilo -c": \ 253 -e 's/g95.*.w_w.*.(F_D)/g95 w_w = '"$OPTIM "'/' \269 -e 's/g95.*.w_w.*.(F_D)/g95 w_w = '"$OPTIMGCM"'/' \ 254 270 -e 's:g95.*.NCDF_INC.*.$:g95 NCDF_INC='"$ncdfdir"'/include:' \ 255 271 -e 's:g95.*.NCDF_LIB.*.$:g95 NCDF_LIB='"$ncdfdir"'/lib:' \ … … 301 317 cd src_parameters 302 318 # Une petite astuce pour ORCHIDEE suivant qu'on est en real*4 ou real*8 303 if [ $compilo = gfortran ] ; then 304 if [ "`echo $OPTIM | grep real-8`" = "" ] ; then real=r4 ; else real=r8 ; fi 305 else # g95 ou pgf90 306 if [ "`echo $OPTIM | grep r8`" = "" ] ; then real=r4 ; else real=r8 ; fi 307 fi 319 320 308 321 \cp reqdprec.$real reqdprec.f90 309 322 make … … 357 370 -e 's/-lorglob//' \ 358 371 -e 's/-ffixed-form//' -e 's/-ffree-form//' \ 359 -e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIM "\"'/' makegcm.orig >| makegcm372 -e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIMGCM"\"'/' makegcm.orig >| makegcm 360 373 else # g95 or pgf90 361 374 sed \ … … 369 382 -e 's/-lorglob//' \ 370 383 -e 's/-ffixed-form//' -e 's/-ffree-form//' \ 371 -e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIM "\"'/' makegcm.orig >| makegcm384 -e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIMGCM"\"'/' makegcm.orig >| makegcm 372 385 fi 373 386 else … … 403 416 -e s:"%LINK pgf95":"%LINK g95":1 \ 404 417 -e s:"%PROD_FFLAGS -fast":"%PROD_FFLAGS ":1 \ 405 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTIM ":1 \418 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTIMGCM":1 \ 406 419 arch-linux-32bit.fcm > arch-local.fcm 407 if [ "`echo $OPTIM | grep r8`" != ""] ; then420 if [ $real = r8 ] ; then 408 421 sed -e s:"%FPP_DEF ":"%FPP_DEF NC_DOUBLE":1 \ 409 422 arch-local.fcm > arch-local.fcm.new … … 414 427 -e s:"%LINK pgf95":"%LINK gfortran":1 \ 415 428 -e s:"%PROD_FFLAGS -fast":"%PROD_FFLAGS ":1 \ 416 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTIM ":1 \429 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTIMGCM":1 \ 417 430 arch-linux-32bit.fcm > arch-local.fcm 418 if [ "`echo $OPTIM | grep real-8`" != ""] ; then431 if [ $real = r8 ] ; then 419 432 sed -e s:"%FPP_DEF ":"%FPP_DEF NC_DOUBLE":1 \ 420 433 arch-local.fcm > arch-local.fcm.new … … 424 437 sed -e s:"-Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2":" ":1 \ 425 438 -e s:"%PROD_FFLAGS -fast":"%PROD_FFLAGS ":1 \ 426 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTIM ":1 \439 -e s:"%BASE_FFLAGS ":"%BASE_FFLAGS $OPTIMGCM":1 \ 427 440 arch-linux-32bit.fcm > arch-local.fcm 428 if [ "`echo $OPTIM | grep r8`" != ""] ; then441 if [ $real = r8] ; then 429 442 sed -e s:"%FPP_DEF ":"%FPP_DEF NC_DOUBLE":1 \ 430 443 arch-local.fcm > arch-local.fcm.new
Note: See TracChangeset
for help on using the changeset viewer.