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

brad at geodynamics.org brad at geodynamics.org
Wed Mar 9 14:33:28 PST 2011


Author: brad
Date: 2011-03-09 14:33:27 -0800 (Wed, 09 Mar 2011)
New Revision: 18085

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:
Setup spatialdata build from source.

Modified: short/3D/PyLith/pylith_installer/trunk/Makefile.am
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/Makefile.am	2011-03-09 21:57:45 UTC (rev 18084)
+++ short/3D/PyLith/pylith_installer/trunk/Makefile.am	2011-03-09 22:33:27 UTC (rev 18085)
@@ -56,7 +56,7 @@
 	bin
 
 noinst_tmp = \
-	installed_gcc \
+	installed_compilers \
 	installed_python \
 	installed_mpi \
 	installed_cppunit \
@@ -107,7 +107,7 @@
 # ----------------------------------------------------------------------
 default: installed_pylith
 
-all: gcc python mpi cppunit swig numpy proj4 netcdf hdf5 petsc nemesis spatialdata fiat
+all: compilers python mpi cppunit swig numpy proj4 netcdf hdf5 petsc nemesis spatialdata fiat
 
 # ----------------------------------------------------------------------
 # Note on configure invocations
@@ -119,9 +119,9 @@
 # make install.
 
 # ----------------------------------------------------------------------
-# gcc
+# compilers
 # ----------------------------------------------------------------------
-gcc:
+compilers:
 if INSTALL_GCC
 	LANGUAGES = "c,c++"
 if WITH_FORTRAN
@@ -149,15 +149,15 @@
 	@echo "$@ already installed. Skipping installation."
 endif
 
-installed_gcc:
-	$(MAKE) $(AM_MAKEFLAGS) gcc
+installed_compilers:
+	$(MAKE) $(AM_MAKEFLAGS) compilers
 	touch $@
 
 
 # ----------------------------------------------------------------------
 # python
 # ----------------------------------------------------------------------
-python: installed_gcc
+python: installed_compilers
 if INSTALL_PYTHON
 	$(FETCH_SCRIPT) $(downloader) Python-$(PYTHON_VER).tgz http://geodynamics.org/~buildbot/deps
 	$(TAR) -zxf Python-$(PYTHON_VER).tgz
@@ -200,13 +200,22 @@
 # ----------------------------------------------------------------------
 # openmpi
 # ----------------------------------------------------------------------
