[cig-commits] r18282 - short/3D/PyLith/pylith_installer/trunk
brad at geodynamics.org
brad at geodynamics.org
Fri Apr 22 10:41:51 PDT 2011
Author: brad
Date: 2011-04-22 10:41:50 -0700 (Fri, 22 Apr 2011)
New Revision: 18282
Modified:
short/3D/PyLith/pylith_installer/trunk/Makefile.am
short/3D/PyLith/pylith_installer/trunk/configure.ac
Log:
Switched to setting up environment in configure.ac (which is propagated to Makefile).
Modified: short/3D/PyLith/pylith_installer/trunk/Makefile.am
===================================================================
--- short/3D/PyLith/pylith_installer/trunk/Makefile.am 2011-04-22 15:01:51 UTC (rev 18281)
+++ short/3D/PyLith/pylith_installer/trunk/Makefile.am 2011-04-22 17:41:50 UTC (rev 18282)
@@ -104,11 +104,12 @@
FETCH_SCRIPT = $(top_srcdir)/bin/fetch.sh
# ----------------------------------------------------------------------
-# Environment settings for configure for "installed" packages.
+# Environment settings.
# ----------------------------------------------------------------------
-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
+if WITH_FORTRAN
+env_mpicompilers = CC=mpicc CXX=mpicxx FC=mpif90
+else
+env_mpicompilers = CC=mpicc CXX=mpicxx
endif
# ----------------------------------------------------------------------
@@ -180,11 +181,12 @@
# ----------------------------------------------------------------------
python: installed_compilers
if INSTALL_PYTHON
- $(FETCH_SCRIPT) $(downloader) Python-$(PYTHON_VER).tgz http://geodynamics.org/~buildbot/deps
+ $(FETCH_SCRIPT) "$(downloader)" Python-$(PYTHON_VER).tgz http://geodynamics.org/~buildbot/deps
$(TAR) -zxf Python-$(PYTHON_VER).tgz
$(MKDIR_P) python-build
cd python-build && \
- ../Python-$(PYTHON_VER)/configure --prefix=$(prefix) $(env_flags) && \
+ ../Python-$(PYTHON_VER)/configure --prefix=$(prefix) \
+ --enable-shared && \
make -j $(make_threads) && \
make install && \
touch ../installed_python
@@ -228,11 +230,11 @@
$(MKDIR_P) openmpi-build
cd openmpi-build && \
../openmpi-$(OPENMPI_VER)/configure \
- --prefix=$(prefix) $(env_flags) ; \
+ --prefix=$(prefix) ; \
make && \
make install && \
touch ../installed_mpi
- if [ ! -x $(prefix)/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
+ if [ ! -x $(prefix)/bin/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
# ----------------------------------------------------------------------
@@ -246,11 +248,11 @@
../mpich2-$(MPICH2_VER)/configure --with-pm=gforker \
--enable-shared --enable-sharedlibs=gcc \
--disable-static --disable-mpe \
- --prefix=$(prefix) $(env_flags) $(env_compilers) ; \
+ --prefix=$(prefix) ; \
make && \
make install && \
touch ../installed_mpi
- if [ ! -x $(prefix)/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
+ if [ ! -x $(prefix)/bin/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
# ----------------------------------------------------------------------
@@ -262,7 +264,7 @@
$(TAR) -zxf cppunit-$(CPPUNIT_VER).tar.gz
$(MKDIR_P) cppunit-build
cd cppunit-build && \
- ../cppunit-$(CPPUNIT_VER)/configure --prefix=$(prefix) $(env_flags) ; \
+ ../cppunit-$(CPPUNIT_VER)/configure --prefix=$(prefix) ; \
make -j $(make_threads) && \
make install && \
touch ../installed_cppunit
@@ -285,7 +287,7 @@
$(TAR) -zxf pcre-$(PCRE_VER).tar.gz
$(MKDIR_P) pcre-build
cd pcre-build && \
- ../pcre-$(PCRE_VER)/configure --prefix=$(prefix) $(env_flags) ; \
+ ../pcre-$(PCRE_VER)/configure --prefix=$(prefix) ; \
make -j $(make_threads) && \
make install && \
touch ../installed_pcre
@@ -307,7 +309,7 @@
$(TAR) -zxf swig-$(SWIG_VER).tar.gz
$(MKDIR_P) swig-build
cd swig-build && \
- ../swig-$(SWIG_VER)/configure --prefix=$(prefix) $(env_flags) ; \
+ ../swig-$(SWIG_VER)/configure --prefix=$(prefix) ; \
make -j $(make_threads) && \
make install && \
touch ../installed_swig
@@ -356,7 +358,7 @@
cd proj4-build/nad && \
unzip ../../proj-datumgrid-1.3.zip
cd proj4-build && \
- ../proj-$(PROJ4_VER)/configure --prefix=$(prefix) $(env_flags) ; \
+ ../proj-$(PROJ4_VER)/configure --prefix=$(prefix) ; \
make -j $(make_threads) && \
make install && \
touch ../installed_proj4
@@ -380,7 +382,7 @@
$(MKDIR_P) netcdf-build
cd netcdf-build && \
../netcdf-$(NETCDF_VER)/configure --prefix=$(prefix) \
- --enable-shared --disable-static --disable-netcdf-4 $(env_flags) ; \
+ --enable-shared --disable-static --disable-netcdf-4 ; \
make -j $(make_threads) && \
make install && \
touch ../installed_netcdf
@@ -405,16 +407,11 @@
# ----------------------------------------------------------------------
hdf5: installed_mpi
if INSTALL_HDF5
-if WITH_FORTRAN
-env_compilers = CC=mpicc CXX=mpicxx FC=mpif90
-else
-env_compilers = CC=mpicc CXX=mpicxx
-endif
$(FETCH_SCRIPT) "$(downloader)" hdf5-$(HDF5_VER).tar.gz http://geodynamics.org/~buildbot/deps
$(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_flags) $(env_compilers) ; \
+ ../hdf5-$(HDF5_VER)/configure --enable-parallel --enable-shared --disable-static --prefix=$(prefix) $(env_mpicompilers) ; \
make -j $(make_threads) && \
make install && \
touch ../installed_hdf5
@@ -463,7 +460,7 @@
--with-shared-libraries=1 \
--with-sieve=1 \
--download-boost=1 \
- $(petsc_options); \
+ $(petsc_options) ; \
make && \
make install && \
make test && \
@@ -497,7 +494,7 @@
endif
$(MKDIR_P) spatialdata-build
cd spatialdata-build && \
- ../spatialdata-$(SPATIALDATA_VER)/configure --prefix=$(prefix) $(spatialdata_options) $(env_flags) ; \
+ ../spatialdata-$(SPATIALDATA_VER)/configure --prefix=$(prefix) $(spatialdata_options) ; \
make -j $(make_threads) && \
make install && \
touch ../installed_spatialdata
@@ -522,7 +519,7 @@
$(TAR) -zxvf nemesis-$(NEMESIS_VER).tar.gz
$(MKDIR_P) nemesis-build
cd nemesis-build && \
- ../nemesis-$(NEMESIS_VER)/configure --prefix=$(prefix) $(env_flags) ; \
+ ../nemesis-$(NEMESIS_VER)/configure --prefix=$(prefix) ; \
make && \
make install
@@ -578,7 +575,7 @@
endif
$(MKDIR_P) pylith-build
cd pylith-build && \
- ../pylith-$(PYLITH_VER)/configure --prefix=$(prefix) $(pylith_options) $(env_flags) ; \
+ ../pylith-$(PYLITH_VER)/configure --prefix=$(prefix) $(pylith_options) ; \
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 15:01:51 UTC (rev 18281)
+++ short/3D/PyLith/pylith_installer/trunk/configure.ac 2011-04-22 17:41:50 UTC (rev 18282)
@@ -32,6 +32,9 @@
[install GNU compilers (no, c,c++,fortran)@<:@default=no@:>@])],
[if test "$enableval" != no ; then install_gcc=yes; gcc_languages=$enableval; else install_gcc=no; fi],
[install_gcc=no])
+if test "$gcc_languages" = yes ; then
+ gcc_languages=c,c++,fortran
+fi
AC_SUBST(gcc_languages)
AM_CONDITIONAL([INSTALL_GCC], [test "$install_gcc" = yes])
AM_CONDITIONAL([GCC_FORTRAN_ONLY], [test "$gcc_languages" = fortran])
@@ -438,12 +441,35 @@
# ----------------------------------------------------------------------
-AC_CONFIG_FILES([Makefile
- bin/Makefile
- ])
+# Setup environment so dependencies are used in build
-AC_OUTPUT
+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
@@ -455,7 +481,7 @@
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
+ echo "LD_LIBRARY_PATH=$prefix/lib\:$prefix/lib64:${LD_LIBRARY_PATH}" >> setup.sh
fi
if test "X${PYTHONPATH}" = X ; then
@@ -464,6 +490,15 @@
echo "PYTHONPATH=$prefix/lib/python$PYTHON_VERSION/site-packages:\${PYTHONPATH}" >> setup.sh
fi
+# ----------------------------------------------------------------------
+AC_CONFIG_FILES([Makefile
+ bin/Makefile
+ ])
+
+AC_OUTPUT
+
+# ----------------------------------------------------------------------
+# Write summary.
echo ""
echo "Build info:"
echo " Using $downloader to download tarballs."
More information about the CIG-COMMITS
mailing list