Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
e0bd47b1
Commit
e0bd47b1
authored
Jun 07, 2017
by
Uwe Schulzweida
Browse files
Added configure option --with-eccodes.
parent
549723a0
Changes
12
Hide whitespace changes
Inline
Side-by-side
Makefile.in
View file @
e0bd47b1
...
...
@@ -253,6 +253,8 @@ DEPDIR = @DEPDIR@
DLLTOOL
=
@DLLTOOL@
DSYMUTIL
=
@DSYMUTIL@
DUMPBIN
=
@DUMPBIN@
ECCODES_INCLUDE
=
@ECCODES_INCLUDE@
ECCODES_LIBS
=
@ECCODES_LIBS@
ECHO_C
=
@ECHO_C@
ECHO_N
=
@ECHO_N@
ECHO_T
=
@ECHO_T@
...
...
app/Makefile.in
View file @
e0bd47b1
...
...
@@ -226,6 +226,8 @@ DEPDIR = @DEPDIR@
DLLTOOL
=
@DLLTOOL@
DSYMUTIL
=
@DSYMUTIL@
DUMPBIN
=
@DUMPBIN@
ECCODES_INCLUDE
=
@ECCODES_INCLUDE@
ECCODES_LIBS
=
@ECCODES_LIBS@
ECHO_C
=
@ECHO_C@
ECHO_N
=
@ECHO_N@
ECHO_T
=
@ECHO_T@
...
...
cdi.settings.in
View file @
e0bd47b1
...
...
@@ -48,6 +48,10 @@
"lib" : "@GRIB_API_LIBS@",
"include" : "@GRIB_API_INCLUDE@"
}
"eccodes" : {
"lib" : "@ECCODES_LIBS@",
"include" : "@ECCODES_INCLUDE@"
}
}
},
"features" : {
...
...
config/default
View file @
e0bd47b1
...
...
@@ -57,7 +57,7 @@ case "${HOSTNAME}" in
--enable-iso-c-interface
\
--enable-swig
\
--enable-python
\
--with-
grib_api
=
$HOME
/local/
gribapi-1.1
3.0
\
--with-
eccodes
=
$HOME
/local/
eccodes-2.
3.0
\
--with-netcdf
=
$HOME
/local
\
CC
=
gcc
CFLAGS
=
"-g -pipe -D_REENTRANT -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3"
;;
...
...
configure
View file @
e0bd47b1
...
...
@@ -690,6 +690,8 @@ HAVE_LIBGRIB_API_FALSE
HAVE_LIBGRIB_API_TRUE
GRIB_API_LIBS
GRIB_API_INCLUDE
ECCODES_LIBS
ECCODES_INCLUDE
NETCDF_LIBS
NETCDF_INCLUDE
NETCDF_ROOT
...
...
@@ -860,6 +862,7 @@ enable_largefile
with_threads
with_szlib
with_netcdf
with_eccodes
with_grib_api
enable_grib
enable_cgribex
...
...
@@ -1590,10 +1593,14 @@ Optional Packages:
NETCDF4 compression
--with-netcdf=<yes|no|directory> (default=no)
location of NetCDF library (lib and include subdirs)
--with-eccodes=<yes|no|directory>
library for grib2 encoding/decoding; if a directory
is given, it will be used as a value for
--with-eccodes-root
--with-grib_api=<yes|no|directory>
library for grib2
compression
; if a directory
is
given, it will be used as a value for
--with-
jasper
-root
library for grib2
encoding/decoding
; if a directory
is
given, it will be used as a value for
--with-
grib_api
-root
--with-mpi-root set directory to search for MPI headers and library
--with-mpi-include specifically set directory to search for MPI
headers, [default=$with_mpi_root/include]
...
...
@@ -27576,6 +27583,187 @@ fi
# ----------------------------------------------------------------------
# Compile application with ECCODES library (for GRIB2 support)
ECCODES_INCLUDE=''
ECCODES_LIBS=''
# Check whether --with-eccodes was given.
if test "${with_eccodes+set}" = set; then :
withval=$with_eccodes; case "$with_eccodes" in #(
no) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ECCODES library" >&5
$as_echo_n "checking for ECCODES library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; } ;; #(
yes) :
for ac_header in grib_api.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "grib_api.h" "ac_cv_header_grib_api_h" "$ac_includes_default"
if test "x$ac_cv_header_grib_api_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GRIB_API_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing grib_get_message" >&5
$as_echo_n "checking for library containing grib_get_message... " >&6; }
if ${ac_cv_search_grib_get_message+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char grib_get_message ();
int
main ()
{
return grib_get_message ();
;
return 0;
}
_ACEOF
for ac_lib in '' eccodes; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_grib_get_message=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_grib_get_message+:} false; then :
break
fi
done
if ${ac_cv_search_grib_get_message+:} false; then :
else
ac_cv_search_grib_get_message=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_grib_get_message" >&5
$as_echo "$ac_cv_search_grib_get_message" >&6; }
ac_res=$ac_cv_search_grib_get_message
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_LIBGRIB_API 1" >>confdefs.h
else
as_fn_error $? "Could not link to eccodes library" "$LINENO" 5
fi
;; #(
*) :
ECCODES_ROOT=$with_eccodes
if test -d "$ECCODES_ROOT"; then :
LDFLAGS="-L$ECCODES_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$ECCODES_ROOT/include $CPPFLAGS"
for ac_header in grib_api.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "grib_api.h" "ac_cv_header_grib_api_h" "$ac_includes_default"
if test "x$ac_cv_header_grib_api_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GRIB_API_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing grib_get_message" >&5
$as_echo_n "checking for library containing grib_get_message... " >&6; }
if ${ac_cv_search_grib_get_message+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char grib_get_message ();
int
main ()
{
return grib_get_message ();
;
return 0;
}
_ACEOF
for ac_lib in '' eccodes; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_grib_get_message=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_grib_get_message+:} false; then :
break
fi
done
if ${ac_cv_search_grib_get_message+:} false; then :
else
ac_cv_search_grib_get_message=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_grib_get_message" >&5
$as_echo "$ac_cv_search_grib_get_message" >&6; }
ac_res=$ac_cv_search_grib_get_message
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_LIBGRIB_API 1" >>confdefs.h
else
as_fn_error $? "Could not link to eccodes library" "$LINENO" 5
fi
ECCODES_LIBS=" -L$ECCODES_ROOT/lib -leccodes"
ECCODES_INCLUDE=" -I$ECCODES_ROOT/include"
else
as_fn_error $? "$ECCODES_ROOT is not a directory! ECCODES suppressed" "$LINENO" 5
fi ;; #(
*) :
;;
esac
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ECCODES library" >&5
$as_echo_n "checking for the ECCODES library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; }
fi
# AM_CONDITIONAL([HAVE_LIBGRIB_API],[test "x$with_eccodes" != 'x' -a "x$with_eccodes" != 'xno' ])
# ----------------------------------------------------------------------
# Compile application with GRIB_API library (for GRIB2 support)
GRIB_API_INCLUDE=''
...
...
@@ -27756,7 +27944,7 @@ fi
if test "x$with_grib_api" != 'x' -a "x$with_grib_api" != 'xno' ; then
if test
\(
"x$with_grib_api" != 'x' -a "x$with_grib_api" != 'xno'
\) -o \( "x$with_eccodes" != 'x' -a "x$with_eccodes" != 'xno' \)
; then
HAVE_LIBGRIB_API_TRUE=
HAVE_LIBGRIB_API_FALSE='#'
else
examples/Makefile.in
View file @
e0bd47b1
...
...
@@ -285,6 +285,8 @@ DEPDIR = @DEPDIR@
DLLTOOL
=
@DLLTOOL@
DSYMUTIL
=
@DSYMUTIL@
DUMPBIN
=
@DUMPBIN@
ECCODES_INCLUDE
=
@ECCODES_INCLUDE@
ECCODES_LIBS
=
@ECCODES_LIBS@
ECHO_C
=
@ECHO_C@
ECHO_N
=
@ECHO_N@
ECHO_T
=
@ECHO_T@
...
...
examples/pio/Makefile.in
View file @
e0bd47b1
...
...
@@ -268,6 +268,8 @@ DEPDIR = @DEPDIR@
DLLTOOL
=
@DLLTOOL@
DSYMUTIL
=
@DSYMUTIL@
DUMPBIN
=
@DUMPBIN@
ECCODES_INCLUDE
=
@ECCODES_INCLUDE@
ECCODES_LIBS
=
@ECCODES_LIBS@
ECHO_C
=
@ECHO_C@
ECHO_N
=
@ECHO_N@
ECHO_T
=
@ECHO_T@
...
...
interfaces/Makefile.in
View file @
e0bd47b1
...
...
@@ -252,6 +252,8 @@ DEPDIR = @DEPDIR@
DLLTOOL
=
@DLLTOOL@
DSYMUTIL
=
@DSYMUTIL@
DUMPBIN
=
@DUMPBIN@
ECCODES_INCLUDE
=
@ECCODES_INCLUDE@
ECCODES_LIBS
=
@ECCODES_LIBS@
ECHO_C
=
@ECHO_C@
ECHO_N
=
@ECHO_N@
ECHO_T
=
@ECHO_T@
...
...
m4/acx_options.m4
View file @
e0bd47b1
...
...
@@ -155,12 +155,44 @@ AC_SUBST([NETCDF_ROOT])
AC_SUBST([NETCDF_INCLUDE])
AC_SUBST([NETCDF_LIBS])
# ----------------------------------------------------------------------
# Compile application with ECCODES library (for GRIB2 support)
ECCODES_INCLUDE=''
ECCODES_LIBS=''
AC_ARG_WITH([eccodes],
[AS_HELP_STRING([--with-eccodes=<yes|no|directory>],
[library for grib2 encoding/decoding; if a directory is given, it will be used as a value for --with-eccodes-root])],
[AS_CASE(["$with_eccodes"],
[no],[AC_MSG_CHECKING([for ECCODES library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([grib_api.h])
AC_SEARCH_LIBS([grib_get_message],
[eccodes],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[ECCODES library is present if defined to 1])],
[AC_MSG_ERROR([Could not link to eccodes library])])],
[*],[ECCODES_ROOT=$with_eccodes
AS_IF([test -d "$ECCODES_ROOT"],
[LDFLAGS="-L$ECCODES_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$ECCODES_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([grib_api.h])
AC_SEARCH_LIBS([grib_get_message],
[eccodes],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[ECCODES library is present if defined to 1])],
[AC_MSG_ERROR([Could not link to eccodes library])])
ECCODES_LIBS=" -L$ECCODES_ROOT/lib -leccodes"
ECCODES_INCLUDE=" -I$ECCODES_ROOT/include"],
[AC_MSG_ERROR([$ECCODES_ROOT is not a directory! ECCODES suppressed])])])],
[AC_MSG_CHECKING([for the ECCODES library])
AC_MSG_RESULT([suppressed])])
AC_SUBST([ECCODES_INCLUDE])
AC_SUBST([ECCODES_LIBS])
# AM_CONDITIONAL([HAVE_LIBGRIB_API],[test "x$with_eccodes" != 'x' -a "x$with_eccodes" != 'xno' ])
# ----------------------------------------------------------------------
# Compile application with GRIB_API library (for GRIB2 support)
GRIB_API_INCLUDE=''
GRIB_API_LIBS=''
AC_ARG_WITH([grib_api],
[AS_HELP_STRING([--with-grib_api=<yes|no|directory>],
[library for grib2
compression
; if a directory is given, it will be used as a value for --with-
jasper
-root])],
[library for grib2
encoding/decoding
; if a directory is given, it will be used as a value for --with-
grib_api
-root])],
[AS_CASE(["$with_grib_api"],
[no],[AC_MSG_CHECKING([for GRIB_API library])
AC_MSG_RESULT([suppressed])],
...
...
@@ -185,7 +217,7 @@ AC_ARG_WITH([grib_api],
AC_MSG_RESULT([suppressed])])
AC_SUBST([GRIB_API_INCLUDE])
AC_SUBST([GRIB_API_LIBS])
AM_CONDITIONAL([HAVE_LIBGRIB_API],[test "x$with_grib_api" != 'x' -a "x$with_grib_api" != 'xno' ])
AM_CONDITIONAL([HAVE_LIBGRIB_API],[test
\(
"x$with_grib_api" != 'x' -a "x$with_grib_api" != 'xno'
\) -o \( "x$with_eccodes" != 'x' -a "x$with_eccodes" != 'xno' \)
])
# ----------------------------------------------------------------------
# Enable GRIB support
AC_MSG_CHECKING([for GRIB support])
...
...
src/Makefile.am
View file @
e0bd47b1
...
...
@@ -138,7 +138,7 @@ libcdi_la_USE_FC_extra_sources = \
cfortran.h
\
cdiFortran.c
# these only contain code if
f
grib_api is available
# these only contain code if grib_api is available
libcdi_la_HAVE_LIBGRIB_API_extra_sources
=
\
gribapi_utilities.c stream_gribapi.c
...
...
src/Makefile.in
View file @
e0bd47b1
...
...
@@ -339,6 +339,8 @@ DEPDIR = @DEPDIR@
DLLTOOL
=
@DLLTOOL@
DSYMUTIL
=
@DSYMUTIL@
DUMPBIN
=
@DUMPBIN@
ECCODES_INCLUDE
=
@ECCODES_INCLUDE@
ECCODES_LIBS
=
@ECCODES_LIBS@
ECHO_C
=
@ECHO_C@
ECHO_N
=
@ECHO_N@
ECHO_T
=
@ECHO_T@
...
...
@@ -541,7 +543,7 @@ libcdi_la_USE_FC_extra_sources = \
cdiFortran.c
# these only contain code if
f
grib_api is available
# these only contain code if grib_api is available
libcdi_la_HAVE_LIBGRIB_API_extra_sources
=
\
gribapi_utilities.c stream_gribapi.c
...
...
tests/Makefile.in
View file @
e0bd47b1
...
...
@@ -350,6 +350,8 @@ DEPDIR = @DEPDIR@
DLLTOOL
=
@DLLTOOL@
DSYMUTIL
=
@DSYMUTIL@
DUMPBIN
=
@DUMPBIN@
ECCODES_INCLUDE
=
@ECCODES_INCLUDE@
ECCODES_LIBS
=
@ECCODES_LIBS@
ECHO_C
=
@ECHO_C@
ECHO_N
=
@ECHO_N@
ECHO_T
=
@ECHO_T@
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment