From 12a1d82bfde7e9d125157cefac483d9729f5b643 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 8 Oct 2004 21:39:31 -0500 Subject: [svn-r9388] *** empty log message *** --- config/freebsd | 6 - config/gnu-flags | 79 ++++++------ config/i386-pc-cygwin32 | 3 - config/intel-flags | 1 + config/linux-gnulibc1 | 12 +- config/powerpc-apple | 18 --- fortran/config/freebsd | 6 - fortran/config/gnu-flags | 277 +++++++++++++++++++++++----------------- fortran/config/i386-pc-cygwin32 | 3 - fortran/config/intel-fflags | 87 +++++++++++++ fortran/config/intel-flags | 87 +++++++++++++ fortran/config/linux-gnulibc1 | 94 +++++++------- fortran/config/pgi-fflags | 86 +++++++++++++ fortran/config/pgi-flags | 86 +++++++++++++ fortran/config/powerpc-apple | 69 +++++----- fortran/configure.in | 17 ++- 16 files changed, 647 insertions(+), 284 deletions(-) create mode 100644 fortran/config/intel-fflags create mode 100644 fortran/config/intel-flags create mode 100644 fortran/config/pgi-fflags create mode 100644 fortran/config/pgi-flags diff --git a/config/freebsd b/config/freebsd index 44c098d..8bdad05 100644 --- a/config/freebsd +++ b/config/freebsd @@ -11,16 +11,10 @@ if test "X-" = "X-$CC"; then CC_BASENAME=gcc fi -# Architecture-specific flags -ARCH= - # Add "_POSIX_C_SOURCE" define to cpp flags, to quiet warnings # from /usr/include/sys/cdefs.h CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=1" -# Omit frame pointer for optimized code? -NOFP=${NOFP:=-fomit-frame-pointer} - # Figure out compiler flags . $srcdir/config/gnu-flags diff --git a/config/gnu-flags b/config/gnu-flags index 5568d24..7fb392d 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -89,42 +89,47 @@ EOF fi -arch= -# Architecture-specific flags -case "$host_os-$host_cpu" in - # FreeBSD sets the information from "uname -m" to the general machine - # architecture, not the specific CPU for the machine, so even our - # Pentium II Xeon server is set to "i386". Once we know we are on a FreeBSD - # machine, use the "sysctl" command to get the CPU hardware model. - freebsd*-i386) - host_cpu_model=`sysctl -n hw.model` - case "$host_cpu_model" in - # Hmm.. this might not catch Celerons, but it won't hurt them either... - *Pro*|*II*|*III*|*IV*|*Athlon*) - arch="-march=i686" +# Common GCC flags for various situations +case "$cc_vendor-$cc_version" in + gcc*|egcs*|pgcc*) + + # Architecture-specific flags + arch= + case "$host_os-$host_cpu" in + # FreeBSD sets the information from "uname -m" to the general machine + # architecture, not the specific CPU for the machine, so even our + # Pentium II Xeon server is set to "i386". Once we know we are on a FreeBSD + # machine, use the "sysctl" command to get the CPU hardware model. + freebsd*-i386) + host_cpu_model=`sysctl -n hw.model` + case "$host_cpu_model" in + # Hmm.. this might not catch Celerons, but it won't hurt them either... + *Pro*|*II*|*III*|*IV*|*Athlon*) + arch="-march=i686" + ;; + esac ;; - esac - ;; - *-i686) - arch="-march=i686" - ;; -esac + *-i686) + arch="-march=i686" + ;; + esac -# Host-specific flags -case "`hostname`" in - sleipnir.ncsa.uiuc.edu) - arch="$arch -pipe" - ;; -esac + # Host-specific flags + case "`hostname`" in + sleipnir.ncsa.uiuc.edu) + arch="$arch -pipe" + ;; + esac -# Common GCC flags for various situations -case "$cc_vendor-$cc_version" in - gcc*|egcs*|pgcc*) # General CFLAGS="$CFLAGS $arch -ansi -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline" # Production + + # Omit frame pointer for optimized code? + NOFP=${NOFP:=-fomit-frame-pointer} + case "$cc_vendor-$cc_version" in gcc-2.95.[34]) PROD_CFLAGS="-O3 $NOFP" @@ -157,6 +162,9 @@ case "$cc_vendor-$cc_version" in # Profile PROFILE_CFLAGS="-g -pg" PROFILE_CPPFLAGS= + + # Flags are set + cc_flags_set=yes ;; esac @@ -190,9 +198,6 @@ case "$cc_vendor-$cc_version" in # Append more extra warning flags that only gcc3.4+ know about CFLAGS="$CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Flags are set - cc_flags_set=yes ;; gcc-3.3*) @@ -217,9 +222,6 @@ case "$cc_vendor-$cc_version" in # Append more extra warning flags that only gcc3.3+ know about CFLAGS="$CFLAGS -Wendif-labels" - - # Flags are set - cc_flags_set=yes ;; gcc-3.2*) @@ -241,9 +243,6 @@ case "$cc_vendor-$cc_version" in # The "unreachable code" warning does not appear to be reliable yet... #CFLAGS="$CFLAGS -Wunreachable-code" - - # Flags are set - cc_flags_set=yes ;; gcc-3*) @@ -255,17 +254,11 @@ case "$cc_vendor-$cc_version" in # Append some extra warning flags that only gcc3+ know about CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - - # Flags are set - cc_flags_set=yes ;; gcc-2.9[56]*) # Disable warnings about using 'long long' type CFLAGS="$CFLAGS -Wno-long-long" - - # Flags are set - cc_flags_set=yes ;; esac diff --git a/config/i386-pc-cygwin32 b/config/i386-pc-cygwin32 index 4054819..474903b 100644 --- a/config/i386-pc-cygwin32 +++ b/config/i386-pc-cygwin32 @@ -13,8 +13,5 @@ if test "X-" = "X-$CC"; then LD=ld fi -# Omit frame pointer for optimized code? -NOFP=${NOFP:=-fomit-frame-pointer} - # Figure out compiler flags . $srcdir/config/gnu-flags diff --git a/config/intel-flags b/config/intel-flags index 166448e..d04c112 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -84,3 +84,4 @@ if test "X-$cc_flags_set" = "X-"; then cc_version= fi + diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 3659eb3..bec3fa4 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -12,8 +12,12 @@ if test -z "$CC"; then CC_BASENAME=gcc fi -# Omit frame pointer for optimized code? -NOFP=${NOFP:=-fomit-frame-pointer} - -# Figure out compiler flags +# Figure out GNU C compiler flags . $srcdir/config/gnu-flags + +# Figure out PGI C compiler flags +. $srcdir/config/pgi-flags + +# Figure out Intel C compiler flags +. $srcdir/config/intel-flags + diff --git a/config/powerpc-apple b/config/powerpc-apple index a0c2aa2..e0e63c6 100644 --- a/config/powerpc-apple +++ b/config/powerpc-apple @@ -11,24 +11,6 @@ if test "X-" = "X-$CC"; then CC_BASENAME=gcc fi -# Architecture-specific flags -ARCH= - -# Add "_POSIX_C_SOURCE" define to cpp flags, to quiet warnings -# from /usr/include/sys/cdefs.h -#CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=1" - -# Omit frame pointer for optimized code? -NOFP=${NOFP:=-fomit-frame-pointer} - # Figure out compiler flags . $srcdir/config/gnu-flags -# Special setup to use pthread support if enable-threadsafe is on. -# Works with static executable only. -#if test "X-" != "X-$enable_threadsafe"; then -# CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" -# LDFLAGS="$LDFLAGS -pthread" -# LIBS="$LIBS -lcipher" -# enable_static_exec=yes -#fi diff --git a/fortran/config/freebsd b/fortran/config/freebsd index 8608a85..d7bce7f 100644 --- a/fortran/config/freebsd +++ b/fortran/config/freebsd @@ -11,11 +11,5 @@ if test "X-" = "X-$CC"; then CC_BASENAME=gcc fi -# Architecture-specific flags -ARCH= - -# Omit frame pointer for optimized code? -NOFP=${NOFP:=-fomit-frame-pointer} - # Figure out compiler flags . $srcdir/config/gnu-flags diff --git a/fortran/config/gnu-flags b/fortran/config/gnu-flags index a14d70e..8e543db 100644 --- a/fortran/config/gnu-flags +++ b/fortran/config/gnu-flags @@ -47,17 +47,32 @@ if test gcc = "$cc_vendor" -a "$cc_vers_all" -lt 2008001; then EOF sleep 5 +# GCC v2.96 (shipped with RH7.x) has problems with `float'-> `double' conversions. +elif test gcc = "$cc_vendor" -a "$cc_vers_all" -eq 2096000; then + cat < long long conversions in the + # test/dtypes test). Perhaps later versions of gcc will fix this + # bug... - QAK - 2003/10/20 + PROD_CFLAGS="-O $NOFP" + ;; + gcc-3*) + # Be optimistic about future versions of gcc.. :-) - QAK - 2003/10/20 + PROD_CFLAGS="-O3 $NOFP" ;; + *) + PROD_CFLAGS="-O $NOFP" + ;; + esac + + PROD_CFLAGS="$PROD_CFLAGS -finline-functions" + PROD_CPPFLAGS= + + # Debug + DEBUG_CFLAGS="-g -fverbose-asm" + DEBUG_CPPFLAGS= + + # Profile + PROFILE_CFLAGS="-g -pg" + PROFILE_CPPFLAGS= + + # Flags are set + cc_flags_set=yes + ;; esac -# Compiler flags +# Version specific GCC flags +# +# Please follow the pattern below by adding new versions at the top, copying +# the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in - gcc-2.7*) - # General - CFLAGS="$CFLAGS $ARCH -ansi" + gcc-3.4*) + # Replace -ansi flag with -std=c99 flag + CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" - # Production - PROC_CFLAGS="-O3 $NOFP -finline-functions -Wno-shadow" - PROD_CPPFLAGS= + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" - # Debug - DEBUG_CFLAGS="-g -fverbose-asm -Wno-shadow" - DEBUG_CPPFLAGS= + # Append warning flags from gcc-3* case + CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - # Profile - PROFILE_CFLAGS=-pg - PROFILE_CPPFLAGS= + # Append warning flags from gcc-3.2* case + CFLAGS="$CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" - # Flags are set - cc_flags_set=yes - ;; + # The "format=2" warning generates too many warnings about valid + # usage in the library. + #CFLAGS="$CFLAGS -Wformat=2" - gcc-2.8.*) - # General - CFLAGS="$CFLAGS $ARCH -Wsign-compare" + # The "unreachable code" warning does not appear to be reliable yet... + #CFLAGS="$CFLAGS -Wunreachable-code" - # Production - PROD_CFLAGS="-O3 $NOFP -finline-functions -fschedule-insns2 -Wno-shadow" - PROD_CPPFLAGS= + # Append warning flags from gcc-3.3* case + CFLAGS="$CFLAGS -Wendif-labels" - # Debug - DEBUG_CFLAGS="-g -fverbose-asm -Wno-shadow" - DEBUG_CPPFLAGS= + # Append more extra warning flags that only gcc3.4+ know about + CFLAGS="$CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + ;; - # Profile - PROFILE_CFLAGS=-pg - PROFILE_CPPFLAGS= + gcc-3.3*) + # Replace -ansi flag with -std=c99 flag + CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" - # Flags are set - cc_flags_set=yes - ;; + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" - gcc-2.95*) - # General - CFLAGS="$CFLAGS $ARCH -Wsign-compare" + # Append warning flags from gcc-3* case + CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - # Production - PROD_CFLAGS="-O6 $NOFP -Wno-shadow" - PROD_CPPFLAGS= + # Append warning flags from gcc-3.2* case + CFLAGS="$CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" - # Debug - DEBUG_CFLAGS="-g -fverbose-asm -Wno-shadow" - DEBUG_CPPFLAGS= + # The "format=2" warning generates too many warnings about valid + # usage in the library. + #CFLAGS="$CFLAGS -Wformat=2" - # Profile - PROFILE_CFLAGS=-pg - PROFILE_CPPFLAGS= + # The "unreachable code" warning does not appear to be reliable yet... + #CFLAGS="$CFLAGS -Wunreachable-code" - # Flags are set - cc_flags_set=yes - ;; + # Append more extra warning flags that only gcc3.3+ know about + CFLAGS="$CFLAGS -Wendif-labels" + ;; - egcs-2.*|pgcc-2.*) - # General - CFLAGS="$CFLAGS $ARCH -Wsign-compare" + gcc-3.2*) + # Replace -ansi flag with -std=c99 flag + CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" - # Production - PROD_CFLAGS="-O6 $NOFP -Wno-shadow" - PROD_CPPFLAGS= + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" - # Debug - DEBUG_CFLAGS="-g -fverbose-asm -Wno-shadow" - DEBUG_CPPFLAGS= + # Append warning flags from gcc-3* case + CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - # Profile - PROFILE_CFLAGS=-pg - PROFILE_CPPFLAGS= + # Append more extra warning flags that only gcc3.2+ know about + CFLAGS="$CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar" - # Flags are set - cc_flags_set=yes - ;; + # The "format=2" warning generates too many warnings about valid + # usage in the library. + #CFLAGS="$CFLAGS -Wformat=2" - gcc-*|egcs-*|pgcc-*) - # This must be some other GNU compiler that we don't know about. - # Just use fairly generic flags. + # The "unreachable code" warning does not appear to be reliable yet... + #CFLAGS="$CFLAGS -Wunreachable-code" + ;; - # Production - PROD_CFLAGS=-O - PROD_CPPFLAGS= + gcc-3*) + # Replace -ansi flag with -std=c99 flag + CFLAGS="`echo $CFLAGS | sed -e 's/-ansi/-std=c99/g'`" - # Debug - DEBUG_CFLAGS=-g - DEBUG_CPPFLAGS= + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" - # Profile - PROFILE_CFLAGS=-pg - PROFILE_CPPFLAGS= + # Append some extra warning flags that only gcc3+ know about + CFLAGS="$CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + ;; - # Flags are set - cc_flags_set=yes - ;; + gcc-2.9[56]*) + # Disable warnings about using 'long long' type + CFLAGS="$CFLAGS -Wno-long-long" + ;; esac # Clear cc info if no flags set -if test X = "X$cc_flags_set"; then - cc_vendor= - cc_version= +if test "X$cc_flags_set" = "X"; then + cc_vendor= + cc_version= fi diff --git a/fortran/config/i386-pc-cygwin32 b/fortran/config/i386-pc-cygwin32 index 4054819..474903b 100644 --- a/fortran/config/i386-pc-cygwin32 +++ b/fortran/config/i386-pc-cygwin32 @@ -13,8 +13,5 @@ if test "X-" = "X-$CC"; then LD=ld fi -# Omit frame pointer for optimized code? -NOFP=${NOFP:=-fomit-frame-pointer} - # Figure out compiler flags . $srcdir/config/gnu-flags diff --git a/fortran/config/intel-fflags b/fortran/config/intel-fflags new file mode 100644 index 0000000..77dd1c5 --- /dev/null +++ b/fortran/config/intel-fflags @@ -0,0 +1,87 @@ + +# -*- shell-script -*- +# +# This file should be sourced into configure if the compiler is the +# Intel ifort compiler or a derivative. It is careful not to do anything +# if the compiler is not Intel; otherwise `f9x_flags_set' is set to `yes' +# + +# Get the compiler version in a way that works for ifort +# ifort unless a compiler version is already known +# +# f9x_vendor: The compiler name: ifort +# f9x_version: Version number: 8.0 +# +if test X = "X$f9x_flags_set"; then + f9x_version="`$F9X $FFLAGS -V 2>&1 |grep '^Intel'`" + if test X != "X$f9x_version"; then + f9x_vendor=ifort + f9x_version="`$F9X $FFLAGS -v 2>&1 |sed 's/Version \([-a-z0-9\.\-]*\).*/\1/'`" + echo "compiler '$F9X' is Intel $f9x_vendor-$f9x_version" + + # Some version numbers + # Intel version numbers are of the form: "major.minor" + f9x_vers_major=`echo $f9x_version | cut -f1 -d.` + f9x_vers_minor=`echo $f9x_version | cut -f2 -d.` + #f9x_vers_patch=`echo $f9x_version | cut -f2 -d.` + test -n "$f9x_vers_major" || f9x_vers_major=0 + test -n "$f9x_vers_minor" || f9x_vers_minor=0 + test -n "$f9x_vers_patch" || f9x_vers_patch=0 + f9x_vers_all=`expr $f9x_vers_major '*' 1000000 + $f9x_vers_minor '*' 1000 + $f9x_vers_patch` + fi +fi + +# Common Intel flags for various situations +if test "X-ifort" = "X-$f9x_vendor"; then + # Insert section about version specific problems from gnu-flags here, if + # necessary. + + arch= + # Architecture-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "$host_os-$host_cpu" in + # *-i686) + # arch="-march=i686" + # ;; + #esac + + # Host-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "`hostname`" in + # sleipnir.ncsa.uiuc.edu) + # arch="$arch -pipe" + # ;; + #esac + + # General + F9X_BASENAME=ifort + F9XSUFFIXFLAG="" + FSEARCH_DIRS="" + FFLAGS="$FFLAGS" + + # Production + + # Omit frame pointer for optimized code? + #NOFP=${NOFP:=-Mnoframe} + + #PROD_FFLAGS="-O3 $NOFP" + PROD_FFLAGS="-O3" + + # Debug + DEBUG_FFLAGS="-g -check all" + + # Profile + # Use this for profiling with gprof + PROFILE_FFLAGS="-g -p" + + # Flags are set + f9x_flags_set=yes +fi + +# Clear f9x info if no flags set +if test "X-$f9x_flags_set" = "X-"; then + f9x_vendor= + f9x_version= +fi + + diff --git a/fortran/config/intel-flags b/fortran/config/intel-flags new file mode 100644 index 0000000..d04c112 --- /dev/null +++ b/fortran/config/intel-flags @@ -0,0 +1,87 @@ +# -*- shell-script -*- +# +# This file should be sourced into configure if the compiler is the +# Intel icc compiler or a derivative. It is careful not to do anything +# if the compiler is not Intel; otherwise `cc_flags_set' is set to `yes' +# + +# Get the compiler version in a way that works for icc +# icc unless a compiler version is already known +# +# cc_vendor: The compiler name: icc +# cc_version: Version number: 8.0 +# +if test X = "X$cc_flags_set"; then + cc_version="`$CC $CFLAGS -V 2>&1 |grep '^Intel'`" + if test X != "X$cc_version"; then + cc_vendor=icc + cc_version="`$CC $CFLAGS --version 2>&1`" + echo "compiler '$CC' is Intel $cc_vendor-$cc_version" + + # Some version numbers + # Intel version numbers are of the form: "major.minor" + cc_vers_major=`echo $cc_version | cut -f1 -d.` + cc_vers_minor=`echo $cc_version | cut -f2 -d.` + #cc_vers_patch=`echo $cc_version | cut -f2 -d.` + test -n "$cc_vers_major" || cc_vers_major=0 + test -n "$cc_vers_minor" || cc_vers_minor=0 + test -n "$cc_vers_patch" || cc_vers_patch=0 + cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch` + fi +fi + +# Common Intel flags for various situations +if test "X-icc" = "X-$cc_vendor"; then + # Insert section about version specific problems from gnu-flags here, if + # necessary. + + arch= + # Architecture-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "$host_os-$host_cpu" in + # *-i686) + # arch="-march=i686" + # ;; + #esac + + # Host-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "`hostname`" in + # sleipnir.ncsa.uiuc.edu) + # arch="$arch -pipe" + # ;; + #esac + + # General + CFLAGS="$CFLAGS $arch -Wall -Wcheck" + + # Production + + # Omit frame pointer for optimized code? + #NOFP=${NOFP:=-Mnoframe} + + #PROD_CFLAGS="-O3 $NOFP" + PROD_CFLAGS="-O3" + PROD_CPPFLAGS= + + # Debug + DEBUG_CFLAGS="-g" + DEBUG_CPPFLAGS= + + # Profile + # Use this for profiling with gprof + PROFILE_CFLAGS="-g -p" + PROFILE_CPPFLAGS= + + # Flags are set + cc_flags_set=yes + +fi + +# Clear cc info if no flags set +if test "X-$cc_flags_set" = "X-"; then + cc_vendor= + cc_version= +fi + + diff --git a/fortran/config/linux-gnulibc1 b/fortran/config/linux-gnulibc1 index 17409d5..f88ddbf 100644 --- a/fortran/config/linux-gnulibc1 +++ b/fortran/config/linux-gnulibc1 @@ -12,32 +12,43 @@ if test -z "$CC"; then CC_BASENAME=gcc fi -# Omit frame pointer for optimized code? -NOFP=${NOFP:=-fomit-frame-pointer} - -# Figure out compiler flags +# Figure out GNU C compiler flags . $srcdir/config/gnu-flags -# Figure out which compiler we are using: pgf90 or Absoft f95 -RM='rm -f' -tmpfile=/tmp/cmpver.$$ -$F9X -V >$tmpfile +# Figure out PGI C compiler flags +. $srcdir/config/pgi-flags - if test -s "$tmpfile"; then - if( grep -s 'Absoft' $tmpfile > /dev/null) - then - F9X_BASENAME=f95 - CFLAGS="$CFLAGS -DH5_ABSOFT" - fi - if( grep -s 'pgf90' $tmpfile > /dev/null) - then - F9X_BASENAME=pgf90 - fi - fi +# Figure out Intel C compiler flags +. $srcdir/config/intel-flags -$RM $tmpfile # The default Fortran 90 compiler +if test "X-" = "X-$F9X"; then + case $CC_BASENAME in + gcc*|pgcc*) + F9X=pgf90 + F9X_BASENAME=pgf90 + ;; + icc*) + F9X=ifort + F9X_BASENAME=ifort + ;; + esac +else + # Figure out which compiler we are using: pgf90 or Absoft f95 + RM='rm -f' + tmpfile=/tmp/cmpver.$$ + $F9X -V >$tmpfile + if test -s "$tmpfile"; then + if( grep -s 'Absoft' $tmpfile > /dev/null) then + F9X_BASENAME=f95 + fi + if( grep -s 'pgf90' $tmpfile > /dev/null) then + F9X_BASENAME=pgf90 + fi + fi + $RM $tmpfile +fi # # HDF5 integers @@ -55,34 +66,29 @@ HID_T='SELECTED_INT_KIND(R_INTEGER)' SIZE_T='SELECTED_INT_KIND(R_INTEGER)' OBJECT_NAMELEN_DEFAULT_F=-1 -if test "X-" = "X-$F9X"; then - F9X=pgf90 - F9X_BASENAME=pgf90 -fi +# Figure out PGI F90 compiler flags +. $srcdir/config/pgi-fflags + +# Figure out Intel F90 compiler flags +. $srcdir/config/intel-fflags case $F9X_BASENAME in - pgf90) - F9XSUFFIXFLAG="" - FFLAGS="$FFLAGS" - FSEARCH_DIRS="" - DEBUG_FFLAGS="" - PROD_FFLAGS="" - PROFILE_FFLAGS="" - f9x_flags_set=yes - ;; -# -# Assume Absoft compiler -# + # + # Absoft compiler + # f95) - F9XSUFFIXFLAG="" + # Set required flag for compiling C stubs + CFLAGS="$CFLAGS -DH5_ABSOFT" + + F9XSUFFIXFLAG="" # We force compiler to use upper case for external names # (just in case since this should be a default EIP) - FFLAGS="$FFLAGS -YEXT_NAMES=UCS" - FSEARCH_DIRS="" - DEBUG_FFLAGS="-O" - PROD_FFLAGS="-O" - PROFILE_FFLAGS="-O" - f9x_flags_set=yes - ;; + FFLAGS="$FFLAGS -YEXT_NAMES=UCS" + FSEARCH_DIRS="" + DEBUG_FFLAGS="-g" + PROD_FFLAGS="-O" + PROFILE_FFLAGS="-g" + f9x_flags_set=yes + ;; esac diff --git a/fortran/config/pgi-fflags b/fortran/config/pgi-fflags new file mode 100644 index 0000000..6d4553e --- /dev/null +++ b/fortran/config/pgi-fflags @@ -0,0 +1,86 @@ +# -*- shell-script -*- +# +# This file should be sourced into configure if the compiler is the +# PGI pgf90 compiler or a derivative. It is careful not to do anything +# if the compiler is not PGI; otherwise `f9x_flags_set' is set to `yes' +# + +# Get the compiler version in a way that works for pgf90 +# pgf90 unless a compiler version is already known +# +# f9x_vendor: The compiler name: pgf90 +# f9x_version: Version number: 5.0-2, 5.2-2 +# +if test X = "X$f9x_flags_set"; then + f9x_version="`$F9X $FFLAGS -V 2>&1 |grep '^pgf90'`" + if test X != "X$f9x_version"; then + f9x_vendor=`echo $f9x_version |sed 's/\([a-z0-9]*\).*/\1/'` + f9x_version=`echo $f9x_version |sed 's/pgf90 \([-a-z0-9\.\-]*\).*/\1/'` + echo "compiler '$F9X' is PGI $f9x_vendor-$f9x_version" + + # Some version numbers + # PGI version numbers are of the form: "major.minor-patch" + f9x_vers_major=`echo $f9x_version | cut -f1 -d.` + f9x_vers_minor=`echo $f9x_version | cut -f2 -d. | cut -f1 -d-` + f9x_vers_patch=`echo $f9x_version | cut -f2 -d. | cut -f2 -d-` + test -n "$f9x_vers_major" || f9x_vers_major=0 + test -n "$f9x_vers_minor" || f9x_vers_minor=0 + test -n "$f9x_vers_patch" || f9x_vers_patch=0 + f9x_vers_all=`expr $f9x_vers_major '*' 1000000 + $f9x_vers_minor '*' 1000 + $f9x_vers_patch` + fi +fi + +# Common PGI flags for various situations +if test "X-pgf90" = "X-$f9x_vendor"; then + # Insert section about version specific problems from gnu-flags here, if + # necessary. + + arch= + # Architecture-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "$host_os-$host_cpu" in + # *-i686) + # arch="-march=i686" + # ;; + #esac + + # Host-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "`hostname`" in + # sleipnir.ncsa.uiuc.edu) + # arch="$arch -pipe" + # ;; + #esac + + # General + F9X_BASENAME=pgf90 + F9XSUFFIXFLAG="" + FSEARCH_DIRS="" + FFLAGS="$FFLAGS -Mdclchk -Mstandard -Minform,warn" + + # Production + + # Omit frame pointer for optimized code? + NOFP=${NOFP:=-Mnoframe} + + PROD_FFLAGS="-fast -s $NOFP" + + # Debug + DEBUG_FFLAGS="-g -Mbounds -Mchkfpstk -Mchkptr" + + # Profile + PROFILE_FFLAGS="-g -Mprof=func,line" + # Use this for profiling with gprof + #PROFILE_FFLAGS="-g -pg" + + # Flags are set + f9x_flags_set=yes +fi + +# Clear f9x info if no flags set +if test "X-$f9x_flags_set" = "X-"; then + f9x_vendor= + f9x_version= +fi + + diff --git a/fortran/config/pgi-flags b/fortran/config/pgi-flags new file mode 100644 index 0000000..8329eb0 --- /dev/null +++ b/fortran/config/pgi-flags @@ -0,0 +1,86 @@ +# -*- shell-script -*- +# +# This file should be sourced into configure if the compiler is the +# PGI pgcc compiler or a derivative. It is careful not to do anything +# if the compiler is not PGI; otherwise `cc_flags_set' is set to `yes' +# + +# Get the compiler version in a way that works for pgcc +# pgcc unless a compiler version is already known +# +# cc_vendor: The compiler name: pgcc +# cc_version: Version number: 5.0-2, 5.2-2 +# +if test X = "X$cc_flags_set"; then + cc_version="`$CC $CFLAGS -V 2>&1 |grep '^pgcc'`" + if test X != "X$cc_version"; then + cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'` + cc_version=`echo $cc_version |sed 's/pgcc \([-a-z0-9\.\-]*\).*/\1/'` + echo "compiler '$CC' is PGI $cc_vendor-$cc_version" + + # Some version numbers + # PGI version numbers are of the form: "major.minor-patch" + cc_vers_major=`echo $cc_version | cut -f1 -d.` + cc_vers_minor=`echo $cc_version | cut -f2 -d. | cut -f1 -d-` + cc_vers_patch=`echo $cc_version | cut -f2 -d. | cut -f2 -d-` + test -n "$cc_vers_major" || cc_vers_major=0 + test -n "$cc_vers_minor" || cc_vers_minor=0 + test -n "$cc_vers_patch" || cc_vers_patch=0 + cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch` + fi +fi + +# Common PGI flags for various situations +if test "X-pgcc" = "X-$cc_vendor"; then + # Insert section about version specific problems from gnu-flags here, if + # necessary. + + arch= + # Architecture-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "$host_os-$host_cpu" in + # *-i686) + # arch="-march=i686" + # ;; + #esac + + # Host-specific flags + # Nothing currently. (Uncomment code below and modify to add any) + #case "`hostname`" in + # sleipnir.ncsa.uiuc.edu) + # arch="$arch -pipe" + # ;; + #esac + + # General + CFLAGS="$CFLAGS $arch -Minform,warn" + + # Production + + # Omit frame pointer for optimized code? + NOFP=${NOFP:=-Mnoframe} + + PROD_CFLAGS="-fast -s $NOFP" + PROD_CPPFLAGS= + + # Debug + DEBUG_CFLAGS="-g -Mbounds -Mchkfpstk" + DEBUG_CPPFLAGS= + + # Profile + PROFILE_CFLAGS="-g -Mprof=func,line" + # Use this for profiling with gprof + #PROFILE_CFLAGS="-g -pg" + PROFILE_CPPFLAGS= + + # Flags are set + cc_flags_set=yes + +fi + +# Clear cc info if no flags set +if test "X-$cc_flags_set" = "X-"; then + cc_vendor= + cc_version= +fi + diff --git a/fortran/config/powerpc-apple b/fortran/config/powerpc-apple index c6d1ceb..13f288a 100644 --- a/fortran/config/powerpc-apple +++ b/fortran/config/powerpc-apple @@ -11,20 +11,17 @@ if test "X-" = "X-$CC"; then CC_BASENAME=gcc fi -# Architecture-specific flags -ARCH= - - -# Omit frame pointer for optimized code? -NOFP=${NOFP:=-fomit-frame-pointer} - . $srcdir/config/gnu-flags - if test "X-$F9X" = "X-f95"; then - CFLAGS="$CFLAGS -DH5_ABSOFT" - fi # The default Fortran 90 compiler +if test "X-" = "X-$F9X"; then + F9X=xlf + F9X_BASENAME=xlf + else + F9X_BASENAME=f95 + +fi # # HDF5 integers @@ -42,36 +39,32 @@ HID_T='SELECTED_INT_KIND(R_INTEGER)' SIZE_T='SELECTED_INT_KIND(R_INTEGER)' OBJECT_NAMELEN_DEFAULT_F=-1 -if test "X-" = "X-$F9X"; then - F9X=xlf - F9X_BASENAME=xlf - else - F9X_BASENAME=f95 - -fi - case $F9X_BASENAME in xlf) - F9XSUFFIXFLAG="-qsuffix=f=f90 -qfree=f90" - FFLAGS="$FFLAGS -static -O ${F9XSUFFIXFLAG} -qmoddir=./ " - FSEARCH_DIRS="-I./ -I../src" - DEBUG_FFLAGS="-O" - PROD_FFLAGS="-O" - PROFILE_FFLAGS="-O" - f9x_flags_set=yes - ;; -# -# Assume Absoft compiler -# + F9XSUFFIXFLAG="-qsuffix=f=f90 -qfree=f90" + FFLAGS="$FFLAGS -static -O ${F9XSUFFIXFLAG} -qmoddir=./ " + FSEARCH_DIRS="-I./ -I../src" + DEBUG_FFLAGS="-g" + PROD_FFLAGS="-O" + PROFILE_FFLAGS="-g -pg" + f9x_flags_set=yes + ;; + + # + # Assume Absoft compiler + # f95) - F9XSUFFIXFLAG="" + # Set required flag for compiling C stubs + CFLAGS="$CFLAGS -DH5_ABSOFT" + + F9XSUFFIXFLAG="" #We enforce that external name will appear in upper case (this is a default for Absoft) - FFLAGS="$FFLAGS -YEXT_NAMES=UCS" - FSEARCH_DIRS="" - DEBUG_FFLAGS="-O" - PROD_FFLAGS="-O" - PROFILE_FFLAGS="-O" - f9x_flags_set=yes - ;; + FFLAGS="$FFLAGS -YEXT_NAMES=UCS" + FSEARCH_DIRS="" + DEBUG_FFLAGS="-g" + PROD_FFLAGS="-O" + PROFILE_FFLAGS="-g" + f9x_flags_set=yes + ;; -esac +esac diff --git a/fortran/configure.in b/fortran/configure.in index e2952d3..4c6e1e3 100644 --- a/fortran/configure.in +++ b/fortran/configure.in @@ -292,21 +292,36 @@ case "X-$enable_production" in CFLAGS=$CFLAGS_temp fi + dnl Remove the "-g" flag from FFLAGS if it's in there. + dnl + FFLAGS_temp="" + if test -n "$FFLAGS"; then + for d in $FFLAGS ; do + if test "X$d" != "X-g"; then + FFLAGS_temp="$FFLAGS_temp $d" + fi + done + FFLAGS=$FFLAGS_temp + fi + CONFIG_MODE=production CFLAGS="$CFLAGS $PROD_CFLAGS" CPPFLAGS="$CPPFLAGS $PROD_CPPFLAGS" + FFLAGS="$FFLAGS $PROD_FFLAGS" ;; X-no) AC_MSG_RESULT("development") CONFIG_MODE=development CFLAGS="$CFLAGS $DEBUG_CFLAGS" CPPFLAGS="$CPPFLAGS $DEBUG_CPPFLAGS" + FFLAGS="$FFLAGS $DEBUG_FFLAGS" ;; X-pg|X-profile) AC_MSG_RESULT("profile") CONFIG_MODE=profile - CFLAGS="$CXXFLAGS $PROFILE_CFLAGS" + CFLAGS="$CFLAGS $PROFILE_CFLAGS" CPPFLAGS="$CPPFLAGS $PROFILE_CPPFLAGS" + FFLAGS="$FFLAGS $PROFILE_FFLAGS" ;; *) AC_MSG_RESULT("user-defined") -- cgit v0.12