[cig-commits] [commit] devel, master: build: Split regular and optimized compiler flags. (857351f)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Nov 6 08:30:19 PST 2014


Repository : https://github.com/geodynamics/specfem3d_globe

On branches: devel,master
Link       : https://github.com/geodynamics/specfem3d_globe/compare/bc58e579b3b0838a0968725a076f5904845437ca...be63f20cbb6f462104e949894dbe205d2398cd7f

>---------------------------------------------------------------

commit 857351f1b9567594eef6d3d0d7455086a6d8c4a2
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date:   Sun Sep 7 20:26:58 2014 -0400

    build: Split regular and optimized compiler flags.
    
    Currently, doesn't do anything but split them up for future use.


>---------------------------------------------------------------

857351f1b9567594eef6d3d0d7455086a6d8c4a2
 flags.guess | 63 ++++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 35 insertions(+), 28 deletions(-)

diff --git a/flags.guess b/flags.guess
index 1feaf6d..11939ba 100644
--- a/flags.guess
+++ b/flags.guess
@@ -78,18 +78,19 @@ case $my_FC in
         #
         # Cray Fortran
         #
-        DEF_FFLAGS="-O3 -Onoaggress -Oipa0 -hfp2 -Ovector3 -Oscalar3 -Ocache2 -Ounroll2 -Ofusion2 -M 1193 -M 1438" # turn on optimization; -Oaggress -Oipa4 would make it even more aggressive
-        # turn on full debugging and range checking, use:
-        # -eC -eD -ec -en -eI -ea -g -G0 -M 1193 -M 1438 
-        # you then need to run "configure" with option --disable-vectorization
+        DEF_FFLAGS="-M 1193 -M 1438"
+        OPT_FFLAGS="-O3 -Onoaggress -Oipa0 -hfp2 -Ovector3 -Oscalar3 -Ocache2 -Ounroll2 -Ofusion2"
+        # -Oaggress -Oipa4 would make it even more aggressive
+        DEBUG_FFLAGS="-eC -eD -ec -en -eI -ea -g -G0"
         ;;
     pgf95|*/pgf95|pgf90|*/pgf90)
         #
         # Portland PGI
         #
-        DEF_FFLAGS="-fast -Mnobounds -Minline -Mneginfo -Mdclchk -Knoieee -Minform=inform -Mdaz -Mflushz -Mvect -mcmodel=medium"
-        # -Mbounds
+        DEF_FFLAGS="-Mneginfo -Mdclchk -Knoieee -Minform=inform -Mdaz -Mflushz -mcmodel=medium"
+        OPT_FFLAGS="-fast -Mnobounds -Minline -Mvect"
         # -fastsse -tp amd64e -Msmart
+        DEBUG_FFLAGS="-Mbounds"
         ;;
     ifort|*/ifort)
         #
@@ -100,26 +101,27 @@ case $my_FC in
 # parallel file systems like SFS 3.2 / Lustre 1.8. If omitted
 # I/O throughput lingers at 2.5 MB/s, with it it can increase to ~44 MB/s
 # However it does not make much of a difference on NFS mounted volumes or with SFS 3.1.1 / Lustre 1.6.7.1 
-        DEF_FFLAGS="-O3 -check nobounds -xHost -fpe0 -ftz -assume buffered_io -assume byterecl -align sequence -vec-report0 -std03 -diag-disable 6477 -implicitnone -gen-interfaces -warn all" # -mcmodel=medium -shared-intel
-        # useful for debugging...
-        # for debugging: change -O3 -check nobounds to      -check all -debug -g -O0 -fp-stack-check -traceback -ftrapuv
-        # you then need to run "configure" with option --disable-vectorization
+        DEF_FFLAGS="-xHost -fpe0 -ftz -assume buffered_io -assume byterecl -align sequence -vec-report0 -std03 -diag-disable 6477 -implicitnone -gen-interfaces -warn all" # -mcmodel=medium -shared-intel
+        OPT_FFLAGS="-O3 -check nobounds"
+        DEBUG_FFLAGS="-check all -debug -g -O0 -fp-stack-check -traceback -ftrapuv"
         #
         ;;
     gfortran|*/gfortran|f95|*/f95)
         #
         # GNU gfortran
         #
-        DEF_FFLAGS="-std=gnu -fimplicit-none -frange-check -O2 -fmax-errors=10 -pedantic -pedantic-errors -Waliasing -Wampersand -Wcharacter-truncation -Wline-truncation -Wsurprising -Wno-tabs -Wunderflow -ffpe-trap=invalid,zero,overflow" # -mcmodel=medium
-        # useful for debugging: add   -ggdb -fbacktrace -fbounds-check
-        # you then need to run "configure" with option --disable-vectorization
+        DEF_FFLAGS="-std=gnu -fimplicit-none -frange-check -fmax-errors=10 -pedantic -pedantic-errors -Waliasing -Wampersand -Wcharacter-truncation -Wline-truncation -Wsurprising -Wno-tabs -Wunderflow -ffpe-trap=invalid,zero,overflow" # -mcmodel=medium
+        OPT_FFLAGS="-O2"
+        DEBUG_FFLAGS="-ggdb -fbacktrace -fbounds-check"
         # useful to track loss of accuracy because of automatic double to single precision conversion:  -Wconversion  (this may generate many warnings...)
         ;;
     g95|*/g95)
         #
         # g95 (free f95 compiler from http://www.g95.org)
         #
-        DEF_FFLAGS="-O"
+        DEF_FFLAGS="-fimplicit-none"
+        OPT_FFLAGS="-O"
+        DEBUG_FFLAGS="-fbounds-check -ftrace"
         ;;
     f90|*/f90)
         case $host_os in
@@ -129,7 +131,9 @@ case $my_FC in
                 #
                 case $host_cpu in
                     i*86 | x86_64)
-                        DEF_FFLAGS="-W132 -s -O3 -cpu:p7 -v -YDEALLOC=ALL"
+                        DEF_FFLAGS="-W132 -s -cpu:p7 -v -YDEALLOC=ALL"
+                        OPT_FFLAGS="-O3"
+                        DEBUG_FFLAGS=""
                         ;;
                 esac
                 ;;
@@ -137,13 +141,16 @@ case $my_FC in
                 ################ SGI Irix #################
                 DEF_MPIFC=$FC
                 DEF_MPILIBS="-lmpi -lfastm -lfpe"
-                DEF_FFLAGS="-ansi -u -64 -O3 -OPT:Olimit=0 -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -r10000 -mips4"
-                #   -check_bounds
+                DEF_FFLAGS="-ansi -u -64 -OPT:Olimit=0 -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -r10000 -mips4"
+                OPT_FFLAGS="-O3"
+                DEBUG_FFLAGS="-check_bounds"
                 ;;
             superux*)
                 ################## NEC SX ##################
                 DEF_MPIFC=$FC
                 DEF_FFLAGS="-C hopt -R2 -Wf\" -L nostdout noinclist mrgmsg noeject -msg b -pvctl loopcnt=14000000 expand=10 fullmsg vecthreshold=20 -s\" -pi auto line=100 exp=swap_all,rank"
+                OPT_FFLAGS=""
+                DEBUG_FFLAGS=""
                 ;;
         esac
         ;;
@@ -151,8 +158,9 @@ case $my_FC in
         #
         # Lahey f90
         #
-        DEF_FFLAGS="--warn --wo --tpp --f95 --dal -O"
-        #    --chk
+        DEF_FFLAGS="--warn --wo --tpp --f95 --dal"
+        OPT_FFLAGS="-O"
+        DEBUG_FFLAGS="--chk"
         ;;
     ######## IBM ######
     mpxlf*|*/mpxlf*)
@@ -185,15 +193,12 @@ case $my_FC in
         # one should also use additional flags:
         # CFLAGS = -Wl,-relax
         #
-# deleted -qxflag=dvz because it requires handler function __xl_dzx and thus linking will fail 
-        DEF_FFLAGS="-O4 -qnostrict -qassert=contig -qhot -q64 -qtune=auto -qarch=auto -qcache=auto -qfree=f90 -qsuffix=f=f90 -qhalt=w -qlanglvl=2003std -g -qsuppress=1518-234 -qsuppress=1518-317 -qsuppress=1518-318 -qsuppress=1500-036 -Q -Wl,-relax"
-        # Options -qreport -qsource -qlist create a *.lst file containing detailed information about vectorization.
         # On IBM BlueGene at IDRIS (France) use:
         # -qtune=auto -qarch=450d -qsave     instead of -qtune=auto -qarch=auto
-        #
-        # to debug with IBM xlf, remove -Wl,-relax and add -g -O0 -C -qddim -qfullpath -qflttrap=overflow:zerodivide:invalid:enable -qfloat=nans -qinitauto=7FBFFFFF
-        # you then need to run "configure" with option --disable-vectorization
-        #
+        DEF_FFLAGS="-qassert=contig -qhot -q64 -qtune=auto -qarch=auto -qcache=auto -qfree=f90 -qsuffix=f=f90 -qhalt=w -qlanglvl=2003std -g -qsuppress=1518-234 -qsuppress=1518-317 -qsuppress=1518-318 -qsuppress=1500-036"
+        OPT_FFLAGS="-O4 -qnostrict -Q -Wl,-relax"
+        # Options -qreport -qsource -qlist create a *.lst file containing detailed information about vectorization.
+        DEBUG_FFLAGS="-g -O0 -C -qddim -qfullpath -qflttrap=overflow:zerodivide:invalid:enable -qfloat=nans -qinitauto=7FBFFFFF"
         ;;
     pathf90|*/pathf90)
         #
@@ -203,7 +208,9 @@ case $my_FC in
         # CC = pathcc
         # CFLAGS = -O2
         #
-        DEF_FFLAGS="-O3 -OPT:Ofast -fno-math-errno -ffast-math -LNO:fusion=2 -LNO:simd=2 -LNO:simd_verbose=ON -msse3 -march=auto -fno-second-underscore -align64"
+        DEF_FFLAGS="-fno-math-errno -ffast-math -msse3 -march=auto -fno-second-underscore -align64"
+        OPT_FFLAGS="-O3 -OPT:Ofast -LNO:fusion=2 -LNO:simd=2 -LNO:simd_verbose=ON"
+        DEBUG_FFLAGS="-g2"
         ;;
 
 esac
@@ -224,7 +231,7 @@ esac
 #DEF_CFLAGS="-g -O3"
 
 if test "x$FLAGS_CHECK" = "x"; then
-    FLAGS_CHECK="$DEF_FFLAGS"
+    FLAGS_CHECK="$DEF_FFLAGS $OPT_FFLAGS"
 fi
 if test "x$MPIFC" = "x"; then
     MPIFC="$DEF_MPIFC"



More information about the CIG-COMMITS mailing list