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

brad at geodynamics.org brad at geodynamics.org
Tue May 3 17:26:01 PDT 2011


Author: brad
Date: 2011-05-03 17:26:01 -0700 (Tue, 03 May 2011)
New Revision: 18308

Modified:
   short/3D/PyLith/pylith_installer/trunk/INSTALL
   short/3D/PyLith/pylith_installer/trunk/Makefile.am
   short/3D/PyLith/pylith_installer/trunk/configure.ac
Log:
Bug fixes. Added ability to install mercurial. Added more documentation.

Modified: short/3D/PyLith/pylith_installer/trunk/INSTALL
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/INSTALL	2011-05-02 23:01:27 UTC (rev 18307)
+++ short/3D/PyLith/pylith_installer/trunk/INSTALL	2011-05-04 00:26:01 UTC (rev 18308)
@@ -130,7 +130,7 @@
 -------
 
   The default installation assumes you have
-    * C/C++ compiler
+    * C, C++, and Fortran compilers
     * Python 2.4 or later
     * MPI
 
@@ -139,6 +139,22 @@
     --with-make-threads=2 \
     --prefix=$HOME/pylith
 
+---------------
+WITHOUT FORTRAN
+---------------
+
+  The default installation assumes you have
+    * C, C++, and Fortran compilers
+    * Python 2.4 or later
+    * MPI
+
+  mkdir -p $HOME/build/pylith
+  $HOME/src/pylith/pylith-installer-1.0.0/configure \
+    --with-fortran=no \
+    --with-make-threads=2 \
+    --petsc_options="--download-chaco=1 --download-c-blas-lapack=1" \
+    --prefix=$HOME/pylith
+
 ---------------------
 DESKTOP-LINUX-MINIMAL
 ---------------------
@@ -148,7 +164,7 @@
   with the MPI used by PETSc and PyLith.
 
   We assume you have
-    * C/C++/Fortran compilers
+    * C, C++, Fortran compilers
     * Python 2.4 or later
     * MPI
     * NetCDF 3.6.2 or 4.1.1
@@ -162,7 +178,6 @@
     --disable-numpy \
     --disable-proj4 \
     --disable-netcdf \
-    --with-fortran \
     --with-make-threads=2 \
     --prefix=$HOME/pylith
 
@@ -174,13 +189,12 @@
   want to use the OpenMPI implementation.
   
   We assume you have
-    * C/C++/Fortran compilers
+    * C, C++, Fortran compilers
     * Python 2.4 or later
 
   mkdir -p $HOME/build/pylith
   $HOME/src/pylith/pylith-installer-1.0.0/configure \
     --enable-mpi=openmpi \
-    --with-fortran \
     --with-make-threads=2 \
     --prefix=$HOME/pylith
 
@@ -205,7 +219,6 @@
   $HOME/src/pylith/pylith-installer-1.0.0/configure \
     --enable-gcc=fortran \
     --enable-mpi=openmpi \
-    --with-fortran \
     --with-fetch=curl \
     --with-make-threads=2 \
     --prefix=$HOME/pylith
@@ -218,13 +231,12 @@
   appropriate for the hardware. We assume that Python has not been
   installed or was not built with the selected compiler suite. So we
   assume you have
-    * C/C++/Fortran compilers
+    * C, C++, Fortran compilers
     * MPI
 
   mkdir -p $HOME/build/pylith
   $HOME/src/pylith/pylith-installer-1.0.0/configure \
     --enable-python \
-    --with-fortran \
     --with-make-threads=2 \
     --prefix=$HOME/pylith
 
@@ -242,7 +254,7 @@
   (e.g., branches/v1.5-stable) in the SVN repository.
 
   We assume you have
-    * C/C++ compiler
+    * C, C++, Fortran compilers
     * Python 2.4 or later
     * MPI
     * Subversion
@@ -262,6 +274,7 @@
 Setup your environment variables (as indicated in the output of the
 configure script).
 
+  cd $HOME/build/pylith
   source setup.sh
 
 
@@ -308,3 +321,33 @@
 environment variables from setup.sh to your .bashrc (or other
 appropriate file) so that the environment is setup properly
 automatically every time you open a shell.
+
+
+======================================================================
+TROUBLESHOOTING
+======================================================================
+
+----------------------------------------------------------------------
+numpy fails to build due to a blas/lapack problem
+----------------------------------------------------------------------
+
+If a bad version of blas/lapack if found while installing numpy,
+resulting in an error, follow the steps below to force numpy to build
+blas/lapack itself.
+
+  1. cd numpy-1.5.1
+  2. cp site.cfg.example site.cfg
+  3. Change
+
+     #[DEFAULT]
+     #library_dirs = /usr/local/lib
+     #include_dirs = /usr/local/include
+
+     to
+
+     [DEFAULT]
+     library_dirs = /dev/null
+     include_dirs = /dev/null
+
+  4. cd $HOME/build/pylith
+  5. make

Modified: short/3D/PyLith/pylith_installer/trunk/Makefile.am
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/Makefile.am	2011-05-02 23:01:27 UTC (rev 18307)
+++ short/3D/PyLith/pylith_installer/trunk/Makefile.am	2011-05-04 00:26:01 UTC (rev 18308)
@@ -34,6 +34,7 @@
 
 PCRE_VER=8.12
 SWIG_VER=2.0.2
+MERCURIAL_VER=1.8
 
 NUMPY_VER=1.5.1
 
@@ -127,10 +128,10 @@
 
 if WITH_FORTRAN
 env_compilers = CC=$(CC) CXX=$(CXX) FC=$(FC)
-env_mpicompilers = CC=mpicc CXX=mpicxx FC=mpif90
+env_mpicompilers = CC=$(MPICC) CXX=$(MPICXX) FC=$(MPIF90)
 else
 env_compilers = CC=$(CC) CXX=$(CXX)
-env_mpicompilers = CC=mpicc CXX=mpicxx
+env_mpicompilers = CC=$(MPICC) CXX=$(MPICXX)
 endif
 
 # ----------------------------------------------------------------------
@@ -208,7 +209,7 @@
 	$(MKDIR_P) python-build
 	cd python-build && \
 		../Python-$(PYTHON_VER)/configure --prefix=$(prefix) \
-		--enable-shared $(env_flags) && \
+		--enable-shared $(env_flags) $(env_compilers) && \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_python
@@ -252,7 +253,7 @@
 	$(MKDIR_P) openmpi-build
 	cd openmpi-build && \
 		../openmpi-$(OPENMPI_VER)/configure \
-			--prefix=$(prefix) $(env_flags) ; \
+			--prefix=$(prefix) $(env_flags) $(env_compilers); \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_mpi
@@ -295,7 +296,7 @@
 	$(MKDIR_P) cppunit-build
 	cd cppunit-build && \
 		../cppunit-$(CPPUNIT_VER)/configure \
-			--prefix=$(prefix) $(env_flags) ; \
+			--prefix=$(prefix) $(env_flags) $(env_compilers); \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_cppunit
@@ -319,7 +320,7 @@
 	$(MKDIR_P) pcre-build
 	cd pcre-build && \
 		../pcre-$(PCRE_VER)/configure \
-			--prefix=$(prefix) $(env_flags) ; \
+			--prefix=$(prefix) $(env_flags) $(env_compilers) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_pcre
@@ -342,7 +343,7 @@
 	$(MKDIR_P) swig-build
 	cd swig-build && \
 		../swig-$(SWIG_VER)/configure \
-			--prefix=$(prefix) $(env_flags) ; \
+			--prefix=$(prefix) $(env_flags) $(env_compilers) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_swig
@@ -365,8 +366,8 @@
 numpy: installed_python
 if INSTALL_NUMPY
 	$(FETCH_SCRIPT) "$(downloader)" numpy-$(NUMPY_VER).tar.gz http://geodynamics.org/~buildbot/deps
-	$(TAR) -zxf numpy-1.5.1.tar.gz
-	cd numpy-1.5.1 && \
+	$(TAR) -zxf numpy-$(NUMPY_VER).tar.gz
+	cd numpy-$(NUMPY_VER) && \
 		$(PYTHON) setup.py install --prefix=$(prefix) && \
 		touch ../installed_numpy
 
