[MOAB-dev] r3057 - in MOAB/trunk: . m4

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Thu Jul 23 15:27:56 CDT 2009


Author: kraftche
Date: 2009-07-23 15:27:56 -0500 (Thu, 23 Jul 2009)
New Revision: 3057

Modified:
   MOAB/trunk/configure.ac
   MOAB/trunk/m4/netcdf.m4
Log:
Partial support for hdf5-based netcdf4 library: will configure correctly as long as MOAB's HDF5 support is enabled

Modified: MOAB/trunk/configure.ac
===================================================================
--- MOAB/trunk/configure.ac	2009-07-23 20:13:21 UTC (rev 3056)
+++ MOAB/trunk/configure.ac	2009-07-23 20:27:56 UTC (rev 3057)
@@ -356,13 +356,14 @@
 #                             NetCDF OPTIONS
 ################################################################################
 
+old_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
 SNL_CHECK_NETCDF
+LDFLAGS="$old_LDFLAGS"
 if test "xno" = "x$HAVE_NETCDF"; then
   AC_MSG_WARN([Support for ExodusII file format disabled])
-  NETCDF_LIBS=
 else
   DEFINES="$DEFINES -DNETCDF_FILE"
-  NETCDF_LIBS="-lnetcdf_c++ -lnetcdf"
 fi
 AM_CONDITIONAL(NETCDF_FILE, [test "xno" != "x$HAVE_NETCDF"])
 AM_CPPFLAGS="$NETCDF_CPPFLAGS $AM_CPPFLAGS"

Modified: MOAB/trunk/m4/netcdf.m4
===================================================================
--- MOAB/trunk/m4/netcdf.m4	2009-07-23 20:13:21 UTC (rev 3056)
+++ MOAB/trunk/m4/netcdf.m4	2009-07-23 20:27:56 UTC (rev 3057)
@@ -1,7 +1,10 @@
 #######################################################################################
 # Check for NetCDF library ((C++)
 # Sets HAVE_NETCDF to 'yes' or 'no'
-# If HAVE_NETCDF == yes, then exports NETCDF_CPPFLAGS and NETCDF_LDFLAGS
+# If HAVE_NETCDF == yes, then exports:
+#   NETCDF_CPPFLAGS
+#   NETCDF_LDFLAGS
+#   NETCDF_LIBS
 #######################################################################################
 AC_DEFUN([SNL_CHECK_NETCDF],[
 
@@ -82,14 +85,20 @@
   LIBS="$LIBS -lnetcdf_c++ -lnetcdf"
   AC_TRY_LINK(
     [#include <netcdf.hh>], [NcFile ncf("foo",NcFile::ReadOnly);],
-    [AC_MSG_RESULT([yes])], 
-    [AC_MSG_RESULT([no]); 
-     AC_MSG_WARN([NetCDF C++ API not found])
-     HAVE_NETCDF=no] )
+    [AC_MSG_RESULT([yes]); NETCDF_LIBS="-lnetcdf_c++ -lnetcdf"], 
+    [AC_MSG_RESULT([no]);
+     AC_MSG_CHECKING([for netcdf_c++ library requiring HDF5-high-level])
+     LIBS="$LIBS -lhdf5_hl -lhdf5"
+     AC_TRY_LINK(
+           [#include <netcdf.hh>], [NcFile ncf("foo",NcFile::ReadOnly);],
+           [AC_MSG_RESULT([yes]); NETCDF_LIBS="-lnetcdf_c++ -lnetcdf -lhdf5_hl ${HDF5_LIBS}"], 
+           [AC_MSG_RESULT([no]); HAVE_NETCDF=no] )    
+     ])
   LIBS="$old_LIBS"
   AC_LANG_RESTORE
   CPPFLAGS="$old_CPPFLAGS"
   LDFLAGS="$old_LDFLAGS"
+
   if test "x$HAVE_NETCDF" = "xno"; then
     if test "x$NETCDF_ARG" != "x"; then 
       AC_MSG_ERROR("NetCDF not found or not working")



More information about the moab-dev mailing list