diff --git a/Makefile.am b/Makefile.am index c3ff722357e9972ef25b6662c4d9abb638582c12..e6b9801be55fe18fe099d3ac1734f03f7f994bc1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,14 +11,9 @@ doc/cdi_fman.pdf: EXTRA_DIST = \ LICENSE \ - config/default \ config/interface.rb \ doc/cdi_cman.pdf \ doc/cdi_fman.pdf \ - src/cfortran.doc \ - util/crayftnpreproc-wrapper \ - util/sunf95preproc-wrapper \ - util/sxpreproc-wrapper \ - util/xlfpreproc-wrapper + src/cfortran.doc ACLOCAL_AMFLAGS = -I m4 diff --git a/config/default b/config/default deleted file mode 100755 index 78cba4d32d89e306d3b3a300a331e5b72463cd74..0000000000000000000000000000000000000000 --- a/config/default +++ /dev/null @@ -1,196 +0,0 @@ -#! /bin/sh -# -# default configuration options and compiler flags for different hosts -# -# -CONFPATH=`echo $0 | cut -c 1-6` -if [ "$CONFPATH" != "../../" ] ; then - CONFPATH='./' -fi -# -set -x - -HOSTNAME=`hostname` -# -while test $# != 0 -do - case $1 in - CC=?*) - COMP=`expr "X$1" : 'X[^=]*=\(.*\)'` - ;; - CONFIG_OPTS=?*) - CONFIG_OPTS=`expr "X$1" : 'X[^=]*=\(.*\)'` - ;; - *) - HOSTNAME=$1 - ;; - esac - shift -done -# -case "${HOSTNAME}" in -# i386-apple-darwin10 - icc) - ${CONFPATH}configure --prefix=$HOME/local \ - --enable-maintainer-mode \ - --enable-iso-c-interface \ - --enable-swig \ - --enable-python \ - --with-eccodes=$HOME/local/eccodes-2.6.0 \ - --with-netcdf=$HOME/local/netcdf-4.4.1.1 \ - --with-szlib=$HOME/local \ - CC=icc CFLAGS="-g -D_REENTRANT -Wall -Wwrite-strings -O3 -march=native -fp-model source" - ;; - bailung*|d133*|d134*) - ${CONFPATH}configure --prefix=$HOME/local/cdi \ - --enable-maintainer-mode \ - --enable-iso-c-interface \ - --enable-swig \ - --with-eccodes=/opt/local \ - --with-netcdf=/opt/local \ - --with-szlib=/opt/local/lib/libaec \ - CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3" - ;; - cinglung*|feilung*|wanglung*) - ${CONFPATH}configure --prefix=$HOME/local \ - --enable-shared \ - --enable-maintainer-mode \ - --enable-swig \ - --enable-python \ - --with-grib_api=/opt/local \ - --with-netcdf=/opt/local \ - --with-szlib=/opt/local \ - CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O2" - ;; - hama*) - CDILIBS="--disable-iso-c-interface \ - --enable-maintainer-mode \ - --with-szlib=$HOME/local \ - --with-fdb5=$HOME/src/fdb \ - --with-eccodes=$HOME/local/eccodes-2.22.0 \ - --with-netcdf=$HOME/local/netcdf-c-4.9.0" - PREFIX="--prefix=$HOME/local/cdi" - LD_ADD="-Wl,-rpath,$HOME/local/eccodes-2.22.0/lib -Wl,-rpath,$HOME/src/fdb/lib" - if test "$COMP" = clang ; then - ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \ - CC=clang CFLAGS="-g -pipe -D_REENTRANT -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3" - else - ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \ - CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3" - fi; - ;; -# x86_64-squeeze-x64-linux - thunder*) - ${CONFPATH}configure --with-grib_api=/sw/squeeze-x64/grib_api-1.13.0-static-gccsys \ - --with-netcdf=/sw/squeeze-x64/netcdf-4.2-static \ - --disable-cf-interface \ - CC=gcc CFLAGS="-g -Wall -O3" - ;; -# ia64-nec-linux - ds*) - ${CONFPATH}configure --prefix=$HOME/local \ - --with-netcdf=/pool/ia64/netcdf/netcdf-3.6.0-p1 \ - --with-szlib=$HOME/local \ - CC=icc CFLAGS="-g -O2 -Wall -fno-alias -DMIN_BUF_SIZE=4194304" - ;; -# i686-linux - melian) - ${CONFPATH}configure --prefix=`pwd`/build \ - --with-netcdf \ - --with-szlib \ - --with-eccodes \ - --with-pic --enable-swig --enable-ruby --enable-python \ - CC=gcc CFLAGS="-g -O2 -Wall" LIBS=-lopenjpeg - ;; -# sx6-nec-superux12.2 - cs*) - ${CONFPATH}configure --prefix=$HOME/local \ - --with-netcdf=/pool/netcdf/netcdf-3.6.0-p1 \ - CC=c++ \ - CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000" - ;; - sx6) - ${CONFPATH}configure --host=sx6 --prefix=$HOME/local \ - --with-netcdf=/pool/SX-6/netcdf/netcdf-3.6.0-p1 \ - CC=sxc++ AR=sxar RANLIB=ls \ - CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000" - ;; - lxe0*) - echo 'Please choose compiler modules! Checkout with "module av"!' - ${CONFPATH}configure --prefix=$(pwd)/build-SX --host=sx9-nec-superux \ - --with-netcdf=/usr/local/pkg-sx9 \ - --with-grib_api=/usr/local/pkg-sx9/grib_api CC=sxc++ FC=sxf90 \ - LD=/SX/opt/crosskit/inst/bin/sxld AR=/SX/opt/crosskit/inst/bin/sxar \ - RANLIB=echo - ;; -# powerpc-ibm-aix6.1.0.0 - blizzard*) - CONFIG_SHELL=/bin/bash /bin/bash \ - ${CONFPATH}configure --prefix=$HOME/local \ - --with-netcdf=/sw/aix61/netcdf-4.2 \ - --with-szlib=/sw/aix61/szip-2.1-threadsafe \ - AR="ar -X 64" LDFLAGS="-brtl" FC=xlf2003_r CC=xlc_r \ - CFLAGS="-g -O3 -qhot -q64 -qarch=auto -qtune=auto -qlistfmt=html=transforms -DHAVE_MMAP" \ - FCFLAGS="-qsuffix=cpp=f90 -qextname" \ - SHELL=/bin/bash - ;; - breeze*) - CDILIBS="--with-eccodes=/sw/jessie-x64/eccodes/eccodes-2.4.1-gccsys \ - --with-netcdf=/sw/jessie-x64/netcdf-4.3.3.1-gccsys" - PREFIX="--prefix=$(pwd)/build/${COMP}" - LD_ADD="-Wl,-rpath,/sw/jessie-x64/eccodes/eccodes-2.4.1-gccsys/lib" - - if test "$COMP" = intel ; then - ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \ - CC=icc FC=ifort CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native" - elif test "$COMP" = gnu ; then - ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS $LDFLAGS\ - CC=gcc FC=gfortran F77=gfortran CFLAGS="-g -Wall -O2 -march=native" - elif test "$COMP" = pgi ; then - ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS $LDFLAGS\ - CC=pgcc FC=pgf90 F77=pgf90 CFLAGS="-g" - elif test "$COMP" = clang ; then - ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS $LDFLAGS\ - CC=clang FC=gfortran CFLAGS="-g -O2" - elif test "$COMP" = nag ; then - ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \ - CC=gcc FC=nagfor F77=nagfor CFLAGS="-g -O2" - elif test "$COMP" = nagClang ; then - ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS \ - CC=clang FC=nagfor F77=nagfor CFLAGS="-g -Wall -02" - else - echo "no config found for host: $HOSTNAME, COMP: $COMP !!" - fi; - - ;; - mlogin*) - CDILIBS="--with-eccodes=/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48 \ - --with-netcdf=/sw/rhel6-x64/netcdf/netcdf_c-4.3.2-gcc48" - PREFIX="--prefix=$(pwd)/build/${COMP}" - - if test "$COMP" = intel ; then - ${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \ - LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \ - F77=ifort FC=ifort FFLAGS="-g -O2" \ - CC=icc CFLAGS="-g -Wall -O2 -qopt-report=5 -march=core-avx2" - elif test "$COMP" = pgi ; then - ${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \ - LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \ - CXX=pgc++ CXXFLAGS="-g -fast" \ - CC=pgcc CFLAGS="-g -fast" - elif test "$COMP" = gnu_pic ; then - ${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \ - LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \ - FC=gfortran F77=gfortran FFLAGS="-g -O2" \ - CC=gcc CFLAGS='-g -Wall -O3 -march=native -mavx2 -fPIC' - else - ${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \ - LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \ - FC=gfortran F77=gfortran FFLAGS="-g -O2" \ - CC=gcc CFLAGS='-g -Wall -O3 -march=native -mavx2' - fi - ;; - *) - echo "configuration for hostname $HOSTNAME not found!" - ;; -esac diff --git a/m4/acx_lang_other_suffix_conftest.m4 b/m4/acx_lang_other_suffix_conftest.m4 deleted file mode 100644 index ea84cd0ddbca9778e9987172c63a6b09e1335d5e..0000000000000000000000000000000000000000 --- a/m4/acx_lang_other_suffix_conftest.m4 +++ /dev/null @@ -1,64 +0,0 @@ -dnl acx_lang_other_suffix_conftest.m4 --- create a language test with a suffix -dnl different from the default, i.e. -dnl .inc instead of .f90 for Fortran -dnl headers -dnl -dnl Copyright (C) 2010 Thomas Jahns <jahns@dkrz.de> -dnl -dnl Version: 1.0 -dnl Keywords: -dnl Author: Thomas Jahns <jahns@dkrz.de> -dnl Maintainer: Thomas Jahns <jahns@dkrz.de> -dnl URL: https://www.dkrz.de/redmine/projects/scales-ppm -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that the following conditions are -dnl met: -dnl -dnl Redistributions of source code must retain the above copyright notice, -dnl this list of conditions and the following disclaimer. -dnl -dnl Redistributions in binary form must reproduce the above copyright -dnl notice, this list of conditions and the following disclaimer in the -dnl documentation and/or other materials provided with the distribution. -dnl -dnl Neither the name of the DKRZ GmbH nor the names of its contributors -dnl may be used to endorse or promote products derived from this software -dnl without specific prior written permission. -dnl -dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -dnl -dnl Commentary: -dnl -dnl -dnl -dnl Code: -dnl -dnl ACX_LANG_OTHER_SUFFIX_CONFTEST(SUFFIX, SOURCE) -dnl produce source in same language environment as AC_LANG_CONFTEST uses -dnl but change ac_ext to SUFFIX, so that a file conftest.SUFFIX will be -dnl written instead (useful e.g. to produce a header file). -AC_DEFUN([ACX_LANG_OTHER_SUFFIX_CONFTEST], - [m4_define([_ACX_LANG_OLD],_AC_LANG) - AC_LANG_PUSH(_AC_LANG) - ac_ext="$1" - AC_LANG_CONFTEST([$2]) - AC_LANG_POP(_ACX_LANG_OLD) - m4_undefine([_ACX_LANG_OLD]) - ]) -dnl -dnl Local Variables: -dnl mode: autoconf -dnl license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm" -dnl license-default: "bsd" -dnl End: diff --git a/m4/starlink_fpp.m4 b/m4/starlink_fpp.m4 deleted file mode 100644 index e99be060fd2c75056f13108b91509c401d9e1734..0000000000000000000000000000000000000000 --- a/m4/starlink_fpp.m4 +++ /dev/null @@ -1,748 +0,0 @@ -# This file is part of Autoconf. -*- Autoconf -*- -# Fortran languages support. -# Copyright (C) 2001, 2003-2005 -# Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. -# -# As a special exception, the Free Software Foundation gives unlimited -# permission to copy, distribute and modify the configure scripts that -# are the output of Autoconf. You need not follow the terms of the GNU -# General Public License when using or distributing such scripts, even -# though portions of the text of Autoconf appear in them. The GNU -# General Public License (GPL) does govern all other use of the material -# that constitutes the Autoconf program. -# -# Certain portions of the Autoconf source text are designed to be copied -# (in certain cases, depending on the input) into the output of -# Autoconf. We call these the "data" portions. The rest of the Autoconf -# source text consists of comments plus executable code that decides which -# of the data portions to output in any given case. We call these -# comments and executable code the "non-data" portions. Autoconf never -# copies any of the non-data portions into its output. -# -# This special exception to the GPL applies to versions of Autoconf -# released by the Free Software Foundation. When you make and -# distribute a modified version of Autoconf, you may extend this special -# exception to the GPL to apply to your modified version as well, *unless* -# your modified version has the potential to copy into its output some -# of the text that was the non-data portion of the version that you started -# with. (In other words, unless your change moves or copies text from -# the non-data portions to the data portions.) If your modification has -# such potential, you must delete any notice of this special exception -# to the GPL from your modified version. -# -# Written by David MacKenzie, with help from -# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, -# Roland McGrath, Noah Friedman, david d zuhn, and many others. -# -# Fortran preprocessing support written by Martin Wilck, adapted and -# extended by Norman Gray and Toby White. -# -# Reduced to searching the Fortran preprocessor and flags for FC to -# preprocess by Thomas Jahns, 2009 - - -## ------------------------------- ## -## Preprocessor features ## -## ------------------------------- ## -# -# Supported features are: -# -# include : correctly process #include directives and -I -# define : correctly process -D -# substitute: substitute macros in Fortran code -# (some preprocessors touch only lines starting with #) -# wrap : wrap lines that become too long through macro substitution -# fpp is probably the only preprocessor that does this. -# cstyle : Do not suppress C style comments (-C option in cpp) -# CSTYLE : *Do* suppress C style comments -# (e.g. code contains C-style comments, and compiler may not -# know how to handle them) -# cxxstyle : Do not suppress C++ style comments (default) -# CXXSTYLE : *Do* suppress C++ style comments (seems unlikely, but in here -# for completeness) -# -# Features can be abbreviated: i, in, inc etc. are equivalent to include. -# Features can be deselected (feature not needed) by prepending "no", -# e.g. nodef (=nodefine), now (=nowrap). -# -# Default for the feature list is -# [include define substitute nowrap nocstyle noCSTYLE cxxstyle] -# Feature requirements corresponding to the defaults may be omitted -# -# Note that "wrap" implies "substitute", and CSTYLE and cstyle cannot -# be requested at the same time. The macro adjusts this automatically. -# - -# -------------------------------------- # -# Feature tests for Preprocessed Fortran # -# -------------------------------------- # - -# ------------------# -# Internal macros # -# ------------------# - -# ----------------------------------------------# -# Some test programs for different features # -# ----------------------------------------------# - -# _AC_LANG_PROGRAM_FPP_SIMPLE -# --------------------------- -# The minimum test program - any compiler supporting -# preprocessing should handle this -AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_SIMPLE], - [AC_LANG_PROGRAM(,[@%:@define OK -@%:@ifndef OK - syntax error -@%:@endif])])#_ACX_SL_LANG_PROGRAM_FPP_SIMPLE - - -# _ACX_SL_LANG_PROGRAM_FPP_ONLY -# --------------------------- -# Test program for pure preprocessing -# Note that other macros test for literal strings within this, so check -# for those if you have to change anything here. -AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_ONLY], - [AC_LANG_PROGRAM(,[@%:@define OK -@%:@ifdef OK - REAL A -@%:@else - syntax error -@%:@endif])])#_ACX_SL_LANG_PROGRAM_FPP_ONLY - - -# _ACX_SL_LANG_PROGRAM_FPP_D -# --------------------------- -# Like _ACX_SL_LANG_PROGRAM_FPP_SIMPLE, but OK is passed via -D switch -AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_D], -[AC_LANG_PROGRAM([],[@%:@ifndef OK - syntax error -@%:@endif])])#_ACX_SL_LANG_PROGRAM_FPP_D - - -# _ACX_SL_LANG_PROGRAM_FPP_I -# --------------------------- -# Test for #include statement -# If unsupported, this should give a type error -AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_I], - [AC_LANG_PROGRAM(,[ IMPLICIT CHARACTER (c) - ! Comments in test programs should be freeform compliant just in case. - ! conftest.inc contains the Fortran statement "REAL cc" -@%:@include "conftest.inc" - cc=1.])])#_ACX_SL_LANG_PROGRAM_FPP_I - - -# _ACX_SL_LANG_PROGRAM_FPP_SUBS -# --------------------------- -# Test whether cpp symbols are expanded in Fortran code lines -# If not, this should give a type error -AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_SUBS], -[AC_LANG_PROGRAM(,[@%:@define NM xxxx - IMPLICIT CHARACTER (n) - REAL xxxx - NM=1.])])#_ACX_SL_LANG_PROGRAM_FPP_SUBS - - -# _ACX_SL_LANG_PROGRAM_FPP_WRAP -# --------------------------- -# Test whether preprocessor breaks lines that become too long due -# to macro substitution. -# If not, this gives an "unterminated character constant" error -AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_WRAP], - [AC_LANG_PROGRAM(, - [m4_case(_AC_LANG, - [Fortran], -[@%:@define LONG '901234567890123456789012345678901234567890123456789012345678901234567890' - CHARACTER(LEN=80) :: A - A=LONG], - [Fortran 77], -[@%:@define LONG '901234567890123456789012345678901234567890123456789012345678901234567890' - CHARACTER*80 A - A=LONG], - [m4_fatal([$0: current language is not Fortran: ] _AC_LANG)])])])#_ACX_SL_LANG_PROGRAM_FPP_WRAP - - -# _ACX_SL_LANG_PROGRAM_FPP_CSTYLE -# --------------------------- -# Test program for C style comments -AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_CSTYLE], -[AC_LANG_PROGRAM(,[ A=1. /* C-style comment */])])#_ACX_SL_LANG_PROGRAM_FPP_CSTYLE - -# _ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE -# --------------------------- -# Test program for C++ style comments -AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE], - [AC_LANG_SOURCE([m4_case(_AC_LANG, - [Fortran], -[ PROGRAM MAIN - CHARACTER(LEN=10) :: C - C = "abcde" // "fghij"; END PROGRAM], - [Fortran 77], -[ PROGRAM MAIN - CHARACTER*10 C - C = "abcde" // "fghij"; END PROGRAM])])])#_ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE - -# _ACX_SL_SET_FPP_FEATURE_VARS ([feature list]) -# -------------------------------------- -# Parse the feature list from configure.in -AC_DEFUN([_ACX_SL_SET_FPP_FEATURE_VARS], - [# defaults for needed features - ac_fpp_need_d=yes - ac_fpp_need_i=yes - ac_fpp_need_subs=no - ac_fpp_need_wrap=no - ac_fpp_need_cstyle=no - ac_fpp_need_CSTYLE=no - ac_fpp_need_cxxstyle=yes - ac_fpp_need_CXXSTYLE=no - m4_foreach_w([_t],[$1],[m4_case([_t], - [define], [ac_fpp_need_d=yes], - [nodefine], [ac_fpp_need_d=no], - [include], [ac_fpp_need_i=yes], - [noinclude], [ac_fpp_need_i=no], - [substitute], [ac_fpp_need_subs=yes], - [nosubstitute], [ac_fpp_need_subs=no], - [wrap], [ac_fpp_need_wrap=yes], - [nowwrap], [ac_fpp_need_wrap=no], - [cstyle], [ac_fpp_need_cstyle=yes], - [nocstyle], [ac_fpp_need_cstyle=no], - [CSTYLE], [ac_fpp_need_CSTYLE=yes], - [noCSTYLE], [ac_fpp_need_CSTYLE=no], - [cxxstyle], [ac_fpp_need_cxxstyle=yes], - [nocxxstyle], [ac_fpp_need_cxxstyle=no], - [CXXSTYLE], [ac_fpp_need_CXXSTYLE=yes], - [noCXXSTYLE], [ac_fpp_need_CXXSTYLE=no], - [nil], [])]) - # Wrapping requires substitution - test $ac_fpp_need_wrap = yes && ac_fpp_need_subs=yes - # CSTYLE and cstyle are mutually exclusive. - # CSTYLE takes precedence, since if it is not fulfilled, - # compile errors may arise - test $ac_fpp_need_CSTYLE = yes && ac_fpp_need_cstyle=no - dnl Similarly for cxxstyle - test $ac_fpp_need_CXXSTYLE = yes && ac_fpp_need_cxxstyle=no - ])# _ACX_SL_SET_FPP_FEATURE_VARS - - -# _ACX_SL_TEST_FPP(COMMAND,SUFFIX,[ACTION-IF-SUCCESSFULL],[ACTION-IF-FAILED]) -# ------------------------ -# A helper macro to test correct fpp behaviour -# Invokes COMMAND <FILE_ONLY_COMPILABLE_WHEN_PREPROC_RUN> -# If the output on stdout is valid input to the Fortran compiler, it sets -# * acx_sl_prog_fpp -# * acx_sl_prog_fpp_suffix -# accordingly. -AC_DEFUN([_ACX_SL_TEST_FPP], - [rm -f conftest* - ACX_ASSERT_LANG_IS_FORTRAN_VARIANT - AC_LANG_CONFTEST([_ACX_SL_LANG_PROGRAM_FPP_ONLY]) - ac_tmp=conftest.fppout - AS_IF([_AC_RUN_LOG([$1 conftest.$2 >$ac_tmp], - [_AC_DO_ECHO([$1 $FPPFLAGS conftest.$2 >$ac_tmp])])], - [AS_IF([test -f $ac_tmp \ - && ! cmp conftest.$2 $ac_tmp >/dev/null 2>&1 \ - && grep '^ REAL A' $ac_tmp >/dev/null 2>&1 \ - && ! grep 'syntax error' $ac_tmp >/dev/null 2>&1], - [# we have Fortran! See if the file can be compiled: - mv $ac_tmp conftest.$ac_ext - AC_COMPILE_IFELSE(, [_AC_MSG_LOG_CONFTEST - $3], - [_AC_MSG_LOG_CONFTEST - $4])], - [mv $ac_tmp conftest.$ac_ext - _AC_MSG_LOG_CONFTEST - $4])]) -dnl Preprocessing might fail for one of the following reasons: -dnl * no output was produced (disk full?), -dnl * FPP input and output have the same content, -dnl * the output did not contain the critical part of the source file -dnl * some syntax error crept into the output -dnl indicating that this is a case-insensitive filesystem or -dnl preprocessing failed. So this command doesn't work. - rm -f conftest* -])# _ACX_SL_TEST_FPP - -# _ACX_SL_PROG_FPP([SUFFIX], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ------------ -# Try to figure out how to preprocess files with the given suffix -# just like the selected Fortran compiler does -# -# Must be run after _ACX_SL_PROG_FC_CPP -AC_DEFUN([_ACX_SL_PROG_FPP], - [acx_sl_fpp_srcext=m4_default([$1],[${ac_fc_srcext-F}]) - AS_VAR_PUSHDEF([acx_sl_prog_fpp], - [acx_sl_cv_prog_fpp_]_AC_LANG_ABBREV[_]m4_default([$1],[${ac_fc_srcext-f}])) - AC_CACHE_CHECK([how to preprocess Fortran files with suffix $acx_sl_fpp_srcext], - [acx_sl_prog_fpp], - [AS_VAR_SET([acx_sl_prog_fpp], []) - # Let the user specify FPP - AS_IF([test -n "$FPP"], - [_ACX_SL_TEST_FPP([$FPP],[$acx_sl_fpp_srcext], - [AS_VAR_SET([acx_sl_prog_fpp], ["$FPP"])], - [AC_MSG_WARN([user-specified \$FPP ($FPP) does not work]) - FPP=])]) - AS_IF([test -z "$FPP"], - [for ac_fpp in `cd $srcdir ; pwd`/util/sxpreproc-wrapper \ - `cd $srcdir ; pwd`/util/xlfpreproc-wrapper \ - `cd $srcdir ; pwd`/util/sunf95preproc-wrapper \ - `cd $srcdir ; pwd`/util/crayftnpreproc-wrapper \ - "$FC -F" "$FC -F -fpp" "$FC -E" "$FC -E -cpp" \ - "$FC $FCFLAGS -F" "$FC $FCFLAGS -E" "$FC $FCFLAGS -E" \ - "$FC $FCFLAGS -E -cpp" "$FC $FCFLAGS -x f95-cpp-input -E -P" - do - _ACX_SL_TEST_FPP([$ac_fpp],[$acx_sl_fpp_srcext],[FPP="$ac_fpp" - break]) - _ACX_SL_TEST_FPP([$ac_fpp -P],[$acx_sl_fpp_srcext], - [FPP="$ac_fpp -P" - break]) - done - dnl the above tests might generate an executable - \rm a.out 2>/dev/null]) - AS_IF([test -z "$FPP"], [$3], - [AS_VAR_SET([acx_sl_prog_fpp], [$FPP]) - $2])]) - AS_VAR_PUSHDEF([acx_sl_prog_fpp]) -])# _ACX_SL_PROG_FPP - - - -# _ACX_SL_PROG_FPP_CSTYLE -# ------------------- -# Check whether FPP lets C-style comments through to FC -AC_DEFUN([_ACX_SL_PROG_FPP_CSTYLE], -[AC_CACHE_CHECK([how to pass C-style comments to $FC], - ac_cv_prog_fpp_cstyle, -[ac_cv_prog_fpp_cstyle=unknown -ACX_ASSERT_LANG_IS_FORTRAN_VARIANT -cat > conftest.$ac_ext << \_ACEOF -_ACX_SL_LANG_PROGRAM_FPP_CSTYLE -_ACEOF - -AC_LANG_PUSH(Fortran) -ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out" -AS_IF([AC_TRY_EVAL(ac_cmd) && \ - cat conftest.f | grep '[[*]]/.*[[*]]/' >/dev/null 2>&1], - [ac_cv_prog_fpp_cstyle=], - [ac_save_FPPFLAGS=$FPPFLAGS - ac_name=`expr "x$FPP" : 'x\(fpp\)'` - AS_IF([test "x$ac_name" = xfpp], - [ac_flag="-c_com=no"], - [ac_flag="-C"]) - FPPFLAGS="$FPPFLAGS $ac_flag" - ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out" - AS_IF([AC_TRY_EVAL(ac_cmd) && \ - cat conftest.f | grep '/[[*]].*[[*]]/' >/dev/null 2>&1], - [ac_cv_prog_fpp_cstyle=$ac_flag]) - FPPFLAGS=$ac_save_FPPFLAGS]) -rm -f conftest* -AC_LANG_POP(Fortran)dnl -]) -if test "x$ac_cv_prog_fpp_cstyle" = "xunknown"; then - AC_MSG_WARN([cannot find a way to make $FPP pass C-style comments]) -else - FPPFLAGS="$FPPFLAGS $ac_cv_prog_fpp_cstyle" -fi -])# _ACX_SL_PROG_FPP_CSTYLE - -# _ACX_CHECK_FPP_COMPILE([EXTRA-FLAGS], direct|indirect, -# [ACTION-IF-COMPILABLE],[ACTION-IF-NOT-COMPILABLE]) -# helper macro to run the preprocessor or compile directly -# with preprocessor flags -m4_define([_ACX_FPP_COMPILE_IFELSE], - [m4_if([$2],[direct], - [cp conftest.$acx_sl_fpp_srcext conftest.${ac_ext}.tmp], - [_AC_RUN_LOG([$FPP $FPPFLAGS m4_ifval([$1],[$1 ])conftest.$acx_sl_fpp_srcext \ - >conftest.${ac_ext}.tmp], - [echo Running preprocessor $FPP $FPPFLAGS m4_ifval([$1],[$1 ])conftest.$acx_sl_fpp_srcext])]) - m4_if([$2],[direct],[FCFLAGS="$FPPFLAGS $1 $ac_save_FCFLAGS"]) - mv conftest.${ac_ext}.tmp conftest.${ac_ext} - AC_COMPILE_IFELSE(,[$3],[$4])]) - -# ACX_SL_PROG_FC_FPP_FEATURES(FEATURES,METHOD,[SUFFIX], -# [ACTION-IF-SUCCESS],[ACTION-IF-FAILURE]) -# --------------- -# This macro checks whether the chosen preprocessing method -# has all the requested features. -# -# This macro must be called with METHOD set to either -# direct or indirect; it behaves differently accordingly. -# -# In case one of the checks fails, ACTION-IF-FAILED will be called. -# -#FIXME: this is only for fixed form code. Need a separate check for free-form. -# -# NB We are definitely using a suffix of .F in this case. If the filesystem -# is case-insensitive, we may need to force preprocessing. -# -# Sets ac_fpp_ok to "no" if a requested feature is unavailable -# -AC_DEFUN([ACX_SL_PROG_FC_FPP_FEATURES], - [AS_VAR_PUSHDEF([acx_sl_fpp_ok], [acx_sl_cv_]_AC_LANG_ABBREV[_$2_ok]) - AC_CACHE_CHECK([if ]m4_case([$2],[direct],[compilation with $FC], -[indirect],[preprocessing with $FPP], -[m4_fatal([$0: only direct or indirect method supported: ']$2['])])[ of Fortran source supports required preprocessor features], -[acx_sl_fpp_ok], - [AS_VAR_SET([acx_sl_fpp_ok], [yes]) - # Set up ac_fpp_need_* flags based on features in $1 - acx_sl_fpp_srcext=m4_default([$3],[${ac_fc_srcext-F}]) - _ACX_SL_SET_FPP_FEATURE_VARS([$1]) - - acx_sl_prog_fc_cpp_CSTYLE=no - acx_sl_prog_fc_cpp_cxxstyle=no - - ACX_ASSERT_LANG_IS_FORTRAN_VARIANT - ac_save_FCFLAGS=$FCFLAGS - - m4_case([$2],[direct],[],[indirect],[], - [m4_fatal([$0: only direct or indirect method supported: ] $2)]) - - # We need to skip the following tests if we're trying direct compilation - # and FC won't preprocess. - AS_IF([test x$ac_fpp_need_d = xyes], - [acx_sl_prog_fc_cpp_d=no - _AS_ECHO_LOG([Trying flag to create preprocessor defines.]) - ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext], - [_ACX_SL_LANG_PROGRAM_FPP_D]) - # Normally we expect to be able to define preprocessor macros - # with -D, but this might be IBM xlf compiler, which needs - # -WF,-D or Fujitsu VPP700 which needs -Wp,-D - mv conftest.$acx_sl_fpp_srcext conftest.${acx_sl_fpp_srcext}.bak - for FPP_DEFOPT in "$FPP_DEFOPT" '-D' '-WF,-D' '-Wp,-D' - do - AS_IF([test x"$FPP_DEFOPT" != x ], - [cp conftest.${acx_sl_fpp_srcext}.bak conftest.$acx_sl_fpp_srcext - _ACX_FPP_COMPILE_IFELSE([${FPP_DEFOPT}OK],[$2], - [acx_sl_prog_fc_cpp_d=yes; break])]) - done - FCFLAGS=$ac_save_FCFLAGS - AS_IF([test $acx_sl_prog_fc_cpp_d = no], - [AS_VAR_SET([acx_sl_fpp_ok], [no])]) - AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes], - [_AS_ECHO_LOG([Test successful.])], - [_AS_ECHO_LOG([Test failed.])]) - ]) - - AS_IF([test $ac_fpp_need_i = yes], - [acx_sl_prog_fc_cpp_i=no - _AS_ECHO_LOG([Trying flag to add directories to preprocessor search path.]) - AS_MKDIR_P([conftst]) - cd conftst - ACX_LANG_OTHER_SUFFIX_CONFTEST([inc], - [AC_LANG_SOURCE([ ! This statement overrides the IMPLICIT statement in the program - REAL cc])]) - cd .. - ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext],[_ACX_SL_LANG_PROGRAM_FPP_I]) - mv conftest.$acx_sl_fpp_srcext conftest.${acx_sl_fpp_srcext}.bak - for FPP_INCOPT in "$FPP_INCOPT" '-I' '-WF,-I' '-Wp,-I' - do - AS_IF([test x"$FPP_INCOPT" != x ], - [cp conftest.${acx_sl_fpp_srcext}.bak conftest.$acx_sl_fpp_srcext - _ACX_FPP_COMPILE_IFELSE([${FPP_INCOPT}conftst],[$2], - [acx_sl_prog_fc_cpp_i=yes - break])]) - done - FCFLAGS=$ac_save_FCFLAGS - rm -rf conftst - AS_IF([test $acx_sl_prog_fc_cpp_i = no], - [AS_VAR_SET([acx_sl_fpp_ok], [no])]) - AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes], - [_AS_ECHO_LOG([Test successful.])], - [_AS_ECHO_LOG([Test failed.])])]) -dnl -dnl - AS_IF([test $ac_fpp_need_subs = yes], - [acx_sl_prog_fc_cpp_subs=no - _AS_ECHO_LOG([Testing preprocessor expansion in Fortran code.]) - ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext], - [_ACX_SL_LANG_PROGRAM_FPP_SUBS]) - _ACX_FPP_COMPILE_IFELSE(,[$2], - [acx_sl_prog_fc_cpp_subs=yes],[AS_VAR_SET([acx_sl_fpp_ok], [no])]) - AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes], - [_AS_ECHO_LOG([Test successful.])], - [_AS_ECHO_LOG([Test failed.])]) - ]) -dnl -dnl - AS_IF([test $ac_fpp_need_wrap = yes], - [acx_sl_prog_fc_cpp_wrap=no - _AS_ECHO_LOG([Testing whether preprocessor wraps long lines.]) - ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext], - [_ACX_SL_LANG_PROGRAM_FPP_WRAP]) - _ACX_FPP_COMPILE_IFELSE(,[$2], - [acx_sl_prog_fc_cpp_wrap=yes], [AS_VAR_SET([acx_sl_fpp_ok], [no])]) - AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes], - [_AS_ECHO_LOG([Test successful.])], - [_AS_ECHO_LOG([Test failed.])]) - ]) -dnl -dnl - AS_IF([test $ac_fpp_need_CSTYLE = yes], - [_AS_ECHO_LOG([Testing whether preprocessor removes C-style comments.]) - ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext], - [_ACX_SL_LANG_PROGRAM_FPP_CSTYLE]) - _ACX_FPP_COMPILE_IFELSE(,[$2], - [acx_sl_prog_fc_cpp_CSTYLE=yes], [AS_VAR_SET([acx_sl_fpp_ok], [no])]) - AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes], - [_AS_ECHO_LOG([Test successful.])], - [_AS_ECHO_LOG([Test failed.])]) - ]) -dnl - AS_IF([test $ac_fpp_need_cstyle = yes], - [_AS_ECHO_LOG([Testing whether preprocessor leaves C-style comments in place.]) - ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext], - [_ACX_SL_LANG_PROGRAM_FPP_CSTYLE]) - _ACX_FPP_COMPILE_IFELSE(,[$2], - [acx_sl_prog_fc_cpp_CSTYLE=yes], [AS_VAR_SET([acx_sl_fpp_ok], [no])]) - AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes], - [_AS_ECHO_LOG([Test failed.])], - [_AS_ECHO_LOG([Test successful.])]) - ]) -dnl - AS_IF([test $ac_fpp_need_cxxstyle = yes], - [_AS_ECHO_LOG([Testing if preprocessor leaves C++-style comments in place.]) - ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext], - [_ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE]) - _ACX_FPP_COMPILE_IFELSE(,[$2], - [acx_sl_prog_fc_cpp_cxxstyle=yes],[AS_VAR_SET([acx_sl_fpp_ok], [no])]) - AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes], - [_AS_ECHO_LOG([Test successful.])], - [_AS_ECHO_LOG([Test failed.])]) - ]) -dnl - AS_IF([test $ac_fpp_need_CXXSTYLE = yes], - [_AS_ECHO_LOG([Testing if preprocessor suppresses C++-style comments.]) - ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext], - [_ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE]) - _ACX_FPP_COMPILE_IFELSE(,[$2], - [acx_sl_prog_fc_cpp_cxxstyle=yes], - [AS_VAR_SET([acx_sl_fpp_ok], [no])]) - AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes], - [_AS_ECHO_LOG([Test failed.])], - [_AS_ECHO_LOG([Test successful.])]) - ]) -dnl - FCFLAGS=$ac_save_FCFLAGS - rm -f conftest.* - AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],[$4],[$5]) - ]) - #FIXME we should probably do the AC_SUBST somewhere else. - AC_SUBST([FPP_DEFOPT]) - AC_SUBST([FPP_INCOPT]) - AS_VAR_POPDEF([acx_sl_fpp_ok]) - ])#ACX_SL_PROG_FC_FPP_FEATURES - - - -# _ACX_SL_FC_CHECK_CIFS -# ----------------- -# Check whether the filesystem is case-insensitive (eg, HFS+ on -# MacOS X). Set ac_cv_fc_cifs=yes if so. -AC_DEFUN([_ACX_SL_FC_CHECK_CIFS], - [AC_CACHE_CHECK([whether the filesystem is case-insensitive], - [ac_cv_fc_cifs], - [rm -f conftest.* - echo wibble >conftest.F - AS_IF([test -f conftest.f && test "`cat conftest.f`" = wibble], - [ac_cv_fc_cifs=yes], [ac_cv_fc_cifs=no]) -])])# _ACX_SL_FC_CHECK_CIFS - - - -# ----------------------- -# User macros -# ----------------------- - -# AC_PROG_FPP([required features], [SUFFIX]) -# -------------------------------------------------- -# -# [required features] is a space-separated list of features that the Fortran -# preprocessor must have for the code to compile. -# It is up to the package maintainer to properly set these requirements. -# -# If SUFFIX is set it's assumed that files for the preprocessor have -# this suffix, otherwise .F is assumed. The output of the preprocessor -# is placed in files with the extension .f or whatever was last setup -# with AC_FC_SRCEXT. -# -# This macro will find out how to compile a preprocessable fixed-form -# file, with a .SUFFIX file extension. The type of Fortran code used -# for tests will be determined by the currently selected AC_LANG -# (Fortran or Fortran 77 at the time of this writing) -# -# See the section Preprocessor features for discussion of individual -# features. -# -# This macro sets and substitutes the variables FPP and FPPFLAGS. -# -# The macro depends on both FC and CPP, because we must possibly fall -# back on CPP for preprocessing. -# -AC_DEFUN([AC_PROG_FPP], - [AC_REQUIRE([AC_PROG_FC])dnl -dnl We are not going to use AC_REQUIRE(AC_PROG_CPP) here for -dnl two reasons: -dnl 1. we don't really need to if FC will preprocess itself -dnl 2. we can't pass in an optional parameter to change the -dnl default CPP search order, which we need to. -dnl AC_REQUIRE([AC_PROG_CPP([cpp])])dnl - - # Prefer AC_PROG_FC to AC_PROG_F77 - export FC FCFLAGS - AS_IF([test "X$F77" != X], - [AC_MSG_WARN([Use A@&t@C_PROG_FC with A@&t@C_PROG_FPP, instead of A@&t@C_PROG_F77])]) - - - AC_ARG_VAR([FPP], [Command to preprocess Fortran code]) - AC_ARG_VAR([FPPFLAGS], [Flags for the Fortran preprocessor]) - - _ACX_SL_PROG_FPP([$2]) - - # ACX_SL_PROG_FC_FPP_FEATURES does the actual feature tests, - # storing results of the checks in non-cv variables like - # ac_prog_fc_cpp_*, which we copy to cv variables afterwards. This - # allows this macro to be reusable for other cv variables (see - # below) - ACX_SL_PROG_FC_FPP_FEATURES([$1],[indirect],[$2],, - [AC_MSG_FAILURE([required Fortran preprocessor not available])]) - ])# AC_PROG_FPP - -# -# ACX_FC_INTEGRAL_FPP(FEATURES,[SUFFIX],[ACTION-IF-TRUE],[ACTION-IF-NOT]) -# Determines whether $FC can process files containing preprocessor directives -# and processes each of the requested features correctly -# and run the according ACTION-*. -AC_DEFUN([ACX_FC_INTEGRAL_FPP], - [# On nearly all systems where direct compilation is possible, a - # .F file containing preprocessable fixed-form will be compiled - # and preprocessed automatically. However, case-insensitive - # filesystems (eg HFS+ on MacOSX) may get confused. Therefore, - # we must check for cpp flags. - AC_ARG_VAR([FPPFLAGS], [Flags for the Fortran preprocessor]) - acx_sl_prog_fc_cpp=no - AC_COMPILE_IFELSE([AC_LANG_PP_MANDATORY_SOURCE], - [acx_sl_prog_fc_cpp=yes], [AS_VAR_SET([acx_sl_fpp_ok], [no])]) - # It is possible we've failed the previous test because of a - # Tru64 bug where the compiler fails when called as 'f95' on - # a .F file. It works when called as f90. - #FIXME: this does not protect the user's setting of FC, though - # we set it back if sensible. - AS_IF([test x$acx_sl_prog_fc_cpp = xno && test $FC = f95], - [FC=f90 - AC_LINK_IFELSE([AC_LANG_PP_MANDATORY_SOURCE], - [acx_sl_prog_fc_cpp=yes],[FC=f95 - AS_VAR_SET([acx_sl_fpp_ok], [no])]) - ]) - ACX_SL_PROG_FC_FPP_FEATURES([$1],[indirect],[$2],, - [AC_MSG_FAILURE([required Fortran preprocessor not available])]) - ac_first_save_FPPFLAGS=$FPPFLAGS - FPPFLAGS="$FPPFLAGS $FPPFLAGS_F" - # Don't need to test if $FC removes C++ comments - that - # way madness lies. - ACX_SL_PROG_FC_FPP_FEATURES([$1],[direct],[$2],[$3],[$4]) -]) - -AC_DEFUN([_ACX_CHOOSE_FPP_BUILD_RULE], - [# If so, we don't need to go any further. -if test x$acx_sl_fpp_ok = xyes; then - ac_cv_fpp_build_rule=direct - AC_MSG_RESULT([direct]) -else -# indirect compilation - AC_MSG_RESULT([indirect]) - -# Before we go any further, check that we're not courting disaster, -# here, by using indirect compilation (.F -> .f -> .o) on a -# case-insensitive filesystem. If we are, there's nothing we can do -# other than fail noisily. -_ACX_SL_FC_CHECK_CIFS -if test $ac_cv_fc_cifs = yes; then - AC_MSG_ERROR([disaster: this Fortran needs indirect compilation, but we - have a case-insensitive filesystem, so .F -> .f would fail; further compilation isn't going to work -- consider filing a bug]) -fi - -# Now we check how to invoke a preprocessor that outputs Fortran code -# that FC can understand -#FIXME: in a joint C/Fortran project, CPP might have already -# been defined. Here we are potentially (probably) redefining it. -# I don't think this matters. Not sure, though. -# In that case, AC_SUBST has already been called on CPP. -# We don't want to fail if we can't find cpp - we might be able -# to fall back on fpp. -#FIXME: actually, we should just prefer cpp to $CPP -# The next macro sets FPP (unless already set by the user) -_ACX_SL_PROG_FPP - -# Redefine the compile and link commands for indirect compilation - ac_fpp_compile='${FPP-fpp} $FPPFLAGS $FPPFLAGS_SRCEXT conftest.$ac_ext '"$ac_fpp_out"' && ${FC-fc} -c $FCFLAGS conftest.f >&AS_MESSAGE_LOG_FD' - ac_fpp_link='${FPP-fpp} $FPPFLAGS conftest.$ac_ext $FPPFLAGS_SRCEXT '"$ac_fpp_out"' && ${FC-fc} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.f $LIBS >&AS_MESSAGE_LOG_FD' - - ac_compile=$ac_fpp_compile - ac_link=$ac_fpp_link -# Redo all the feature checks for indirect compilation. - - ACX_SL_PROG_FC_FPP_FEATURES([$1], [indirect], - ,[AC_MSG_FAILURE([required fortran preprocessor not available])]) - -if test $ac_fpp_need_d = yes; then - AC_CACHE_CHECK([whether $FPP accepts -D], - ac_cv_prog_fpp_d, - [ac_cv_prog_fpp_d=$ac_prog_fc_cpp_d]) -fi - -if test $ac_fpp_need_i = yes; then - AC_CACHE_CHECK([whether $FPP accepts -I], - ac_cv_prog_fpp_i, - [ac_cv_prog_fpp_i=$ac_prog_fc_cpp_i]) -fi - -if test $ac_fpp_need_subs = yes; then - AC_CACHE_CHECK([whether $FPP substitutes macros in Fortran code], - ac_cv_prog_fpp_subs, - [ac_cv_prog_fpp_subs=$ac_prog_fc_cpp_subs]) -fi - -if test $ac_fpp_need_wrap = yes; then - AC_CACHE_CHECK([whether $FPP wraps long lines automatically], - ac_cv_prog_fpp_wrap, - [ac_cv_prog_fpp_wrap=$ac_prog_fc_cpp_wrap]) -fi - -if test $ac_fpp_need_CSTYLE = yes; then - AC_CACHE_CHECK([whether $FPP suppresses C-style comments], - ac_cv_prog_fpp_CSTYLE, - [ac_cv_prog_fpp_CSTYLE=$ac_prog_fc_cpp_CSTYLE]) - -elif test $ac_fpp_need_cstyle = yes; then -# It only makes sense to test this for indirect compilation, -# i.e., if .f files are generated - _ACX_SL_PROG_FPP_CSTYLE -fi - -if test $ac_fpp_need_cxxstyle = yes; then - AC_CACHE_CHECK([whether $FPP preserves C++-style comments], - ac_cv_prog_fpp_cxxstyle, - [ac_cv_prog_fpp_cxxstyle=$ac_prog_fc_cpp_cxxstyle]) -fi - -AC_CACHE_CHECK([whether $FPP fulfils requested features], - ac_cv_prog_fpp_ok, - [ac_cv_prog_fpp_ok=AS_VAR_GET([acx_sl_fpp_ok])]) - - ac_cv_fpp_build_rule=indirect - -fi # test acx_sl_fpp_ok != yes -]) diff --git a/util/sunf95preproc-wrapper b/util/sunf95preproc-wrapper deleted file mode 100755 index 5d4df6f532b6d1852644db42e2dc00d764d1ab15..0000000000000000000000000000000000000000 --- a/util/sunf95preproc-wrapper +++ /dev/null @@ -1,151 +0,0 @@ -#! /bin/sh -# -# sunf95preproc-wrapper --- wrapper to produce Sun F95 style front-end -# preprocessor output on stdout -# -# Copyright (C) 2010, 2012 Thomas Jahns <jahns@dkrz.de> -# -# Version: 1.0 -# Keywords: -# Author: Thomas Jahns <jahns@dkrz.de> -# Maintainer: Thomas Jahns <jahns@dkrz.de> -# URL: https://www.dkrz.de/redmine/projects/scales-ppm -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# Neither the name of the DKRZ GmbH nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Commentary: -# -# -# -# Code: -# -if [ "${DEBUG+set}" = set ]; then - set -x - outputRedir=">&2" - echo "$0 $*" -else - outputRedir=">/dev/null 2>&1" -fi -while [ $# -gt 0 ]; do - case $1 in - -mdir) - shift - shift - ;; - -*) - FPPFLAGS="${FPPFLAGS+${FPPFLAGS} }\"$1\"" - shift - ;; - *) - break - ;; - esac -done -TRAPCMD=':' -trap 'eval $TRAPCMD' 0 -set -e -test "${DEBUG+set}" = set && echo "$FPPFLAGS" >&2 -if [ "${FC+set}" != set ]; then - for F90C in sunf95 '' ; do - test -n "$F90C" || exit 1 - set +e - F90BIN=`which $F90C 2>/dev/null` - set -e - test ! -x "$F90BIN" || break - done -fi -FC=${FC-$F90C} -# nagfor 5.3 up chokes on -EP flag -case `$FC -V 2>&1 | sed 5q` in - *NAG\ Fortran\ Compiler*) - ;; - *PGI\ Compilers\ and\ Tools*) - echo 'This wrapper does not support the PGI Fortran compiler, use' >&2 - echo " $FC -E" >&2 - echo "instead." >&2 - exit 1 - ;; - *) - FCFLAGS=${FCFLAGS--EP} - ;; -esac -# append -fpp if necessary -IFStr=`echo "$IFS" | sed -n '$!s/$/\\\\n/ -H -$x -$s/\n//g -$P'` -if echo "$FCFLAGS" \ - | grep -v '\('"[$IFStr]\\|^\\)-[cf]pp\\([$IFStr]\\|\$\\)" >/dev/null -then - FCFLAGS="${FCFLAGS+$FCFLAGS }-fpp" -fi -TMPDIR="${TMPDIR-/tmp}" -{ - tmp=` - (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null - ` && - test -n "$tmp" && test -d "$tmp" -} || { - tmp="$TMPDIR/foo$$-$RANDOM" - (umask 077 && mkdir "$tmp") -} || exit $? -TRAPCMD="$TRAPCMD ; rm -rf \"$tmp\"" -#echo \"$FCFLAGS\" -for FortranFile in "$@" ; do - fppInput=`echo "$FortranFile" | sed 's:.*/:: -s:\.[^./]*:.F90:'` - cp "$FortranFile" "$tmp/$fppInput" - fppOutput=`echo "$fppInput" | sed 's:.*/:: -s:\.F90:.f90:'` - for i in fppOutput ; do - if eval test -e \$$i ; then - eval backup$i=true - eval mv \"\$$i\" \"\$$i.bak\" - eval TRAPCMD${i}Save=\"$TRAPCMD\" - TRAPCMD="$TRAPCMD ; "`eval echo mv \"\\$$i.bak\" \"\\$$i\"` - fi - done - set +e - eval \$FC \$FCFLAGS -F $FPPFLAGS \"\$tmp/\$fppInput\" $outputRedir - set -e - grep -v '^#' "$fppOutput" - test "${DEBUG+set}" = set && cat "$fppOutput" >&2 - rm "$fppOutput" "$tmp/$fppInput" - for i in fppOutput ; do - if eval test \"\$backup$i\" = true ; then - eval mv \"\$$i.bak\" \"\$$i\" - TRAPCMD=`eval echo \\$TRAPCMD\${i}Save` - fi - done -done -# -# Local Variables: -# license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm" -# license-default: "bsd" -# End: diff --git a/util/sxpreproc-wrapper b/util/sxpreproc-wrapper deleted file mode 100755 index 56c14569867010ec71ac2c33339a992eeb153786..0000000000000000000000000000000000000000 --- a/util/sxpreproc-wrapper +++ /dev/null @@ -1,109 +0,0 @@ -#! /bin/sh -# -# sxpreproc-wrapper --- capture preprocessed output from frontends of -# NEC SX series Fortran 90 compiler -# -# Copyright (C) 2010 Thomas Jahns <jahns@dkrz.de> -# -# Version: 1.0 -# Keywords: -# Author: Thomas Jahns <jahns@dkrz.de> -# Maintainer: Thomas Jahns <jahns@dkrz.de> -# URL: https://www.dkrz.de/redmine/projects/scales-ppm -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# Neither the name of the DKRZ GmbH nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Commentary: -# -# -# -# Code: -# -if [ "${DEBUG+set}" = set ]; then - set -x - outputRedir=">&2" -else - outputRedir=">/dev/null 2>&1" -fi -while echo "$1" | grep '^-' >/dev/null 2>&1; do - FPPFLAGS="${FPPFLAGS+${FPPFLAGS} }$1" - shift -done -set -e -test "${DEBUG+set}" = set && echo "$FPPFLAGS" >&2 -FCFLAGS=${FCFLAGS--EP} -if [ "${FC+set}" != set ]; then - for F90C in sxf90 f90 '' ; do - test -n "$F90C" || exit 1 - set +e - F90BIN=`which $F90C 2>/dev/null` - set -e - test ! -x "$F90BIN" || break - done -fi -FC=${FC-$F90C} -IFStr=`echo "$IFS" | sed -n '$!s/$/\\\\n/ -H -$x -$s/\n//g -$P'` -#translate -Ep to -EP in FCFLAGS -FCFLAGS=`echo "$FCFLAGS" | sed -e 's/\('"[$IFStr]\\|^\\)-Ep\\([$IFStr]\\|\$\\)"'/\1-EP\2/'` -# append -EP if necessary -if echo "$FCFLAGS" \ - | grep -v '\('"[$IFStr]\\|^\\)-EP\\([$IFStr]\\|\$\\)" >/dev/null -then - FCFLAGS="${FCFLAGS+$FCFLAGS }-EP" -fi -TMPDIR="${TMPDIR-/tmp}" -{ - tmp=` - (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null - ` && - test -n "$tmp" && test -d "$tmp" -} || { - tmp=$TMPDIR/foo$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || exit $? -#echo \"$FCFLAGS\" -trap "rm -rf '$tmp'" 0 -for FortranFile in "$@" ; do - fppOutput=`echo "$FortranFile" | sed 's:.*/:: -s:^:'"$tmp/"'i.:'` - set +e - eval \$FC \$FCFLAGS -ts \"'$tmp'\" \$FPPFLAGS \"\$FortranFile\" $outputRedir - set -e - cat "$fppOutput" 2>/dev/null - test "${DEBUG+set}" = set && cat "$fppOutput" >&2 - rm "$fppOutput" -done -# -# Local Variables: -# license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm" -# license-default: "bsd" -# End: diff --git a/util/xlfpreproc-wrapper b/util/xlfpreproc-wrapper deleted file mode 100755 index 0064f7e3ecfa6c81226de702ac4ac4b7c2ffe62e..0000000000000000000000000000000000000000 --- a/util/xlfpreproc-wrapper +++ /dev/null @@ -1,72 +0,0 @@ -#! /bin/sh -# -# xlfpreproc-wrapper --- wrapper to produce IBM xlf style front-end -# preprocessor output on stdout -# -# Copyright (C) 2010 Thomas Jahns <jahns@dkrz.de> -# -# Version: 1.0 -# Keywords: -# Author: Thomas Jahns <jahns@dkrz.de> -# Maintainer: Thomas Jahns <jahns@dkrz.de> -# URL: https://www.dkrz.de/redmine/projects/scales-ppm -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# Neither the name of the DKRZ GmbH nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Commentary: -# -# -# -# Code: -# -if [ "${DEBUG+set}" = set ]; then - set -x - outputRedir=">&2" -else - outputRedir=">/dev/null 2>&1" -fi -while echo "$1" | grep '^-' >/dev/null 2>&1; do - FPPFLAGS="${FPPFLAGS+${FPPFLAGS} }$1" - shift -done -set -e -for srcfile in "$@" ; do - set +e - eval \$FC \$FCFLAGS \$FPPFLAGS -d -qnoobject \"\$srcfile\" $outputRedir - set -e - FPPOUTNAME=`echo $srcfile | sed -e 's:\(.*/\)*\([^/]*\)\.[^./]*$:F\2.f:'` - test -r "$FPPOUTNAME" || FPPOUTNAME="${FPPOUTNAME}90" - cat "$FPPOUTNAME" 2>/dev/null - test "${DEBUG+set}" = set && cat "$FPPOUTNAME" >&2 - rm "$FPPOUTNAME" -done -# -# Local Variables: -# license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm" -# license-default: "bsd" -# End: