Commit 2997b7f3 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

merged changes from trunk

parents 89955264 6b2dd992
......@@ -230,7 +230,6 @@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
......
......@@ -203,7 +203,6 @@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
# autoconf 2.68
# libtool 2.4.2
AC_INIT([cdi], [1.6.9], [http://mpimet.mpg.de/cdi])
AC_INIT([cdi], [1.7.0rc1], [http://mpimet.mpg.de/cdi])
echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}"
......@@ -21,35 +21,31 @@ AM_INIT_AUTOMAKE([foreign serial-tests])
AC_CONFIG_HEADERS([src/config.h])
AM_MAINTAINER_MODE([disable])
# Set up libtool.
AC_MSG_NOTICE([setting up libtool])
LT_INIT([pic-only])
# Check building environment
AC_CHECK_TOOL([CC],[gcc],[:])
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_C_RESTRICT
AC_PROG_FC
AS_IF([test -n "$FC" && test "X$FC" != "Xno"],
AS_IF([test -n "$FC" && test "X$FC" != Xno],
[AC_FC_SRCEXT([f90])
AC_LANG_PUSH([Fortran])
AC_PROG_FPP
AC_LANG_POP([Fortran])])
AC_PROG_F77
AC_PROG_CXX
AC_CHECK_PROG(SED,sed,sed,false)
AC_CHECK_PROG(GREP,grep,grep,false)
AC_PROG_INSTALL
AC_CHECK_TOOL([AR],[ar],[:])
AC_CHECK_TOOL([CPP],[cpp],[:])
AC_CHECK_TOOL([LD],[ld],[:])
AC_CHECK_TOOL([NM],[nm],[:])
AC_CHECK_TOOL([AS],[as],[:])
AC_CHECK_TOOL([DLLTOOL],[dlltool],[:])
AC_CHECK_TOOL([OBJDUMP],[objdump],[:])
AC_CHECK_TOOL([STRIP],[strip],[:])
AC_CHECK_TOOL([RANLIB],[ranlib],[:])
# Set up libtool.
AC_MSG_NOTICE([setting up libtool])
dnl before switching on libtool, identify compilers that prevent us from
dnl certain build configurations
ACX_LT_PROBLEMS
LT_INIT([pic-only])
dnl _KPSE_USE_LIBTOOL ensures libtool is also used for configure-time tests,
dnl which deduces dependent libraries automatically
_KPSE_USE_LIBTOOL
# -----------------------------------------------------------------------
# Check endianess of system
AC_C_BIGENDIAN
......
......@@ -251,7 +251,6 @@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
......
......@@ -245,7 +245,6 @@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
......
......@@ -229,7 +229,6 @@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
......
......@@ -284,7 +284,7 @@ dnl preprocessing failed. So this command doesn't work.
# _ACX_SL_PROG_FPP([SUFFIX], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ------------
# Try to figure out how to preprocess files with the given suffix
# for use with the selected Fortran compiler
# just like the selected Fortran compiler does
#
# Must be run after _ACX_SL_PROG_FC_CPP
AC_DEFUN([_ACX_SL_PROG_FPP],
......@@ -305,12 +305,9 @@ AC_DEFUN([_ACX_SL_PROG_FPP],
`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" "$FC -E -cpp" \
"$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" \
"${F77-f77} -F" "${F77-f77} -E" 'fpp' \
"$CPP" "$CPP -x c" 'cpp' '/lib/cpp' \
'/usr/ccs/lib/cpp' 'g77 -E' '${CC-cc} -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])
......
......@@ -115,8 +115,14 @@ libcdi_la_SOURCES = \
vlist_var.h \
zaxis.c \
zaxis.h \
stream.c \
swap.c
stream.c \
swap.c \
iterator.c \
iterator.h \
iterator_fallback.c \
iterator_fallback.h \
iterator_grib.c \
iterator_grib.h
# cfortran.h is an optional part of libcdi
libcdi_la_USE_FC_extra_sources = \
......@@ -131,15 +137,6 @@ EXTRA_DIST += \
$(libcdi_la_USE_FC_extra_sources)
if HAVE_LIBGRIB_API
libcdi_la_SOURCES += \
iterator.c \
iterator.h \
iterator_fallback.c \
iterator_fallback.h \
iterator_grib.c \
iterator_grib.h
endif
libcdiresunpack_la_SOURCES = \
resource_unpack.c
......
......@@ -83,25 +83,17 @@ host_triplet = @host@
@USE_FC_TRUE@am__append_2 = \
@USE_FC_TRUE@ $(libcdi_la_USE_FC_extra_sources)
@HAVE_LIBGRIB_API_TRUE@am__append_3 = \
@HAVE_LIBGRIB_API_TRUE@ iterator.c \
@HAVE_LIBGRIB_API_TRUE@ iterator.h \
@HAVE_LIBGRIB_API_TRUE@ iterator_fallback.c \
@HAVE_LIBGRIB_API_TRUE@ iterator_fallback.h \
@HAVE_LIBGRIB_API_TRUE@ iterator_grib.c \
@HAVE_LIBGRIB_API_TRUE@ iterator_grib.h
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am__append_4 = libcdipio.la
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am__append_5 = cdipio.h cdipio.inc
@ENABLE_CDI_LIB_FALSE@@USE_MPI_TRUE@am__append_6 = libcdipio.la
@ENABLE_CDI_LIB_TRUE@am__append_7 = pkgconfig/cdi.pc
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am__append_8 = pkgconfig/cdipio.pc
@CREATE_ISOC_TRUE@am__append_9 = mo_cdi.$(OBJEXT)
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am__append_3 = libcdipio.la
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am__append_4 = cdipio.h cdipio.inc
@ENABLE_CDI_LIB_FALSE@@USE_MPI_TRUE@am__append_5 = libcdipio.la
@ENABLE_CDI_LIB_TRUE@am__append_6 = pkgconfig/cdi.pc
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am__append_7 = pkgconfig/cdipio.pc
@CREATE_ISOC_TRUE@am__append_8 = mo_cdi.$(OBJEXT)
#CLEANFILES += cdilib.c
@CREATE_ISOC_TRUE@am__append_10 = mo_cdi.$(FCMODEXT) mo_cdi.$(OBJEXT) mo_cdi.f90
@ENABLE_CDI_LIB_TRUE@am__append_11 = pkgconfig/cdi.pc
@CREATE_ISOC_TRUE@am__append_9 = mo_cdi.$(FCMODEXT) mo_cdi.$(OBJEXT) mo_cdi.f90
@ENABLE_CDI_LIB_TRUE@am__append_10 = pkgconfig/cdi.pc
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am__append_11 = pkgconfig/cdipio.pc
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am__append_12 = pkgconfig/cdipio.pc
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am__append_13 = pkgconfig/cdipio.pc
subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/config.h.in $(top_srcdir)/config/mkinstalldirs \
......@@ -189,13 +181,11 @@ am__libcdi_la_SOURCES_DIST = basetime.c basetime.h binary.c binary.h \
swap.h table.c table.h tablepar.h taxis.c taxis.h timebase.c \
timebase.h tsteps.c util.c varscan.c varscan.h version.c \
vlist.c vlist.h vlist_att.c vlist_att.h vlist_var.c \
vlist_var.h zaxis.c zaxis.h stream.c swap.c cfortran.h \
cdiFortran.c iterator.c iterator.h iterator_fallback.c \
iterator_fallback.h iterator_grib.c iterator_grib.h
vlist_var.h zaxis.c zaxis.h stream.c swap.c iterator.c \
iterator.h iterator_fallback.c iterator_fallback.h \
iterator_grib.c iterator_grib.h cfortran.h cdiFortran.c
am__objects_1 = cdiFortran.lo
@USE_FC_TRUE@am__objects_2 = $(am__objects_1)
@HAVE_LIBGRIB_API_TRUE@am__objects_3 = iterator.lo \
@HAVE_LIBGRIB_API_TRUE@ iterator_fallback.lo iterator_grib.lo
am_libcdi_la_OBJECTS = basetime.lo binary.lo calendar.lo cdf.lo \
cdf_int.lo cdi_error.lo cdi_util.lo cgribexlib.lo dmemory.lo \
cksum.lo cdi_cksum.lo error.lo extralib.lo file.lo \
......@@ -208,7 +198,8 @@ am_libcdi_la_OBJECTS = basetime.lo binary.lo calendar.lo cdf.lo \
stream_srv.lo stream_var.lo subtype.lo table.lo taxis.lo \
timebase.lo tsteps.lo util.lo varscan.lo version.lo vlist.lo \
vlist_att.lo vlist_var.lo zaxis.lo stream.lo swap.lo \
$(am__objects_2) $(am__objects_3)
iterator.lo iterator_fallback.lo iterator_grib.lo \
$(am__objects_2)
libcdi_la_OBJECTS = $(am_libcdi_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
......@@ -301,7 +292,6 @@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
......@@ -494,9 +484,9 @@ top_srcdir = @top_srcdir@
#
EXTRA_DIST = cdilib.c mo_cdi.f90 $(libcdi_la_USE_FC_extra_sources)
noinst_LTLIBRARIES = libcdiresunpack.la $(am__append_1) \
$(am__append_6)
@ENABLE_CDI_LIB_TRUE@lib_LTLIBRARIES = libcdi.la $(am__append_4)
@ENABLE_CDI_LIB_TRUE@include_HEADERS = cdi.h cdi.inc $(am__append_5)
$(am__append_5)
@ENABLE_CDI_LIB_TRUE@lib_LTLIBRARIES = libcdi.la $(am__append_3)
@ENABLE_CDI_LIB_TRUE@include_HEADERS = cdi.h cdi.inc $(am__append_4)
AM_CFLAGS = $(PPM_CORE_CFLAGS) $(YAXT_CFLAGS) $(MPI_C_INCLUDE)
libcdi_la_SOURCES = basetime.c basetime.h binary.c binary.h calendar.c \
calendar.h cdf.c cdf.h cdf_int.c cdf_int.h cdi.h cdi_error.c \
......@@ -518,7 +508,9 @@ libcdi_la_SOURCES = basetime.c basetime.h binary.c binary.h calendar.c \
tablepar.h taxis.c taxis.h timebase.c timebase.h tsteps.c \
util.c varscan.c varscan.h version.c vlist.c vlist.h \
vlist_att.c vlist_att.h vlist_var.c vlist_var.h zaxis.c \
zaxis.h stream.c swap.c $(am__append_2) $(am__append_3)
zaxis.h stream.c swap.c iterator.c iterator.h \
iterator_fallback.c iterator_fallback.h iterator_grib.c \
iterator_grib.h $(am__append_2)
# cfortran.h is an optional part of libcdi
libcdi_la_USE_FC_extra_sources = \
......@@ -568,12 +560,11 @@ libcdi_la_LIBADD = $(UUID_C_LIB)
#
#cdilib.o: cdilib.c
# $(COMPILE) -c $<
LOCALTARGETS = $(am__append_7) $(am__append_8) $(am__append_9)
LOCALTARGETS = $(am__append_6) $(am__append_7) $(am__append_8)
#
CLEANFILES = `ls *~` $(am__append_10) $(am__append_11) \
$(am__append_12)
CLEANFILES = `ls *~` $(am__append_9) $(am__append_10) $(am__append_11)
@ENABLE_CDI_LIB_TRUE@PKGCONFIG_FILES = pkgconfig/cdi.pc \
@ENABLE_CDI_LIB_TRUE@ $(am__append_13)
@ENABLE_CDI_LIB_TRUE@ $(am__append_12)
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
......
......@@ -1782,7 +1782,9 @@ int main(void)
#include <mach/mach_time.h>
#endif
#ifdef __cplusplus
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#if defined(__GNUC__) && (__GNUC__ >= 4)
......
......@@ -170,9 +170,7 @@ destructSuper:
fail:
return NULL;
}
#endif
#ifdef HAVE_LIBGRIB_API
static void cdiGribIterator_ensureBuffer(CdiGribIterator* me, size_t requiredSize)
{
if(me->bufferSize < requiredSize)
......@@ -536,6 +534,7 @@ void cdiGribIterator_readFieldF(CdiIterator* super, float* buffer, size_t* nmiss
for(size_t i = valueCount; i--; ) buffer[i] = (float)temp[i];
free(temp);
}
#endif
/**
@Function cdiGribIterator_delete
......@@ -550,7 +549,12 @@ void cdiGribIterator_readFieldF(CdiIterator* super, float* buffer, size_t* nmiss
*/
void cdiGribIterator_delete(CdiGribIterator* me)
{
#ifdef HAVE_LIBGRIB_API
if(me) cdiGribIterator_condestruct(me, NULL, 0);
#else
(void)me;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
......@@ -573,7 +577,12 @@ void cdiGribIterator_delete(CdiGribIterator* me)
*/
int cdiGribIterator_inqEdition(CdiGribIterator* me)
{
#ifdef HAVE_LIBGRIB_API
return (int)gribEditionNumber(me->gribHandle);
#else
(void)me;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -592,7 +601,14 @@ int cdiGribIterator_inqEdition(CdiGribIterator* me)
*/
int cdiGribIterator_getLong(CdiGribIterator* me, const char* key, long* result)
{
#ifdef HAVE_LIBGRIB_API
return grib_get_long(me->gribHandle, key, result);
#else
(void)me;
(void)key;
(void)result;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -613,9 +629,17 @@ int cdiGribIterator_getLength(CdiGribIterator* me, const char* key, size_t* resu
{
#ifdef HAVE_GRIB_GET_LENGTH
return grib_get_length(me->gribHandle, key, result);
#else
Error("unimplemented");
#elif defined(HAVE_LIBGRIB_API)
(void)me;
(void)key;
(void)result;
Error("grib_get_length() is not available, so cdiGribIterator_getLength() can't be used");
return -1;
#else
(void)me;
(void)key;
(void)result;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
......@@ -635,7 +659,15 @@ int cdiGribIterator_getLength(CdiGribIterator* me, const char* key, size_t* resu
*/
int cdiGribIterator_getString(CdiGribIterator* me, const char* key, char* result, size_t* length)
{
#ifdef HAVE_LIBGRIB_API
return grib_get_string(me->gribHandle, key, result, length);
#else
(void)me;
(void)key;
(void)result;
(void)length;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -655,7 +687,13 @@ int cdiGribIterator_getString(CdiGribIterator* me, const char* key, char* result
*/
long cdiGribIterator_inqLongValue(CdiGribIterator* me, const char* key)
{
#ifdef HAVE_LIBGRIB_API
return gribGetLong(me->gribHandle, key);
#else
(void)me;
(void)key;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -676,7 +714,14 @@ long cdiGribIterator_inqLongValue(CdiGribIterator* me, const char* key)
*/
long cdiGribIterator_inqLongDefaultValue(CdiGribIterator* me, const char* key, long defaultValue)
{
#ifdef HAVE_LIBGRIB_API
return gribGetLongDefault(me->gribHandle, key, defaultValue);
#else
(void)me;
(void)key;
(void)defaultValue;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -697,7 +742,13 @@ long cdiGribIterator_inqLongDefaultValue(CdiGribIterator* me, const char* key, l
*/
char* cdiGribIterator_inqStringValue(CdiGribIterator* me, const char* key)
{
#ifdef HAVE_LIBGRIB_API
return gribCopyString(me->gribHandle, key);
#else
(void)me;
(void)key;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -716,7 +767,14 @@ char* cdiGribIterator_inqStringValue(CdiGribIterator* me, const char* key)
*/
int cdiGribIterator_getDouble(CdiGribIterator* me, const char* key, double* result)
{
#ifdef HAVE_LIBGRIB_API
return grib_get_double(me->gribHandle, key, result);
#else
(void)me;
(void)key;
(void)result;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -735,7 +793,14 @@ int cdiGribIterator_getDouble(CdiGribIterator* me, const char* key, double* resu
*/
int cdiGribIterator_getSize(CdiGribIterator* me, const char* key, size_t* result)
{
#ifdef HAVE_LIBGRIB_API
return grib_get_size(me->gribHandle, key, result);
#else
(void)me;
(void)key;
(void)result;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -754,7 +819,15 @@ int cdiGribIterator_getSize(CdiGribIterator* me, const char* key, size_t* result
*/
int cdiGribIterator_getLongArray(CdiGribIterator* me, const char* key, long* result, size_t* size)
{
#ifdef HAVE_LIBGRIB_API
return grib_get_long_array(me->gribHandle, key, result, size);
#else
(void)me;
(void)key;
(void)result;
(void)size;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -773,7 +846,15 @@ int cdiGribIterator_getLongArray(CdiGribIterator* me, const char* key, long* res
*/
int cdiGribIterator_getDoubleArray(CdiGribIterator* me, const char* key, double* result, size_t* size)
{
#ifdef HAVE_LIBGRIB_API
return grib_get_double_array(me->gribHandle, key, result, size);
#else
(void)me;
(void)key;
(void)result;
(void)size;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -793,7 +874,13 @@ int cdiGribIterator_getDoubleArray(CdiGribIterator* me, const char* key, double*
*/
double cdiGribIterator_inqDoubleValue(CdiGribIterator* me, const char* key)
{
#ifdef HAVE_LIBGRIB_API
return gribGetDouble(me->gribHandle, key);
#else
(void)me;
(void)key;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
/**
......@@ -814,7 +901,12 @@ double cdiGribIterator_inqDoubleValue(CdiGribIterator* me, const char* key)
*/
double cdiGribIterator_inqDoubleDefaultValue(CdiGribIterator* me, const char* key, double defaultValue)
{
#ifdef HAVE_LIBGRIB_API
return gribGetDoubleDefault(me->gribHandle, key, defaultValue);
}
#else
(void)me;
(void)key;
(void)defaultValue;
xabort("CDI was compiled without GribAPI support, so you can't possibly have a valid CdiGribIterator* to call this function with");
#endif
}
......@@ -309,7 +309,6 @@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
......
......@@ -2,7 +2,7 @@
#include "config.h"
#endif
#ifndef __STDC_FORMAT_MACROS
#if defined __cplusplus && !defined __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment