Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
017951f3
Commit
017951f3
authored
9 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
configure: check for H5get_libversion()
parent
f9f1f6df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+63
-3
63 additions, 3 deletions
configure
m4/acx_options.m4
+6
-4
6 additions, 4 deletions
m4/acx_options.m4
src/cdf.c
+11
-12
11 additions, 12 deletions
src/cdf.c
src/config.h.in
+3
-0
3 additions, 0 deletions
src/config.h.in
with
83 additions
and
19 deletions
configure
+
63
−
3
View file @
017951f3
...
...
@@ -26855,8 +26855,7 @@ esac
# ----------------------------------------------------------------------
# Compile application with SZLIB library, needed for GRIB1 or for
# linking against hdf5/netcdf4
# Compile application with SZLIB library, needed for GRIB1
SZLIB_INCLUDE=''
SZLIB_LIBS=''
...
...
@@ -27430,7 +27429,7 @@ for ac_lib in '' netcdf; do
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib
-lhdf5_hl -lhdf5
$ac_func_search_save_LIBS"
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_H5TS_mutex_lock=$ac_res
...
...
@@ -27461,6 +27460,67 @@ fi
fi
if test "x$ENABLE_NC4HDF5" = "xyes"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5get_libversion" >&5
$as_echo_n "checking for library containing H5get_libversion... " >&6; }
if ${ac_cv_search_H5get_libversion+:} 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 H5get_libversion ();
int
main ()
{
return H5get_libversion ();
;
return 0;
}
_ACEOF
for ac_lib in '' netcdf; 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_H5get_libversion=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_H5get_libversion+:} false; then :
break
fi
done
if ${ac_cv_search_H5get_libversion+:} false; then :
else
ac_cv_search_H5get_libversion=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5get_libversion" >&5
$as_echo "$ac_cv_search_H5get_libversion" >&6; }
ac_res=$ac_cv_search_H5get_libversion
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_H5GET_LIBVERSION 1" >>confdefs.h
fi
fi
This diff is collapsed.
Click to expand it.
m4/acx_options.m4
+
6
−
4
View file @
017951f3
...
...
@@ -27,8 +27,7 @@ AS_CASE([$with_threads],
AC_SUBST([THREADS_INCLUDE])
AC_SUBST([THREADS_LIBS])
# ----------------------------------------------------------------------
# Compile application with SZLIB library, needed for GRIB1 or for
# linking against hdf5/netcdf4
# Compile application with SZLIB library, needed for GRIB1
SZLIB_INCLUDE=''
SZLIB_LIBS=''
AC_ARG_WITH([szlib],
...
...
@@ -138,8 +137,11 @@ AC_ARG_WITH([netcdf],
AS_IF([test "x$ENABLE_NC4HDF5" = "xyes"],
[AC_SEARCH_LIBS([H5TS_mutex_lock], [netcdf],
[AC_DEFINE([HAVE_NC4HDF5_THREADSAFE],[1],[Define to 1 for NetCDF4/HDF5 threadsafe support])],,
[-lhdf5_hl -lhdf5])])
[AC_DEFINE([HAVE_NC4HDF5_THREADSAFE],[1],[Define to 1 for NetCDF4/HDF5 threadsafe support])],,)])
AS_IF([test "x$ENABLE_NC4HDF5" = "xyes"],
[AC_SEARCH_LIBS([H5get_libversion], [netcdf],
[AC_DEFINE([HAVE_H5GET_LIBVERSION],[1],[Define to 1 for H5get_libversion support])],,)])
AC_SUBST([ENABLE_NETCDF])
AC_SUBST([ENABLE_NC2])
...
...
This diff is collapsed.
Click to expand it.
src/cdf.c
+
11
−
12
View file @
017951f3
...
...
@@ -17,13 +17,13 @@
const
char
*
cdfLibraryVersion
(
void
)
{
#if defined (HAVE_LIBNETCDF)
return
(
nc_inq_libvers
()
)
;
return
nc_inq_libvers
();
#else
return
(
"library undefined"
)
;
return
"library undefined"
;
#endif
}
#if defined(HAVE_
NC4HDF5
)
#if defined(HAVE_
H5GET_LIBVERSION
)
#if defined(__cplusplus)
extern
"C"
{
#endif
...
...
@@ -35,7 +35,7 @@ extern "C" {
const
char
*
hdfLibraryVersion
(
void
)
{
#if defined(HAVE_
NC4HDF5
)
#if defined(HAVE_
H5GET_LIBVERSION
)
static
char
hdf_libvers
[
256
];
unsigned
majnum
,
minnum
,
relnum
;
...
...
@@ -43,9 +43,9 @@ const char *hdfLibraryVersion(void)
sprintf
(
hdf_libvers
,
"%u.%u.%u"
,
majnum
,
minnum
,
relnum
);
return
(
hdf_libvers
)
;
return
hdf_libvers
;
#else
return
(
"library undefined"
)
;
return
"library undefined"
;
#endif
}
...
...
@@ -137,24 +137,23 @@ static int cdfOpenFile(const char *filename, const char *mode, int *filetype)
}
#endif
return
(
ncid
)
;
return
ncid
;
}
int
cdfOpen
(
const
char
*
filename
,
const
char
*
mode
)
{
int
fileID
=
0
;
int
filetype
=
FILETYPE_NC
;
if
(
CDF_Debug
)
Message
(
"Open %s with mode %c"
,
filename
,
*
mode
);
fileID
=
cdfOpenFile
(
filename
,
mode
,
&
filetype
);
int
fileID
=
cdfOpenFile
(
filename
,
mode
,
&
filetype
);
if
(
CDF_Debug
)
Message
(
"File %s opened with id %d"
,
filename
,
fileID
);
return
(
fileID
)
;
return
fileID
;
}
...
...
@@ -185,7 +184,7 @@ int cdfOpen64(const char *filename, const char *mode)
fileID
=
CDI_ELIBNAVAIL
;
}
return
(
fileID
)
;
return
fileID
;
}
...
...
@@ -213,7 +212,7 @@ int cdf4Open(const char *filename, const char *mode, int *filetype)
fileID
=
CDI_ELIBNAVAIL
;
}
return
(
fileID
)
;
return
fileID
;
}
...
...
This diff is collapsed.
Click to expand it.
src/config.h.in
+
3
−
0
View file @
017951f3
...
...
@@ -79,6 +79,9 @@
/* Define to 1 if you have the `grib_get_length' function. */
#undef HAVE_GRIB_GET_LENGTH
/* Define to 1 for H5get_libversion support */
#undef HAVE_H5GET_LIBVERSION
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment