Skip to content

Commit

Permalink
Fix for gfortran on powerpc
Browse files Browse the repository at this point in the history
  • Loading branch information
sangallidavide committed Nov 4, 2020
1 parent e137d3e commit e4b2e9c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 36 deletions.
44 changes: 26 additions & 18 deletions config/acx_fortran_flags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ i?86*linux*)
;;
*gfortran*)
SYSFLAGS="-O3 -g -mtune=native"
FUFLAGS="-O0 -g -mtune=native"
FUFLAGS="-O0 -mtune=native"
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*ifort*)
OMPFLAGS="-openmp"
Expand All @@ -97,16 +97,16 @@ i?86*linux*)
;;
esac
SYSFLAGS="-assume bscc -O3 -g -ip $CPU_FLAG"
FUFLAGS="-assume bscc -O0 -g $CPU_FLAG"
FUFLAGS="-assume bscc -O0 $CPU_FLAG"
FCMFLAG="-nofor_main"
DEBUG_FLAGS="-check all -CB -g -traceback -check bound"
DEBUG_FLAGS="-check all -CB -traceback -check bound"
;;
*pathf9*)
SYSFLAGS="-O2 -g -fno-second-underscore"
FUFLAGS="-O0 -g -fno-second-underscore"
FCMFLAG=""
OMPFLAGS=""
DEBUG_FLAGS="-g -ffortran-bounds-check -C"
DEBUG_FLAGS="-ffortran-bounds-check -C"
;;
*)
SYSFLAGS="-O -g"
Expand All @@ -131,13 +131,13 @@ i?86*linux*)
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*g95*)
SYSFLAGS="-O3 -g -fno-second-underscore -mtune=pentium4"
FUFLAGS="-O0 -g -fno-second-underscore"
FCMFLAG=""
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ftrace=full"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ftrace=full"
;;
*ifort*)
CPU_FLAG=""
Expand All @@ -154,7 +154,7 @@ i?86*linux*)
FCMFLAG="-nofor_main"
OMPFLAGS="-openmp"
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-check all -CB -g -traceback -check bound"
DEBUG_FLAGS="-check all -CB -traceback -check bound"
;;
*)
SYSFLAGS="-O -g"
Expand All @@ -180,13 +180,13 @@ ia64*linux* )
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*g95*)
SYSFLAGS="-O3 -g -fbackslash -fno-second-underscore"
FUFLAGS="-O0 -g -fbackslash -fno-second-underscore"
FCMFLAG=""
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ftrace=full"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ftrace=full"
;;
*abf90*)
SYSFLAGS="-B101 -YEXT_NAMES=LCS -YEXT_SFX=_"
Expand All @@ -196,7 +196,7 @@ ia64*linux* )
FUFLAGS="-O0 -g -w"
OMPFLAGS="-openmp"
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-g"
DEBUG_FLAGS=""
;;
*ifort*)
CPU_FLAG=""
Expand All @@ -213,19 +213,19 @@ ia64*linux* )
FCMFLAG="-nofor_main"
OMPFLAGS="-openmp"
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-g -check all -CB -traceback -check bound"
DEBUG_FLAGS="-check all -CB -traceback -check bound"
;;
*openf9*)
SYSFLAGS="-O2 -fno-second-underscore"
FUFLAGS="-O0 -fno-second-underscore"
FCMFLAG=""
;;
*pathf9*)
SYSFLAGS="-O2 -g -fno-second-underscore"
FUFLAGS="-O0 -g -fno-second-underscore"
SYSFLAGS="-O2 -fno-second-underscore"
FUFLAGS="-O0 -fno-second-underscore"
FCMFLAG=""
OMPFLAGS=""
DEBUG_FLAGS="-g -ffortran-bounds-check -C"
DEBUG_FLAGS="-ffortran-bounds-check -C"
;;
*)
SYSFLAGS="-g -O"
Expand All @@ -251,13 +251,13 @@ ia64*linux* )
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*g95*)
SYSFLAGS="-O3 -g -fbackslash -fno-second-underscore"
FUFLAGS="-O0 -g -fbackslash -fno-second-underscore"
FCMFLAG=""
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ftrace=full"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ftrace=full"
;;
*abf90*)
SYSFLAGS="-B101 -YEXT_NAMES=LCS -YEXT_SFX=_"
Expand Down Expand Up @@ -291,7 +291,7 @@ ia64*linux* )
FUFLAGS="-assume bscc -O0 -g ${CPU_FLAG}"
FCMFLAG="-nofor_main"
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-g -CB -traceback"
DEBUG_FLAGS="-CB -traceback"
;;
*openf9*)
SYSFLAGS="-O2 -fno-second-underscore"
Expand Down Expand Up @@ -327,6 +327,14 @@ powerpc64*linux* )
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-g -Minform=inform -Mbounds -Mchkptr -Mchkstk -Meh_frame"
;;
*gfortran*)
SYSFLAGS="-O3 -g -mtune=native"
FUFLAGS="-O0 -g -mtune=native"
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*)
CFLAGS="-q64 -O2 -g"
SYSFLAGS="-q64 -O2 -g -qnoescape -qnostrict -qarch=ppc970 -qtune=ppc970"
Expand Down
44 changes: 26 additions & 18 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6563,11 +6563,11 @@ i?86*linux*)
;;
*gfortran*)
SYSFLAGS="-O3 -g -mtune=native"
FUFLAGS="-O0 -g -mtune=native"
FUFLAGS="-O0 -mtune=native"
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*ifort*)
OMPFLAGS="-openmp"
Expand All @@ -6590,16 +6590,16 @@ i?86*linux*)
;;
esac
SYSFLAGS="-assume bscc -O3 -g -ip $CPU_FLAG"
FUFLAGS="-assume bscc -O0 -g $CPU_FLAG"
FUFLAGS="-assume bscc -O0 $CPU_FLAG"
FCMFLAG="-nofor_main"
DEBUG_FLAGS="-check all -CB -g -traceback -check bound"
DEBUG_FLAGS="-check all -CB -traceback -check bound"
;;
*pathf9*)
SYSFLAGS="-O2 -g -fno-second-underscore"
FUFLAGS="-O0 -g -fno-second-underscore"
FCMFLAG=""
OMPFLAGS=""
DEBUG_FLAGS="-g -ffortran-bounds-check -C"
DEBUG_FLAGS="-ffortran-bounds-check -C"
;;
*)
SYSFLAGS="-O -g"
Expand All @@ -6624,13 +6624,13 @@ i?86*linux*)
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*g95*)
SYSFLAGS="-O3 -g -fno-second-underscore -mtune=pentium4"
FUFLAGS="-O0 -g -fno-second-underscore"
FCMFLAG=""
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ftrace=full"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ftrace=full"
;;
*ifort*)
CPU_FLAG=""
Expand All @@ -6647,7 +6647,7 @@ i?86*linux*)
FCMFLAG="-nofor_main"
OMPFLAGS="-openmp"
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-check all -CB -g -traceback -check bound"
DEBUG_FLAGS="-check all -CB -traceback -check bound"
;;
*)
SYSFLAGS="-O -g"
Expand All @@ -6673,13 +6673,13 @@ ia64*linux* )
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*g95*)
SYSFLAGS="-O3 -g -fbackslash -fno-second-underscore"
FUFLAGS="-O0 -g -fbackslash -fno-second-underscore"
FCMFLAG=""
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ftrace=full"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ftrace=full"
;;
*abf90*)
SYSFLAGS="-B101 -YEXT_NAMES=LCS -YEXT_SFX=_"
Expand All @@ -6689,7 +6689,7 @@ ia64*linux* )
FUFLAGS="-O0 -g -w"
OMPFLAGS="-openmp"
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-g"
DEBUG_FLAGS=""
;;
*ifort*)
CPU_FLAG=""
Expand All @@ -6706,19 +6706,19 @@ ia64*linux* )
FCMFLAG="-nofor_main"
OMPFLAGS="-openmp"
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-g -check all -CB -traceback -check bound"
DEBUG_FLAGS="-check all -CB -traceback -check bound"
;;
*openf9*)
SYSFLAGS="-O2 -fno-second-underscore"
FUFLAGS="-O0 -fno-second-underscore"
FCMFLAG=""
;;
*pathf9*)
SYSFLAGS="-O2 -g -fno-second-underscore"
FUFLAGS="-O0 -g -fno-second-underscore"
SYSFLAGS="-O2 -fno-second-underscore"
FUFLAGS="-O0 -fno-second-underscore"
FCMFLAG=""
OMPFLAGS=""
DEBUG_FLAGS="-g -ffortran-bounds-check -C"
DEBUG_FLAGS="-ffortran-bounds-check -C"
;;
*)
SYSFLAGS="-g -O"
Expand All @@ -6744,13 +6744,13 @@ ia64*linux* )
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*g95*)
SYSFLAGS="-O3 -g -fbackslash -fno-second-underscore"
FUFLAGS="-O0 -g -fbackslash -fno-second-underscore"
FCMFLAG=""
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ftrace=full"
DEBUG_FLAGS="-Wall -pedantic -fbounds-check -ftrace=full"
;;
*abf90*)
SYSFLAGS="-B101 -YEXT_NAMES=LCS -YEXT_SFX=_"
Expand Down Expand Up @@ -6784,7 +6784,7 @@ ia64*linux* )
FUFLAGS="-assume bscc -O0 -g ${CPU_FLAG}"
FCMFLAG="-nofor_main"
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-g -CB -traceback"
DEBUG_FLAGS="-CB -traceback"
;;
*openf9*)
SYSFLAGS="-O2 -fno-second-underscore"
Expand Down Expand Up @@ -6820,6 +6820,14 @@ powerpc64*linux* )
NETCDFFLAGS="-DpgiFortran"
DEBUG_FLAGS="-g -Minform=inform -Mbounds -Mchkptr -Mchkstk -Meh_frame"
;;
*gfortran*)
SYSFLAGS="-O3 -g -mtune=native"
FUFLAGS="-O0 -g -mtune=native"
FCMFLAG=""
OMPFLAGS="-fopenmp"
NETCDFFLAGS="-DgFortran"
DEBUG_FLAGS="-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,zero,overflow"
;;
*)
CFLAGS="-q64 -O2 -g"
SYSFLAGS="-q64 -O2 -g -qnoescape -qnostrict -qarch=ppc970 -qtune=ppc970"
Expand Down

0 comments on commit e4b2e9c

Please sign in to comment.