[cig-commits] r20678 - short/3D/PyLith/pylith_installer/trunk

brad at geodynamics.org brad at geodynamics.org
Tue Sep 4 10:47:54 PDT 2012


Author: brad
Date: 2012-09-04 10:47:54 -0700 (Tue, 04 Sep 2012)
New Revision: 20678

Modified:
   short/3D/PyLith/pylith_installer/trunk/Makefile.am
   short/3D/PyLith/pylith_installer/trunk/configure.ac
Log:
Updated netcdf to version 4.1.3 and added netCDF4.

Modified: short/3D/PyLith/pylith_installer/trunk/Makefile.am
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/Makefile.am	2012-09-04 15:44:33 UTC (rev 20677)
+++ short/3D/PyLith/pylith_installer/trunk/Makefile.am	2012-09-04 17:47:54 UTC (rev 20678)
@@ -40,9 +40,12 @@
 
 PROJ4_VER=4.8.0
 
-NETCDF_VER=4.1.1
 HDF5_VER=1.8.8
+H5PY_VER=2.0.1
 
+NETCDF_VER=4.1.3
+NETCDFPY_VER=1.0
+
 SCIENTIFICPYTHON_VER=2.9.1
 FIAT_VER=0.9.9
 
@@ -50,7 +53,6 @@
 NEMESIS_VER=1.0.2
 
 CMAKE_VER=2.8.8
-H5PY_VER=2.0.1
 
 if USE_PYLITH_SVN
 SPATIALDATA_VER=dev
@@ -85,6 +87,7 @@
 	installed_numpy \
 	installed_proj4 \
 	installed_netcdf \
+	installed_netcdfpy \
 	installed_hdf5 \
 	installed_h5py \
 	installed_fiat \
@@ -120,6 +123,7 @@
 	swig-$(SWIG_VER) \
 	proj-$(PROJ4_VER) \
 	netcdf-$(NETCDF_VER) \
+	netCDF4-$(NETCDFPY_VER) \
 	hdf5-$(HDF5_VER) \
 	h5py-$(H5PY_VER) \
 	spatialdata-$(SPATIALDATA_VER) \
@@ -419,37 +423,6 @@
 
 
 # ----------------------------------------------------------------------
-# netcdf
-# ----------------------------------------------------------------------
-netcdf: installed_compilers
-if INSTALL_NETCDF
-	$(FETCH_SCRIPT) "$(downloader)" netcdf-$(NETCDF_VER).tar.gz http://geodynamics.org/~buildbot/deps
-	$(TAR) -zxf netcdf-$(NETCDF_VER).tar.gz
-	$(MKDIR_P) netcdf-build
-	cd netcdf-build && \
-		../netcdf-$(NETCDF_VER)/configure \
-			--prefix=$(prefix) $(env_flags) $(env_compilers) \
-			--enable-shared --disable-static --disable-netcdf-4 --disable-dap ; \
-		make -j $(make_threads) && \
-		make install && \
-		touch ../installed_netcdf
-
-else
-if WITH_NETCDF
-	@echo "$@ already installed. Skipping installation."
-else
-	@echo "netcdf option not requested. To enable NetCDF option, "
-	@echo "reconfigure with --enable-netcdf (to install NetCDF) or "
-	@echo "--with-netcdf (to use an existing installation)."
-endif
-	touch installed_netcdf
-endif
-
-installed_netcdf:
-	$(MAKE) $(AM_MAKEFLAGS) netcdf
-
-
-# ----------------------------------------------------------------------
 # hdf5
 # ----------------------------------------------------------------------
 hdf5: installed_mpi
@@ -510,6 +483,69 @@
 
 
 # ----------------------------------------------------------------------
