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

brad at geodynamics.org brad at geodynamics.org
Thu Apr 21 14:52:37 PDT 2011


Author: brad
Date: 2011-04-21 14:52:37 -0700 (Thu, 21 Apr 2011)
New Revision: 18268

Modified:
   short/3D/PyLith/pylith_installer/trunk/Makefile.am
   short/3D/PyLith/pylith_installer/trunk/TODO
   short/3D/PyLith/pylith_installer/trunk/configure.ac
Log:
Fixes.

Modified: short/3D/PyLith/pylith_installer/trunk/Makefile.am
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/Makefile.am	2011-04-21 21:35:50 UTC (rev 18267)
+++ short/3D/PyLith/pylith_installer/trunk/Makefile.am	2011-04-21 21:52:37 UTC (rev 18268)
@@ -47,7 +47,7 @@
 
 NEMESIS_VER=1.0.1
 SPATIALDATA_VER=0.6.0
-PYLITH_VER=1.5.1
+PYLITH_VER=1.5.2
 
 
 # ----------------------------------------------------------------------
@@ -107,13 +107,16 @@
 # Environment settings for configure for "installed" packages.
 # ----------------------------------------------------------------------
 env_flags=CPPFLAGS=-I$(prefix)/include LDFLAGS=-L$(prefix)/lib PATH=$(prefix)/bin:$(PATH)
+if INSTALL_PETSC
+env_flags += PETSC_DIR=$(prefix) PETSC_ARCH=pylith_petsc_opt
+endif
 
 # ----------------------------------------------------------------------
 # Targets
 # ----------------------------------------------------------------------
-default: installed_pylith
+all: installed_pylith
 
-all: finished_mkdest compilers python mpi cppunit swig numpy proj4 netcdf hdf5 petsc nemesis spatialdata fiat
+rebuild-all: finished_mkdest compilers python mpi cppunit swig numpy proj4 netcdf hdf5 petsc nemesis spatialdata fiat pylith
 
 # ----------------------------------------------------------------------
 # Note on configure invocations
@@ -131,17 +134,16 @@
 	$(MKDIR_P) $(prefix)/include $(prefix)/lib $(prefix)/bin
 
 finished_mkdest:
-	$(MAKE) $(AM_MAKEFLAGS) mkdest
-	touch $@
+	$(MAKE) $(AM_MAKEFLAGS) mkdest && touch $@
 
 # ----------------------------------------------------------------------
 # compilers
 # ----------------------------------------------------------------------
 compilers: finished_mkdest
 if INSTALL_GCC
-	LANGUAGES = "c,c++"
+LANGUAGES = "c,c++"
 if WITH_FORTRAN
-	$(LANGUAGES) += ",fortran"
+LANGUAGES += ",fortran"
 endif
 	$(FETCH_SCRIPT) "$(downloader)" gcc-$(GCC_VER).tar.bz2 http://geodynamics.org/~buildbot/deps
 	$(FETCH_SCRIPT) "$(downloader)" mpc-$(MPC_VER).tar.gz http://geodynamics.org/~buildbot/deps
@@ -159,7 +161,8 @@
 	cd gcc-build && \
 		../gcc-4.5.2/configure --prefix=$(prefix) $(LANGUAGES)
 		make -j $(make_threads) && \
-		make install
+		make install && \
+		touch ../installed_compilers
 
 else
 	@echo "$@ already installed. Skipping installation."
@@ -181,7 +184,8 @@
 	cd python-build && \
 		../Python-$(PYTHON_VER)/configure --prefix=$(prefix) $(env_flags) && \
 		make -j $(make_threads) && \
-		make install
+		make install && \
+		touch ../installed_python
 else
 	@echo "$@ already installed. Skipping installation."
 endif
@@ -224,7 +228,8 @@
 		../openmpi-$(OPENMPI_VER)/configure \
 			--prefix=$(prefix)  $(env_flags) ; \
 		make && \
-		make install
+		make install && \
+		touch ../installed_mpi
 	if [ ! -x $(prefix)/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
 
 
@@ -241,7 +246,8 @@
 			--disable-static --disable-mpe \
 			--prefix=$(prefix)  $(env_flags) ; \
 		make && \
-		make install
+		make install && \
+		touch ../installed_mpi
 	if [ ! -x $(prefix)/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
 
 
@@ -256,7 +262,8 @@
 	cd cppunit-build && \
 		../cppunit-$(CPPUNIT_VER)/configure --prefix=$(prefix)  $(env_flags) ; \
 		make -j $(make_threads) && \
-		make install
+		make install && \
+		touch ../installed_cppunit
 
 else
 	@echo "$@ already installed. Skipping installation."
@@ -278,7 +285,8 @@
 	cd pcre-build && \
 		../pcre-$(PCRE_VER)/configure --prefix=$(prefix)  $(env_flags) ; \
 		make -j $(make_threads) && \
-		make install
+		make install && \
+		touch ../installed_pcre
 else
 	@echo "$@ already installed. Skipping installation."
 endif
@@ -299,7 +307,8 @@
 	cd swig-build && \
 		../swig-$(SWIG_VER)/configure --prefix=$(prefix)  $(env_flags) ; \
 		make -j $(make_threads) && \
-		make install
+		make install && \
+		touch ../installed_swig
 else
 if WITH_SWIG
 	@echo "$@ already installed. Skipping installation."
@@ -320,7 +329,9 @@
 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 && $(PYTHON) setup.py install --prefix=$(prefix)
+	cd numpy-1.5.1 && \
+		$(PYTHON) setup.py install --prefix=$(prefix) && \
+		touch ../installed_numpy
 
 else
 	@echo "$@ already installed. Skipping installation."
@@ -345,7 +356,8 @@
 	cd proj4-build && \
 		../proj-$(PROJ4_VER)/configure --prefix=$(prefix)  $(env_flags) ; \
 		make -j $(make_threads) && \
-		make install
+		make install && \
+		touch ../installed_proj4
 
 else
 	@echo "$@ already installed. Skipping installation."
@@ -368,7 +380,8 @@
 		../netcdf-$(NETCDF_VER)/configure --prefix=$(prefix) \
 			--enable-shared --disable-static --disable-netcdf-4 $(env_flags) ; \
 		make -j $(make_threads) && \
-		make install
+		make install && \
+		touch ../installed_netcdf
 
 else
 if WITH_NETCDF
@@ -396,7 +409,8 @@
 	cd hdf5-build && \
 		../hdf5-$(HDF5_VER)/configure --enable-parallel --enable-shared --disable-static --prefix=$(prefix) CC=mpicc CXX=mpicxx FC=mpif90  $(env_flags) ; \
 		make -j $(make_threads) && \
-		make install
+		make install && \
+		touch ../installed_hdf5
 
 else
 if WITH_HDF5
@@ -418,10 +432,29 @@
 # ----------------------------------------------------------------------
 petsc: installed_mpi
 if INSTALL_PETSC
-# :TODO: Use nightly tarball if PyLith is coming from SVN repository
+if USE_PYLITH_SVN
+	hg clone http://petsc.cs.iit.edu/petsc/petsc-dev
+	cd petsc-dev/config
+	hg clone http://petsc.cs.iit.edu/petsc/BuildSystem BuildSystem
+else
 	$(FETCH_SCRIPT) "$(downloader)" petsc-dev-pylith-$(PYLITH_VER).tgz http://www.geodynamics.org/cig/software/pylith
 	$(TAR) -zxf petsc-dev-pylith-$(PYLITH_VER).tgz
-	@echo "ADD PETSC STUFF "
+endif
+	cd petsc-dev && \
+		./configure --prefix=$(prefix) \
+			--with-c2html=0 --with-x=0 \
+			--CXXFLAGS=-DMPICH_IGNORE_CXX_SEEK \
+			--with-clanguage=C++ \
+			--with-mpicompilers=1 \
+			--with-debugging=0 \
+			--with-shared-libraries=1 \
+			--with-sieve=1 \
+			--download-boost=1 \
+			$(petsc_options); \
+		make && \
+		make install && \
+		make test && \
+		touch ../installed_petsc
 else
 	@echo "$@ already installed. Skipping installation."
 endif
@@ -440,9 +473,10 @@
 if WITH_TESTING
 spatialdata_options += --enable-testing
 endif
-if USE_SPATIALDATA_SVN
+if USE_PYLITH_SVN
+	SPATIALDATA_VER=dev
 	spatialdata_options += --enable-swig
-	$(SVN) co http://geodynamics.org/svn/cig/cs/spatialdata/$(spatialdata_svn) spatialdata-$(SPATIALDATA_VER)
+	$(SVN) co http://geodynamics.org/svn/cig/cs/spatialdata/trunk spatialdata-$(SPATIALDATA_VER)
 	cd spatialdata-$(SPATIALDATA_VER) && $(AUTORECONF) -if
 else
 	$(FETCH_SCRIPT) "$(downloader)" spatialdata-$(SPATIALDATA_VER).tgz http://www.geodynamics.org/cig/software/pylith
@@ -452,7 +486,11 @@
 	cd spatialdata-build && \
 		../spatialdata-$(SPATIALDATA_VER)/configure --prefix=$(prefix) $(spatialdata_options) $(env_flags) ; \
 		make -j $(make_threads) && \
-		make install
+		make install && \
+		touch ../installed_spatialdata
+if WITH_TESTING
+	cd spatialdata-build && make -j $(make_threads) check
+endif
 else
 	@echo "$@ already installed. Skipping installation."
 endif
@@ -509,6 +547,31 @@
 # pylith
 # ----------------------------------------------------------------------
 pylith: installed_cppunit installed_swig installed_netcdf installed_hdf5 installed_petsc installed_nemesis installed_spatialdata installed_fiat
+pylith_options = 
+if WITH_NETCDF
+pylith_options += --enable-cubit
+endif
+if WITH_TESTING
+pylith_options += --enable-testing
+endif
+if USE_PYLITH_SVN
+	PYLITH_VER=dev
+	spatialdata_options += --enable-swig
+	$(SVN) co http://geodynamics.org/svn/cig/short/3D/PyLith/$(pylith_svn) pylith-$(PYLITH_VER)
+	cd pylith-$(PYLITH_VER) && $(AUTORECONF) -if
+else
+	$(FETCH_SCRIPT) "$(downloader)" pylith-$(PYLITH_VER).tgz http://www.geodynamics.org/cig/software/pylith
+	$(TAR) -zxvf pylith-$(PYLITH_VER).tgz
+endif
+	$(MKDIR_P) pylith-build
+	cd pylith-build && \
+		../pylith-$(PYLITH_VER)/configure --prefix=$(prefix) $(pylith_options) $(env_flags) ; \
+		make -j $(make_threads) && \
+		make install && \
+		touch ../installed_pylith
+if WITH_TESTING
+	cd pylith-build && make -j $(make_threads) check
+endif
 
 installed_pylith:
 	$(MAKE) $(AM_MAKEFLAGS) pylith

Modified: short/3D/PyLith/pylith_installer/trunk/TODO
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/TODO	2011-04-21 21:35:50 UTC (rev 18267)
+++ short/3D/PyLith/pylith_installer/trunk/TODO	2011-04-21 21:52:37 UTC (rev 18268)
@@ -1,5 +1,3 @@
-create prefix/include and prefix/lib directories
-
 Makefile
 
   gcc
@@ -14,15 +12,6 @@
   openmpi
     setup
 
-  swig
-    test
-
-  netcdf
-    test
-
-  hdf5
-    test
-
   petsc
     build from source
     build from repository
@@ -35,10 +24,5 @@
     build from repository
 
 
-Automatically set environment variables for make.
-
-
 AC_PROG_MKDIR_P not available with autoconf 2.59.
 Need to add fetch.sh to distribution "install" fetch.sh script.
-
-Need to add CPPFLAGS, LDFLAGS of prefix to spatialdata, pylith.
\ No newline at end of file

Modified: short/3D/PyLith/pylith_installer/trunk/configure.ac
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/configure.ac	2011-04-21 21:35:50 UTC (rev 18267)
+++ short/3D/PyLith/pylith_installer/trunk/configure.ac	2011-04-21 21:52:37 UTC (rev 18268)
@@ -196,22 +196,16 @@
         [set optional PETSc configure options @<:@default=--download-chaco=1 --download-ml=1 --download-f-blas-lapack=1@:>@])],
 	[petsc_options=$withval],
 	[petsc_options="--download-chaco=1 --download-ml=1 --download-f-blas-lapack=1"])
+AC_SUBST(petsc_options)
 
-# spatialdata svn
-AC_ARG_WITH([spatialdata-svn],
-    [AC_HELP_STRING([--with-spatialdata-svn],
-        [use spatialdata from SVN repository @<:@default=no@:>@])],
-	[spatialdata_svn=yes],
-	[spatialdata_svn=no])
-AC_SUBST(spatialdata_svn)
-AM_CONDITIONAL([USE_SPATIALDATA_SVN], [test "$spatialdata_svn" != no])
-
 # pylith svn
 AC_ARG_WITH([pylith-svn],
     [AC_HELP_STRING([--with-pylith-svn],
         [use PyLith from SVN repository (trunk, stable, BRANCH) @<:@default=no@:>@])],
-	[pylith_svn==$withval],
+	[pylith_svn=$withval],
 	[pylith_svn=no])
+if test "$pylith_svn" = yes ; then pylith_svn="trunk"; fi
+if test "$pylith_svn" = stable ; then pylith_svn="branches/v1.5-stable"; fi
 AC_SUBST(pylith_svn)
 AM_CONDITIONAL([USE_PYLITH_SVN], [test "$pylith_svn" != no])
 
@@ -266,7 +260,8 @@
 AC_SUBST(downloader)
 
 # svn/mercurial/autoreconf
-if test "$spatialdata_svn" != no || test "$pylith_svn" != no ; then
+petsc_hg=no
+if test "$pylith_svn" != no ; then
   # SVN
   AC_PATH_PROG(SVN, svn)
   if test -z "$SVN" ; then
@@ -277,11 +272,6 @@
   if test -z "$AUTORECONF" ; then
     AC_MSG_FAILURE([cannot find 'autoreconf' program.])
   fi
-fi
-AM_CONDITIONAL([WITH_SWIG], 
-  [test "$spatialdata_svn" != no || test "$pylith_svn" != no])
-petsc_hg=no
-if test "$pylith_svn" != no ; then
   # HG
   AC_PATH_PROG(HG, hg)
   if test -z "$HG" ; then
@@ -289,6 +279,7 @@
   fi
   petsc_hg=yes
 fi
+AM_CONDITIONAL([WITH_SWIG], [test "$pylith_svn" != no])
 AC_SUBST(petsc_hg)
 
 # ----------------------------------------------------------------------
@@ -363,7 +354,7 @@
 if test "$install_swig" = yes ; then
   echo "do nothing" >& /dev/null
 else
-  if test "$spatialdata_svn" != no || test "$pylith_svn" != no ; then
+  if test "$pylith_svn" != no ; then
     AC_PROG_SWIG(1.3.33)
   fi
 fi
@@ -450,10 +441,25 @@
 AC_OUTPUT
 
 echo "#!/bin/bash" > setup.sh
-echo "PATH=$prefix/bin:\${PATH}" >> setup.sh
-echo "LD_LIBRARY_PATH=$prefix/lib:$prefix/lib64:\${LD_LIBRARY_PATH}" >> setup.sh
-echo "PYTHONPATH=$prefix/lib/python$PYTHON_VERSION/site-packages:\${PYTHONPATH}" >> setup.sh
 
+if test "X${PATH}" = X ; then
+  echo "PATH=$prefix/bin" >> setup.sh
+else
+  echo "PATH=$prefix/bin:\${PATH}" >> setup.sh
+fi
+
+if test "X${LD_LIBRARY_PATH}" = X ; then
+  echo "LD_LIBRARY_PATH=$prefix/lib" >> setup.sh
+else
+  echo "LD_LIBRARY_PATH=$prefix/lib:\${LD_LIBRARY_PATH}" >> setup.sh
+fi
+
+if test "X${PYTHONPATH}" = X ; then
+  echo "PYTHONPATH=$prefix/lib/python$PYTHON_VERSION/site-packages" >> setup.sh
+else
+  echo "PYTHONPATH=$prefix/lib/python$PYTHON_VERSION/site-packages:\${PYTHONPATH}" >> setup.sh
+fi
+
 echo ""
 echo "Additional info:"
 echo "  Using $downloader to download tarballs."



More information about the CIG-COMMITS mailing list