-openmpi: installed_gcc
+openmpi: installed_compilers
+	$(FETCH_SCRIPT) "$(downloader)" openmpi-$(OPENMPI_VER).tar.gz http://geodynamics.org/~buildbot/deps
+	$(TAR) -zxf openmpi-$(MPICH2_VER).tar.gz
+	$(MKDIR_P) openmpi-build
+	cd openmpi-build && \
+		../openmpi-$(MPICH2_VER)/configure \
+			--prefix=$(prefix) ; \
+		make && \
+		make install
+	if [ ! -x $(prefix)/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
 
 
 # ----------------------------------------------------------------------
 # mpich
 # ----------------------------------------------------------------------
-mpich: installed_gcc
+mpich: installed_compilers
 	$(FETCH_SCRIPT) "$(downloader)" mpich2-$(MPICH2_VER).tar.gz http://geodynamics.org/~buildbot/deps
 	$(TAR) -zxf mpich2-$(MPICH2_VER).tar.gz
 	$(MKDIR_P) mpich-build
@@ -214,8 +223,7 @@
 		../mpich2-$(MPICH2_VER)/configure --with-pm=gforker \
 			--enable-shared --enable-sharedlibs=gcc \
 			--disable-static --disable-mpe \
-			--prefix=$(HOME)/install/$(BUILDBOT) \
-			CC=gcc CXX=g++ FC=gfortran ; \
+			--prefix=$(prefix) ; \
 		make && \
 		make install
 	if [ ! -x $(prefix)/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
@@ -224,7 +232,7 @@
 # ----------------------------------------------------------------------
 # cppunit
 # ----------------------------------------------------------------------
-cppunit: installed_gcc
+cppunit: installed_compilers
 if INSTALL_CPPUNIT
 	$(FETCH_SCRIPT) "$(downloader)" cppunit-$(CPPUNIT_VER).tar.gz http://geodynamics.org/~buildbot/deps
 	$(TAR) -zxf cppunit-$(CPPUNIT_VER).tar.gz
@@ -246,7 +254,7 @@
 # ----------------------------------------------------------------------
 # swig
 # ----------------------------------------------------------------------
-swig: installed_gcc
+swig: installed_compilers
 if INSTALL_SWIG
 	$(FETCH_SCRIPT) "$(downloader)" swig-$(SWIG_VER).tar.gz http://geodynamics.org/~buildbot/deps
 	$(TAR) -zxf swig-$(SWIG_VER).tar.gz
@@ -256,8 +264,12 @@
 		make -j 4 && \
 		make install
 else
+if WITH_SWIG
 	@echo "$@ already installed. Skipping installation."
+else
+	@echo "$@ not required. Skipping installation."
 endif
+endif
 
 installed_swig:
 	$(MAKE) $(AM_MAKEFLAGS) swig
@@ -285,7 +297,7 @@
 # ----------------------------------------------------------------------
 # proj4
 # ----------------------------------------------------------------------
-proj4: installed_gcc
+proj4: installed_compilers
 if INSTALL_PROJ4
 	$(FETCH_SCRIPT) "$(downloader)" proj-$(PROJ4_VER).tar.gz http://geodynamics.org/~buildbot/deps
 	$(FETCH_SCRIPT) "$(downloader)" proj-datumgrid-1.3.zip http://geodynamics.org/~buildbot/deps
@@ -310,7 +322,7 @@
 # ----------------------------------------------------------------------
 # netcdf
 # ----------------------------------------------------------------------
-netcdf: installed_gcc
+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
@@ -386,16 +398,23 @@
 # ----------------------------------------------------------------------
 spatialdata: installed_numpy installed_proj4 installed_swig installed_cppunit
 if INSTALL_SPATIALDATA
-	spatialdata_options =
+spatialdata_options =
 if WITH_TESTING
-	spatialdata_options += --enable-testing
+spatialdata_options += --enable-testing
 endif
-# :TODO: Add switch for using SVN repository (add --enable-swig)
-	$(FETCH_DIR) "$(downloader)" spatialdata-$(SPATIALDATA_VER).tgz http://www.geodynamics.org/cig/software/pylith
+if USE_SPATIALDATA_SVN
+	spatialdata_options += --enable-swig
+	$(SVN) co http://geodynamics.org/svn/cig/cs/spatialdata/$(spatialdata_svn) spatialdata-$(SPATIALDATA_VER)
+	cd spatialdata-$(SPATIALDATA_VER) && $(AUTORECONF) -if
+else
+	$(FETCH_SCRIPT) "$(downloader)" spatialdata-$(SPATIALDATA_VER).tgz http://www.geodynamics.org/cig/software/pylith
 	$(TAR) -zxvf spatialdata-$(SPATIALDATA_VER).tgz
+endif
 	$(MKDIR_P) spatialdata-build
 	cd spatialdata-build && \
-		../spatialdata-$(SPATIALDATA_VER)/configure --prefix=$(prefix) $(spatialdata_options)
+		../spatialdata-$(SPATIALDATA_VER)/configure --prefix=$(prefix) $(spatialdata_options) ; \
+		make -j $(make_threads) && \
+		make install
 else
 	@echo "$@ already installed. Skipping installation."
 endif

Modified: short/3D/PyLith/pylith_installer/trunk/TODO
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/TODO	2011-03-09 21:57:45 UTC (rev 18084)
+++ short/3D/PyLith/pylith_installer/trunk/TODO	2011-03-09 22:33:27 UTC (rev 18085)
@@ -27,7 +27,6 @@
     build from repository
   
   spatialdata
-    build from source
     build from repository
 
   pylith

Modified: short/3D/PyLith/pylith_installer/trunk/configure.ac
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/configure.ac	2011-03-09 21:57:45 UTC (rev 18084)
+++ short/3D/PyLith/pylith_installer/trunk/configure.ac	2011-03-09 22:33:27 UTC (rev 18085)
@@ -192,6 +192,7 @@
 	[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],
@@ -200,6 +201,7 @@
 	[pylith_svn==$withval],
 	[pylith_svn=no])
 AC_SUBST(pylith_svn)
+AM_CONDITIONAL([USE_PYLITH_SVN], [test "$pylith_svn" != no])
 
 # fetch tool
 AC_ARG_WITH([fetch],
@@ -251,15 +253,24 @@
 fi
 AC_SUBST(downloader)
 
-# svn/mercurial
+# svn/mercurial/autoreconf
 if test "$spatialdata_svn" != "no" || test "$pylith_svn" != "no" ; then
+  # SVN
   AC_PATH_PROG(SVN, svn)
   if test -z "$SVN" ; then
     AC_MSG_FAILURE([cannot find 'svn' program.])
   fi
+  # autoreconf 
+  AC_PATH_PROG(AUTORECONF, autoreconf)
+  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
     AC_MSG_FAILURE([cannot find 'hg' program.])
@@ -314,13 +325,11 @@
 fi
 
 # SWIG
-swig_ok=false
 if test "$install_swig" = "yes" ; then
-  swig_ok=true
+  echo "do nothing" >& /dev/null
 else
   if test "$spatialdata_svn" != "no" || test "$pylith_svn" != "no" ; then
     AC_PROG_SWIG(1.3.33)
-    swig_ok=true
   fi
 fi
 
@@ -416,12 +425,14 @@
 echo ""
 echo "IMPORTANT"
 echo ""
-echo "Runing "make" will install PyLith and its dependencies to $prefix."
+echo "  Runing "make" will install PyLith and its dependencies to $prefix."
 echo ""
-echo "Before attempting to use PyLith you may need to update your environment "
-echo "variables. See setup.sh for how to set your environment variables for the "
-echo "bash shell. You can either run "source setup.sh" in the shell where you will"
-echo "run PyLith or add these settings to your .bashrc or equivalent file."
+echo "  Before attempting to use PyLith you may need to update your environment "
+echo "  variables. See the file setup.sh in this directory for how to set your "
+echo "  environment variables for the bash shell. You can either run "
+echo "  \"source setup.sh\" in the terminal (i.e., shell) where you will "
+echo "  run PyLith or add these settings to your .bashrc or equivalent file."
+echo ""
 
 
 dnl end of configure.ac



More information about the CIG-COMMITS mailing list