Commit 4043d788 authored by Florian Prill's avatar Florian Prill
Browse files

[cdi-tiles] merged changes from trunk.

parents b5f53b98 b4889299
......@@ -172,6 +172,8 @@ interfaces/testdata/mulval.nc -text
m4/ac_lang_program_fortran.m4 -text
m4/acx_assert_lang_is_fortran_variant.m4 -text
m4/acx_c_package.m4 -text
m4/acx_cfortran_flags.m4 -text
m4/acx_check_cfortran.m4 -text
m4/acx_check_strptr_convert.m4 -text
m4/acx_execinfo.m4 -text
m4/acx_fortran_check_include.m4 -text
......@@ -295,8 +297,6 @@ src/pio_util.c -text
src/pio_util.h -text
src/pkgconfig/cdi.pc.in -text
src/pkgconfig/cdipio.pc.in -text
src/proprietarySystemWorkarounds.c -text
src/proprietarySystemWorkarounds.h -text
src/referenceCounting.c -text
src/referenceCounting.h -text
src/resource_handle.c -text
......
2015-05-28 Uwe Schulzweida
* dmemory: added env. MEMORY_INFO
2015-04-28 Uwe Schulzweida
* Version 1.6.9 released
......
......@@ -97,6 +97,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = \
$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
$(top_srcdir)/m4/acx_c_package.m4 \
$(top_srcdir)/m4/acx_cfortran_flags.m4 \
$(top_srcdir)/m4/acx_check_cfortran.m4 \
$(top_srcdir)/m4/acx_check_strptr_convert.m4 \
$(top_srcdir)/m4/acx_execinfo.m4 \
$(top_srcdir)/m4/acx_fortran_package.m4 \
......
dnl
dnl AC_CHECK_CFINT
dnl
dnl Check C / Fortran interface
dnl
AC_DEFUN([ACX_CHECK_CFINT],
[AC_CACHE_CHECK([whether the C / Fortran interface works],[acx_cv_check_cfint],
[AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "$1"],[])],
[acx_cv_check_cfint=yes],
[acx_cv_check_cfint=no])
AC_LANG_POP([C])])
AS_IF([test x$acx_cv_check_cfint = xyes],
[AC_DEFINE(HAVE_CF_INTERFACE, [1],
[Define if C / Fortran interface cfortran.h works])])
])
m4_include([m4/ac_lang_program_fortran.m4])
m4_include([m4/acx_lang_fortran_check_include.m4])
m4_include([m4/acx_lang_c_check_include.m4])
......
......@@ -1185,6 +1185,8 @@ AC_SUBST([am__untar])
m4_include([m4/acx_assert_lang_is_fortran_variant.m4])
m4_include([m4/acx_c_package.m4])
m4_include([m4/acx_cfortran_flags.m4])
m4_include([m4/acx_check_cfortran.m4])
m4_include([m4/acx_check_strptr_convert.m4])
m4_include([m4/acx_execinfo.m4])
m4_include([m4/acx_fortran_package.m4])
......
......@@ -90,6 +90,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = \
$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
$(top_srcdir)/m4/acx_c_package.m4 \
$(top_srcdir)/m4/acx_cfortran_flags.m4 \
$(top_srcdir)/m4/acx_check_cfortran.m4 \
$(top_srcdir)/m4/acx_check_strptr_convert.m4 \
$(top_srcdir)/m4/acx_execinfo.m4 \
$(top_srcdir)/m4/acx_fortran_package.m4 \
......
......@@ -22,7 +22,7 @@ case "${HOSTNAME}" in
--with-grib_api=$HOME/local/gribapi-1.12.3 \
--with-netcdf=$HOME/local \
--with-szlib=$HOME/local \
CC=icc CFLAGS="-g -D_REENTRANT -Wall -O3 -march=native -Df2cFortran -fp-model source"
CC=icc CFLAGS="-g -D_REENTRANT -Wall -O3 -march=native -fp-model source"
;;
bailung*|d133*|d134*)
./configure --prefix=$HOME/local \
......@@ -34,7 +34,7 @@ case "${HOSTNAME}" in
--with-grib_api=$HOME/local/gribapi-1.12.3 \
--with-netcdf=$HOME/local \
--with-szlib=$HOME/local \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native -Df2cFortran"
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native"
;;
cinglung*|feilung*|wanglung*)
./configure --prefix=$HOME/local \
......@@ -49,7 +49,7 @@ case "${HOSTNAME}" in
--with-netcdf=/opt/local \
--with-hdf5=/opt/local \
--with-szlib=/opt/local \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O2 -DpgiFortran"
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O2"
;;
hama*)
./configure --prefix=$HOME/local \
......@@ -59,14 +59,14 @@ case "${HOSTNAME}" in
--enable-python \
--with-grib_api=$HOME/local/gribapi-1.13.0 \
--with-netcdf=$HOME/local \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -Df2cFortran"
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3"
;;
# ia64-nec-linux
ds*)
./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 -Df2cFortran"
CC=icc CFLAGS="-g -O2 -Wall -fno-alias -DMIN_BUF_SIZE=4194304"
;;
# i686-linux
etch-ia32 | gata)
......@@ -141,7 +141,7 @@ case "${HOSTNAME}" in
--with-zlib=/sw/aix61/zlib-1.2.6 \
--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 -Dextname" \
CFLAGS="-g -O3 -qhot -q64 -qarch=auto -qtune=auto -qlistfmt=html=transforms -DHAVE_MMAP" \
FCFLAGS="-qsuffix=cpp=f90 -qextname" \
SHELL=/bin/bash
;;
......
......@@ -49,7 +49,7 @@ case "${HOSTNAME}" in
CFLAGS="$OPTFLAGS -q64" \
CPPFLAGS='-Dextname' \
F77=smartmpxlf \
F77FLAGS="$OPTFLAGS -q64 -qsuffix=cpp=f90 -qextname" \
FFLAGS="$OPTFLAGS -q64 -qsuffix=cpp=f90 -qextname" \
FC=smartmpxlf \
FCFLAGS="$OPTFLAGS -q64 -qsuffix=cpp=f90 -qextname" \
CXX=smartmpCC_r \
......
......@@ -2506,6 +2506,48 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
} # ac_fn_c_check_decl
# ac_fn_fc_try_run LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
# that executables *can* be run.
ac_fn_fc_try_run ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then :
ac_retval=0
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_fc_try_run
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
......@@ -27270,6 +27312,17 @@ else
ENABLE_NETCDF_FALSE=
fi
 
for ac_func in grib_get_length
do :
ac_fn_c_check_func "$LINENO" "grib_get_length" "ac_cv_func_grib_get_length"
if test "x$ac_cv_func_grib_get_length" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GRIB_GET_LENGTH 1
_ACEOF
fi
done
# ----------------------------------------------------------------------
# Compile with MPI support
# Sed expression to map a string onto a valid argument string part.
......@@ -28716,14 +28769,209 @@ else
CREATE_INTERFACES_FALSE=
fi
 
# ----------------------------------------------------------------------
# Check C / Fortran interface
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C / Fortran interface works" >&5
$as_echo_n "checking whether the C / Fortran interface works... " >&6; }
if ${acx_cv_check_cfint+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking C preprocessor flags for Fortran calling convention cfortran.h" >&5
$as_echo_n "checking C preprocessor flags for Fortran calling convention cfortran.h... " >&6; }
if ${acx_cv_cf_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_ext=c
acx_cv_cf_flag=''
for macro in pgiFortran NAGf90Fortran f2cFortran hpuxFortran apolloFortran sunFortran IBMR2Fortran CRAYFortran PATHSCALE_COMPILER gFortran mipsFortran DECFortran vmsFortran CONVEXFortran PowerStationFortran AbsoftUNIXFortran AbsoftProFortran SXFortran
do :
acx_temp=`echo "$CPPFLAGS $CFLAGS" | sed -n 's/^\(.* \)*-D\('"$macro"'\)\( .*\)*$/\2/;t print
b
: print
p'`
if test x"$acx_temp" != x; then :
if test x"$acx_cv_cf_flag" = x; then :
acx_cv_cf_flag="$acx_temp (user-specified)"
else
echo ; echo '"'"$acx_cv_cf_flag $acx_temp"'"'
as_fn_error $? "Multiple specification of cfortran.h flags" "$LINENO" 5
fi
fi
done
if test x"$acx_cv_cf_flag" = x; then :
if test -n "$FC" -a X"$FC" != Xno; then :
ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
save_FC=$FC ; acx_FC=$FC
case $host in #(
x86_64-*-linux-*|i*86-*-linux-*|*-apple-darwin*|ia64-*-linux-*|x86_64-*-freebsd*|i*86-*-freebsd*) :
acx_temp=`$acx_FC -V 2>&1`
if echo "$acx_temp" | grep '^Copyright.*\(The Portland Group\|NVIDIA CORPORATION\)' >/dev/null; then :
acx_cv_fc_cf_flag=-DgFortran
elif echo "$acx_temp" | grep '^NAG Fortran Compiler Release' >/dev/null; then :
acx_cv_fc_cf_flag=-DNAGf90Fortran
elif echo "$acx_temp" | grep '^Intel(R) Fortran.*Compiler' >/dev/null; then :
acx_cv_fc_cf_flag=-DgFortran
elif echo "$acx_temp" | grep '^Cray Fortran' >/dev/null; then :
acx_cv_fc_cf_flag=-DgFortran
elif acx_temp=`$acx_FC --version 2>&1` \
&& echo $acx_temp | grep '^GNU Fortran' >/dev/null; then :
if echo $acx_temp | grep g77 >/dev/null; then :
acx_cv_fc_cf_flag=-Dg77Fortran
else
if echo "$FCFLAGS" | grep '^\(.* \)*-ff2c\( .*\)*$' >/dev/null; then :
acx_cv_fc_cf_flag=-Df2cFortran
else
acx_cv_fc_cf_flag=-DgFortran
fi
fi
elif acx_temp=`$acx_FC -v 2>&1` \
&& echo $acx_temp | grep '^f2c'; then :
acx_cv_fc_cf_flag=-Df2cFortran
fi ;; #(
*-ibm-aix*) :
if $CC -qversion 2>&1 | grep '^IBM XL C' >/dev/null; then :
else
acx_cv_fc_cf_flag=-DIBMR2Fortran
fi
;; #(
*-*-hpux*) :
acx_cv_fc_cf_flag=-DhpuxFortran ;; #(
sx*-*-*|es*-*-*) :
acx_cv_fc_cf_flag=-DSXFortran ;; #(
*) :
;;
esac
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
if test -n "$F77" -a X"$F77" != Xno; then :
ac_ext=f
ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_f77_compiler_gnu
save_F77=$F77 ; acx_FC=$F77
case $host in #(
x86_64-*-linux-*|i*86-*-linux-*|*-apple-darwin*|ia64-*-linux-*|x86_64-*-freebsd*|i*86-*-freebsd*) :
acx_temp=`$acx_FC -V 2>&1`
if echo "$acx_temp" | grep '^Copyright.*\(The Portland Group\|NVIDIA CORPORATION\)' >/dev/null; then :
acx_cv_f77_cf_flag=-DgFortran
elif echo "$acx_temp" | grep '^NAG Fortran Compiler Release' >/dev/null; then :
acx_cv_f77_cf_flag=-DNAGf90Fortran
elif echo "$acx_temp" | grep '^Intel(R) Fortran.*Compiler' >/dev/null; then :
acx_cv_f77_cf_flag=-DgFortran
elif echo "$acx_temp" | grep '^Cray Fortran' >/dev/null; then :
acx_cv_f77_cf_flag=-DgFortran
elif acx_temp=`$acx_FC --version 2>&1` \
&& echo $acx_temp | grep '^GNU Fortran' >/dev/null; then :
if echo $acx_temp | grep g77 >/dev/null; then :
acx_cv_f77_cf_flag=-Dg77Fortran
else
if echo "$FFLAGS" | grep '^\(.* \)*-ff2c\( .*\)*$' >/dev/null; then :
acx_cv_f77_cf_flag=-Df2cFortran
else
acx_cv_f77_cf_flag=-DgFortran
fi
fi
elif acx_temp=`$acx_FC -v 2>&1` \
&& echo $acx_temp | grep '^f2c'; then :
acx_cv_f77_cf_flag=-Df2cFortran
fi ;; #(
*-ibm-aix*) :
if $CC -qversion 2>&1 | grep '^IBM XL C' >/dev/null; then :
else
acx_cv_f77_cf_flag=-DIBMR2Fortran
fi
;; #(
*-*-hpux*) :
acx_cv_f77_cf_flag=-DhpuxFortran ;; #(
sx*-*-*|es*-*-*) :
acx_cv_f77_cf_flag=-DSXFortran ;; #(
*) :
;;
esac
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
if test -z "$FC" -o X"$FC" != Xno; then :
acx_cv_cf_flag="$acx_cv_fc_cf_flag (probed)"
elif test -z "$F77" -o X"$F77" != Xno; then :
acx_cv_cf_flag="$acx_cv_f77_cf_flag (probed)"
else
if test x"$acx_cv_f77_cf_flag" = x"$acx_cv_fc_cf_flag"; then :
acx_cv_cf_flag="$acx_cv_f77_cf_flag (probed)"
else
as_fn_error $? "cfortran.h flag for $F77 does not match the flag for $FC.
Have you configured compatible compilers?" "$LINENO" 5
fi
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_cf_flag" >&5
$as_echo "$acx_cv_cf_flag" >&6; }
if echo "$acx_cv_cf_flag" | grep ' (probed)$' >/dev/null; then :
CPPFLAGS="${CPPFLAGS+$CPPFLAGS }`echo "$acx_cv_cf_flag" | sed 's/ (probed)$//'`"
fi
case $host in #(
*-ibm-aix*) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -Dappendus needs to be added to CPPFLAGS for cfortran.h" >&5
$as_echo_n "checking if -Dappendus needs to be added to CPPFLAGS for cfortran.h... " >&6; }
if $CC -qversion 2>&1 | grep '^IBM XL C' >/dev/null; then :
acx_temp_qextname_f77flags=`echo "$FFLAGS" | sed -n '/-qextname/{ s/^\(.* \)*-qextname\( .*\)*$/-qextname/;p;}'`
acx_temp_qextname_fcflags=`echo "$FCFLAGS" | sed -n '/-qextname/{ s/^\(.* \)*-qextname\( .*\)*$/-qextname/;p;}'`
if $FC -qversion 2>&1 | grep '^IBM XL Fortran' >/dev/null; then :
else
acx_temp_qextname_fcflags=-qextname
fi
case x"$acx_temp_qextname_fcflags$acx_temp_qextname_f77flags" in #(
x-qextname) :
as_fn_error $? "Option -qextname must be provided consistently to F77 and FC" "$LINENO" 5 ;; #(
x-qextname-qextname) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
CPPFLAGS="${CPPFLAGS+$CPPFLAGS }-Dappendus" ;; #(
*) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; } ;;
esac
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi ;; #(
*) :
;;
esac
if test -n "$FC" -a X"$FC" != Xno -o -n "$F77" -a X"$F77" != Xno; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C externals constructed with cfortran.h work" >&5
$as_echo_n "checking if C externals constructed with cfortran.h work... " >&6; }
if ${acx_cv_cfortran_works+:} false; then :
$as_echo_n "(cached) " >&6
else
acx_cv_cfortran_works=no
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="-I$srcdir/src $CPPFLAGS"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
......@@ -28731,19 +28979,172 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "$srcdir/src/cfortran.h"
int
main ()
#include "cfortran.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
PROTOCCALLSFFUN1(FLOAT,CONFTEST_F,conftest_f,FLOAT)
#define conftest_F(v) \
CCALLSFFUN1(CONFTEST_F,conftest_f,FLOAT,(v));
static float
conftest_C(int i, float v, int *p, float *q)
{
float f;
*p = (int)roundf(v * i);
*q = f = conftest_F(v * i);
return f;
}
FCALLSCFUN4(FLOAT,conftest_C,CONFTEST_C,conftest_c,INT,FLOAT,PINT,PFLOAT)
/* test string returns */
static const char *
conftest_str_C(void)
{
static const char msg[100] = "aaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
return msg;
}
 
;
return 0;
FCALLSCFUN0(STRING,conftest_str_C,CONFTEST_STR_C,conftest_str_c)
/* This function is required simply because some Fortran compilers
* won't stop with exit code n when encountering STOP n */
static void
errExit(void)
{
exit(1);
}
FCALLSCSUB0(errExit,ERR_EXIT,err_exit)
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
acx_cv_check_cfint=yes
{ { $as_echo "$as_me:${as_lineno-$LINENO}: Renaming C object file." >&5; } >&5
(mv "conftest.$ac_objext" "conftest_c.$ac_objext") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
cat > conftest.$ac_ext <<_ACEOF
MODULE conftest_data
IMPLICIT NONE
PRIVATE
REAL :: ri
PUBLIC :: ri
END MODULE conftest_data
FUNCTION conftest_f(v) RESULT(r)
USE conftest_data, ONLY: ri
REAL, INTENT(in) :: v
REAL :: r
r = v * 100.0
ri = 1.0 / v
END FUNCTION conftest_f
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: Renaming Fortran object file." >&5; } >&5
(mv "conftest.$ac_objext" "conftest_f.$ac_objext") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
save_LIBS=$LIBS
LIBS="conftest_c.$ac_objext conftest_f.$ac_objext $LIBS"
if test "$cross_compiling" = yes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: Skipping run test for cfortran.h in cross-compilation mode," >&5
$as_echo "$as_me: Skipping run test for cfortran.h in cross-compilation mode," >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: link test succeeded." >&5
$as_echo "$as_me: link test succeeded." >&6;}
acx_cv_cfortran_works=yes
else
acx_cv_check_cfint=no
cat > conftest.$ac_ext <<_ACEOF
program conftest
USE conftest_data, ONLY: ri
IMPLICIT NONE
INTERFACE
FUNCTION conftest_c(i, v, p, q) RESULT(f)
INTEGER, INTENT(in) :: i
REAL, INTENT(in) :: v
INTEGER, INTENT(out) :: p
REAL, INTENT(out) :: q
REAL :: f
END FUNCTION conftest_c
FUNCTION conftest_str_c() result(s)
CHARACTER(99) :: s
END FUNCTION conftest_str_c
END INTERFACE
REAL, PARAMETER :: eps = 10e-6
REAL :: foo, boo, too
INTEGER :: bar, baz, i
CHARACTER(99) :: aaaaaa
bar = 5
foo = 0.3
too = conftest_c(bar, foo, baz, boo)
IF (ABS(baz - NINT(bar * foo)) /= 0) THEN
WRITE (0, '(2(a,i0))') "error checking, when baz, baz=", baz, &
", NINT(bar * foo) =", NINT(bar * foo)
FLUSH(0)
CALL err_exit
END IF
IF (ABS((ri - 1.0 / (bar * foo)) / ABS(ri)) > eps) THEN
WRITE (0, '(2(a,g24.15))') "error checking ri, ri=", ri, ", 1.0 / &
&(bar * foo) = ", 1.0 / (bar * foo)
FLUSH(0)
CALL err_exit
END IF
IF (ABS((boo - (bar * foo * 100.0))/ABS(boo)) > eps) THEN
WRITE (0, '(2(a,g24.15))') "error checking boo, boo=", boo, &
", bar * foo * 100.0 = ", bar * foo * 100.0
FLUSH(0)
CALL err_exit
END IF
IF (too /= boo) THEN
WRITE (0, '(2(a,g24.15))') "error checking too vs. boo, too=", too, &
", boo = ", boo
FLUSH(0)
CALL err_exit
END IF
aaaaaa = conftest_str_c()
DO i = 1, 99
IF (aaaaaa(i:i) /= 'a') THEN
WRITE (0, '(a,i0,a)') "error checking aaaaaa(", i, ")=", &
aaaaaa(i:i)
FLUSH(0)
CALL err_exit
END IF
END DO
end
_ACEOF
if ac_fn_fc_try_run "$LINENO"; then :
acx_cv_cfortran_works=yes
else
acx_cv_cfortran_works="error"
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
LIBS=$save_LIBS
else
acx_cv_cfortran_works="error compiling Fortran subroutine"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
else
acx_cv_cfortran_works="compiling with cfortran.h failed"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
......@@ -28752,16 +29153,37 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
CPPFLAGS=$save_CPPFLAGS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_check_cfint" >&5
$as_echo "$acx_cv_check_cfint" >&6; }
if test x$acx_cv_check_cfint = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_cfortran_works" >&5
$as_echo "$acx_cv_cfortran_works" >&6; }
if test x"$acx_cv_cfortran_works" = xyes; then :
 
$as_echo "#define HAVE_CF_INTERFACE 1" >>confdefs.h
 
else
case x"$acx_cv_cfortran_works" in #(
x"error") :
{ $as_echo "$as_me:${as_lineno-$LINENO}: Linking/Running with C EXTERNAL built with cfortran.h does not work!" >&5
$as_echo "$as_me: Linking/Running with C EXTERNAL built with cfortran.h does not work!" >&6;} ;; #(
x"compiling with cfortran.h failed") :
{ $as_echo "$as_me:${as_lineno-$LINENO}: Compilation with cfortran.h is not working!" >&5
$as_echo "$as_me: Compilation with cfortran.h is not working!" >&6;} ;; #(
x"error compiling Fortran subroutine") :
{ $as_echo "$as_me:${as_lineno-$LINENO}: compilation of simple Fortran source failed!" >&5
$as_echo "$as_me: compilation of simple Fortran source failed!" >&6;} ;; #(
*) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: Unexpected error when linking C and Fortran via cfortran.h!" >&5
$as_echo "$as_me: Unexpected error when linking C and Fortran via cfortran.h!" >&6;} ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling cfortran.h bindings generation" >&5
$as_echo "$as_me: Disabling cfortran.h bindings generation" >&6;}
acx_cv_cfortran_works=no
fi
 
if test -n "$FC" && test "X$FC" != "Xno" && test x$acx_cv_check_cfint = "xyes"; then
fi
if test -n "$FC" -a X"$FC" != Xno -a x"$acx_cv_cfortran_works" = xyes; then
USE_FC_TRUE=
USE_FC_FALSE='#'
else
......
......@@ -129,6 +129,7 @@ AC_CHECK_LIB(m, floor)
# Add basic configure options
ACX_OPTIONS
AM_CONDITIONAL([ENABLE_NETCDF],[test x$ENABLE_NETCDF = xyes])
AC_CHECK_FUNCS([grib_get_length])
# ----------------------------------------------------------------------
# Compile with MPI support
AC_ARG_ENABLE([mpi],
......@@ -319,10 +320,26 @@ AM_CONDITIONAL(ENABLE_PYTHON, [test "x$enable_python" != "xno"])
AS_IF([test "x$enable_python" != "xno"],[AC_SUBST([ENABLE_PYTHON],[true])],[AC_SUBST([ENABLE_PYTHON],[false])])
# ----------------------------------------------------------------------
AM_CONDITIONAL(CREATE_INTERFACES, [test "x$enable_ruby" = "xyes" -o "x$enable_python" = "xyes"])