Commit e1e83cdc authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

configure: check whether netCDF4/HDF5 is threadsafe

parent 396adbf2
......@@ -18998,66 +18998,6 @@ else
as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
fi
 
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5TS_mutex_lock" >&5
$as_echo_n "checking for library containing H5TS_mutex_lock... " >&6; }
if ${ac_cv_search_H5TS_mutex_lock+:} 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 H5TS_mutex_lock ();
int
main ()
{
return H5TS_mutex_lock ();
;
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_H5TS_mutex_lock=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_H5TS_mutex_lock+:} false; then :
break
fi
done
if ${ac_cv_search_H5TS_mutex_lock+:} false; then :
else
ac_cv_search_H5TS_mutex_lock=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5TS_mutex_lock" >&5
$as_echo "$ac_cv_search_H5TS_mutex_lock" >&6; }
ac_res=$ac_cv_search_H5TS_mutex_lock
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_NC4HDF5_THREADSAFE 1" >>confdefs.h
fi
NETCDF_LIBS=" -lnetcdf"
 
# Extract the first word of "nc-config", so it can be a program name with args.
......@@ -19218,66 +19158,6 @@ else
as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
fi
 
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5TS_mutex_lock" >&5
$as_echo_n "checking for library containing H5TS_mutex_lock... " >&6; }
if ${ac_cv_search_H5TS_mutex_lock+:} 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 H5TS_mutex_lock ();
int
main ()
{
return H5TS_mutex_lock ();
;
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 -lhdf5_hl -lhdf5 $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_H5TS_mutex_lock=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_H5TS_mutex_lock+:} false; then :
break
fi
done
if ${ac_cv_search_H5TS_mutex_lock+:} false; then :
else
ac_cv_search_H5TS_mutex_lock=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5TS_mutex_lock" >&5
$as_echo "$ac_cv_search_H5TS_mutex_lock" >&6; }
ac_res=$ac_cv_search_H5TS_mutex_lock
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_NC4HDF5_THREADSAFE 1" >>confdefs.h
fi
NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
 
......@@ -19391,6 +19271,68 @@ $as_echo "suppressed" >&6; }
fi
 
 
if test "x$ENABLE_NC4HDF5" = "xyes"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5TS_mutex_lock" >&5
$as_echo_n "checking for library containing H5TS_mutex_lock... " >&6; }
if ${ac_cv_search_H5TS_mutex_lock+:} 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 H5TS_mutex_lock ();
int
main ()
{
return H5TS_mutex_lock ();
;
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 -lhdf5_hl -lhdf5 $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_H5TS_mutex_lock=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_H5TS_mutex_lock+:} false; then :
break
fi
done
if ${ac_cv_search_H5TS_mutex_lock+:} false; then :
else
ac_cv_search_H5TS_mutex_lock=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5TS_mutex_lock" >&5
$as_echo "$ac_cv_search_H5TS_mutex_lock" >&6; }
ac_res=$ac_cv_search_H5TS_mutex_lock
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_NC4HDF5_THREADSAFE 1" >>confdefs.h
fi
fi
 
 
 
......
......@@ -153,10 +153,6 @@ AC_ARG_WITH([netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])
ENABLE_NETCDF=yes],
[AC_MSG_ERROR([Could not link to netcdf library])])
AC_SEARCH_LIBS([H5TS_mutex_lock], [netcdf],
[AC_DEFINE([HAVE_NC4HDF5_THREADSAFE],[1],[Define to 1 for NETCDF4/HDF5 threadsafe support])])
NETCDF_LIBS=" -lnetcdf"
AC_CHECK_PROG(NC_CONFIG,nc-config,nc-config)
......@@ -187,11 +183,6 @@ AC_ARG_WITH([netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])
ENABLE_NETCDF=yes],
[AC_MSG_ERROR([Could not link to netcdf library])])
AC_SEARCH_LIBS([H5TS_mutex_lock], [netcdf],
[AC_DEFINE([HAVE_NC4HDF5_THREADSAFE],[1],[Define to 1 for NETCDF4/HDF5 threadsafe support])],,
[-lhdf5_hl -lhdf5])
NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
......@@ -221,6 +212,12 @@ AC_ARG_WITH([netcdf],
[AC_MSG_NOTICE([$with_netcdf is not a directory! NETCDF suppressed])])])],
[AC_MSG_CHECKING([for NETCDF library])
AC_MSG_RESULT([suppressed])])
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_SUBST([ENABLE_NETCDF])
AC_SUBST([ENABLE_NC2])
AC_SUBST([ENABLE_NC4])
......
Markdown is supported
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