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

brad at geodynamics.org brad at geodynamics.org
Fri Apr 22 17:21:59 PDT 2011


Author: brad
Date: 2011-04-22 17:21:59 -0700 (Fri, 22 Apr 2011)
New Revision: 18283

Modified:
   short/3D/PyLith/pylith_installer/trunk/Makefile.am
   short/3D/PyLith/pylith_installer/trunk/configure.ac
Log:
Fixed environment settings.

Modified: short/3D/PyLith/pylith_installer/trunk/Makefile.am
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/Makefile.am	2011-04-22 17:41:50 UTC (rev 18282)
+++ short/3D/PyLith/pylith_installer/trunk/Makefile.am	2011-04-23 00:21:59 UTC (rev 18283)
@@ -45,7 +45,7 @@
 SCIENTIFICPYTHON_VER=2.9.1
 FIAT_VER=0.9.9
 
-NEMESIS_VER=1.0.1
+NEMESIS_VER=1.0.2
 SPATIALDATA_VER=0.6.0
 PYLITH_VER=1.5.2
 
@@ -66,10 +66,10 @@
 	installed_proj \
 	installed_netcdf \
 	installed_hdf5 \
+	installed_fiat \
+	installed_nemesis \
+	installed_spatialdata \
 	installed_petsc \
-	installed_spatialdata \
-	installed_nemesis \
-	installed_fiat \
 	installed_pylith
 
 noinst_builddirs = \
@@ -82,8 +82,8 @@
 	proj4-build \
 	netcdf-build \
 	hdf5-build \
+	nemesis-build \
 	spatialdata-build \
-	nemesis-build \
 	pylith-build
 
 noinst_srcdirs = \
@@ -106,6 +106,8 @@
 # ----------------------------------------------------------------------
 # Environment settings.
 # ----------------------------------------------------------------------
+env_flags = CPPFLAGS=$(CPPFLAGS) LDFLAGS=$(LDFLAGS)
+
 if WITH_FORTRAN
 env_mpicompilers = CC=mpicc CXX=mpicxx FC=mpif90
 else
@@ -117,7 +119,7 @@
 # ----------------------------------------------------------------------
 all: installed_pylith
 
-rebuild-all: finished_mkdest compilers python mpi cppunit swig numpy proj4 netcdf hdf5 petsc nemesis spatialdata fiat pylith
+rebuild-all: finished_mkdest compilers python mpi cppunit swig numpy proj4 netcdf hdf5 fiat nemesis spatialdata petsc pylith
 
 # ----------------------------------------------------------------------
 # Note on configure invocations
@@ -158,8 +160,9 @@
 	cd gcc-build && \
 		../gcc-4.5.2/configure --prefix=$(prefix) \
 			--disable-multilib \
-			--enable-languages=$(LANGUAGES) && \
-		make -j $(make_threads) && \
+			--enable-languages=$(gcc_languages) \
+			$(env_flags) && \
+		make -j $(make_threads) $(env_flags) && \
 		make install && \
 		touch ../installed_compilers
 
@@ -186,7 +189,7 @@
 	$(MKDIR_P) python-build
 	cd python-build && \
 		../Python-$(PYTHON_VER)/configure --prefix=$(prefix) \
-		--enable-shared && \
+		--enable-shared $(env_flags) && \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_python
@@ -230,8 +233,8 @@
 	$(MKDIR_P) openmpi-build
 	cd openmpi-build && \
 		../openmpi-$(OPENMPI_VER)/configure \
-			--prefix=$(prefix) ; \
-		make && \
+			--prefix=$(prefix) $(env_flags) ; \
+		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_mpi
 	if [ ! -x $(prefix)/bin/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
@@ -248,8 +251,8 @@
 		../mpich2-$(MPICH2_VER)/configure --with-pm=gforker \
 			--enable-shared --enable-sharedlibs=gcc \
 			--disable-static --disable-mpe \
-			--prefix=$(prefix) ; \
-		make && \
+			--prefix=$(prefix) $(env_flags) ; \
+		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_mpi
 	if [ ! -x $(prefix)/bin/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
@@ -264,7 +267,8 @@
 	$(TAR) -zxf cppunit-$(CPPUNIT_VER).tar.gz
 	$(MKDIR_P) cppunit-build
 	cd cppunit-build && \
-		../cppunit-$(CPPUNIT_VER)/configure --prefix=$(prefix) ; \
+		../cppunit-$(CPPUNIT_VER)/configure \
+			--prefix=$(prefix) $(env_flags) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_cppunit
@@ -287,7 +291,8 @@
 	$(TAR) -zxf pcre-$(PCRE_VER).tar.gz
 	$(MKDIR_P) pcre-build
 	cd pcre-build && \
-		../pcre-$(PCRE_VER)/configure --prefix=$(prefix) ; \
+		../pcre-$(PCRE_VER)/configure \
+			--prefix=$(prefix) $(env_flags) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_pcre
@@ -309,7 +314,8 @@
 	$(TAR) -zxf swig-$(SWIG_VER).tar.gz
 	$(MKDIR_P) swig-build
 	cd swig-build && \
-		../swig-$(SWIG_VER)/configure --prefix=$(prefix) ; \
+		../swig-$(SWIG_VER)/configure \
+			--prefix=$(prefix) $(env_flags) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_swig
@@ -358,7 +364,8 @@
 	cd proj4-build/nad && \
 		unzip ../../proj-datumgrid-1.3.zip
 	cd proj4-build && \
-		../proj-$(PROJ4_VER)/configure --prefix=$(prefix) ; \
+		../proj-$(PROJ4_VER)/configure \
+			--prefix=$(prefix) $(env_flags) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_proj4
@@ -381,7 +388,8 @@
 	$(TAR) -zxf netcdf-$(NETCDF_VER).tar.gz
 	$(MKDIR_P) netcdf-build
 	cd netcdf-build && \
-		../netcdf-$(NETCDF_VER)/configure --prefix=$(prefix) \
+		../netcdf-$(NETCDF_VER)/configure \
+			--prefix=$(prefix) $(env_flags) \
 			--enable-shared --disable-static --disable-netcdf-4 ; \
 		make -j $(make_threads) && \
 		make install && \
@@ -411,7 +419,10 @@
 	$(TAR) -zxf hdf5-$(HDF5_VER).tar.gz
 	$(MKDIR_P) hdf5-build
 	cd hdf5-build && \
-		../hdf5-$(HDF5_VER)/configure --enable-parallel --enable-shared --disable-static --prefix=$(prefix) $(env_mpicompilers) ; \
+		../hdf5-$(HDF5_VER)/configure \
+			--enable-parallel --enable-shared \
+			--disable-static --prefix=$(prefix) \
+			$(env_flags) $(env_mpicompilers) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_hdf5
@@ -432,45 +443,46 @@
 
 
 # ----------------------------------------------------------------------
-# petsc
+# fiat
 # ----------------------------------------------------------------------
-petsc: installed_mpi
-if INSTALL_PETSC
-if WITH_HDF5
-petsc_options += --with-hdf5=1
-endif
-if INSTALL_HDF5
-petsc_options += --with-hdf5-include=$(prefix)/include --with-hdf5-lib=$(prefix)/lib/libhdf5.dylib
-endif
-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
+fiat: installed_numpy
+if INSTALL_FIAT
+	$(FETCH_SCRIPT) "$(downloader)" ScientificPython-$(SCIENTIFICPYTHON_VER).tar.gz http://geodynamics.org/~buildbot/deps
+	$(TAR) -zxf ScientificPython-$(SCIENTIFICPYTHON_VER).tar.gz
+	cd ScientificPython-$(SCIENTIFICPYTHON_VER) && $(PYTHON) setup.py install --prefix=$(prefix)
+	$(FETCH_SCRIPT) "$(downloader)" fiat-$(FIAT_VER).tar.gz http://geodynamics.org/~buildbot/deps
+	$(TAR) -zxf fiat-$(FIAT_VER).tar.gz
+	cd fiat-$(FIAT_VER) && $(PYTHON) setup.py install --prefix=$(prefix)
+
 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 "$@ already installed. Skipping installation."
 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) ; \
+
+installed_fiat:
+	$(MAKE) $(AM_MAKEFLAGS) fiat
+	touch $@
+
+
+# ----------------------------------------------------------------------
+# nemesis
+# ----------------------------------------------------------------------
+nemesis: installed_mpi installed_python
+if INSTALL_NEMESIS
+	$(FETCH_SCRIPT) "$(downloader)" nemesis-$(NEMESIS_VER).tar.gz http://www.geodynamics.org/cig/software/pythia
+	$(TAR) -zxvf nemesis-$(NEMESIS_VER).tar.gz
+	$(MKDIR_P) nemesis-build
+	cd nemesis-build && \
+		../nemesis-$(NEMESIS_VER)/configure \
+			--prefix=$(prefix) $(env_flags) ; \
 		make && \
-		make install && \
-		make test && \
-		touch ../installed_petsc
+		make install
+
 else
 	@echo "$@ already installed. Skipping installation."
 endif
 
-installed_petsc:
-	$(MAKE) $(AM_MAKEFLAGS) petsc
+installed_nemesis:
+	$(MAKE) $(AM_MAKEFLAGS) nemesis
 	touch $@
 
 
@@ -494,7 +506,9 @@
 endif
 	$(MKDIR_P) spatialdata-build
 	cd spatialdata-build && \
-		../spatialdata-$(SPATIALDATA_VER)/configure --prefix=$(prefix) $(spatialdata_options) ; \
+		../spatialdata-$(SPATIALDATA_VER)/configure \
+			--prefix=$(prefix) $(env_flags) \
+			$(spatialdata_options) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_spatialdata
@@ -511,52 +525,52 @@
 
 
 # ----------------------------------------------------------------------
-# nemesis
+# petsc
 # ----------------------------------------------------------------------
-nemesis: installed_mpi installed_python
-if INSTALL_NEMESIS
-	$(FETCH_SCRIPT) "$(downloader)" nemesis-$(NEMESIS_VER).tar.gz http://www.geodynamics.org/cig/software/pythia
-	$(TAR) -zxvf nemesis-$(NEMESIS_VER).tar.gz
-	$(MKDIR_P) nemesis-build
-	cd nemesis-build && \
-		../nemesis-$(NEMESIS_VER)/configure --prefix=$(prefix) ; \
-		make && \
-		make install
-
+petsc: installed_mpi
+if INSTALL_PETSC
+if WITH_HDF5
+petsc_options += --with-hdf5=1
+endif
+if INSTALL_HDF5
+petsc_options += --with-hdf5-include=$(prefix)/include --with-hdf5-lib=$(prefix)/lib/libhdf5.dylib
+endif
+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
-	@echo "$@ already installed. Skipping installation."
+	$(FETCH_SCRIPT) "$(downloader)" petsc-dev-pylith-$(PYLITH_VER).tgz http://www.geodynamics.org/cig/software/pylith
+	$(TAR) -zxf petsc-dev-pylith-$(PYLITH_VER).tgz
 endif
-
-installed_nemesis:
-	$(MAKE) $(AM_MAKEFLAGS) nemesis
-	touch $@
-
-
-# ----------------------------------------------------------------------
-# fiat
-# ----------------------------------------------------------------------
-fiat: installed_numpy
-if INSTALL_FIAT
-	$(FETCH_SCRIPT) "$(downloader)" ScientificPython-$(SCIENTIFICPYTHON_VER).tar.gz http://geodynamics.org/~buildbot/deps
-	$(TAR) -zxf ScientificPython-$(SCIENTIFICPYTHON_VER).tar.gz
-	cd ScientificPython-$(SCIENTIFICPYTHON_VER) && python setup.py install --prefix=$(prefix)
-	$(FETCH_SCRIPT) "$(downloader)" fiat-$(FIAT_VER).tar.gz http://geodynamics.org/~buildbot/deps
-	$(TAR) -zxf fiat-$(FIAT_VER).tar.gz
-	cd fiat-$(FIAT_VER) && python setup.py install --prefix=$(prefix)
-
+	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) $(env_flags) ; \
+		make PETSC_DIR=$(abs_builddir)/petsc-dev && \
+		make PETSC_DIR=$(abs_builddir)/petsc-dev install && \
+		make PETSC_DIR=$(abs_builddir)/petsc-dev test && \
+		touch ../installed_petsc
 else
 	@echo "$@ already installed. Skipping installation."
 endif
 
-installed_fiat:
-	$(MAKE) $(AM_MAKEFLAGS) fiat
+installed_petsc:
+	$(MAKE) $(AM_MAKEFLAGS) petsc
 	touch $@
 
 
 # ----------------------------------------------------------------------
 # pylith
 # ----------------------------------------------------------------------
-pylith: installed_cppunit installed_swig installed_netcdf installed_hdf5 installed_petsc installed_nemesis installed_spatialdata installed_fiat
+pylith: installed_cppunit installed_swig installed_netcdf installed_hdf5 installed_fiat installed_nemesis installed_spatialdata installed_petsc
 pylith_options = 
 if WITH_NETCDF
 pylith_options += --enable-cubit
@@ -575,7 +589,9 @@
 endif
 	$(MKDIR_P) pylith-build
 	cd pylith-build && \
-		../pylith-$(PYLITH_VER)/configure --prefix=$(prefix) $(pylith_options) ; \
+		../pylith-$(PYLITH_VER)/configure \
+			--prefix=$(prefix) $(pylith_options) $(env_flags) \
+			PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=$(PETSC_ARCH) ; \
 		make -j $(make_threads) && \
 		make install && \
 		touch ../installed_pylith

Modified: short/3D/PyLith/pylith_installer/trunk/configure.ac
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/configure.ac	2011-04-22 17:41:50 UTC (rev 18282)
+++ short/3D/PyLith/pylith_installer/trunk/configure.ac	2011-04-23 00:21:59 UTC (rev 18283)
@@ -308,6 +308,8 @@
 # Python
 if test "$install_python" = yes ; then
   echo "do nothing" >& /dev/null
+  PYTHON=$prefix/bin/python
+  AC_SUBST(PYTHON)
 else
   AM_PATH_PYTHON([2.4])
   CIT_PYTHON_SYSCONFIG
@@ -404,7 +406,10 @@
 
 # PETSC
 if test "$install_petsc" = yes ; then
-  echo "do nothing" >& /dev/null
+  PETSC_DIR=$prefix
+  AC_SUBST(PETSC_DIR)
+  PETSC_ARCH=pylith_petsc_opt
+  AC_SUBST(PETSC_ARCH)
 else
   CIT_PATH_PETSC([3.1.0])
   CIT_HEADER_PETSC
@@ -445,49 +450,29 @@
 
 CPPFLAGS="-I$prefix/include $CPPFLAGS"
 LDFLAGS="-L$prefix/lib $LDFLAGS"
-PATH="$prefix/bin:$PATH"
-
-if test "X$LD_LIBRARY_PATH" == "X" ; then
-  LD_LIBRARY_PATH="$prefix/lib:$prefix/lib64"
-else
-  LD_LIBRARY_PATH="$prefix/lib:$prefix/lib64:$LD_LIBRARY_PATH"
-fi
-
-if test "X$PYTHONPATH" == "X" ; then
-  PYTHONPATH="$prefix/lib/python$PYTHON_VERSION/site-packages"
-else
-  PYTHONPATH="$prefix/lib/python$PYTHON_VERSION/site-packages:$PYTHON_PATH"
-fi
-if test "$install_petsc" = yes ; then
-  PETSC_DIR="$prefix"
-  PETSC_ARCH=pylith_petsc_opt
-fi
 AC_SUBST(CPPFLAGS)
 AC_SUBST(LDFLAGS)
-AC_SUBST(PATH)
-AC_SUBST(LD_LIBRARY_PATH)
-AC_SUBST(PYTHONPATH)
 
 
 # Create setup.sh
 echo "#!/bin/bash" > setup.sh
 
 if test "X${PATH}" = X ; then
-  echo "PATH=$prefix/bin" >> setup.sh
+  echo "export PATH=$prefix/bin" >> setup.sh
 else
-  echo "PATH=$prefix/bin:\${PATH}" >> setup.sh
+  echo "export PATH=$prefix/bin:\${PATH}" >> setup.sh
 fi
 
 if test "X${LD_LIBRARY_PATH}" = X ; then
-  echo "LD_LIBRARY_PATH=$prefix/lib" >> setup.sh
+  echo "export LD_LIBRARY_PATH=$prefix/lib" >> setup.sh
 else
-  echo "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
-  echo "PYTHONPATH=$prefix/lib/python$PYTHON_VERSION/site-packages" >> setup.sh
+  echo "export PYTHONPATH=$prefix/lib/python$PYTHON_VERSION/site-packages" >> setup.sh
 else
-  echo "PYTHONPATH=$prefix/lib/python$PYTHON_VERSION/site-packages:\${PYTHONPATH}" >> setup.sh
+  echo "export PYTHONPATH=$prefix/lib/python$PYTHON_VERSION/site-packages:\${PYTHONPATH}" >> setup.sh
 fi
 
 # ----------------------------------------------------------------------
@@ -537,14 +522,19 @@
 echo ""
 echo "IMPORTANT"
 echo ""
-echo "  Runing "make" will install PyLith and its dependencies to $prefix."
+echo "  BEFORE running \"make\", setup your environment so that all of the "
+echo "  dependencies are consistent. See the file setup.sh in this directory "
+echo "  for how to set your variables for the bash shell. You can either run "
+echo "  \"source setup.sh\" in this terminal (i.e., shell) where you will "
+echo "  build PyLith and it dependencies or add these settings to your "
+echo "  .bashrc or equivalent file and open a new terminal (i.e., shell)."
 echo ""
-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 "  Runing \"make\" will install PyLith and its dependencies to $prefix."
 echo ""
+echo "  AFTER running make, if you did not setup your .bashrc with the "
+echo "  environment variables, be sure to run \"source setup.sh\" in the "
+echo "  terminal (i.e., shell) BEFORE running PyLith."
+echo ""
 
 
 dnl end of configure.ac



More information about the CIG-COMMITS mailing list