+# netcdf
+# ----------------------------------------------------------------------
+netcdf: installed_compilers installed_hdf5
+if INSTALL_NETCDF
+if WITH_HDF5
+netcdf_4_options = --enable-netcdf-4
+else
+netcdf_4_options = --disable-netcdf-4
+endif
+	$(FETCH_SCRIPT) "$(downloader)" netcdf-$(NETCDF_VER).tar.gz http://geodynamics.org/~buildbot/deps
+	$(TAR) -zxf netcdf-$(NETCDF_VER).tar.gz
+	$(MKDIR_P) netcdf-build
+	cd netcdf-build && \
+		../netcdf-$(NETCDF_VER)/configure \
+			--prefix=$(prefix) $(env_flags) $(env_mpicompilers) \
+			--enable-shared --disable-static $(netcdf_4_options) --disable-dap ; \
+		sed -e "s/-l //g" libtool > libtool.tmp && mv -f libtool.tmp libtool; \
+		make -j $(make_threads) && \
+		make install && \
+		touch ../installed_netcdf
+
+else
+if WITH_NETCDF
+	@echo "$@ already installed. Skipping installation."
+else
+	@echo "netcdf option not requested. To enable NetCDF option, "
+	@echo "reconfigure with --enable-netcdf (to install NetCDF) or "
+	@echo "--with-netcdf (to use an existing installation)."
+endif
+	touch installed_netcdf
+endif
+
+installed_netcdf:
+	$(MAKE) $(AM_MAKEFLAGS) netcdf
+
+
+# ----------------------------------------------------------------------
+# netcdfpy
+# ----------------------------------------------------------------------
+netcdfpy: installed_netcdf installed_numpy
+if INSTALL_NETCDFPY
+	$(FETCH_SCRIPT) "$(downloader)" netCDF4-$(NETCDFPY_VER)fix1.tar.gz http://geodynamics.org/~buildbot/deps
+	$(TAR) -zxf netCDF4-$(NETCDFPY_VER)fix1.tar.gz
+	echo -e "[options]\nuse_ncconfig=True" > netCDF4-$(NETCDFPY_VER)/setup.cfg
+	cd netCDF4-$(NETCDFPY_VER) && \
+		CC=mpicc $(env_flags) python setup.py build && \
+		python setup.py install --prefix=$(prefix) && \
+		touch ../installed_netcdfpy
+else
+if WITH_NETCDFPY
+	@echo "$@ already installed. Skipping installation."
+else
+	@echo "netCDF4 option not requested. To enable netCDF4 option, "
+	@echo "reconfigure with --enable-netcdfpy (to install netCDF4)."
+endif
+	touch installed_netcdfpy
+endif
+
+installed_netcdfpy:
+	$(MAKE) $(AM_MAKEFLAGS) netcdfpy
+
+
+# ----------------------------------------------------------------------
 # fiat
 # ----------------------------------------------------------------------
 fiat: installed_numpy

Modified: short/3D/PyLith/pylith_installer/trunk/configure.ac
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/configure.ac	2012-09-04 15:44:33 UTC (rev 20677)
+++ short/3D/PyLith/pylith_installer/trunk/configure.ac	2012-09-04 17:47:54 UTC (rev 20678)
@@ -89,14 +89,6 @@
 	[install_proj4=yes])
 AM_CONDITIONAL([INSTALL_PROJ4], [test "$install_proj4" = yes])
 
