[CIG-SHORT] Summary & tips: Pylith installation from source using installer

Ravi Kanda kanda.vs.ravi at gmail.com
Thu Jul 7 15:07:53 PDT 2016


Hi Brad, Matt, and Charles,

I finally managed to install pylith-2.1.3-0 from source using the 
installer on both my laptop and workstation (both running Ubuntu 14).  
Along the way I had to make some tweaks to setup.sh & Makefile due to 
two additional dependencies (Cython & PGen). All the unit-tests passed, 
and I was able to get meaningful results from the 2d_gravity-vardensity 
example problem we did in Tutorial 4 of the workshop.

I am not sure whether the above tweaks are specific to my systems or 
might benefit a wider audience - so, I am briefly documenting what I did 
below, and attaching my versions of the configure script, setup.sh and 
Makefile+DIFF.  I do not know if these tweaks are worth propagating 
upstream to autotools input files (Makefile.am &/or configure.ac?) - you 
would be a better judge of that.

A) CONFIGURE OPTIONS (attachment #1):  In the end, I had to enable all 
major dependencies except autotools, git, & cmake (but it turns out the 
last one was installed anyway during petsc build). BTW, I also tried to 
install pylith with --enable-autotools on one of the systems, which 
worked only when I used GNU m4-1.4.17 instead of m4-1.4.16 that the 
installer uses (turns out v.16 has a bug that was fixed in v.17 as per 
link [1] below) - version updated in the Makefile (below).

B) SETUP.SH (attachment #2): For some reason, $PYTHON_VERSION (=2.7) is 
not passed on to PYTHONPATH variable in the setup.sh generated by the 
above config script (I see <PREFIX>/lib/python/site-packages, and 
<PREFIX>/lib64/python/site-packages).  So, I had to update the python 
folder with 'python2.7' before sourcing, so the build environment used 
the locally installed python & py-packages. Variable also updated in the 
Makefile (below).

C) MAKEFILE (attachments #3,4):  H5PY built successfully only when I 
added a new rule for cython (which in turn required setuptools and 
pcgen).  Without cython, I got a "... failed to import Cython ..." 
error.  Cython, in turn needed setuptools installed first (see link [2] 
below), as well as PGen (see [3] below).  So, I added new Makefile rules 
for pgen and cython, and the latter to the h5py rule dependencies.  I 
tried to keep all changes to a single section of the Makefile for 
clarity.  However, also see the attached DIFF of my Makefile version 
w.r.t. the original installer version.

If you would like further details, or specific config files, feel free 
to let me know.  Again, thanks much for your help & tips during 
CIG-2016, which eventually helped me figure out the build process.

Regards,
Ravi.
===============
Relevant links &/fixes:
===============
[1] m4 bug ("... 'gets' undeclared ..." similar to what I got), and the 
fix to a similar problem (upgrade to v-17):
http://www.linuxquestions.org/questions/slackware-14/m4-need-some-love-4175471638/

[2] H5py install distutils error ("... AttributeError: install_layout 
..."), and the fix to a similar problem (install/upgrade setuptools):
https://github.com/gotcha/ipdb/issues/60

[3] H5py install pcgen error ("... Unable to find pgen, not compiling 
formal grammar ..."), and was able to fix it by installing PGen python 
package.
===============

-- 
---------------------------------------------------------------------
Ravi Kanda
Adjunct Assistant Professor
Department of Geology
Utah State University
4505 Old Main Hill
Logan UT 84322-4505
--------------------------
Web Page: https://ravi-vs-kanda.github.io

----------------------------------------------------------------------
For a human being, the unexamined life is not worth living - SOCRATES
----------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: config_FORCE_ALL_np8.sh
Type: application/x-shellscript
Size: 1012 bytes
Desc: not available
URL: <http://lists.geodynamics.org/pipermail/cig-short/attachments/20160707/980f4d00/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup_python-version.sh
Type: application/x-shellscript
Size: 333 bytes
Desc: not available
URL: <http://lists.geodynamics.org/pipermail/cig-short/attachments/20160707/980f4d00/attachment-0003.bin>
-------------- next part --------------
# Makefile.in generated by automake 1.12.6 from Makefile.am.
# Makefile.  Generated from Makefile.in by configure.

# Copyright (C) 1994-2012 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.



# -*- Makefile -*-
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2016 University of California, Davis
#
# See COPYING for license information.
#
# ----------------------------------------------------------------------

am__make_dryrun = \
  { \
    am__dry=no; \
    case $$MAKEFLAGS in \
      *\\[\ \	]*) \
        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
      *) \
        for am__flg in $$MAKEFLAGS; do \
          case $$am__flg in \
            *=*|--*) ;; \
            *n*) am__dry=yes; break;; \
          esac; \
        done;; \
    esac; \
    test $$am__dry = yes; \
  }
pkgdatadir = $(datadir)/pylith-installer
pkgincludedir = $(includedir)/pylith-installer
pkglibdir = $(libdir)/pylith-installer
pkglibexecdir = $(libexecdir)/pylith-installer
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = x86_64-unknown-linux-gnu
host_triplet = x86_64-unknown-linux-gnu
am__append_1 = --enable-testing
#am__append_2 = --enable-swig
am__append_3 = --with-hdf5=1
am__append_4 = --with-hdf5-dir=$(prefix) --LIBS=-lz
#am__append_5 = --with-cuda=1 --with-cusp=1 --with-thrust=1 --with-nvcc=$(NVCC)
am__append_6 = 
#am__append_7 = --with-fc=0
am__append_8 = --enable-cubit
am__append_9 = --enable-hdf5
am__append_10 = --enable-testing
#am__append_11 = --enable-cuda
#am__append_12 = --enable-swig
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
	$(srcdir)/Makefile.in $(top_srcdir)/./aux-config/config.guess \
	$(top_srcdir)/./aux-config/config.sub \
	$(top_srcdir)/./aux-config/install-sh \
	$(top_srcdir)/./aux-config/ltmain.sh \
	$(top_srcdir)/./aux-config/missing $(top_srcdir)/configure \
	./aux-config/config.guess ./aux-config/config.sub \
	./aux-config/install-sh ./aux-config/ltmain.sh \
	./aux-config/missing AUTHORS COPYING INSTALL NEWS TODO
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_pkg_swig.m4 \
	$(top_srcdir)/m4/cit_cppunit.m4 $(top_srcdir)/m4/cit_hdf5.m4 \
	$(top_srcdir)/m4/cit_mpi.m4 $(top_srcdir)/m4/cit_netcdf.m4 \
	$(top_srcdir)/m4/cit_numpy.m4 $(top_srcdir)/m4/cit_petsc.m4 \
	$(top_srcdir)/m4/cit_proj4.m4 $(top_srcdir)/m4/cit_python.m4 \
	$(top_srcdir)/m4/cit_spatialdata.m4 \
	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
 configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
	html-recursive info-recursive install-data-recursive \
	install-dvi-recursive install-exec-recursive \
	install-html-recursive install-info-recursive \
	install-pdf-recursive install-ps-recursive install-recursive \
	installcheck-recursive installdirs-recursive pdf-recursive \
	ps-recursive uninstall-recursive
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
    *) (install-info --version) >/dev/null 2>&1;; \
  esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
  distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
	cscope distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
  if test -d "$(distdir)"; then \
    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
      && rm -rf "$(distdir)" \
      || { sleep 5 && rm -rf "$(distdir)"; }; \
  else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
  dir0=`pwd`; \
  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
  sed_rest='s,^[^/]*/*,,'; \
  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
  sed_butlast='s,/*[^/]*$$,,'; \
  while test -n "$$dir1"; do \
    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
    if test "$$first" != "."; then \
      if test "$$first" = ".."; then \
        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
      else \
        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
        if test "$$first2" = "$$first"; then \
          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
        else \
          dir2="../$$dir2"; \
        fi; \
        dir0="$$dir0"/"$$first"; \
      fi; \
    fi; \
    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
  done; \
  reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = ${SHELL} /home/rkanda/sw/src/pylith/pylith-installer-2.1.3-0/aux-config/missing --run aclocal-1.12
