dnl -------------------------------------------------------------
-dnl Check for the NetCDF API. If it is found we will be able read
+dnl Check whether NetCDF is installed. If so we will be able to read
dnl from and write to NetCDF binary or ascii files.
dnl
-dnl We assume that $NETCDF_DIR points to the NetCDF installation
-dnl directory, which includes the lib and include directory. I.e.
-dnl cd $NETCDF_DIR; ls
-dnl would result in something like
-dnl bin include lib man src
-dnl netcdf-3.6.0-p1>
+dnl The NetCDF installation directory (including the lib and include
+dnl directory) is given to the --with-netcdf configure option or to
+dnl the NETCDF_DIR environment variable
dnl
dnl Usage: DEAL_II_CONFIGURE_NETCDF
dnl
dnl -------------------------------------------------------------
AC_DEFUN(DEAL_II_CONFIGURE_NETCDF, dnl
[
- AC_CHECK_FILE($NETCDF_DIR/lib/libnetcdf.a,
- NETCDF_LIB=$NETCDF_DIR/lib/libnetcdf.a)
- AC_CHECK_FILE($NETCDF_DIR/lib/libnetcdf_c++.a,
- NETCDF_LIB="$NETCDF_DIR/lib/libnetcdf_c++.a $NETCDF_LIB",
- NETCDF_LIB="")
- AC_CHECK_FILE($NETCDF_DIR/include/netcdfcpp.h,
- NETCDF_INCLUDE_DIR=-I$NETCDF_DIR/include,
- NETCDF_LIB="")
-
- if (test "x$NETCDF_LIB" != "x") ; then
- AC_DEFINE(DEAL_II_HAVE_NETCDF, 1,
- [Flag indicating whether the library shall be compiled to use the NetCDF interface])
-
- AC_MSG_CHECKING(for NetCDF version)
- DEAL_II_NETCDF_VERSION=`cat $NETCDF_DIR/src/VERSION`
- AC_MSG_RESULT($DEAL_II_NETCDF_VERSION)
-
- LIBS="$NETCDF_LIB $LIBS"
+ AC_MSG_CHECKING(for NetCDF library directory)
+
+ AC_ARG_WITH(netcdf,
+ [ --with-netcdf=/path/to/netcdf Specify the path to the NetCDF installation,
+ of which the include and library directories
+ are subdirs; use this if you want to
+ override the NETCDF_DIR environment variable],
+ [
+ DEAL_II_NETCDF_DIR=$withval
+ ],
+ [
+ dnl Take something from the environment variables, if it is there
+ if test "x$NETCDF_DIR" != "x" ; then
+ DEAL_II_NETCDF_DIR="$NETCDF_DIR"
+ else
+ DEAL_II_NETCDF_DIR=""
+ AC_MSG_RESULT(not found)
+ fi
+ ])
+
+ if test "x$DEAL_II_NETCDF_DIR" != "x" ; then
+ AC_MSG_RESULT($DEAL_II_NETCDF_DIR)
+ AC_CHECK_FILE($DEAL_II_NETCDF_DIR/lib/libnetcdf.a,
+ NETCDF_LIB=$DEAL_II_NETCDF_DIR/lib/libnetcdf.a)
+ AC_CHECK_FILE($DEAL_II_NETCDF_DIR/lib/libnetcdf_c++.a,
+ NETCDF_LIB="$DEAL_II_NETCDF_DIR/lib/libnetcdf_c++.a $NETCDF_LIB",
+ NETCDF_LIB="")
+ AC_CHECK_FILE($DEAL_II_NETCDF_DIR/include/netcdfcpp.h,
+ NETCDF_INCLUDE_DIR=-I$DEAL_II_NETCDF_DIR/include,
+ NETCDF_LIB="")
+
+ if (test "x$NETCDF_LIB" != "x") ; then
+ AC_DEFINE(DEAL_II_HAVE_NETCDF, 1,
+ [Flag indicating whether the library shall be compiled to use the NetCDF interface])
+
+ AC_MSG_CHECKING(for NetCDF version)
+ DEAL_II_NETCDF_VERSION=`cat $DEAL_II_NETCDF_DIR/src/VERSION`
+ AC_MSG_RESULT($DEAL_II_NETCDF_VERSION)
+
+ LIBS="$NETCDF_LIB $LIBS"
+ fi
fi
])
#! /bin/sh
-# From configure.in Revision: 1.209 .
+# From configure.in Revision: 1.210 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for deal.II 5.3.pre.
#
the path to the libary is searched by ld, since it is included
by the argument -lblaslib. If no argument is given, use -lblas.
Default is to use -lblas only if required by other libraries.
+ --with-netcdf=/path/to/netcdf Specify the path to the NetCDF installation,
+ of which the include and library directories
+ are subdirs; use this if you want to
+ override the NETCDF_DIR environment variable
--with-metis=/path/to/metis Specify the path to the Metis installation,
of which the include and library directories
are subdirs; use this if you want to
- as_ac_File=`echo "ac_cv_file_$NETCDF_DIR/lib/libnetcdf.a" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $NETCDF_DIR/lib/libnetcdf.a" >&5
-echo $ECHO_N "checking for $NETCDF_DIR/lib/libnetcdf.a... $ECHO_C" >&6
+ echo "$as_me:$LINENO: checking for NetCDF library directory" >&5
+echo $ECHO_N "checking for NetCDF library directory... $ECHO_C" >&6
+
+
+# Check whether --with-netcdf or --without-netcdf was given.
+if test "${with_netcdf+set}" = set; then
+ withval="$with_netcdf"
+
+ DEAL_II_NETCDF_DIR=$withval
+
+else
+
+ if test "x$NETCDF_DIR" != "x" ; then
+ DEAL_II_NETCDF_DIR="$NETCDF_DIR"
+ else
+ DEAL_II_NETCDF_DIR=""
+ echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6
+ fi
+
+fi;
+
+ if test "x$DEAL_II_NETCDF_DIR" != "x" ; then
+ echo "$as_me:$LINENO: result: $DEAL_II_NETCDF_DIR" >&5
+echo "${ECHO_T}$DEAL_II_NETCDF_DIR" >&6
+ as_ac_File=`echo "ac_cv_file_$DEAL_II_NETCDF_DIR/lib/libnetcdf.a" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $DEAL_II_NETCDF_DIR/lib/libnetcdf.a" >&5
+echo $ECHO_N "checking for $DEAL_II_NETCDF_DIR/lib/libnetcdf.a... $ECHO_C" >&6
if eval "test \"\${$as_ac_File+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
{ { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
{ (exit 1); exit 1; }; }
-if test -r "$NETCDF_DIR/lib/libnetcdf.a"; then
+if test -r "$DEAL_II_NETCDF_DIR/lib/libnetcdf.a"; then
eval "$as_ac_File=yes"
else
eval "$as_ac_File=no"
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
if test `eval echo '${'$as_ac_File'}'` = yes; then
- NETCDF_LIB=$NETCDF_DIR/lib/libnetcdf.a
+ NETCDF_LIB=$DEAL_II_NETCDF_DIR/lib/libnetcdf.a
fi
- as_ac_File=`echo "ac_cv_file_$NETCDF_DIR/lib/libnetcdf_c++.a" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $NETCDF_DIR/lib/libnetcdf_c++.a" >&5
-echo $ECHO_N "checking for $NETCDF_DIR/lib/libnetcdf_c++.a... $ECHO_C" >&6
+ as_ac_File=`echo "ac_cv_file_$DEAL_II_NETCDF_DIR/lib/libnetcdf_c++.a" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $DEAL_II_NETCDF_DIR/lib/libnetcdf_c++.a" >&5
+echo $ECHO_N "checking for $DEAL_II_NETCDF_DIR/lib/libnetcdf_c++.a... $ECHO_C" >&6
if eval "test \"\${$as_ac_File+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
{ { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
{ (exit 1); exit 1; }; }
-if test -r "$NETCDF_DIR/lib/libnetcdf_c++.a"; then
+if test -r "$DEAL_II_NETCDF_DIR/lib/libnetcdf_c++.a"; then
eval "$as_ac_File=yes"
else
eval "$as_ac_File=no"
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
if test `eval echo '${'$as_ac_File'}'` = yes; then
- NETCDF_LIB="$NETCDF_DIR/lib/libnetcdf_c++.a $NETCDF_LIB"
+ NETCDF_LIB="$DEAL_II_NETCDF_DIR/lib/libnetcdf_c++.a $NETCDF_LIB"
else
NETCDF_LIB=""
fi
- as_ac_File=`echo "ac_cv_file_$NETCDF_DIR/include/netcdfcpp.h" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $NETCDF_DIR/include/netcdfcpp.h" >&5
-echo $ECHO_N "checking for $NETCDF_DIR/include/netcdfcpp.h... $ECHO_C" >&6
+ as_ac_File=`echo "ac_cv_file_$DEAL_II_NETCDF_DIR/include/netcdfcpp.h" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $DEAL_II_NETCDF_DIR/include/netcdfcpp.h" >&5
+echo $ECHO_N "checking for $DEAL_II_NETCDF_DIR/include/netcdfcpp.h... $ECHO_C" >&6
if eval "test \"\${$as_ac_File+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
{ { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
{ (exit 1); exit 1; }; }
-if test -r "$NETCDF_DIR/include/netcdfcpp.h"; then
+if test -r "$DEAL_II_NETCDF_DIR/include/netcdfcpp.h"; then
eval "$as_ac_File=yes"
else
eval "$as_ac_File=no"
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
if test `eval echo '${'$as_ac_File'}'` = yes; then
- NETCDF_INCLUDE_DIR=-I$NETCDF_DIR/include
+ NETCDF_INCLUDE_DIR=-I$DEAL_II_NETCDF_DIR/include
else
NETCDF_LIB=""
fi
- if (test "x$NETCDF_LIB" != "x") ; then
+ if (test "x$NETCDF_LIB" != "x") ; then
cat >>confdefs.h <<\_ACEOF
#define DEAL_II_HAVE_NETCDF 1
_ACEOF
- echo "$as_me:$LINENO: checking for NetCDF version" >&5
+ echo "$as_me:$LINENO: checking for NetCDF version" >&5
echo $ECHO_N "checking for NetCDF version... $ECHO_C" >&6
- DEAL_II_NETCDF_VERSION=`cat $NETCDF_DIR/src/VERSION`
- echo "$as_me:$LINENO: result: $DEAL_II_NETCDF_VERSION" >&5
+ DEAL_II_NETCDF_VERSION=`cat $DEAL_II_NETCDF_DIR/src/VERSION`
+ echo "$as_me:$LINENO: result: $DEAL_II_NETCDF_VERSION" >&5
echo "${ECHO_T}$DEAL_II_NETCDF_VERSION" >&6
- LIBS="$NETCDF_LIB $LIBS"
+ LIBS="$NETCDF_LIB $LIBS"
+ fi
fi