-# NETCDF
-AC_ARG_ENABLE([netcdf],
-    [AC_HELP_STRING([--enable-netcdf],
-        [install NetCDF @<:@default=yes@:>@])],
-	[if test "$enableval" = yes ; then install_netcdf=yes; else install_netcdf=no; fi],
-	[install_netcdf=yes])
-AM_CONDITIONAL([INSTALL_NETCDF], [test "$install_netcdf" = yes])
-
 # HDF5
 AC_ARG_ENABLE([hdf5],
     [AC_HELP_STRING([--enable-hdf5],
@@ -113,6 +105,22 @@
 	[install_h5py=yes])
 AM_CONDITIONAL([INSTALL_H5PY], [test "$install_h5py" = yes])
 
+# NETCDF
+AC_ARG_ENABLE([netcdf],
+    [AC_HELP_STRING([--enable-netcdf],
+        [install NetCDF @<:@default=yes@:>@])],
+	[if test "$enableval" = yes ; then install_netcdf=yes; else install_netcdf=no; fi],
+	[install_netcdf=yes])
+AM_CONDITIONAL([INSTALL_NETCDF], [test "$install_netcdf" = yes])
+
+# NETCDFPY
+AC_ARG_ENABLE([netcdfpy],
+    [AC_HELP_STRING([--enable-netcdfpy],
+        [install netCDF4 @<:@default=yes@:>@])],
+	[if test "$enableval" = yes ; then install_netcdfpy=yes; else install_netcdfpy=no; fi],
+	[install_netcdfpy=yes])
+AM_CONDITIONAL([INSTALL_NETCDFPY], [test "$install_netcdfpy" = yes])
+
 # CMAKE
 AC_ARG_ENABLE([cmake],
     [AC_HELP_STRING([--enable-cmake],
@@ -211,17 +219,6 @@
 	[with_fortran=yes])
 AM_CONDITIONAL([WITH_FORTRAN], [test "$with_fortran" = yes])
 
-# NetCDF
-if test "$install_netcdf" = yes ; then
-  with_netcdf=yes
-fi
-AC_ARG_WITH([netcdf],
-    [AC_HELP_STRING([--with-netcdf],
-        [enable NetCDF (CUBIT) options for PyLith @<:@default=yes@:>@])],
-	[if test "$withval" = yes; then with_netcdf=yes; else with_netcdf=no; fi],
-	[with_netcdf=yes])
-AM_CONDITIONAL([WITH_NETCDF], [test "$with_netcdf" = yes])
-
 # HDF5
 if test "$install_hdf5" = "yes"; then
   with_hdf5=yes
@@ -244,6 +241,28 @@
 	[with_h5py=no])
 AM_CONDITIONAL([WITH_H5PY], [test "$with_h5py" = yes])
 
+# NetCDF
+if test "$install_netcdf" = yes ; then
+  with_netcdf=yes
+fi
+AC_ARG_WITH([netcdf],
+    [AC_HELP_STRING([--with-netcdf],
+        [enable NetCDF (CUBIT) options for PyLith @<:@default=yes@:>@])],
+	[if test "$withval" = yes; then with_netcdf=yes; else with_netcdf=no; fi],
+	[with_netcdf=yes])
+AM_CONDITIONAL([WITH_NETCDF], [test "$with_netcdf" = yes])
+
+# netCDF (python)
+if test "$install_netcdfpy" = yes ; then
+  with_netcdfpy=yes
+fi
+AC_ARG_WITH([netcdfpy],
+    [AC_HELP_STRING([--with-netcdfpy],
+        [enable netCDF4 (python) @<:@default=yes@:>@])],
+	[if test "$withval" = yes; then with_netcdfpy=yes; else with_netcdfpy=no; fi],
+	[with_netcdfpy=yes])
+AM_CONDITIONAL([WITH_NETCDFPY], [test "$with_netcdfpy" = yes])
+
 # CUDA
 AC_ARG_WITH([cuda],
     [AC_HELP_STRING([--with-cuda],
@@ -473,16 +492,6 @@
   CIT_PROJ4_LIB
 fi
 
-# NETCDF
-if test "$install_netcdf" = yes ; then
-  echo "do nothing" >& /dev/null
-else
-  if test "$with_netcdf" = yes ; then
-    CIT_NETCDF_HEADER
-    CIT_NETCDF_LIB
-  fi
-fi
-
 # HDF5
 if test "$install_hdf5" = yes ; then
   # Need to account for PETSc option --download-hdf5=1.
@@ -512,6 +521,38 @@
   fi
 fi
 
+# NETCDF
+if test "$install_netcdf" = yes ; then
+  echo "do nothing" >& /dev/null
+else
+  if test "$with_netcdf" = yes ; then
+    CIT_NETCDF_HEADER
+    CIT_NETCDF_LIB
+  fi
+fi
+
+# NETCDF4 (python)
+if test "$install_netcdfpy" = yes ; then
+   if test "$install_netcdf" = yes; then
+      echo "do nothing" >& /dev/null
+     if test "$with_hdf5" = yes; then
+       echo "do nothing" >& /dev/null
+     else
+       AC_MSG_ERROR([netCDF4 requires HDF5.])
+     fi
+   else
+     if test "$with_netcdf" = yes && "$with_hdf5" = yes; then
+       echo "do nothing" >& /dev/null
+     else
+       AC_MSG_ERROR([netCDF4 requires NetCDF and HDF5.])
+     fi
+   fi
+else
+  if test "$with_netcdfpy" = yes ; then
+    CIT_PYTHON_MODULE([netCDF4],[1.0])
+  fi
+fi
+
 # CUDA
 if test "$with_cuda" = yes ; then
   AC_PATH_PROG(NVCC, nvcc)
@@ -619,9 +660,10 @@
 echo "  mpi: $install_mpi"
 echo "  cppunit: $install_cppunit"
 echo "  proj4: $install_proj4"
-echo "  netcdf: $install_netcdf"
 echo "  hdf5: $install_hdf5"
 echo "  h5py: $install_h5py"
+echo "  netcdf: $install_netcdf"
+echo "  netNDF4 (python): $install_netcdfpy"
 echo "  pcre: $install_pcre"
 echo "  swig: $install_swig"
 echo "  nemesis: $install_nemesis"



More information about the CIG-COMMITS mailing list