AMTAR = $${TAR-tar}
AR = ar
AUTOCONF = ${SHELL} /home/rkanda/sw/src/pylith/pylith-installer-2.1.3-0/aux-config/missing --run autoconf
AUTOHEADER = ${SHELL} /home/rkanda/sw/src/pylith/pylith-installer-2.1.3-0/aux-config/missing --run autoheader
AUTOMAKE = ${SHELL} /home/rkanda/sw/src/pylith/pylith-installer-2.1.3-0/aux-config/missing --run automake-1.12
AUTORECONF = 
AWK = gawk
CC = gcc
CCDEPMODE = depmode=none
CFLAGS = -g -O2
CP = /bin/cp
CPP = gcc -E
CPPFLAGS = -I/home/rkanda/sw/pylith-2.1.3-0/include 
CURL = 
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=none
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DPACKAGE_NAME=\"PyLith\ Installer\" -DPACKAGE_TARNAME=\"pylith-installer\" -DPACKAGE_VERSION=\"2.1.3-0\" -DPACKAGE_STRING=\"PyLith\ Installer\ 2.1.3-0\" -DPACKAGE_BUGREPORT=\"cig-short at geodynamics.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"pylith-installer\" -DVERSION=\"2.1.3-0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBZ=1
DEPDIR = .deps
DLLTOOL = false
DSYMUTIL = 
DUMPBIN = 
ECHO_C = 
ECHO_N = -n
ECHO_T = 
EGREP = /bin/grep -E
EXEEXT = 
FC = gfortran
FCFLAGS = 
FGREP = /bin/grep -F
GIT = 
GREP = /bin/grep
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = /usr/bin/ld -m elf_x86_64
LDFLAGS = -L/home/rkanda/sw/pylith-2.1.3-0/lib 
LIBOBJS = 
LIBS = -lz 
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO = 
LN_S = ln -s
LTLIBOBJS = 
LT_SYS_LIBRARY_PATH = 
MAKEINFO = ${SHELL} /home/rkanda/sw/src/pylith/pylith-installer-2.1.3-0/aux-config/missing --run makeinfo
MANIFEST_TOOL = :
MKDIR_P = /bin/mkdir -p
MPICC = 
MPICXX = 
MPIF90 = 
NEMESIS = 
NM = /usr/bin/nm -B
NMEDIT = 
NUMPY_INCDIR = 
NVCC = 
OBJDUMP = objdump
OBJEXT = o
OTOOL = 
OTOOL64 = 
PACKAGE = pylith-installer
PACKAGE_BUGREPORT = cig-short at geodynamics.org
PACKAGE_NAME = PyLith Installer
PACKAGE_STRING = PyLith Installer 2.1.3-0
PACKAGE_TARNAME = pylith-installer
PACKAGE_URL = 
PACKAGE_VERSION = 2.1.3-0
PATH_SEPARATOR = :
PCRETEST = 
PETSC_ARCH = arch-pylith
PETSC_CC = 
PETSC_CC_INCLUDES = 
PETSC_CXX = 
PETSC_CXX_INCLUDE = 
PETSC_CXX_LIB = 
PETSC_DIR = /home/rkanda/sw/pylith-2.1.3-0
PETSC_FC = 
PETSC_FC_INCLUDES = 
PETSC_FORTRAN_LIB = 
PETSC_LIB = 
PETSC_MPI_INCLUDE = 
PETSC_MPI_LIB = 
PETSC_SIEVE_FLAGS = 
PETSC_VERSION_MAJOR = 
PETSC_VERSION_MINOR = 
PETSC_VERSION_SUBMINOR = 
PYTHON = /home/rkanda/sw/pylith-2.1.3-0/bin/python
PYTHON_BLDLIBRARY = 
PYTHON_CPPFLAGS = 
PYTHON_EXEC_PREFIX = 
PYTHON_INCDIR = 
PYTHON_LA_LDFLAGS = 
PYTHON_LDFLAGS = 
PYTHON_LDLAST = 
PYTHON_LDLIBRARY = 
PYTHON_LIBDIR = /usr/lib/python2.7
PYTHON_LIBP = 
PYTHON_LIBPL = 
PYTHON_LIBS = 
PYTHON_LINKFORSHARED = 
PYTHON_MODLIBS = 
PYTHON_PLATFORM = 
PYTHON_PREFIX = 
PYTHON_SYSLIBS = 
PYTHON_VERSION = 2.7
RANLIB = ranlib
SED = /bin/sed
SET_MAKE = 
SHELL = /bin/bash
STRIP = strip
SWIG = 
SWIG_LIB = 
TAR = /bin/tar
VERSION = 2.1.3-0
WGET = /usr/bin/wget
_cv_PYTHON_INCDIR = 

# ----------------------------------------------------------------------
# Environment settings.
# ----------------------------------------------------------------------
abs_builddir = `pwd`
abs_srcdir = /home/rkanda/sw/src/pylith/pylith-installer-2.1.3-0
abs_top_builddir = /home/rkanda/sw/src/pylith/pylith-installer-2.1.3-0
abs_top_srcdir = /home/rkanda/sw/src/pylith/pylith-installer-2.1.3-0
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_DUMPBIN = 
ac_ct_FC = 
am__include = include
am__leading_dot = .
am__quote = 
am__tar = tar --format=posix -chf - "$$tardir"
am__untar = tar -xf -
bindir = ${exec_prefix}/bin
build = x86_64-unknown-linux-gnu
build_alias = 
build_cpu = x86_64
build_os = linux-gnu
build_vendor = unknown
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
downloader = /usr/bin/wget -nd -r -O
dvidir = ${docdir}
exec_prefix = ${prefix}
existing_hdf5 = /usr/bin/h5dump
existing_mpi = /usr/bin/mpirun
existing_nemesis = 
existing_netcdf = /usr/bin/ncdump
existing_petsc = 
existing_proj4 = /usr/bin/proj
existing_pylith = 
existing_spatialdata = 
force_petsc_tarball = no
gcc_languages = c,c++,fortran
host = x86_64-unknown-linux-gnu
host_alias = 
host_cpu = x86_64
host_os = linux-gnu
host_vendor = unknown
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/rkanda/sw/src/pylith/pylith-installer-2.1.3-0/aux-config/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
make_threads = 8
mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P)
mpich_sharedarch = gcc
oldincludedir = /usr/include
pdfdir = ${docdir}
petsc_git = no
petsc_options = --download-chaco=1 --download-ml=1 --download-fblaslapack=1 $(am__append_3) $(am__append_4) \
	$(am__append_5) $(am__append_6) $(am__append_7)