@@ -392,7 +393,7 @@
 		unzip ../../proj-datumgrid-1.3.zip
 	cd proj4-build && \
 		../proj-$(PROJ4_VER)/configure \
-			--prefix=$(prefix) $(env_flags) ; \
+			--prefix=$(prefix) $(env_flags) $(env_compilers) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_proj4
@@ -416,7 +417,7 @@
 	$(MKDIR_P) netcdf-build
 	cd netcdf-build && \
 		../netcdf-$(NETCDF_VER)/configure \
-			--prefix=$(prefix) $(env_flags) \
+			--prefix=$(prefix) $(env_flags) $(env_compilers) \
 			--enable-shared --disable-static --disable-netcdf-4 ; \
 		make -j $(make_threads) && \
 		make install && \
@@ -533,7 +534,7 @@
 	$(MKDIR_P) spatialdata-build
 	cd spatialdata-build && \
 		../spatialdata-$(SPATIALDATA_VER)/configure \
-			--prefix=$(prefix) $(env_flags) \
+			--prefix=$(prefix) $(env_flags) $(env_compilers) \
 			$(spatialdata_options) ; \
 		make -j $(make_threads) && \
 		make install && \
@@ -551,9 +552,29 @@
 
 
 # ----------------------------------------------------------------------
+# mercurial
+# ----------------------------------------------------------------------
+mercurial: installed_python
+if INSTALL_MERCURIAL
+	$(FETCH_SCRIPT) "$(downloader)" mercurial-$(MERCURIAL_VER).tar.gz http://geodynamics.org/~buildbot/deps
+	$(TAR) -zxf mercurial-$(MERCURIAL_VER).tar.gz
+	cd mercurial-$(MERCURIAL_VER) && \
+		$(PYTHON) setup.py install --prefix=$(prefix) && \
+		touch ../installed_mercurial
+
+else
+	@echo "$@ already installed. Skipping installation."
+endif
+
+installed_mercurial:
+	$(MAKE) $(AM_MAKEFLAGS) mercurial
+	touch $@
+
+
+# ----------------------------------------------------------------------
 # petsc
 # ----------------------------------------------------------------------
-petsc: installed_mpi
+petsc: installed_mpi installed_hdf5 installed_mercurial
 if INSTALL_PETSC
 if WITH_HDF5
 petsc_options += --with-hdf5=1
@@ -616,7 +637,8 @@
 	$(MKDIR_P) pylith-build
 	cd pylith-build && \
 		../pylith-$(PYLITH_VER)/configure \
-			--prefix=$(prefix) $(pylith_options) $(env_flags) \
+			--prefix=$(prefix) $(pylith_options) \
+                        $(env_flags) $(env_compilers) \
 			PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=$(PETSC_ARCH) ; \
 		make -j $(make_threads) && \
 		make install && \

Modified: short/3D/PyLith/pylith_installer/trunk/configure.ac
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/configure.ac	2011-05-02 23:01:27 UTC (rev 18307)
+++ short/3D/PyLith/pylith_installer/trunk/configure.ac	2011-05-04 00:26:01 UTC (rev 18308)
@@ -73,22 +73,6 @@
 	[install_cppunit=yes])
 AM_CONDITIONAL([INSTALL_CPPUNIT], [test "$install_cppunit" = yes])
 
-# PCRE
-AC_ARG_ENABLE([pcre],
-    [AC_HELP_STRING([--enable-pcre],
-        [install PCRE @<:@default=no@:>@])],
-	[if test "$enableval" = "yes" ; then install_pcre=yes; else install_pcre=no; fi],
-	[install_pcre=no])
-AM_CONDITIONAL([INSTALL_PCRE], [test "$install_pcre" = yes])
-
-# SWIG
-AC_ARG_ENABLE([swig],
-    [AC_HELP_STRING([--enable-swig],
-        [install SWIG @<:@default=no@:>@])],
-	[if test "$enableval" = "yes" ; then install_swig=yes; else install_swig=no; fi],
-	[install_swig=no])
-AM_CONDITIONAL([INSTALL_SWIG], [test "$install_swig" = yes])
-
 # NUMPY
 AC_ARG_ENABLE([numpy],
     [AC_HELP_STRING([--enable-numpy],
@@ -116,9 +100,9 @@
 # HDF5
 AC_ARG_ENABLE([hdf5],
     [AC_HELP_STRING([--enable-hdf5],
-        [install HDF5 @<:@default=yes@:>@])],
+        [install HDF5 @<:@default=no@:>@])],
 	[if test "$enableval" = yes ; then install_hdf5=yes; else install_hdf5=no; fi],
-	[install_hdf5=yes])
+	[install_hdf5=no])
 AM_CONDITIONAL([INSTALL_HDF5], [test "$install_hdf5" = yes])
 
 # PETSC
@@ -153,7 +137,31 @@
 	[install_fiat=yes])
 AM_CONDITIONAL([INSTALL_FIAT], [test "$install_fiat" = yes])
 
+# PCRE
+AC_ARG_ENABLE([pcre],
+    [AC_HELP_STRING([--enable-pcre],
+        [install PCRE @<:@default=no@:>@])],
+	[if test "$enableval" = "yes" ; then install_pcre=yes; else install_pcre=no; fi],
+	[install_pcre=no])
+AM_CONDITIONAL([INSTALL_PCRE], [test "$install_pcre" = yes])
 
+# SWIG
+AC_ARG_ENABLE([swig],
+    [AC_HELP_STRING([--enable-swig],
+        [install SWIG @<:@default=no@:>@])],
+	[if test "$enableval" = "yes" ; then install_swig=yes; else install_swig=no; fi],
+	[install_swig=no])
+AM_CONDITIONAL([INSTALL_SWIG], [test "$install_swig" = yes])
+
+# MERCURIAL
+AC_ARG_ENABLE([mercurial],
+    [AC_HELP_STRING([--enable-mercurial],
+        [install mercurial @<:@default=no@:>@])],
+	[if test "$enableval" = "yes" ; then install_mercurial=yes; else install_mercurial=no; fi],
+	[install_mercurial=no])
+AM_CONDITIONAL([INSTALL_MERCURIAL], [test "$install_mercurial" = yes])
+
+
 # ----------------------------------------------------------------------
 # OPTIONS
 # ----------------------------------------------------------------------
@@ -165,16 +173,16 @@
 AC_ARG_WITH([testing],
     [AC_HELP_STRING([--with-testing],
         [enable testing (requires cppunit) @<:@default=yes@:>@])],
-	[with_testing=yes],
-	[])
+	[if test "$withval" = yes; then with_testing=yes; else with_testing=no; fi],
+	[with_testing=yes])
 AM_CONDITIONAL([WITH_TESTING], [test "$with_testing" = yes])
 
 # FORTRAN
 AC_ARG_WITH([fortran],
     [AC_HELP_STRING([--with-fortran],
-        [enable Fortran options for packages @<:@default=no@:>@])],
-	[with_fortran=yes],
-	[with_fortran=no])
+        [enable Fortran options for packages @<:@default=yes@:>@])],
+	[if test "$withval" = yes; then with_fortran=yes; else with_fortran=no; fi],
+	[with_fortran=yes])
 AM_CONDITIONAL([WITH_FORTRAN], [test "$with_fortran" = yes])
 
 # NetCDF
@@ -186,8 +194,8 @@
 AC_ARG_WITH([netcdf],
     [AC_HELP_STRING([--with-netcdf],
         [enable NetCDF (CUBIT) options for PyLith @<:@default=yes@:>@])],
-	[with_netcdf=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
@@ -198,9 +206,9 @@
 fi
 AC_ARG_WITH([hdf5],
     [AC_HELP_STRING([--with-hdf5],
-        [enable HDF5 options for PyLith @<:@default=yes@:>@])],
-	[with_hdf5=yes],
-	[])
+        [enable HDF5 options for PyLith @<:@default=no@:>@])],
+	[if test "$withval" = yes; then with_hdf5=yes; else with_hdf5=no; fi],
+	[with_hdf5=no])
 AM_CONDITIONAL([WITH_HDF5], [test "$with_hdf5" = yes])
 
 # PETSC options
@@ -272,7 +280,7 @@
 fi
 AC_SUBST(downloader)
 
-# svn/mercurial/autoreconf
+# svn/autoreconf
 petsc_hg=no
 if test "$pylith_svn" != no ; then
   # SVN
@@ -286,9 +294,13 @@
     AC_MSG_FAILURE([cannot find 'autoreconf' program.])
   fi
   # HG
-  AC_PATH_PROG(HG, hg)
-  if test -z "$HG" ; then
-    AC_MSG_FAILURE([cannot find 'hg' program.])
+  if test "$install_mercurial" = yes; then
+    echo "do nothing" >& /dev/null
+  else
+    AC_PATH_PROG(HG, hg)
+    if test -z "$HG" ; then
+      AC_MSG_FAILURE([cannot find 'hg' program.])
+    fi
   fi
   petsc_hg=yes
 fi
@@ -315,23 +327,39 @@
 
 # Python
 if test "$install_python" = yes ; then
-  echo "do nothing" >& /dev/null
   PYTHON=$prefix/bin/python
   AC_SUBST(PYTHON)
+  AC_CHECK_HEADER([zlib.h], [], [
+                AC_MSG_ERROR([Header file 'zlib.h' not found; maybe you don't have the zlib development package, e.g. 'zlib-dev', installed?])
+                ])
+
 else
   AM_PATH_PYTHON([2.4])
   CIT_PYTHON_SYSCONFIG
+  CIT_PYTHON_MODULE([zlib])
 fi
 
 # MPI
 if test "$install_mpi" != no ; then
   echo "do nothing" >& /dev/null
 else
+  AC_PATH_PROG(MPICC, mpicc)
+  if test -z "$MPICC"; then
+    AC_MSG_FAILURE([cannot find 'mpicc' program.])
+    MPICC=`echo "Error: MPI is not installed properly." ; false`
+  fi
   AC_PATH_PROG(MPICXX, mpicxx)
   if test -z "$MPICXX"; then
     AC_MSG_FAILURE([cannot find 'mpicxx' program.])
     MPICXX=`echo "Error: MPI is not installed properly." ; false`
   fi
+  if test "$with_fortran" = yes ; then
+    AC_PATH_PROG(MPIF90, mpif90)
+    if test -z "$MPIF90"; then
+      AC_MSG_FAILURE([cannot find 'mpif90' program.])
+      MPIF90=`echo "Error: MPI is not installed properly." ; false`
+    fi
+  fi
 fi
 
 # cppunit
@@ -472,9 +500,9 @@
 fi
 
 if test "X${LD_LIBRARY_PATH}" = X ; then
-  echo "export LD_LIBRARY_PATH=$prefix/lib" >> setup.sh
+  echo "export LD_LIBRARY_PATH=$prefix/lib:$prefix/lib64" >> setup.sh
 else
-  echo "export LD_LIBRARY_PATH=$prefix/lib\:$prefix/lib64:${LD_LIBRARY_PATH}" >> setup.sh
+  echo "export LD_LIBRARY_PATH=$prefix/lib:$prefix/lib64:\${LD_LIBRARY_PATH}" >> setup.sh
 fi
 
 if test "X${PYTHONPATH}" = X ; then
@@ -509,16 +537,17 @@
 echo "  Python: $install_python"
 echo "  mpi: $install_mpi"
 echo "  cppunit: $install_cppunit"
-echo "  pcre: $install_pcre"
-echo "  swig: $install_swig"
-echo "  numpy: $install_numpy"
 echo "  proj4: $install_proj4"
 echo "  netcdf: $install_netcdf"
 echo "  hdf5: $install_hdf5"
-echo "  petsc: $install_petsc, options: $petsc_options"
-echo "  spatialdata: $install_spatialdata"
+echo "  pcre: $install_pcre"
+echo "  swig: $install_swig"
 echo "  nemesis: $install_nemesis"
+echo "  numpy: $install_numpy"
 echo "  fiat: $install_fiat"
+echo "  spatialdata: $install_spatialdata"
+echo "  mercurial: $install_mercurial"
+echo "  petsc: $install_petsc, options: $petsc_options"
 echo ""
 if test "$pylith_svn" != no ; then
   echo "  Installing development version of PETSc from repository."



More information about the CIG-COMMITS mailing list