pkgpyexecdir = 
pkgpythondir = 
prefix = /home/rkanda/sw/pylith-2.1.3-0
program_transform_name = s,x,x,
psdir = ${docdir}
pyexecdir = 
pylith_git = no
pythondir = 
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias = 
top_build_prefix = 
top_builddir = .
top_srcdir = .
ACLOCAL_AMFLAGS = -I m4

# ----------------------------------------------------------------------
# Packages URL
# ----------------------------------------------------------------------
DEPS_URL = http://geoweb.cse.ucdavis.edu/~buildbot/deps

# ----------------------------------------------------------------------
# Package Versions
# ----------------------------------------------------------------------
M4_VER = 1.4.17
AUTOCONF_VER = 2.68
AUTOMAKE_VER = 1.11.1
LIBTOOL_VER = 2.4
GCC_VER = 4.7.3
MPC_VER = 1.0.2
GMP_VER = 4.3.2
MPFR_VER = 2.4.2
PYTHON_VER = 2.7.6
MPICH_VER = 3.1.3
OPENMPI_VER = 1.8.4
CPPUNIT_VER = 1.13.2
PCRE_VER = 8.12
SWIG_VER = 2.0.6
GIT_VER = 1.8.2.1
NUMPY_VER = 1.7.2
PROJ4_VER = 4.8.0
HDF5_VER = 1.8.11p2
H5PY_VER = 2.2.1
NETCDF_VER = 4.1.3-p2
NETCDFPY_VER = 1.1.8p1
SCIENTIFICPYTHON_VER = 2.9.1
FIAT_VER = 0.9.9
SETUPTOOLS_VER = 0.6c11
PYTHIA_VER = 0.8.1.16
NEMESIS_VER = 1.1.0
CMAKE_VER = 2.8.12.2
SPATIALDATA_VER = 1.9.6
#SPATIALDATA_VER = master
PYLITH_VER = 2.1.3
#PYLITH_VER = $(pylith_git)
#PETSC_VER = 2.1.3
PETSC_VER = 2.1.3

# ----------------------------------------------------------------------
# Files
# ----------------------------------------------------------------------
SUBDIRS = \
	bin

EXTRA_DIST = \
	AUTHORS \
	CHANGES \
	COPYING \
	INSTALL \
	NEWS \
	README \
	numpy_blaslapack.cfg

noinst_tmp = \
	installed_compilers \
	installed_python \
	installed_mpi \
	installed_cppunit \
	installed_swig \
	installed_numpy \
	installed_proj4 \
	installed_netcdf \
	installed_netcdfpy \
	installed_hdf5 \
	installed_h5py \
	installed_fiat \
	installed_pythia \
	installed_nemesis \
	installed_spatialdata \
	installed_cmake \
	installed_petsc \
	installed_pylith

noinst_builddirs = \
	gcc-build \
	python-build \
	openmpi-build \
	mpich-build \
	cppunit-build \
	swig-build \
	proj4-build \
	netcdf-build \
	hdf5-build \
	nemesis-build \
	spatialdata-build \
	pylith-build

noinst_srcdirs = \
	gcc-$(GCC_VER) \
	Python-$(PYTHON_VER) \
	openmpi-$(OPENMPI_VER) \
	mpich-$(MPICH_VER) \
	cppunit-$(CPPUNIT_VER) \
	swig-$(SWIG_VER) \
	proj-$(PROJ4_VER) \
	netcdf-$(NETCDF_VER) \
	netCDF4-$(NETCDFPY_VER) \
	hdf5-$(HDF5_VER) \
	h5py-$(H5PY_VER) \
	spatialdata-$(SPATIALDATA_VER) \
	pythia-$(PYTHIA_VER) \
	nemesis-$(NEMESIS_VER) \
	cmake-$(CMAKE_VER) \
	pylith-$(PYLITH_VER)

FETCH_SCRIPT = $(top_srcdir)/bin/fetch.sh
env_flags = CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS) -DMPICH_IGNORE_CXX_SEEK" FCFLAGS="$(FCFLAGS)"
#env_compilers = CC=$(CC) CXX=$(CXX)
env_compilers = CC=$(CC) CXX=$(CXX) FC=$(FC)
#env_mpicompilers = CC=mpicc CXX=mpicxx
env_mpicompilers = CC=mpicc CXX=mpicxx FC=mpif90
#mpich_options = --disable-fortran

# ----------------------------------------------------------------------
# mpich
# ----------------------------------------------------------------------
mpich_options = --enable-fc
hdf5_options = --enable-fortran
#netcdf_4_options = --disable-netcdf-4
netcdf_4_options = --enable-netcdf-4
spatialdata_options = $(am__append_1) \
	$(am__append_2)
#petsc_build_options = 
petsc_build_options = -j$(make_threads) -C $(PETSC_ARCH) 
pylith_options = $(am__append_8) $(am__append_9) $(am__append_10) \
	$(am__append_11) $(am__append_12)

# ----------------------------------------------------------------------
# clean
# ----------------------------------------------------------------------
CLEANFILES = $(noinst_tmp)
all: all-recursive

.SUFFIXES:
am--refresh: Makefile
	@:
$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    echo ' $(SHELL) ./config.status'; \
	    $(SHELL) ./config.status;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	$(SHELL) ./config.status --recheck

$(top_srcdir)/configure:  $(am__configure_deps)
	$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs

distclean-libtool:
	-rm -f libtool config.lt

# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
#     (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
	@fail= failcom='exit 1'; \
	for f in x $$MAKEFLAGS; do \
	  case $$f in \
	    *=* | --[!k]*);; \
	    *k*) failcom='fail=yes';; \
	  esac; \
	done; \
	dot_seen=no; \
	target=`echo $@ | sed s/-recursive//`; \
	case "$@" in \
	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
	  *) list='$(SUBDIRS)' ;; \
	esac; \
	for subdir in $$list; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    dot_seen=yes; \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done; \
	if test "$$dot_seen" = "no"; then \
	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
	fi; test -z "$$fail"
tags-recursive:
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
	done
ctags-recursive:
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
	done
cscopelist-recursive:
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	set x; \
	here=`pwd`; \
	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
	  include_option=--etags-include; \
	  empty_fix=.; \
	else \
	  include_option=--include; \
	  empty_fix=; \
	fi; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    test ! -f $$subdir/TAGS || \
	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
	  fi; \
	done; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	shift; \
	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  if test $$# -gt 0; then \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      "$$@" $$unique; \
	  else \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      $$unique; \
	  fi; \
	fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && $(am__cd) $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) "$$here"

cscope: cscope.files
	test ! -s cscope.files \
	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)

clean-cscope:
	-rm -f cscope.files

cscope.files: clean-cscope cscopelist-recursive cscopelist

cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
	list='$(SOURCES) $(HEADERS) $(LISP)'; \
	case "$(srcdir)" in \
	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
	  *) sdir=$(subdir)/$(srcdir) ;; \
	esac; \
	for i in $$list; do \
	  if test -f "$$i"; then \
	    echo "$(subdir)/$$i"; \
	  else \
	    echo "$$sdir/$$i"; \
	  fi; \
	done >> $(top_builddir)/cscope.files

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files

distdir: $(DISTFILES)
	$(am__remove_distdir)
	test -d "$(distdir)" || mkdir "$(distdir)"
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d "$(distdir)/$$file"; then \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
	  else \
	    test -f "$(distdir)/$$file" \
	    || cp -p $$d/$$file "$(distdir)/$$file" \
	    || exit 1; \
	  fi; \
	done
	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    $(am__make_dryrun) \
	      || test -d "$(distdir)/$$subdir" \
	      || $(MKDIR_P) "$(distdir)/$$subdir" \
	      || exit 1; \
	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
	    $(am__relativize); \
	    new_distdir=$$reldir; \
	    dir1=$$subdir; dir2="$(top_distdir)"; \
	    $(am__relativize); \
	    new_top_distdir=$$reldir; \
	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
	    ($(am__cd) $$subdir && \
	      $(MAKE) $(AM_MAKEFLAGS) \
	        top_distdir="$$new_top_distdir" \
	        distdir="$$new_distdir" \
		am__remove_distdir=: \
		am__skip_length_check=: \
		am__skip_mode_fix=: \
	        distdir) \
	      || exit 1; \
	  fi; \
	done
	-test -n "$(am__skip_mode_fix)" \
	|| find "$(distdir)" -type d ! -perm -755 \
		-exec chmod u+rwx,go+rx {} \; -o \
	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
	|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
	$(am__post_remove_distdir)

dist-bzip2: distdir
	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
	$(am__post_remove_distdir)

dist-lzip: distdir
	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
	$(am__post_remove_distdir)

dist-xz: distdir
	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
	$(am__post_remove_distdir)

dist-tarZ: distdir
	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
	$(am__post_remove_distdir)

dist-shar: distdir
	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
	$(am__post_remove_distdir)

dist-zip: distdir
	-rm -f $(distdir).zip
	zip -rq $(distdir).zip $(distdir)
	$(am__post_remove_distdir)

dist dist-all:
	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
	$(am__post_remove_distdir)

# This target untars the dist file and tries a VPATH configuration.  Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
	case '$(DIST_ARCHIVES)' in \
	*.tar.gz*) \
	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
	*.tar.bz2*) \
	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
	*.tar.lz*) \
	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
	*.tar.xz*) \
	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
	*.tar.Z*) \
	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
	*.shar.gz*) \
	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
	*.zip*) \
	  unzip $(distdir).zip ;;\
	esac
	chmod -R a-w $(distdir)
	chmod u+w $(distdir)
	mkdir $(distdir)/_build $(distdir)/_inst
	chmod a-w $(distdir)
	test -d $(distdir)/_build || exit 0; \
	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
	  && am__cwd=`pwd` \
	  && $(am__cd) $(distdir)/_build \
	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
	    $(DISTCHECK_CONFIGURE_FLAGS) \
	  && $(MAKE) $(AM_MAKEFLAGS) \
	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
	  && $(MAKE) $(AM_MAKEFLAGS) check \
	  && $(MAKE) $(AM_MAKEFLAGS) install \
	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
	        distuninstallcheck \
	  && chmod -R a-w "$$dc_install_base" \
	  && ({ \
	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
	  && rm -rf "$$dc_destdir" \
	  && $(MAKE) $(AM_MAKEFLAGS) dist \
	  && rm -rf $(DIST_ARCHIVES) \
	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
	  && cd "$$am__cwd" \
	  || exit 1
	$(am__post_remove_distdir)
	@(echo "$(distdir) archives ready for distribution: "; \
	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
	@test -n '$(distuninstallcheck_dir)' || { \
	  echo 'ERROR: trying to run $@ with an empty' \
	       '$$(distuninstallcheck_dir)' >&2; \
	  exit 1; \
	}; \
	$(am__cd) '$(distuninstallcheck_dir)' || { \
	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
	  exit 1; \
	}; \
	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
	   || { echo "ERROR: files left after uninstall:" ; \
	        if test -n "$(DESTDIR)"; then \
	          echo "  (check DESTDIR support)"; \
	        fi ; \
	        $(distuninstallcheck_listfiles) ; \
	        exit 1; } >&2
distcleancheck: distclean
	@if test '$(srcdir)' = . ; then \
	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
	  exit 1 ; \
	fi
	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
	  || { echo "ERROR: files left in build directory after distclean:" ; \
	       $(distcleancheck_listfiles) ; \
	       exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-recursive
install-strip:
	if test -z '$(STRIP)'; then \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	      install; \
	else \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
	fi
mostlyclean-generic:

clean-generic:
	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive

clean-am: clean-generic clean-libtool clean-local mostlyclean-am

distclean: distclean-recursive
	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
	-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
	distclean-tags

dvi: dvi-recursive

dvi-am:

html: html-recursive

html-am:

info: info-recursive

info-am:

install-data-am:

install-dvi: install-dvi-recursive

install-dvi-am:

install-exec-am:

install-html: install-html-recursive

install-html-am:

install-info: install-info-recursive

install-info-am:

install-man:

install-pdf: install-pdf-recursive

install-pdf-am:

install-ps: install-ps-recursive

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-recursive
	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
	-rm -rf $(top_srcdir)/autom4te.cache
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-recursive

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-recursive

pdf-am:

ps: ps-recursive

ps-am:

uninstall-am:

.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
	cscopelist-recursive ctags-recursive install-am install-strip \
	tags-recursive

.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
	all all-am am--refresh check check-am clean clean-cscope \
	clean-generic clean-libtool clean-local cscope cscopelist \
	cscopelist-recursive ctags ctags-recursive dist dist-all \
	dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \
	dist-zip distcheck distclean distclean-generic \
	distclean-libtool distclean-tags distcleancheck distdir \
	distuninstallcheck dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am install-dvi \
	install-dvi-am install-exec install-exec-am install-html \
	install-html-am install-info install-info-am install-man \
	install-pdf install-pdf-am install-ps install-ps-am \
	install-strip installcheck installcheck-am installdirs \
	installdirs-am maintainer-clean maintainer-clean-generic \
	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
	ps ps-am tags tags-recursive uninstall uninstall-am


# ----------------------------------------------------------------------
# Targets
# ----------------------------------------------------------------------
all: installed_pylith 

deps: installed_cppunit installed_swig installed_netcdf installed_hdf5 installed_h5py installed_fiat installed_nemesis installed_pythia installed_netcdfpy installed_git installed_cmake installed_proj4

rebuild-all: finished_mkdest compilers python mpi cppunit swig numpy proj4 netcdf hdf5 h5py fiat nemesis spatialdata petsc pylith

# ----------------------------------------------------------------------
# Note on configure invocations
#
# Normally, we would like to do configure ARGS && make && make
# install. However a bug in autoconf results in d.SYM directories
# generating an error when configure tries to remove them with "rm"
# rather than "rm -r". As a result, we use configure ARGS ; make &&
# make install.

# ----------------------------------------------------------------------
# setup
# ----------------------------------------------------------------------
mkdest:
	$(MKDIR_P) $(prefix)/include $(prefix)/lib $(prefix)/bin

finished_mkdest:
	$(MAKE) $(AM_MAKEFLAGS) mkdest && touch $@

# ----------------------------------------------------------------------
# autotools
# ----------------------------------------------------------------------
autotools: finished_mkdest
#	$(FETCH_SCRIPT) "$(downloader)" m4-$(M4_VER).tar.gz $(DEPS_URL)
#	$(FETCH_SCRIPT) "$(downloader)" autoconf-$(AUTOCONF_VER).tar.gz $(DEPS_URL)
#	$(FETCH_SCRIPT) "$(downloader)" automake-$(AUTOMAKE_VER).tar.gz $(DEPS_URL)
#	$(FETCH_SCRIPT) "$(downloader)" libtool-$(LIBTOOL_VER).tar.gz $(DEPS_URL)
#	$(TAR) -zxf m4-$(M4_VER).tar.gz
#	mkdir -p m4-$(M4_VER)-build
#	cd m4-$(M4_VER)-build && \
#		../m4-$(M4_VER)/configure --prefix=$(prefix) $(env_flags) && \
#		make -j $(MAKE_THREADS) && \
#		make install
#	$(TAR) -zxf autoconf-$(AUTOCONF_VER).tar.gz
#	mkdir -p autoconf-$(AUTOCONF_VER)-build
#	cd autoconf-$(AUTOCONF_VER)-build && \
#		../autoconf-$(AUTOCONF_VER)/configure --prefix=$(prefix) $(env_flags) && \
#		make -j $(MAKE_THREADS) && \
#		make install
#	$(TAR) -zxf automake-$(AUTOMAKE_VER).tar.gz
#	mkdir -p automake-$(AUTOMAKE_VER)-build
#	cd automake-$(AUTOMAKE_VER)-build && \
#		../automake-$(AUTOMAKE_VER)/configure --prefix=$(prefix) $(env_flags) && \
#		make -j $(MAKE_THREADS) && \
#		make install
#	$(TAR) -zxf libtool-$(LIBTOOL_VER).tar.gz
#	mkdir -p libtool-$(LIBTOOL_VER)-build
#	cd libtool-$(LIBTOOL_VER)-build && \
#		../libtool-$(LIBTOOL_VER)/configure --prefix=$(prefix)  $(env_flags) && \
#		make -j $(MAKE_THREADS) && \
#		make install && \
#		touch ../installed_autotools
	@echo "$@ already installed. Skipping installation."
	touch installed_autotools

installed_autotools:
	$(MAKE) $(AM_MAKEFLAGS) autotools

# ----------------------------------------------------------------------
# compilers
# ----------------------------------------------------------------------
compilers: finished_mkdest
	$(FETCH_SCRIPT) "$(downloader)" gcc-$(GCC_VER).tar.bz2 $(DEPS_URL)
	$(FETCH_SCRIPT) "$(downloader)" mpc-$(MPC_VER).tar.gz $(DEPS_URL)
	$(FETCH_SCRIPT) "$(downloader)" gmp-$(GMP_VER).tar.gz $(DEPS_URL)
	$(FETCH_SCRIPT) "$(downloader)" mpfr-$(MPFR_VER).tar.bz2 $(DEPS_URL)
	$(TAR) -jxf gcc-$(GCC_VER).tar.bz2
	cd gcc-$(GCC_VER) ; \
		tar -zxf ../gmp-$(GMP_VER).tar.gz; \
		ln -sf gmp-$(GMP_VER)/ gmp; \
		tar -zxf ../mpc-$(MPC_VER).tar.gz; \
		ln -sf mpc-$(MPC_VER)/ mpc; \
		tar -jxf ../mpfr-$(MPFR_VER).tar.bz2; \
		ln -sf mpfr-$(MPFR_VER)/ mpfr
	$(MKDIR_P) gcc-build
	cd gcc-build && \
		../gcc-$(GCC_VER)/configure --prefix=$(prefix) \
			--disable-multilib \
			--enable-languages=$(gcc_languages) \
			$(env_flags) && \
		make -j $(make_threads) $(env_flags) && \
		make install && \
		touch ../installed_compilers

#	@echo "$@ already installed. Skipping installation."
#	touch installed_compilers

installed_compilers:
	$(MAKE) $(AM_MAKEFLAGS) compilers

# ----------------------------------------------------------------------
# python
# ----------------------------------------------------------------------
python: installed_compilers
	$(FETCH_SCRIPT) "$(downloader)" Python-$(PYTHON_VER).tgz $(DEPS_URL)
	$(TAR) -zxf Python-$(PYTHON_VER).tgz
	$(MKDIR_P) python-build
	cd python-build && \
		../Python-$(PYTHON_VER)/configure --prefix=$(prefix) \
		--enable-shared $(env_flags) $(env_compilers) && \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_python
#	@echo "$@ already installed. Skipping installation."
#	touch installed_python

installed_python:
	$(MAKE) $(AM_MAKEFLAGS) python

# ----------------------------------------------------------------------
# mpi
# ----------------------------------------------------------------------
#mpi: openmpi

mpi: mpich

#mpi:
#	@echo "$@ already installed. Skipping installation."
#	touch installed_mpi

installed_mpi:
	$(MAKE) $(AM_MAKEFLAGS) mpi

# ----------------------------------------------------------------------
# openmpi
# ----------------------------------------------------------------------
openmpi: installed_compilers
	$(FETCH_SCRIPT) "$(downloader)" openmpi-$(OPENMPI_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf openmpi-$(OPENMPI_VER).tar.gz
	$(MKDIR_P) openmpi-build
	cd openmpi-build && \
		../openmpi-$(OPENMPI_VER)/configure \
			--prefix=$(prefix) $(env_flags) $(env_compilers); \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_mpi
	if [ ! -x $(prefix)/bin/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi
mpich: installed_compilers
	$(FETCH_SCRIPT) "$(downloader)" mpich-$(MPICH_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf mpich-$(MPICH_VER).tar.gz
	$(MKDIR_P) mpich-build
	cd mpich-build && \
		../mpich-$(MPICH_VER)/configure \
			--with-pm=gforker \
			--enable-shared \
			--enable-sharedlibs=$(mpich_sharedarch) \
			--disable-static --disable-mpe \
			--prefix=$(prefix) \
			$(env_flags) $(env_compilers) $(mpich_options) ; \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_mpi
	if [ ! -x $(prefix)/bin/mpirun ]; then cd $(prefix)/bin && $(LN_S) mpiexec mpirun; fi

# ----------------------------------------------------------------------
# cppunit
# ----------------------------------------------------------------------
cppunit: installed_compilers
	$(FETCH_SCRIPT) "$(downloader)" cppunit-$(CPPUNIT_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf cppunit-$(CPPUNIT_VER).tar.gz
	$(MKDIR_P) cppunit-build
	cd cppunit-build && \
		../cppunit-$(CPPUNIT_VER)/configure \
			--prefix=$(prefix) $(env_flags) $(env_compilers); \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_cppunit

#	@echo "$@ already installed. Skipping installation."
#	touch installed_cppunit

installed_cppunit:
	$(MAKE) $(AM_MAKEFLAGS) cppunit

# ----------------------------------------------------------------------
# pcre
# ----------------------------------------------------------------------
pcre: installed_compilers
	$(FETCH_SCRIPT) "$(downloader)" pcre-$(PCRE_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf pcre-$(PCRE_VER).tar.gz
	$(MKDIR_P) pcre-build
	cd pcre-build && \
		../pcre-$(PCRE_VER)/configure \
			--prefix=$(prefix) $(env_flags) $(env_compilers) ; \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_pcre
#	@echo "$@ already installed. Skipping installation."
#	touch installed_pcre

installed_pcre:
	$(MAKE) $(AM_MAKEFLAGS) pcre

# ----------------------------------------------------------------------
# swig
# ----------------------------------------------------------------------
swig: installed_pcre installed_compilers installed_python
	$(FETCH_SCRIPT) "$(downloader)" swig-$(SWIG_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf swig-$(SWIG_VER).tar.gz
	$(MKDIR_P) swig-build
	cd swig-build && \
		../swig-$(SWIG_VER)/configure \
			--prefix=$(prefix) $(env_flags) $(env_compilers) ; \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_swig
##	@echo "$@ already installed. Skipping installation."
#	@echo "$@ not required. Skipping installation."
#	touch installed_swig

installed_swig:
	$(MAKE) $(AM_MAKEFLAGS) swig

# ----------------------------------------------------------------------
# numpy
# ----------------------------------------------------------------------
numpy: installed_python
	$(FETCH_SCRIPT) "$(downloader)" numpy-$(NUMPY_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf numpy-$(NUMPY_VER).tar.gz
#	$(CP) $(top_srcdir)/numpy_blaslapack.cfg numpy-$(NUMPY_VER)/site.cfg
	cd numpy-$(NUMPY_VER) && \
		$(PYTHON) setup.py install --prefix=$(prefix) && \
		touch ../installed_numpy

#	@echo "$@ already installed. Skipping installation."
#	touch installed_numpy

installed_numpy:
	$(MAKE) $(AM_MAKEFLAGS) numpy

# ----------------------------------------------------------------------
# proj4
# ----------------------------------------------------------------------
proj4: installed_compilers
	$(FETCH_SCRIPT) "$(downloader)" proj-$(PROJ4_VER).tar.gz $(DEPS_URL)
	$(FETCH_SCRIPT) "$(downloader)" proj-datumgrid-1.3.zip $(DEPS_URL)
	$(TAR) -zxf proj-$(PROJ4_VER).tar.gz
	$(MKDIR_P) proj4-build/nad
	cd proj4-build/nad && \
		unzip ../../proj-datumgrid-1.3.zip
	cd proj4-build && \
		../proj-$(PROJ4_VER)/configure \
			--prefix=$(prefix) $(env_flags) $(env_compilers) ; \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_proj4

#	@echo "$@ already installed. Skipping installation."
#	touch installed_proj4

installed_proj4:
	$(MAKE) $(AM_MAKEFLAGS) proj4

# ----------------------------------------------------------------------
# hdf5
# ----------------------------------------------------------------------
hdf5: installed_mpi
	$(FETCH_SCRIPT) "$(downloader)" hdf5-$(HDF5_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf hdf5-$(HDF5_VER).tar.gz
	$(MKDIR_P) hdf5-build
	cd hdf5-build && \
		../hdf5-$(HDF5_VER)/configure \
			--enable-parallel --enable-shared --enable-unsupported \
			--disable-static --prefix=$(prefix) $(hdf5_options) \
			$(env_flags) $(env_mpicompilers) ; \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_hdf5
#	@echo "$@ already installed. Skipping installation."
##	@echo "hdf5 option not requested. To enable HDF5 option, "
##	@echo "reconfigure with --enable-hdf5 (to install HDF5) or "
##	@echo "--with-hdf5 (to use an existing installation)."
#	touch installed_hdf5

installed_hdf5:
	$(MAKE) $(AM_MAKEFLAGS) hdf5

# ----------------------------------------------------------------------
# pcgen
# ----------------------------------------------------------------------
pcgen: installed_python
	$(eval UNZIP = /usr/bin/unzip)
	$(eval PKG_URL_BASE = https://pypi.python.org/packages)
	$(eval PCGEN_VERSION = 0.2.1)
	$(eval PCGEN_URL := ${PKG_URL_BASE}/3c/68/3cd7faa8bc9b060eea452c5d6f27919dfb664cc4d1259998718a2360e05c)
#
	$(FETCH_SCRIPT) "$(downloader)" PGen-${PCGEN_VERSION}.zip ${PCGEN_URL}
	$(UNZIP) PGen-${PCGEN_VERSION}.zip
	cd PGen-${PCGEN_VERSION}                        && \
		CC=mpicc $(env_flags) python setup.py build && \
		python setup.py install --prefix=$(prefix)  && \
		touch ../installed_pcgen

installed_pcgen:
	$(MAKE) $(AM_MAKEFLAGS) pcgen

# ----------------------------------------------------------------------
# cython
# ----------------------------------------------------------------------
cython: installed_python installed_setuptools installed_pcgen
	$(eval PKG_URL_BASE = https://pypi.python.org/packages)
	$(eval CYTHON_VERSION := 0.24)
	$(eval CYTHON_URL := ${PKG_URL_BASE}/b1/51/bd5ef7dff3ae02a2c6047aa18d3d06df2fb8a40b00e938e7ea2f75544cac)
#
	$(FETCH_SCRIPT) "$(downloader)" Cython-${CYTHON_VERSION}.tar.gz ${CYTHON_URL}
	$(TAR) -xzf Cython-${CYTHON_VERSION}.tar.gz 
	cd Cython-${CYTHON_VERSION}                     && \
		CC=mpicc $(env_flags) python setup.py build && \
		python setup.py install --prefix=$(prefix)  && \
		touch ../installed_cython

installed_cython:
	$(MAKE) $(AM_MAKEFLAGS) cython

# ----------------------------------------------------------------------
# h5py
# ----------------------------------------------------------------------
h5py: installed_hdf5 installed_numpy installed_cython
	$(FETCH_SCRIPT) "$(downloader)" h5py-$(H5PY_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf h5py-$(H5PY_VER).tar.gz
	cd h5py-$(H5PY_VER) && \
		CC=mpicc $(env_flags) python setup.py build --hdf5=$(prefix) && \
		python setup.py install --prefix=$(prefix) && \
		touch ../installed_h5py
#	@echo "$@ already installed. Skipping installation."
##	@echo "h5py option not requested. To enable h5py option, "
##	@echo "reconfigure with --enable-h5py (to install H5PY)."
#	touch installed_h5py

installed_h5py:
	$(MAKE) $(AM_MAKEFLAGS) h5py

# ----------------------------------------------------------------------
# netcdf
# ----------------------------------------------------------------------
netcdf: installed_compilers installed_hdf5
	$(FETCH_SCRIPT) "$(downloader)" netcdf-$(NETCDF_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf netcdf-$(NETCDF_VER).tar.gz
	$(MKDIR_P) netcdf-build
	cd netcdf-build && \
		../netcdf-$(NETCDF_VER)/configure \
			--prefix=$(prefix) $(env_flags) $(env_mpicompilers) \
			--enable-shared --disable-static $(netcdf_4_options) --disable-dap ; \
		sed -e "s/-l //g" libtool > libtool.tmp && mv -f libtool.tmp libtool; \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_netcdf

#	@echo "$@ already installed. Skipping installation."
##	@echo "netcdf option not requested. To enable NetCDF option, "
##	@echo "reconfigure with --enable-netcdf (to install NetCDF) or "
##	@echo "--with-netcdf (to use an existing installation)."
#	touch installed_netcdf

installed_netcdf:
	$(MAKE) $(AM_MAKEFLAGS) netcdf

# ----------------------------------------------------------------------
# netcdfpy
# ----------------------------------------------------------------------
netcdfpy: installed_netcdf installed_numpy
	$(FETCH_SCRIPT) "$(downloader)" netCDF4-$(NETCDFPY_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf netCDF4-$(NETCDFPY_VER).tar.gz
	cd netCDF4-$(NETCDFPY_VER) && \
		CC=mpicc $(env_flags) python setup.py build && \
		python setup.py install --prefix=$(prefix) && \
		touch ../installed_netcdfpy
#	@echo "$@ already installed. Skipping installation."
##	@echo "netCDF4 option not requested. To enable netCDF4 option, "
##	@echo "reconfigure with --enable-netcdfpy (to install netCDF4)."
#	touch installed_netcdfpy

installed_netcdfpy:
	$(MAKE) $(AM_MAKEFLAGS) netcdfpy

# ----------------------------------------------------------------------
# fiat
# ----------------------------------------------------------------------
fiat: installed_numpy
	$(FETCH_SCRIPT) "$(downloader)" ScientificPython-$(SCIENTIFICPYTHON_VER).tar.gz $(DEPS_URL)
	$(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 $(DEPS_URL)
	$(TAR) -zxf fiat-$(FIAT_VER).tar.gz
	cd fiat-$(FIAT_VER) && $(PYTHON) setup.py install --prefix=$(prefix) && touch ../installed_fiat

#	@echo "$@ already installed. Skipping installation."
#	touch installed_fiat

installed_fiat:
	$(MAKE) $(AM_MAKEFLAGS) fiat

# ----------------------------------------------------------------------
# setuptools
# ----------------------------------------------------------------------
setuptools: 
	$(FETCH_SCRIPT) "$(downloader)" setuptools-$(SETUPTOOLS_VER).tar.gz $(DEPS_URL)
	$(eval SETUPTOOLS_PFX = setuptools-$(SETUPTOOLS_VER))
#
#	NEWER setuptools: USE ONLY IF ABOVE OLDER SETUPTOOLS DOES NOT WORK WITH H5PY BUILD
#		COMMENT-OUT ABOVE TWO LINES, & UNCOMMENT NEXT FOUR LINES ...
#		RECOMPILE WITH 'make h5py', OR CLEAN INSTALL FULL PYLITH SUITE.
#	$(eval SETUPTOOLS_VERSION = 24.0.2)
#	$(eval SETUPTOOLS_URL := ${PKG_URL_BASE}/21/d7/3e7e4b42d40469d2b770e10aee5b49538ecf2853eb5635d2d2536b286e2d)
#	$(FETCH_SCRIPT) "$(downloader)" setuptools-${SETUPTOOLS_VERSION} ${SETUPTOOLS_URL}
#	$(eval SETUPTOOLS_PFX = setuptools-$(SETUPTOOLS_VERSION))
#
	$(TAR) -xzvf ${SETUPTOOLS_PFX}.tar.gz
	cd ${SETUPTOOLS_PFX}                            && \
		CC=mpicc $(env_flags) python setup.py build && \
		python setup.py install --prefix=$(prefix)  && \
		touch ../installed_setuptools

#	@echo "$@ already installed. Skipping installation."
#	touch installed_setuptools

installed_setuptools:
	$(MAKE) $(AM_MAKEFLAGS) setuptools

# ----------------------------------------------------------------------
# pythia
# ----------------------------------------------------------------------
pythia: installed_python installed_setuptools
	$(FETCH_SCRIPT) "$(downloader)" setuptools-0.6c11.tar.gz $(DEPS_URL)
	$(FETCH_SCRIPT) "$(downloader)" pythia-$(PYTHIA_VER).tar.gz https://github.com/geodynamics/pythia/releases/download/v$(PYTHIA_VER)
	$(TAR) -zxvf pythia-$(PYTHIA_VER).tar.gz
	$(CP) -p setuptools-0.6c11.tar.gz pythia-$(PYTHIA_VER)
	cd pythia-$(PYTHIA_VER) && $(PYTHON) setup.py install --prefix=$(prefix) && touch ../installed_pythia

#	@echo "$@ already installed. Skipping installation."
#	touch installed_pythia

installed_pythia:
	$(MAKE) $(AM_MAKEFLAGS) pythia

# ----------------------------------------------------------------------
# nemesis
# ----------------------------------------------------------------------
nemesis: installed_mpi installed_python installed_pythia
	$(FETCH_SCRIPT) "$(downloader)" nemesis-$(NEMESIS_VER).tar.gz https://github.com/geodynamics/nemesis/releases/download/v$(NEMESIS_VER)
	$(TAR) -zxvf nemesis-$(NEMESIS_VER).tar.gz
	$(MKDIR_P) nemesis-build
	cd nemesis-build && \
		../nemesis-$(NEMESIS_VER)/configure \
			--prefix=$(prefix) $(env_flags) $(env_mpicompilers); \
		make && \
		make install && \
		touch ../installed_nemesis

#	@echo "$@ already installed. Skipping installation."
#	touch installed_nemesis

installed_nemesis:
	$(MAKE) $(AM_MAKEFLAGS) nemesis

# ----------------------------------------------------------------------
# spatialdata
# ----------------------------------------------------------------------
spatialdata: installed_numpy installed_pythia installed_proj4 installed_swig installed_cppunit installed_autotools
#	$(GIT) clone --recursive https://github.com/geodynamics/spatialdata.git spatialdata-$(SPATIALDATA_VER)
#	cd spatialdata-$(SPATIALDATA_VER) && $(AUTORECONF) -if
	$(FETCH_SCRIPT) "$(downloader)" spatialdata-$(SPATIALDATA_VER).tgz https://github.com/geodynamics/spatialdata/releases/download/v$(SPATIALDATA_VER)
	$(TAR) -zxvf spatialdata-$(SPATIALDATA_VER).tgz
	$(MKDIR_P) spatialdata-build
	cd spatialdata-build && \
		../spatialdata-$(SPATIALDATA_VER)/configure \
			--prefix=$(prefix) $(env_flags) $(env_compilers) \
			$(spatialdata_options) ; \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_spatialdata
	cd spatialdata-build && make -j $(make_threads) check
#	@echo "$@ already installed. Skipping installation."
#	touch installed_spatialdata

installed_spatialdata:
	$(MAKE) $(AM_MAKEFLAGS) spatialdata

# ----------------------------------------------------------------------
# git
# ----------------------------------------------------------------------
git: installed_python
#	$(FETCH_SCRIPT) "$(downloader)" git-$(GIT_VER).tar.gz $(DEPS_URL)
#	$(TAR) -zxf git-$(GIT_VER).tar.gz
#	cd git-$(GIT_VER) && \
#		make prefix=$(prefix) NO_EXPAT=1 NO_TCLTK=1 NO_GETTEXT=1 all install && \
#		touch ../installed_git

	@echo "$@ already installed. Skipping installation."
	touch installed_git

installed_git:
	$(MAKE) $(AM_MAKEFLAGS) git

# ----------------------------------------------------------------------
# cmake
# ----------------------------------------------------------------------
cmake:
	$(FETCH_SCRIPT) "$(downloader)" cmake-$(CMAKE_VER).tar.gz $(DEPS_URL)
	$(TAR) -zxf cmake-$(CMAKE_VER).tar.gz
	cd cmake-$(CMAKE_VER) && \
		./bootstrap  --prefix=$(prefix) && make && make install && \
		touch ../installed_cmake
#	@echo "Skipping $@ installation."
#	touch installed_cmake

installed_cmake:
	$(MAKE) $(AM_MAKEFLAGS) cmake

# ----------------------------------------------------------------------
# petsc
# ----------------------------------------------------------------------
petsc: installed_mpi installed_hdf5 installed_git installed_cmake
	$(FETCH_SCRIPT) "$(downloader)" petsc-pylith-$(PETSC_VER).tgz https://github.com/geodynamics/pylith/releases/download/v$(PETSC_VER)
	$(TAR) -zxf petsc-pylith-$(PETSC_VER).tgz
#	git clone -b knepley/pylith https://bitbucket.org/petsc/petsc.git petsc-pylith
	cd petsc-pylith && \
		./configure --prefix=$(prefix) \
			--with-c2html=0 --with-x=0 \
			--with-clanguage=C \
			--with-mpicompilers=1 \
			--with-debugging=0 \
			--with-shared-libraries=1 --with-64-bit-points=1 --with-large-file-io=1 \
			$(petsc_options) $(env_flags) \
			PETSC_DIR=$(abs_builddir) PETSC_ARCH=$(PETSC_ARCH) ; \
		make $(petsc_build_options) PETSC_DIR=$(abs_builddir) PETSC_ARCH=$(PETSC_ARCH) && \
		make PETSC_DIR=$(abs_builddir) install && \
		make PETSC_DIR=$(abs_builddir) test && \
		touch ../installed_petsc
#	@echo "$@ already installed. Skipping installation."
#	touch installed_petsc

installed_petsc:
	$(MAKE) $(AM_MAKEFLAGS) petsc

# ----------------------------------------------------------------------
# pylith
# ----------------------------------------------------------------------
pylith: installed_cppunit installed_swig installed_netcdf installed_hdf5 installed_h5py installed_fiat installed_nemesis installed_pythia installed_spatialdata installed_petsc installed_netcdfpy installed_autotools
#	$(GIT) clone --recursive -b $(pylith_git) https://github.com/geodynamics/pylith.git pylith-$(PYLITH_VER)
#	cd pylith-$(PYLITH_VER) && $(AUTORECONF) -if
	$(FETCH_SCRIPT) "$(downloader)" pylith-$(PYLITH_VER).tgz https://github.com/geodynamics/pylith/releases/download/v$(PYLITH_VER)
	$(TAR) -zxvf pylith-$(PYLITH_VER).tgz
	$(MKDIR_P) pylith-build
	cd pylith-build && \
		../pylith-$(PYLITH_VER)/configure \
			--prefix=$(prefix) $(pylith_options) \
                        $(env_flags) $(env_mpicompilers) \
			PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=$(PETSC_ARCH) ; \
		make -j $(make_threads) && \
		make install && \
		touch ../installed_pylith
	cd pylith-build && make -j $(make_threads) check

installed_pylith:
	$(MAKE) $(AM_MAKEFLAGS) pylith

clean-builddirs:
	$(RM) $(RMFLAGS) -r $(noinst_builddirs)

clean-srcdirs:
	$(RM) $(RMFLAGS) -r $(noinst_srcdirs)

clean-local: clean-builddirs clean-srcdirs

# End of file

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
-------------- next part --------------
281c281
< PYTHON_VERSION = 
---
> PYTHON_VERSION = 2.7
382c382
< M4_VER = 1.4.16
---
> M4_VER = 1.4.17
1286a1287,1323
> # pcgen
> # ----------------------------------------------------------------------
> pcgen: installed_python
> 	$(eval UNZIP = /usr/bin/unzip)
> 	$(eval PKG_URL_BASE = https://pypi.python.org/packages)
> 	$(eval PCGEN_VERSION = 0.2.1)
> 	$(eval PCGEN_URL := ${PKG_URL_BASE}/3c/68/3cd7faa8bc9b060eea452c5d6f27919dfb664cc4d1259998718a2360e05c)
> #
> 	$(FETCH_SCRIPT) "$(downloader)" PGen-${PCGEN_VERSION}.zip ${PCGEN_URL}
> 	$(UNZIP) PGen-${PCGEN_VERSION}.zip
> 	cd PGen-${PCGEN_VERSION}                        && \
> 		CC=mpicc $(env_flags) python setup.py build && \
> 		python setup.py install --prefix=$(prefix)  && \
> 		touch ../installed_pcgen
> 
> installed_pcgen:
> 	$(MAKE) $(AM_MAKEFLAGS) pcgen
> 
> # ----------------------------------------------------------------------
> # cython
> # ----------------------------------------------------------------------
> cython: installed_python installed_setuptools installed_pcgen
> 	$(eval PKG_URL_BASE = https://pypi.python.org/packages)
> 	$(eval CYTHON_VERSION := 0.24)
> 	$(eval CYTHON_URL := ${PKG_URL_BASE}/b1/51/bd5ef7dff3ae02a2c6047aa18d3d06df2fb8a40b00e938e7ea2f75544cac)
> #
> 	$(FETCH_SCRIPT) "$(downloader)" Cython-${CYTHON_VERSION}.tar.gz ${CYTHON_URL}
> 	$(TAR) -xzf Cython-${CYTHON_VERSION}.tar.gz 
> 	cd Cython-${CYTHON_VERSION}                     && \
> 		CC=mpicc $(env_flags) python setup.py build && \
> 		python setup.py install --prefix=$(prefix)  && \
> 		touch ../installed_cython
> 
> installed_cython:
> 	$(MAKE) $(AM_MAKEFLAGS) cython
> 
> # ----------------------------------------------------------------------
1289c1326
< h5py: installed_hdf5 installed_numpy
---
> h5py: installed_hdf5 installed_numpy installed_cython
1369,1370c1406,1420
< 	$(TAR) -zxvf setuptools-$(SETUPTOOLS_VER).tar.gz
< 	cd setuptools-$(SETUPTOOLS_VER) && $(PYTHON) setup.py install --prefix=$(prefix) && touch ../installed_setuptools
---
> 	$(eval SETUPTOOLS_PFX = setuptools-$(SETUPTOOLS_VER))
> #
> #	NEWER setuptools: USE ONLY IF ABOVE OLDER SETUPTOOLS DOES NOT WORK WITH H5PY BUILD
> #		COMMENT-OUT ABOVE TWO LINES, & UNCOMMENT NEXT FOUR LINES ...
> #		RECOMPILE WITH 'make h5py', OR CLEAN INSTALL FULL PYLITH SUITE.
> #	$(eval SETUPTOOLS_VERSION = 24.0.2)
> #	$(eval SETUPTOOLS_URL := ${PKG_URL_BASE}/21/d7/3e7e4b42d40469d2b770e10aee5b49538ecf2853eb5635d2d2536b286e2d)
> #	$(FETCH_SCRIPT) "$(downloader)" setuptools-${SETUPTOOLS_VERSION} ${SETUPTOOLS_URL}
> #	$(eval SETUPTOOLS_PFX = setuptools-$(SETUPTOOLS_VERSION))
> #
> 	$(TAR) -xzvf ${SETUPTOOLS_PFX}.tar.gz
> 	cd ${SETUPTOOLS_PFX}                            && \
> 		CC=mpicc $(env_flags) python setup.py build && \
> 		python setup.py install --prefix=$(prefix)  && \
> 		touch ../installed_setuptools


More information about the CIG-SHORT mailing list