summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xbin/spack2
-rw-r--r--lib/spack/docs/basic_usage.rst83
-rw-r--r--lib/spack/docs/configuration.rst7
-rw-r--r--lib/spack/docs/developer_guide.rst9
-rw-r--r--lib/spack/docs/mirrors.rst18
-rw-r--r--lib/spack/docs/packaging_guide.rst217
-rw-r--r--lib/spack/llnl/util/filesystem.py26
-rw-r--r--lib/spack/spack/__init__.py8
-rw-r--r--lib/spack/spack/architecture.py84
-rw-r--r--lib/spack/spack/build_environment.py2
-rw-r--r--lib/spack/spack/cmd/create.py32
-rw-r--r--lib/spack/spack/cmd/load.py2
-rw-r--r--lib/spack/spack/cmd/module.py113
-rw-r--r--lib/spack/spack/cmd/purge.py26
-rw-r--r--lib/spack/spack/cmd/repo.py2
-rw-r--r--lib/spack/spack/cmd/setup.py91
-rw-r--r--lib/spack/spack/cmd/test.py20
-rw-r--r--lib/spack/spack/compilers/__init__.py8
-rw-r--r--lib/spack/spack/concretize.py6
-rw-r--r--lib/spack/spack/config.py2
-rw-r--r--lib/spack/spack/database.py6
-rw-r--r--lib/spack/spack/directory_layout.py2
-rw-r--r--lib/spack/spack/fetch_strategy.py51
-rw-r--r--lib/spack/spack/modules.py27
-rw-r--r--lib/spack/spack/multimethod.py2
-rw-r--r--lib/spack/spack/package.py213
-rw-r--r--lib/spack/spack/repository.py2
-rw-r--r--lib/spack/spack/spec.py2
-rw-r--r--lib/spack/spack/stage.py12
-rw-r--r--lib/spack/spack/test/architecture.py37
-rw-r--r--lib/spack/spack/test/concretize.py4
-rw-r--r--lib/spack/spack/test/install.py7
-rw-r--r--lib/spack/spack/test/mock_packages_test.py13
-rw-r--r--lib/spack/spack/test/modules.py172
-rw-r--r--lib/spack/spack/test/multimethod.py2
-rw-r--r--lib/spack/spack/test/spec_dag.py2
-rw-r--r--lib/spack/spack/test/spec_semantics.py9
-rw-r--r--var/spack/repos/builtin.mock/packages/multimethod/package.py10
-rw-r--r--var/spack/repos/builtin/packages/adios/package.py (renamed from var/spack/packages/adios/package.py)23
-rw-r--r--var/spack/repos/builtin/packages/autoconf/package.py28
-rw-r--r--var/spack/repos/builtin/packages/automake/package.py20
-rw-r--r--var/spack/repos/builtin/packages/curl/package.py2
-rw-r--r--var/spack/repos/builtin/packages/dealii/package.py4
-rw-r--r--var/spack/repos/builtin/packages/eigen/package.py10
-rw-r--r--var/spack/repos/builtin/packages/emacs/package.py35
-rw-r--r--var/spack/repos/builtin/packages/fenics/package.py3
-rw-r--r--var/spack/repos/builtin/packages/fenics/petsc-3.7.patch394
-rw-r--r--var/spack/repos/builtin/packages/fenics/petsc-version-detection.patch39
-rw-r--r--var/spack/repos/builtin/packages/foam-extend/package.py235
-rw-r--r--var/spack/repos/builtin/packages/giflib/package.py41
-rw-r--r--var/spack/repos/builtin/packages/glib/g_date_strftime.patch34
-rw-r--r--var/spack/repos/builtin/packages/glib/package.py8
-rw-r--r--var/spack/repos/builtin/packages/gmsh/package.py84
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py29
-rw-r--r--var/spack/repos/builtin/packages/ibmisc/package.py46
-rw-r--r--var/spack/repos/builtin/packages/intel/package.py2
-rw-r--r--var/spack/repos/builtin/packages/julia/package.py33
-rw-r--r--var/spack/repos/builtin/packages/libtool/package.py24
-rw-r--r--var/spack/repos/builtin/packages/libxpm/package.py44
-rw-r--r--var/spack/repos/builtin/packages/lrzip/package.py61
-rw-r--r--var/spack/repos/builtin/packages/lzo/package.py49
-rw-r--r--var/spack/repos/builtin/packages/mfem/package.py6
-rw-r--r--var/spack/repos/builtin/packages/mpich/package.py5
-rw-r--r--var/spack/repos/builtin/packages/mumps/mumps-shared.patch119
-rw-r--r--var/spack/repos/builtin/packages/mumps/package.py168
-rw-r--r--var/spack/repos/builtin/packages/mvapich2/package.py5
-rw-r--r--var/spack/repos/builtin/packages/mxml/package.py (renamed from var/spack/packages/mxml/package.py)15
-rw-r--r--var/spack/repos/builtin/packages/netcdf-fortran/package.py2
-rw-r--r--var/spack/repos/builtin/packages/octave-splines/package.py44
-rw-r--r--var/spack/repos/builtin/packages/octave/package.py15
-rw-r--r--var/spack/repos/builtin/packages/openmpi/package.py5
-rw-r--r--var/spack/repos/builtin/packages/openssl/package.py40
-rw-r--r--var/spack/repos/builtin/packages/parmgridgen/package.py71
-rw-r--r--var/spack/repos/builtin/packages/petsc/package.py16
-rw-r--r--var/spack/repos/builtin/packages/py-docutils/package.py43
-rw-r--r--var/spack/repos/builtin/packages/py-protobuf/package.py50
-rw-r--r--var/spack/repos/builtin/packages/py-restview/package.py41
-rw-r--r--var/spack/repos/builtin/packages/r-bh/package.py54
-rw-r--r--var/spack/repos/builtin/packages/r-colorspace/package.py44
-rw-r--r--var/spack/repos/builtin/packages/r-dichromat/package.py42
-rw-r--r--var/spack/repos/builtin/packages/r-ggplot2/package.py54
-rw-r--r--var/spack/repos/builtin/packages/r-gridextra/package.py44
-rw-r--r--var/spack/repos/builtin/packages/r-gtable/package.py41
-rw-r--r--var/spack/repos/builtin/packages/r-inline/package.py43
-rw-r--r--var/spack/repos/builtin/packages/r-labeling/package.py41
-rw-r--r--var/spack/repos/builtin/packages/r-lattice/package.py44
-rw-r--r--var/spack/repos/builtin/packages/r-magrittr/package.py45
-rw-r--r--var/spack/repos/builtin/packages/r-mass/package.py42
-rw-r--r--var/spack/repos/builtin/packages/r-matrix/package.py44
-rw-r--r--var/spack/repos/builtin/packages/r-munsell/package.py47
-rw-r--r--var/spack/repos/builtin/packages/r-plyr/package.py49
-rw-r--r--var/spack/repos/builtin/packages/r-rcolorbrewer/package.py42
-rw-r--r--var/spack/repos/builtin/packages/r-rcpp/package.py49
-rw-r--r--var/spack/repos/builtin/packages/r-rcppeigen/package.py56
-rw-r--r--var/spack/repos/builtin/packages/r-reshape2/package.py46
-rw-r--r--var/spack/repos/builtin/packages/r-rstan/package.py57
-rw-r--r--var/spack/repos/builtin/packages/r-scales/package.py49
-rw-r--r--var/spack/repos/builtin/packages/r-stanheaders/package.py55
-rw-r--r--var/spack/repos/builtin/packages/r-stringi/package.py51
-rw-r--r--var/spack/repos/builtin/packages/r-stringr/package.py48
-rw-r--r--var/spack/repos/builtin/packages/ruby/package.py13
-rw-r--r--var/spack/repos/builtin/packages/scotch/package.py12
-rw-r--r--var/spack/repos/builtin/packages/swiftsim/package.py77
104 files changed, 3878 insertions, 536 deletions
diff --git a/.gitignore b/.gitignore
index 643e5d9b03..040df3eafd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
/var/spack/stage
+/var/spack/cache
*.pyc
/opt/
*~
diff --git a/bin/spack b/bin/spack
index 9b1276a866..e9307d1485 100755
--- a/bin/spack
+++ b/bin/spack
@@ -77,7 +77,7 @@ import llnl.util.tty as tty
from llnl.util.tty.color import *
import spack
from spack.error import SpackError
-from external import argparse
+import argparse
# Command parsing
parser = argparse.ArgumentParser(
diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst
index ec193e767d..d8d5a6a23a 100644
--- a/lib/spack/docs/basic_usage.rst
+++ b/lib/spack/docs/basic_usage.rst
@@ -1131,6 +1131,79 @@ of module files:
"""Set up the compile and runtime environments for a package."""
pass
+
+Recursive Modules
+``````````````````
+
+In some cases, it is desirable to load not just a module, but also all
+the modules it depends on. This is not required for most modules
+because Spack builds binaries with RPATH support. However, not all
+packages use RPATH to find their dependencies: this can be true in
+particular for Python extensions, which are currently *not* built with
+RPATH.
+
+Modules may be loaded recursively with the command:
+
+.. code-block:: sh
+
+ $ module load `spack module tcl --dependencies <spec>...
+
+More than one spec may be placed on the command line here.
+
+Module Comamnds for Shell Scripts
+``````````````````````````````````
+
+Although Spack is flexbile, the ``module`` command is much faster.
+This could become an issue when emitting a series of ``spack load``
+commands inside a shell script. By adding the ``--shell`` flag,
+``spack module find`` may also be used to generate code that can be
+cut-and-pasted into a shell script. For example:
+
+.. code-block:: sh
+
+ $ spack module find tcl --dependencies --shell py-numpy git
+ # bzip2@1.0.6%gcc@4.9.3=linux-x86_64
+ module load bzip2-1.0.6-gcc-4.9.3-ktnrhkrmbbtlvnagfatrarzjojmkvzsx
+ # ncurses@6.0%gcc@4.9.3=linux-x86_64
+ module load ncurses-6.0-gcc-4.9.3-kaazyneh3bjkfnalunchyqtygoe2mncv
+ # zlib@1.2.8%gcc@4.9.3=linux-x86_64
+ module load zlib-1.2.8-gcc-4.9.3-v3ufwaahjnviyvgjcelo36nywx2ufj7z
+ # sqlite@3.8.5%gcc@4.9.3=linux-x86_64
+ module load sqlite-3.8.5-gcc-4.9.3-a3eediswgd5f3rmto7g3szoew5nhehbr
+ # readline@6.3%gcc@4.9.3=linux-x86_64
+ module load readline-6.3-gcc-4.9.3-se6r3lsycrwxyhreg4lqirp6xixxejh3
+ # python@3.5.1%gcc@4.9.3=linux-x86_64
+ module load python-3.5.1-gcc-4.9.3-5q5rsrtjld4u6jiicuvtnx52m7tfhegi
+ # py-setuptools@20.5%gcc@4.9.3=linux-x86_64
+ module load py-setuptools-20.5-gcc-4.9.3-4qr2suj6p6glepnedmwhl4f62x64wxw2
+ # py-nose@1.3.7%gcc@4.9.3=linux-x86_64
+ module load py-nose-1.3.7-gcc-4.9.3-pwhtjw2dvdvfzjwuuztkzr7b4l6zepli
+ # openblas@0.2.17%gcc@4.9.3+shared=linux-x86_64
+ module load openblas-0.2.17-gcc-4.9.3-pw6rmlom7apfsnjtzfttyayzc7nx5e7y
+ # py-numpy@1.11.0%gcc@4.9.3+blas+lapack=linux-x86_64
+ module load py-numpy-1.11.0-gcc-4.9.3-mulodttw5pcyjufva4htsktwty4qd52r
+ # curl@7.47.1%gcc@4.9.3=linux-x86_64
+ module load curl-7.47.1-gcc-4.9.3-ohz3fwsepm3b462p5lnaquv7op7naqbi
+ # autoconf@2.69%gcc@4.9.3=linux-x86_64
+ module load autoconf-2.69-gcc-4.9.3-bkibjqhgqm5e3o423ogfv2y3o6h2uoq4
+ # cmake@3.5.0%gcc@4.9.3~doc+ncurses+openssl~qt=linux-x86_64
+ module load cmake-3.5.0-gcc-4.9.3-x7xnsklmgwla3ubfgzppamtbqk5rwn7t
+ # expat@2.1.0%gcc@4.9.3=linux-x86_64
+ module load expat-2.1.0-gcc-4.9.3-6pkz2ucnk2e62imwakejjvbv6egncppd
+ # git@2.8.0-rc2%gcc@4.9.3+curl+expat=linux-x86_64
+ module load git-2.8.0-rc2-gcc-4.9.3-3bib4hqtnv5xjjoq5ugt3inblt4xrgkd
+
+The script may be further edited by removing unnecessary modules.
+This script may be directly executed in bash via
+
+.. code-block :: sh
+
+ source <( spack module find tcl --dependencies --shell py-numpy git )
+
+
+Regenerating Module files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
.. code-block:: python
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
@@ -1395,23 +1468,23 @@ files in the ``cmake`` package while retaining its dependencies.
.. code-block:: sh
-
+
$ spack view -v symlink myview cmake@3.5.2
==> Linking package: "ncurses"
==> Linking package: "zlib"
==> Linking package: "openssl"
==> Linking package: "cmake"
-
+
$ ls myview/
bin doc etc include lib share
$ ls myview/bin/
captoinfo clear cpack ctest infotocap openssl tabs toe tset
ccmake cmake c_rehash infocmp ncurses6-config reset tic tput
-
+
$ spack view -v -d false rm myview cmake@3.5.2
==> Removing package: "cmake"
-
+
$ ls myview/bin/
captoinfo c_rehash infotocap openssl tabs toe tset
clear infocmp ncurses6-config reset tic tput
@@ -1421,7 +1494,7 @@ Limitations of Filesystem Views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This section describes some limitations that should be considered in
-using filesystems views.
+using filesystems views.
Filesystem views are merely organizational. The binary executable
programs, shared libraries and other build products found in a view
diff --git a/lib/spack/docs/configuration.rst b/lib/spack/docs/configuration.rst
index c613071c65..a6f876b2aa 100644
--- a/lib/spack/docs/configuration.rst
+++ b/lib/spack/docs/configuration.rst
@@ -140,7 +140,6 @@ Here's an example packages.yaml file that sets preferred packages:
packages:
dyninst:
compiler: [gcc@4.9]
- variants: +debug
gperftools:
version: [2.2, 2.4, 2.3]
all:
@@ -150,8 +149,8 @@ Here's an example packages.yaml file that sets preferred packages:
At a high level, this example is specifying how packages should be
-concretized. The dyninst package should prefer using gcc 4.9 and
-be built with debug options. The gperftools package should prefer version
+concretized. The dyninst package should prefer using gcc 4.9.
+The gperftools package should prefer version
2.2 over 2.4. Every package on the system should prefer mvapich for
its MPI and gcc 4.4.7 (except for Dyninst, which overrides this by preferring gcc 4.9).
These options are used to fill in implicit defaults. Any of them can be overwritten
@@ -160,7 +159,7 @@ on the command line if explicitly requested.
Each packages.yaml file begins with the string ``packages:`` and
package names are specified on the next level. The special string ``all``
applies settings to each package. Underneath each package name is
-one or more components: ``compiler``, ``variants``, ``version``,
+one or more components: ``compiler``, ``version``,
or ``providers``. Each component has an ordered list of spec
``constraints``, with earlier entries in the list being preferred over
later entries.
diff --git a/lib/spack/docs/developer_guide.rst b/lib/spack/docs/developer_guide.rst
index 0b618aa683..d28fe4b2a5 100644
--- a/lib/spack/docs/developer_guide.rst
+++ b/lib/spack/docs/developer_guide.rst
@@ -80,10 +80,11 @@ with a high level view of Spack's directory structure::
var/
spack/ <- build & stage directories
- repos/ <- contains package repositories
- builtin/ <- pkg repository that comes with Spack
- repo.yaml <- descriptor for the builtin repository
- packages/ <- directories under here contain packages
+ repos/ <- contains package repositories
+ builtin/ <- pkg repository that comes with Spack
+ repo.yaml <- descriptor for the builtin repository
+ packages/ <- directories under here contain packages
+ cache/ <- saves resources downloaded during installs
opt/
spack/ <- packages are installed here
diff --git a/lib/spack/docs/mirrors.rst b/lib/spack/docs/mirrors.rst
index dad04d053b..583575a565 100644
--- a/lib/spack/docs/mirrors.rst
+++ b/lib/spack/docs/mirrors.rst
@@ -214,3 +214,21 @@ Adding a mirror really adds a line in ``~/.spack/mirrors.yaml``::
If you want to change the order in which mirrors are searched for
packages, you can edit this file and reorder the sections. Spack will
search the topmost mirror first and the bottom-most mirror last.
+
+.. _caching:
+
+Local Default Cache
+----------------------------
+
+Spack caches resources that are downloaded as part of installs. The cache is
+a valid spack mirror: it uses the same directory structure and naming scheme
+as other Spack mirrors (so it can be copied anywhere and referenced with a URL
+like other mirrors). The mirror is maintained locally (within the Spack
+installation directory) at :file:`var/spack/cache/`. It is always enabled (and
+is always searched first when attempting to retrieve files for an installation)
+but can be cleared with :ref:`purge <spack-purge>`; the cache directory can also
+be deleted manually without issue.
+
+Caching includes retrieved tarball archives and source control repositories, but
+only resources with an associated digest or commit ID (e.g. a revision number
+for SVN) will be cached.
diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst
index 54b886310a..6cea4da14f 100644
--- a/lib/spack/docs/packaging_guide.rst
+++ b/lib/spack/docs/packaging_guide.rst
@@ -377,6 +377,8 @@ add a line like this in the package class:
version('8.2.1', '4136d7b4c04df68b686570afa26988ac')
...
+Versions should be listed with the newest version first.
+
Version URLs
~~~~~~~~~~~~~~~~~
@@ -385,8 +387,21 @@ in the package. For example, Spack is smart enough to download
version ``8.2.1.`` of the ``Foo`` package above from
``http://example.com/foo-8.2.1.tar.gz``.
-If spack *cannot* extrapolate the URL from the ``url`` field, or if
-the package doesn't have a ``url`` field, you can add a URL explicitly
+If spack *cannot* extrapolate the URL from the ``url`` field by
+default, you can write your own URL generation algorithm in place of
+the ``url`` declaration. For example:
+
+.. code-block:: python
+ :linenos:
+
+ class Foo(Package):
+ def url_for_version(self, version):
+ return 'http://example.com/version_%s/foo-%s.tar.gz' \
+ % (version, version)
+ version('8.2.1', '4136d7b4c04df68b686570afa26988ac')
+ ...
+
+If a URL cannot be derived systematically, you can add an explicit URL
for a particular version:
.. code-block:: python
@@ -703,6 +718,13 @@ Fetching a revision
Subversion branches are handled as part of the directory structure, so
you can check out a branch or tag by changing the ``url``.
+Automatic caching of files fetched during installation
+------------------------------------------------------
+
+Spack maintains a cache (described :ref:`here <caching>`) which saves files
+retrieved during package installations to avoid re-downloading in the case that
+a package is installed with a different specification (but the same version) or
+reinstalled on account of a change in the hashing scheme.
.. _license:
@@ -776,7 +798,7 @@ Spack will create a global license file located at
file using the editor set in ``$EDITOR``, or vi if unset. It will look like
this:
-.. code-block::
+.. code-block:: sh
# A license is required to use pgi.
#
@@ -807,7 +829,7 @@ You can add your license directly to this file, or tell FlexNet to use a
license stored on a separate license server. Here is an example that
points to a license server called licman1:
-.. code-block::
+.. code-block:: sh
SERVER licman1.mcs.anl.gov 00163eb7fba5 27200
USE_SERVER
@@ -1339,6 +1361,19 @@ Now, the ``py-numpy`` package can be used as an argument to ``spack
activate``. When it is activated, all the files in its prefix will be
symbolically linked into the prefix of the python package.
+Many packages produce Python extensions for *some* variants, but not
+others: they should extend ``python`` only if the apropriate
+variant(s) are selected. This may be accomplished with conditional
+``extends()`` declarations:
+
+.. code-block:: python
+
+ class FooLib(Package):
+ variant('python', default=True, description= \
+ 'Build the Python extension Module')
+ extends('python', when='+python')
+ ...
+
Sometimes, certain files in one package will conflict with those in
another, which means they cannot both be activated (symlinked) at the
same time. In this case, you can tell Spack to ignore those files
@@ -1844,7 +1879,7 @@ discover its dependencies.
If you want to see the environment that a package will build with, or
if you want to run commands in that environment to test them out, you
-can use the :ref:```spack env`` <spack-env>` command, documented
+can use the :ref:`spack env <spack-env>` command, documented
below.
.. _compiler-wrappers:
@@ -2524,6 +2559,59 @@ File functions
.. _package-lifecycle:
+Coding Style Guidelines
+---------------------------
+
+The following guidelines are provided, in the interests of making
+Spack packages work in a consistent manner:
+
+
+Variant Names
+~~~~~~~~~~~~~~
+
+Spack packages with variants similar to already-existing Spack
+packages should use the same name for their variants. Standard
+variant names are:
+
+======= ======== ========================
+Name Default Description
+------- -------- ------------------------
+shared True Build shared libraries
+static Build static libraries
+mpi Use MPI
+python Build Python extension
+------- -------- ------------------------
+
+If specified in this table, the corresponding default should be used
+when declaring a variant.
+
+
+Version Lists
+~~~~~~~~~~~~~~
+
+Spack packges should list supported versions with the newest first.
+
+Special Versions
+~~~~~~~~~~~~~~~~~
+
+The following *special* version names may be used when building a package:
+
+* *@system*: Indicates a hook to the OS-installed version of the
+ package. This is useful, for example, to tell Spack to use the
+ OS-installed version in ``packages.yaml``::
+
+ openssl:
+ paths:
+ openssl@system: /usr
+ buildable: False
+
+ Certain Spack internals look for the *@system* version and do
+ appropriate things in that case.
+
+* *@local*: Indicates the version was built manually from some source
+ tree of unknown provenance (see ``spack setup``).
+
+
Packaging workflow commands
---------------------------------
@@ -2618,11 +2706,16 @@ build process will start from scratch.
``spack purge``
~~~~~~~~~~~~~~~~~
-Cleans up all of Spack's temporary files. Use this to recover disk
-space if temporary files from interrupted or failed installs
-accumulate in the staging area. This is equivalent to running ``spack
-clean`` for every package you have fetched or staged.
+Cleans up all of Spack's temporary and cached files. This can be used to
+recover disk space if temporary files from interrupted or failed installs
+accumulate in the staging area.
+
+When called with ``--stage`` or ``--all`` (or without arguments, in which case
+the default is ``--all``) this removes all staged files; this is equivalent to
+running ``spack clean`` for every package you have fetched or staged.
+When called with ``--cache`` or ``--all`` this will clear all resources
+:ref:`cached <caching>` during installs.
Keeping the stage directory on success
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2839,3 +2932,109 @@ might write:
DWARF_PREFIX = $(spack location -i libdwarf)
CXXFLAGS += -I$DWARF_PREFIX/include
CXXFLAGS += -L$DWARF_PREFIX/lib
+
+Build System Configuration Support
+----------------------------------
+
+Imagine a developer creating a CMake-based (or Autotools) project in a local
+directory, which depends on libraries A-Z. Once Spack has installed
+those dependencies, one would like to run ``cmake`` with appropriate
+command line and environment so CMake can find them. The ``spack
+setup`` command does this conveniently, producing a CMake
+configuration that is essentially the same as how Spack *would have*
+configured the project. This can be demonstrated with a usage
+example:
+
+.. code-block:: bash
+
+ cd myproject
+ spack setup myproject@local
+ mkdir build; cd build
+ ../spconfig.py ..
+ make
+ make install
+
+Notes:
+ * Spack must have ``myproject/package.py`` in its repository for
+ this to work.
+ * ``spack setup`` produces the executable script ``spconfig.py`` in
+ the local directory, and also creates the module file for the
+ package. ``spconfig.py`` is normally run from the user's
+ out-of-source build directory.
+ * The version number given to ``spack setup`` is arbitrary, just
+ like ``spack diy``. ``myproject/package.py`` does not need to
+ have any valid downloadable versions listed (typical when a
+ project is new).
+ * spconfig.py produces a CMake configuration that *does not* use the
+ Spack wrappers. Any resulting binaries *will not* use RPATH,
+ unless the user has enabled it. This is recommended for
+ development purposes, not production.
+ * ``spconfig.py`` is human readable, and can serve as a developer
+ reference of what dependencies are being used.
+ * ``make install`` installs the package into the Spack repository,
+ where it may be used by other Spack packages.
+ * CMake-generated makefiles re-run CMake in some circumstances. Use
+ of ``spconfig.py`` breaks this behavior, requiring the developer
+ to manually re-run ``spconfig.py`` when a ``CMakeLists.txt`` file
+ has changed.
+
+CMakePackage
+~~~~~~~~~~~~
+
+In order ot enable ``spack setup`` functionality, the author of
+``myproject/package.py`` must subclass from ``CMakePackage`` instead
+of the standard ``Package`` superclass. Because CMake is
+standardized, the packager does not need to tell Spack how to run
+``cmake; make; make install``. Instead the packager only needs to
+create (optional) methods ``configure_args()`` and ``configure_env()``, which
+provide the arguments (as a list) and extra environment variables (as
+a dict) to provide to the ``cmake`` command. Usually, these will
+translate variant flags into CMake definitions. For example:
+
+.. code-block:: python
+
+ def configure_args(self):
+ spec = self.spec
+ return [
+ '-DUSE_EVERYTRACE=%s' % ('YES' if '+everytrace' in spec else 'NO'),
+ '-DBUILD_PYTHON=%s' % ('YES' if '+python' in spec else 'NO'),
+ '-DBUILD_GRIDGEN=%s' % ('YES' if '+gridgen' in spec else 'NO'),
+ '-DBUILD_COUPLER=%s' % ('YES' if '+coupler' in spec else 'NO'),
+ '-DUSE_PISM=%s' % ('YES' if '+pism' in spec else 'NO')]
+
+If needed, a packager may also override methods defined in
+``StagedPackage`` (see below).
+
+
+StagedPackage
+~~~~~~~~~~~~~
+
+``CMakePackage`` is implemented by subclassing the ``StagedPackage``
+superclass, which breaks down the standard ``Package.install()``
+method into several sub-stages: ``setup``, ``configure``, ``build``
+and ``install``. Details:
+
+* Instead of implementing the standard ``install()`` method, package
+ authors implement the methods for the sub-stages
+ ``install_setup()``, ``install_configure()``,
+ ``install_build()``, and ``install_install()``.
+
+* The ``spack install`` command runs the sub-stages ``configure``,
+ ``build`` and ``install`` in order. (The ``setup`` stage is
+ not run by default; see below).
+* The ``spack setup`` command runs the sub-stages ``setup``
+ and a dummy install (to create the module file).
+* The sub-stage install methods take no arguments (other than
+ ``self``). The arguments ``spec`` and ``prefix`` to the standard
+ ``install()`` method may be accessed via ``self.spec`` and
+ ``self.prefix``.
+
+GNU Autotools
+~~~~~~~~~~~~~
+
+The ``setup`` functionality is currently only available for
+CMake-based packages. Extending this functionality to GNU
+Autotools-based packages would be easy (and should be done by a
+developer who actively uses Autotools). Packages that use
+non-standard build systems can gain ``setup`` functionality by
+subclassing ``StagedPackage`` directly.
diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py
index d72e8bae92..e800c6717a 100644
--- a/lib/spack/llnl/util/filesystem.py
+++ b/lib/spack/llnl/util/filesystem.py
@@ -48,7 +48,7 @@ __all__ = ['set_install_permissions', 'install', 'install_tree',
def filter_file(regex, repl, *filenames, **kwargs):
"""Like sed, but uses python regular expressions.
- Filters every line of file through regex and replaces the file
+ Filters every line of each file through regex and replaces the file
with a filtered version. Preserves mode of filtered files.
As with re.sub, ``repl`` can be either a string or a callable.
@@ -59,7 +59,7 @@ def filter_file(regex, repl, *filenames, **kwargs):
Keyword Options:
string[=False] If True, treat regex as a plain string.
- backup[=True] Make a backup files suffixed with ~
+ backup[=True] Make backup file(s) suffixed with ~
ignore_absent[=False] Ignore any files that don't exist.
"""
string = kwargs.get('string', False)
@@ -80,26 +80,26 @@ def filter_file(regex, repl, *filenames, **kwargs):
regex = re.escape(regex)
for filename in filenames:
- backup = filename + "~"
+ backup_filename = filename + "~"
if ignore_absent and not os.path.exists(filename):
continue
- shutil.copy(filename, backup)
+ shutil.copy(filename, backup_filename)
try:
- with closing(open(backup)) as infile:
+ with closing(open(backup_filename)) as infile:
with closing(open(filename, 'w')) as outfile:
for line in infile:
foo = re.sub(regex, repl, line)
outfile.write(foo)
except:
# clean up the original file on failure.
- shutil.move(backup, filename)
+ shutil.move(backup_filename, filename)
raise
finally:
if not backup:
- shutil.rmtree(backup, ignore_errors=True)
+ os.remove(backup_filename)
class FileFilter(object):
@@ -114,7 +114,7 @@ class FileFilter(object):
def change_sed_delimiter(old_delim, new_delim, *filenames):
"""Find all sed search/replace commands and change the delimiter.
e.g., if the file contains seds that look like 's///', you can
- call change_sed_delimeter('/', '@', file) to change the
+ call change_sed_delimiter('/', '@', file) to change the
delimiter to '@'.
NOTE that this routine will fail if the delimiter is ' or ".
@@ -179,7 +179,7 @@ def install(src, dest):
"""Manually install a file to a particular location."""
tty.debug("Installing %s to %s" % (src, dest))
- # Expand dsst to its eventual full path if it is a directory.
+ # Expand dest to its eventual full path if it is a directory.
if os.path.isdir(dest):
dest = join_path(dest, os.path.basename(src))
@@ -219,7 +219,7 @@ def mkdirp(*paths):
if not os.path.exists(path):
os.makedirs(path)
elif not os.path.isdir(path):
- raise OSError(errno.EEXIST, "File alredy exists", path)
+ raise OSError(errno.EEXIST, "File already exists", path)
def force_remove(*paths):
@@ -309,7 +309,7 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs):
Optional args:
- order=[pre|post] -- Whether to do pre- or post-order traveral.
+ order=[pre|post] -- Whether to do pre- or post-order traversal.
ignore=<predicate> -- Predicate indicating which files to ignore.
@@ -414,7 +414,7 @@ def fix_darwin_install_name(path):
currently won't follow subfolders.
Args:
- path: directory in which .dylib files are alocated
+ path: directory in which .dylib files are located
"""
libs = glob.glob(join_path(path, "*.dylib"))
@@ -438,7 +438,7 @@ def to_link_flags(library):
A string of linking flags.
"""
dir = os.path.dirname(library)
- # Asume libXYZ.suffix
+ # Assume libXYZ.suffix
name = os.path.basename(library)[3:].split(".")[0]
res = '-L%s -l%s' % (dir, name)
return res
diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py
index 75ddca1abc..20c9934704 100644
--- a/lib/spack/spack/__init__.py
+++ b/lib/spack/spack/__init__.py
@@ -48,6 +48,10 @@ var_path = join_path(spack_root, "var", "spack")
stage_path = join_path(var_path, "stage")
repos_path = join_path(var_path, "repos")
share_path = join_path(spack_root, "share", "spack")
+cache_path = join_path(var_path, "cache")
+
+import spack.fetch_strategy
+cache = spack.fetch_strategy.FsCache(cache_path)
prefix = spack_root
opt_path = join_path(prefix, "opt")
@@ -172,8 +176,10 @@ sys_type = None
# TODO: it's not clear where all the stuff that needs to be included in packages
# should live. This file is overloaded for spack core vs. for packages.
#
-__all__ = ['Package', 'Version', 'when', 'ver']
+__all__ = ['Package', 'StagedPackage', 'CMakePackage', \
+ 'Version', 'when', 'ver']
from spack.package import Package, ExtensionConflictError
+from spack.package import StagedPackage, CMakePackage
from spack.version import Version, ver
from spack.multimethod import when
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py
index cbac7b41d6..a7cda2bf68 100644
--- a/lib/spack/spack/architecture.py
+++ b/lib/spack/spack/architecture.py
@@ -91,16 +91,10 @@ from spack.util.multiproc import parmap
import spack.error as serr
-class InvalidSysTypeError(serr.SpackError):
- def __init__(self, sys_type):
- super(InvalidSysTypeError, self).__init__(
- "Invalid sys_type value for Spack: " + sys_type)
-
-
-class NoSysTypeError(serr.SpackError):
+class NoPlatformError(serr.SpackError):
def __init__(self):
- super(NoSysTypeError, self).__init__(
- "Could not determine sys_type for this machine.")
+ super(NoPlatformError, self).__init__(
+ "Could not determine a platform for this machine.")
@key_ordering
@@ -345,14 +339,17 @@ class OperatingSystem(object):
@key_ordering
class Arch(object):
- "Architecture is now a class to help with setting attributes"
-
- def __init__(self, platform=None, platform_os=None, target=None):
- self.platform = platform
- if platform and platform_os:
- platform_os = self.platform.operating_system(platform_os)
- self.platform_os = platform_os
- if platform and target:
+ """Architecture is now a class to help with setting attributes.
+
+ TODO: refactor so that we don't need this class.
+ """
+
+ def __init__(self, plat=None, os=None, target=None):
+ self.platform = plat
+ if plat and os:
+ os = self.platform.operating_system(os)
+ self.platform_os = os
+ if plat and target:
target = self.platform.target(target)
self.target = target
@@ -409,27 +406,27 @@ class Arch(object):
return d
-def _target_from_dict(target_name, platform=None):
+def _target_from_dict(target_name, plat=None):
""" Creates new instance of target and assigns all the attributes of
that target from the dictionary
"""
- if not platform:
- platform = sys_type()
- return platform.target(target_name)
+ if not plat:
+ plat = platform()
+ return plat.target(target_name)
-def _operating_system_from_dict(os_name, platform=None):
+def _operating_system_from_dict(os_name, plat=None):
""" uses platform's operating system method to grab the constructed
operating systems that are valid on the platform.
"""
- if not platform:
- platform = sys_type()
+ if not plat:
+ plat = platform()
if isinstance(os_name, dict):
name = os_name['name']
version = os_name['version']
- return platform.operating_system(name+version)
+ return plat.operating_system(name+version)
else:
- return platform.operating_system(os_name)
+ return plat.operating_system(os_name)
def _platform_from_dict(platform_name):
@@ -504,16 +501,35 @@ def all_platforms():
@memoized
-def sys_type():
- """ Gather a list of all available subclasses of platforms.
- Sorts the list according to their priority looking. Priority is
- an arbitrarily set number. Detects platform either using uname or
- a file path (/opt/cray...)
+def platform():
+ """Detects the platform for this machine.
+
+ Gather a list of all available subclasses of platforms.
+ Sorts the list according to their priority looking. Priority is
+ an arbitrarily set number. Detects platform either using uname or
+ a file path (/opt/cray...)
"""
# Try to create a Platform object using the config file FIRST
platform_list = all_platforms()
platform_list.sort(key=lambda a: a.priority)
- for platform in platform_list:
- if platform.detect():
- return platform()
+ for platform_cls in platform_list:
+ if platform_cls.detect():
+ return platform_cls()
+
+
+@memoized
+def sys_type():
+ """Print out the "default" platform-os-target tuple for this machine.
+
+ On machines with only one target OS/target, prints out the
+ platform-os-target for the frontend. For machines with a frontend
+ and a backend, prints the default backend.
+
+ TODO: replace with use of more explicit methods to get *all* the
+ backends, as client code should really be aware of cross-compiled
+ architectures.
+
+ """
+ arch = Arch(platform(), 'default_os', 'default_target')
+ return str(arch)
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 99c4cae020..7220539886 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -266,6 +266,8 @@ def set_build_environment_variables(pkg, env):
# can affect how some packages find libraries. We want to make
# sure that builds never pull in unintended external dependencies.
env.unset('LD_LIBRARY_PATH')
+ env.unset('LIBRARY_PATH')
+ env.unset('CPATH')
env.unset('LD_RUN_PATH')
env.unset('DYLD_LIBRARY_PATH')
diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py
index 8cbb367f86..f5f234d7a7 100644
--- a/lib/spack/spack/cmd/create.py
+++ b/lib/spack/spack/cmd/create.py
@@ -95,9 +95,9 @@ class ${class_name}(Package):
url = "${url}"
${versions}
-${extends}
- # FIXME: Add dependencies if this package requires them.
- # depends_on("foo")
+
+ # FIXME: Add additional dependencies if required.
+ ${dependencies}
def install(self, spec, prefix):
${install}
@@ -136,8 +136,18 @@ def setup_parser(subparser):
class ConfigureGuesser(object):
def __call__(self, stage):
"""Try to guess the type of build system used by the project.
- Set the appropriate default installation instructions and any
- necessary extensions for Python and R."""
+ Set any necessary build dependencies or extensions.
+ Set the appropriate default installation instructions."""
+
+ # Build dependencies and extensions
+ dependenciesDict = {
+ 'autotools': "# depends_on('foo')",
+ 'cmake': "depends_on('cmake')",
+ 'scons': "depends_on('scons')",
+ 'python': "extends('python')",
+ 'R': "extends('R')",
+ 'unknown': "# depends_on('foo')"
+ }
# Default installation instructions
installDict = {
@@ -214,16 +224,12 @@ class ConfigureGuesser(object):
self.build_system = build_system
+ # Set any necessary build dependencies or extensions.
+ self.dependencies = dependenciesDict[build_system]
+
# Set the appropriate default installation instructions
self.install = installDict[build_system]
- # Set any necessary extensions for Python and R
- extensions = ''
- if build_system in ['python', 'R']:
- extensions = "\n extends('{0}')\n".format(build_system)
-
- self.extends = extensions
-
def guess_name_and_version(url, args):
# Try to deduce name and version of the new package from the URL
@@ -361,7 +367,7 @@ def create(parser, args):
class_name=mod_to_class(name),
url=url,
versions=make_version_calls(ver_hash_tuples),
- extends=guesser.extends,
+ dependencies=guesser.dependencies,
install=guesser.install))
# If everything checks out, go ahead and edit.
diff --git a/lib/spack/spack/cmd/load.py b/lib/spack/spack/cmd/load.py
index 54cf01eb43..205abbb6b3 100644
--- a/lib/spack/spack/cmd/load.py
+++ b/lib/spack/spack/cmd/load.py
@@ -31,7 +31,7 @@ def setup_parser(subparser):
"""Parser is only constructed so that this prints a nice help
message with -h. """
subparser.add_argument(
- 'spec', nargs=argparse.REMAINDER, help='Spec of package to load with modules.')
+ 'spec', nargs=argparse.REMAINDER, help="Spec of package to load with modules. (If -, read specs from STDIN)")
def load(parser, args):
diff --git a/lib/spack/spack/cmd/module.py b/lib/spack/spack/cmd/module.py
index 5292d42225..3cefb512c2 100644
--- a/lib/spack/spack/cmd/module.py
+++ b/lib/spack/spack/cmd/module.py
@@ -22,6 +22,7 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
+from __future__ import print_function
import os
import shutil
import sys
@@ -41,46 +42,98 @@ def setup_parser(subparser):
sp.add_parser('refresh', help='Regenerate all module files.')
find_parser = sp.add_parser('find', help='Find module files for packages.')
- find_parser.add_argument('module_type',
- help="Type of module to find file for. [" +
- '|'.join(module_types) + "]")
- find_parser.add_argument('spec',
- nargs='+',
- help='spec to find a module file for.')
+ find_parser.add_argument(
+ 'module_type',
+ help="Type of module to find file for. [" +
+ '|'.join(module_types) + "]")
-def module_find(mtype, spec_array):
+ find_parser.add_argument(
+ '-r', '--dependencies', action='store_true',
+ dest='recurse_dependencies',
+ help='Recursively traverse dependencies for modules to load.')
+
+ find_parser.add_argument(
+ '-s', '--shell', action='store_true', dest='shell',
+ help='Generate shell script (instead of input for module command)')
+
+ find_parser.add_argument(
+ '-p', '--prefix', dest='prefix',
+ help='Prepend to module names when issuing module load commands')
+
+ find_parser.add_argument(
+ 'spec', nargs='+',
+ help='spec to find a module file for.')
+
+
+def module_find(mtype, flags, spec_array):
"""Look at all installed packages and see if the spec provided
matches any. If it does, check whether there is a module file
of type <mtype> there, and print out the name that the user
should type to use that package's module.
+ prefix:
+ Prepend this to module names when issuing "module load" commands.
+ Some systems seem to need it.
"""
if mtype not in module_types:
tty.die("Invalid module type: '%s'. Options are %s" %
(mtype, comma_or(module_types)))
- specs = spack.cmd.parse_specs(spec_array)
- if len(specs) > 1:
- tty.die("You can only pass one spec.")
- spec = specs[0]
-
- specs = spack.installed_db.query(spec)
- if len(specs) == 0:
- tty.die("No installed packages match spec %s" % spec)
-
- if len(specs) > 1:
- tty.error("Multiple matches for spec %s. Choose one:" % spec)
- for s in specs:
- sys.stderr.write(s.tree(color=True))
- sys.exit(1)
-
- mt = module_types[mtype]
- mod = mt(specs[0])
- if not os.path.isfile(mod.file_name):
- tty.die("No %s module is installed for %s" % (mtype, spec))
-
- print(mod.use_name)
-
+ # --------------------------------------
+ def _find_modules(spec, modules_list):
+ """Finds all modules and sub-modules for a spec"""
+ if str(spec.version) == 'system':
+ # No Spack module for system-installed packages
+ return
+
+ if flags.recurse_dependencies:
+ for dep in spec.dependencies.values():
+ _find_modules(dep, modules_list)
+
+ mod = module_types[mtype](spec)
+ if not os.path.isfile(mod.file_name):
+ tty.die("No %s module is installed for %s" % (mtype, spec))
+ modules_list.append((spec, mod))
+
+
+ # --------------------------------------
+ raw_specs = spack.cmd.parse_specs(spec_array)
+ modules = set() # Modules we will load
+ seen = set()
+ for raw_spec in raw_specs:
+
+ # ----------- Make sure the spec only resolves to ONE thing
+ specs = spack.installed_db.query(raw_spec)
+ if len(specs) == 0:
+ tty.die("No installed packages match spec %s" % raw_spec)
+
+ if len(specs) > 1:
+ tty.error("Multiple matches for spec %s. Choose one:" % spec)
+ for s in specs:
+ sys.stderr.write(s.tree(color=True))
+ sys.exit(1)
+ spec = specs[0]
+
+ # ----------- Chase down modules for it and all its dependencies
+ modules_dups = list()
+ _find_modules(spec, modules_dups)
+
+ # Remove duplicates while keeping order
+ modules_unique = list()
+ for spec,mod in modules_dups:
+ if mod.use_name not in seen:
+ modules_unique.append((spec,mod))
+ seen.add(mod.use_name)
+
+ # Output...
+ if flags.shell:
+ module_cmd = {'tcl': 'module load', 'dotkit': 'dotkit use'}[mtype]
+ for spec,mod in modules_unique:
+ if flags.shell:
+ print('# %s' % spec.format())
+ print('%s %s%s' % (module_cmd, flags.prefix, mod.use_name))
+ else:
+ print(mod.use_name)
def module_refresh():
"""Regenerate all module files for installed packages known to
@@ -101,4 +154,4 @@ def module(parser, args):
module_refresh()
elif args.module_command == 'find':
- module_find(args.module_type, args.spec)
+ module_find(args.module_type, args, args.spec)
diff --git a/lib/spack/spack/cmd/purge.py b/lib/spack/spack/cmd/purge.py
index 7b33ef7f69..f4e27a3969 100644
--- a/lib/spack/spack/cmd/purge.py
+++ b/lib/spack/spack/cmd/purge.py
@@ -22,9 +22,31 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
+import spack
import spack.stage as stage
-description = "Remove all temporary build files and downloaded archives"
+description = "Remove temporary build files and/or downloaded archives"
+
+
+def setup_parser(subparser):
+ subparser.add_argument(
+ '-s', '--stage', action='store_true', default=True,
+ help="Remove all temporary build stages (default).")
+ subparser.add_argument(
+ '-c', '--cache', action='store_true', help="Remove cached downloads.")
+ subparser.add_argument(
+ '-a', '--all', action='store_true',
+ help="Remove all of the above.")
+
def purge(parser, args):
- stage.purge()
+ # Special case: no flags.
+ if not any((args.stage, args.cache, args.all)):
+ stage.purge()
+ return
+
+ # handle other flags with fall through.
+ if args.stage or args.all:
+ stage.purge()
+ if args.cache or args.all:
+ spack.cache.destroy()
diff --git a/lib/spack/spack/cmd/repo.py b/lib/spack/spack/cmd/repo.py
index 399237b169..cbd8f4784e 100644
--- a/lib/spack/spack/cmd/repo.py
+++ b/lib/spack/spack/cmd/repo.py
@@ -26,7 +26,7 @@ import os
import re
import shutil
-from external import argparse
+import argparse
import llnl.util.tty as tty
from llnl.util.filesystem import join_path, mkdirp
diff --git a/lib/spack/spack/cmd/setup.py b/lib/spack/spack/cmd/setup.py
new file mode 100644
index 0000000000..02e9bfd281
--- /dev/null
+++ b/lib/spack/spack/cmd/setup.py
@@ -0,0 +1,91 @@
+##############################################################################
+# Copyright (c) 2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Written by Elizabeth Fischer
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License (as published by
+# the Free Software Foundation) version 2.1 dated February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+import sys
+import os
+import argparse
+
+import llnl.util.tty as tty
+
+import spack
+import spack.cmd
+from spack.cmd.edit import edit_package
+from spack.stage import DIYStage
+
+description = "Create a configuration script and module, but don't build."
+
+def setup_parser(subparser):
+ subparser.add_argument(
+ '-i', '--ignore-dependencies', action='store_true', dest='ignore_deps',
+ help="Do not try to install dependencies of requested packages.")
+ subparser.add_argument(
+ '-v', '--verbose', action='store_true', dest='verbose',
+ help="Display verbose build output while installing.")
+ subparser.add_argument(
+ 'spec', nargs=argparse.REMAINDER,
+ help="specs to use for install. Must contain package AND verison.")
+
+
+def setup(self, args):
+ if not args.spec:
+ tty.die("spack setup requires a package spec argument.")
+
+ specs = spack.cmd.parse_specs(args.spec)
+ if len(specs) > 1:
+ tty.die("spack setup only takes one spec.")
+
+ # Take a write lock before checking for existence.
+ with spack.installed_db.write_transaction():
+ spec = specs[0]
+ if not spack.repo.exists(spec.name):
+ tty.warn("No such package: %s" % spec.name)
+ create = tty.get_yes_or_no("Create this package?", default=False)
+ if not create:
+ tty.msg("Exiting without creating.")
+ sys.exit(1)
+ else:
+ tty.msg("Running 'spack edit -f %s'" % spec.name)
+ edit_package(spec.name, spack.repo.first_repo(), None, True)
+ return
+
+ if not spec.versions.concrete:
+ tty.die("spack setup spec must have a single, concrete version. Did you forget a package version number?")
+
+ spec.concretize()
+ package = spack.repo.get(spec)
+
+ # It's OK if the package is already installed.
+
+ # Forces the build to run out of the current directory.
+ package.stage = DIYStage(os.getcwd())
+
+ # TODO: make this an argument, not a global.
+ spack.do_checksum = False
+
+ package.do_install(
+ keep_prefix=True, # Don't remove install directory, even if you think you should
+ ignore_deps=args.ignore_deps,
+ verbose=args.verbose,
+ keep_stage=True, # don't remove source dir for SETUP.
+ install_phases = set(['setup', 'provenance']))
diff --git a/lib/spack/spack/cmd/test.py b/lib/spack/spack/cmd/test.py
index cb9dd26c71..36810321ef 100644
--- a/lib/spack/spack/cmd/test.py
+++ b/lib/spack/spack/cmd/test.py
@@ -31,6 +31,7 @@ from llnl.util.lang import list_modules
import spack
import spack.test
+from spack.fetch_strategy import FetchError
description ="Run unit tests"
@@ -50,6 +51,24 @@ def setup_parser(subparser):
help="verbose output")
+class MockCache(object):
+ def store(self, copyCmd, relativeDst):
+ pass
+
+ def fetcher(self, targetPath, digest):
+ return MockCacheFetcher()
+
+
+class MockCacheFetcher(object):
+ def set_stage(self, stage):
+ pass
+
+ def fetch(self):
+ raise FetchError("Mock cache always fails for tests")
+
+ def __str__(self):
+ return "[mock fetcher]"
+
def test(parser, args):
if args.list:
print "Available tests:"
@@ -66,4 +85,5 @@ def test(parser, args):
if not os.path.exists(outputDir):
mkdirp(outputDir)
+ spack.cache = MockCache()
spack.test.run(args.names, outputDir, args.verbose)
diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py
index a70d42982f..0ba94741da 100644
--- a/lib/spack/spack/compilers/__init__.py
+++ b/lib/spack/spack/compilers/__init__.py
@@ -93,7 +93,7 @@ def get_compiler_config(scope=None, init_config=True):
for compiler in compilers:
compilers_dict.append(_to_dict(compiler))
spack.config.update_config('compilers', compilers_dict, scope=scope)
-
+
config = spack.config.get_config('compilers', scope=scope)
# Update the configuration if there are currently no compilers
# configured. Avoid updating automatically if there ARE site
@@ -142,8 +142,8 @@ def remove_compiler_from_config(compiler_spec, scope=None):
"""
compiler_config = get_compiler_config(scope)
config_length = len(compiler_config)
-
- filtered_compiler_config = [comp for comp in compiler_config
+
+ filtered_compiler_config = [comp for comp in compiler_config
if spack.spec.CompilerSpec(comp['compiler']['spec']) != compiler_spec]
# Need a better way for this
global _cache_config_file
@@ -315,7 +315,7 @@ def all_os_classes():
"""
classes = []
- platform = spack.architecture.sys_type()
+ platform = spack.architecture.platform()
for os_class in platform.operating_sys.values():
classes.append(os_class)
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 1f37455c77..f792008c49 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -221,7 +221,7 @@ class DefaultConcretizer(object):
if isinstance(spec.root.architecture.platform,spack.architecture.Platform):
spec.architecture.platform = spec.root.architecture.platform
else:
- spec.architecture.platform = spack.architecture.sys_type()
+ spec.architecture.platform = spack.architecture.platform()
return True #changed?
def concretize_architecture(self, spec):
@@ -334,7 +334,7 @@ class DefaultConcretizer(object):
Default specs set at the compiler level will still be added later.
"""
-
+
if not spec.architecture.platform_os:
#Although this usually means changed, this means awaiting other changes
return True
@@ -347,7 +347,7 @@ class DefaultConcretizer(object):
and flag in p.compiler_flags))
if not flag in spec.compiler_flags or \
not (sorted(spec.compiler_flags[flag]) >= sorted(nearest.compiler_flags[flag])):
- if flag in spec.compiler_flags:
+ if flag in spec.compiler_flags:
spec.compiler_flags[flag] = list(set(spec.compiler_flags[flag]) |
set(nearest.compiler_flags[flag]))
else:
diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py
index db0787edc6..84179e1469 100644
--- a/lib/spack/spack/config.py
+++ b/lib/spack/spack/config.py
@@ -307,6 +307,8 @@ section_schemas = {
'autoload': {'$ref': '#/definitions/dependency_selection'},
'prerequisites': {'$ref': '#/definitions/dependency_selection'},
'conflict': {'$ref': '#/definitions/array_of_strings'},
+ 'load': {'$ref': '#/definitions/array_of_strings'},
+ 'suffixes': {'$ref': '#/definitions/dictionary_of_strings'},
'environment': {
'type': 'object',
'default': {},
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py
index f941346bb1..a4bbff3d5a 100644
--- a/lib/spack/spack/database.py
+++ b/lib/spack/spack/database.py
@@ -631,11 +631,13 @@ class WriteTransaction(_Transaction):
class CorruptDatabaseError(SpackError):
def __init__(self, path, msg=''):
super(CorruptDatabaseError, self).__init__(
- "Spack database is corrupt: %s. %s" % (path, msg))
+ "Spack database is corrupt: %s. %s." + \
+ "Try running `spack reindex` to fix." % (path, msg))
class InvalidDatabaseVersionError(SpackError):
def __init__(self, expected, found):
super(InvalidDatabaseVersionError, self).__init__(
- "Expected database version %s but found version %s" %
+ "Expected database version %s but found version %s." + \
+ "Try running `spack reindex` to fix." %
(expected, found))
diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py
index 7e20365b0f..ee13e2dcbc 100644
--- a/lib/spack/spack/directory_layout.py
+++ b/lib/spack/spack/directory_layout.py
@@ -165,7 +165,7 @@ class DirectoryLayout(object):
class YamlDirectoryLayout(DirectoryLayout):
"""Lays out installation directories like this::
<install root>/
- <target>/
+ <platform-os-target>/
<compiler>-<compiler version>/
<name>-<version>-<variants>-<hash>
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index afd293e4ec..38133ee0ca 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -307,7 +307,7 @@ class URLFetchStrategy(FetchStrategy):
if not self.archive_file:
raise NoArchiveFileError("Cannot call archive() before fetching.")
- shutil.move(self.archive_file, destination)
+ shutil.copy(self.archive_file, destination)
@_needs_stage
def check(self):
@@ -345,7 +345,7 @@ class URLFetchStrategy(FetchStrategy):
def __repr__(self):
url = self.url if self.url else "no url"
- return "URLFetchStrategy<%s>" % url
+ return "%s<%s>" % (self.__class__.__name__, url)
def __str__(self):
if self.url:
@@ -354,6 +354,24 @@ class URLFetchStrategy(FetchStrategy):
return "[no url]"
+class CacheURLFetchStrategy(URLFetchStrategy):
+ """The resource associated with a cache URL may be out of date."""
+ def __init__(self, *args, **kwargs):
+ super(CacheURLFetchStrategy, self).__init__(*args, **kwargs)
+
+ @_needs_stage
+ def fetch(self):
+ super(CacheURLFetchStrategy, self).fetch()
+ if self.digest:
+ try:
+ self.check()
+ except ChecksumError:
+ # Future fetchers will assume they don't need to download if the
+ # file remains
+ os.remove(self.archive_file)
+ raise
+
+
class VCSFetchStrategy(FetchStrategy):
def __init__(self, name, *rev_types, **kwargs):
@@ -812,6 +830,35 @@ def for_package_version(pkg, version):
raise InvalidArgsError(pkg, version)
+class FsCache(object):
+ def __init__(self, root):
+ self.root = os.path.abspath(root)
+
+ def store(self, fetcher, relativeDst):
+ unique = False
+ uidGroups = [['tag', 'commit'], ['digest'], ['revision']]
+ for grp in uidGroups:
+ try:
+ unique |= any(getattr(fetcher, x) for x in grp)
+ except AttributeError:
+ pass
+ if unique:
+ break
+ if not unique:
+ return
+
+ dst = join_path(self.root, relativeDst)
+ mkdirp(os.path.dirname(dst))
+ fetcher.archive(dst)
+
+ def fetcher(self, targetPath, digest):
+ url = "file://" + join_path(self.root, targetPath)
+ return CacheURLFetchStrategy(url, digest)
+
+ def destroy(self):
+ shutil.rmtree(self.root, ignore_errors=True)
+
+
class FetchError(spack.error.SpackError):
def __init__(self, msg, long_msg=None):
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py
index d2b819e80a..ce46047fa3 100644
--- a/lib/spack/spack/modules.py
+++ b/lib/spack/spack/modules.py
@@ -285,11 +285,18 @@ class EnvModule(object):
naming_tokens = self.tokens
naming_scheme = self.naming_scheme
name = naming_scheme.format(**naming_tokens)
- name += '-' + self.spec.dag_hash(
- ) # Always append the hash to make the module file unique
# Not everybody is working on linux...
parts = name.split('/')
name = join_path(*parts)
+ # Add optional suffixes based on constraints
+ configuration, _ = parse_config_options(self)
+ suffixes = [name]
+ for constraint, suffix in configuration.get('suffixes', {}).items():
+ if constraint in self.spec:
+ suffixes.append(suffix)
+ # Always append the hash to make the module file unique
+ suffixes.append(self.spec.dag_hash())
+ name = '-'.join(suffixes)
return name
@property
@@ -381,6 +388,8 @@ class EnvModule(object):
for x in filter_blacklisted(
module_configuration.pop('autoload', []), self.name):
module_file_content += self.autoload(x)
+ for x in module_configuration.pop('load', []):
+ module_file_content += self.autoload(x)
for x in filter_blacklisted(
module_configuration.pop('prerequisites', []), self.name):
module_file_content += self.prerequisite(x)
@@ -402,8 +411,12 @@ class EnvModule(object):
return tuple()
def autoload(self, spec):
- m = type(self)(spec)
- return self.autoload_format.format(module_file=m.use_name)
+ if not isinstance(spec, str):
+ m = type(self)(spec)
+ module_file = m.use_name
+ else:
+ module_file = spec
+ return self.autoload_format.format(module_file=module_file)
def prerequisite(self, spec):
m = type(self)(spec)
@@ -441,7 +454,6 @@ class EnvModule(object):
class Dotkit(EnvModule):
name = 'dotkit'
- path = join_path(spack.share_path, "dotkit")
environment_modifications_formats = {
PrependPath: 'dk_alter {name} {value}\n',
@@ -454,7 +466,7 @@ class Dotkit(EnvModule):
@property
def file_name(self):
- return join_path(Dotkit.path, self.spec.architecture,
+ return join_path(spack.share_path, "dotkit", self.spec.architecture,
'%s.dk' % self.use_name)
@property
@@ -482,7 +494,6 @@ class Dotkit(EnvModule):
class TclModule(EnvModule):
name = 'tcl'
- path = join_path(spack.share_path, "modules")
environment_modifications_formats = {
PrependPath: 'prepend-path --delim "{delim}" {name} \"{value}\"\n',
@@ -503,7 +514,7 @@ class TclModule(EnvModule):
@property
def file_name(self):
- return join_path(TclModule.path, self.spec.architecture, self.use_name)
+ return join_path(spack.share_path, "modules", self.spec.architecture, self.use_name)
@property
def header(self):
diff --git a/lib/spack/spack/multimethod.py b/lib/spack/spack/multimethod.py
index 170ef3cea2..0818f9092f 100644
--- a/lib/spack/spack/multimethod.py
+++ b/lib/spack/spack/multimethod.py
@@ -149,7 +149,7 @@ class when(object):
@when('arch=chaos_5_x86_64_ib')
def install(self, prefix):
# This will be executed instead of the default install if
- # the package's sys_type() is chaos_5_x86_64_ib.
+ # the package's platform() is chaos_5_x86_64_ib.
@when('arch=bgqos_0")
def install(self, prefix):
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 6a61b3d52b..53c521b776 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -37,6 +37,8 @@ import os
import re
import textwrap
import time
+import glob
+import string
import llnl.util.tty as tty
import spack
@@ -50,6 +52,8 @@ import spack.mirror
import spack.repository
import spack.url
import spack.util.web
+
+from urlparse import urlparse
from StringIO import StringIO
from llnl.util.filesystem import *
from llnl.util.lang import *
@@ -58,9 +62,11 @@ from llnl.util.tty.log import log_output
from spack.stage import Stage, ResourceStage, StageComposite
from spack.util.compression import allowed_archive
from spack.util.environment import dump_environment
-from spack.util.executable import ProcessError
+from spack.util.executable import ProcessError, Executable, which
from spack.version import *
+from spack import directory_layout
from urlparse import urlparse
+
"""Allowed URL schemes for spack packages."""
_ALLOWED_URL_SCHEMES = ["http", "https", "ftp", "file", "git"]
@@ -748,6 +754,9 @@ class Package(object):
if spack.do_checksum and self.version in self.versions:
self.stage.check()
+ self.stage.cache_local()
+
+
def do_stage(self, mirror_only=False):
"""Unpacks the fetched tarball, then changes into the expanded tarball
directory."""
@@ -864,6 +873,7 @@ class Package(object):
resource_stage_folder = '-'.join(pieces)
return resource_stage_folder
+ install_phases = set(['configure', 'build', 'install', 'provenance'])
def do_install(self,
keep_prefix=False,
keep_stage=False,
@@ -872,7 +882,8 @@ class Package(object):
verbose=False,
make_jobs=None,
fake=False,
- explicit=False):
+ explicit=False,
+ install_phases = install_phases):
"""Called by commands to install a package and its dependencies.
Package implementations should override install() to describe
@@ -900,7 +911,7 @@ class Package(object):
return
# Ensure package is not already installed
- if spack.install_layout.check_installed(self.spec):
+ if 'install' in install_phases and spack.install_layout.check_installed(self.spec):
tty.msg("%s is already installed in %s" % (self.name, self.prefix))
rec = spack.installed_db.get_record(self.spec)
if (not rec.explicit) and explicit:
@@ -939,6 +950,10 @@ class Package(object):
tty.msg("Building %s" % self.name)
self.stage.keep = keep_stage
+ self.install_phases = install_phases
+ self.build_directory = join_path(self.stage.path, 'spack-build')
+ self.source_directory = self.stage.source_path
+
with self.stage:
# Run the pre-install hook in the child process after
# the directory is created.
@@ -970,19 +985,29 @@ class Package(object):
raise e
# Ensure that something was actually installed.
- self.sanity_check_prefix()
+ if 'install' in self.install_phases:
+ self.sanity_check_prefix()
- # Copy provenance into the install directory on success
- log_install_path = spack.install_layout.build_log_path(
- self.spec)
- env_install_path = spack.install_layout.build_env_path(
- self.spec)
- packages_dir = spack.install_layout.build_packages_path(
- self.spec)
- install(log_path, log_install_path)
- install(env_path, env_install_path)
- dump_packages(self.spec, packages_dir)
+ # Copy provenance into the install directory on success
+ if 'provenance' in self.install_phases:
+ log_install_path = spack.install_layout.build_log_path(
+ self.spec)
+ env_install_path = spack.install_layout.build_env_path(
+ self.spec)
+ packages_dir = spack.install_layout.build_packages_path(
+ self.spec)
+
+ # Remove first if we're overwriting another build
+ # (can happen with spack setup)
+ try:
+ shutil.rmtree(packages_dir) # log_install_path and env_install_path are inside this
+ except:
+ pass
+
+ install(log_path, log_install_path)
+ install(env_path, env_install_path)
+ dump_packages(self.spec, packages_dir)
# Run post install hooks before build stage is removed.
spack.hooks.post_install(self)
@@ -1000,6 +1025,18 @@ class Package(object):
try:
# Create the install prefix and fork the build process.
spack.install_layout.create_install_directory(self.spec)
+ except directory_layout.InstallDirectoryAlreadyExistsError:
+ if 'install' in install_phases:
+ # Abort install if install directory exists.
+ # But do NOT remove it (you'd be overwriting someon else's stuff)
+ tty.warn("Keeping existing install prefix in place.")
+ raise
+ else:
+ # We're not installing anyway, so don't worry if someone
+ # else has already written in the install directory
+ pass
+
+ try:
spack.build_environment.fork(self, build_process)
except:
# remove the install prefix if anything went wrong during install.
@@ -1010,7 +1047,7 @@ class Package(object):
"Spack will think this package is installed. " +
"Manually remove this directory to fix:",
self.prefix,
- wrap=True)
+ wrap=False)
raise
# note: PARENT of the build process adds the new package to
@@ -1482,6 +1519,152 @@ def _hms(seconds):
parts.append("%.2fs" % s)
return ' '.join(parts)
+class StagedPackage(Package):
+ """A Package subclass where the install() is split up into stages."""
+
+ def install_setup(self):
+ """Creates an spack_setup.py script to configure the package later if we like."""
+ raise InstallError("Package %s provides no install_setup() method!" % self.name)
+
+ def install_configure(self):
+ """Runs the configure process."""
+ raise InstallError("Package %s provides no install_configure() method!" % self.name)
+
+ def install_build(self):
+ """Runs the build process."""
+ raise InstallError("Package %s provides no install_build() method!" % self.name)
+
+ def install_install(self):
+ """Runs the install process."""
+ raise InstallError("Package %s provides no install_install() method!" % self.name)
+
+ def install(self, spec, prefix):
+ if 'setup' in self.install_phases:
+ self.install_setup()
+
+ if 'configure' in self.install_phases:
+ self.install_configure()
+
+ if 'build' in self.install_phases:
+ self.install_build()
+
+ if 'install' in self.install_phases:
+ self.install_install()
+ else:
+ # Create a dummy file so the build doesn't fail.
+ # That way, the module file will also be created.
+ with open(os.path.join(prefix, 'dummy'), 'w') as fout:
+ pass
+
+# stackoverflow.com/questions/12791997/how-do-you-do-a-simple-chmod-x-from-within-python
+def make_executable(path):
+ mode = os.stat(path).st_mode
+ mode |= (mode & 0o444) >> 2 # copy R bits to X
+ os.chmod(path, mode)
+
+
+
+class CMakePackage(StagedPackage):
+
+ def make_make(self):
+ import multiprocessing
+ # number of jobs spack will to build with.
+ jobs = multiprocessing.cpu_count()
+ if not self.parallel:
+ jobs = 1
+ elif self.make_jobs:
+ jobs = self.make_jobs
+
+ make = spack.build_environment.MakeExecutable('make', jobs)
+ return make
+
+ def configure_args(self):
+ """Returns package-specific arguments to be provided to the configure command."""
+ return list()
+
+ def configure_env(self):
+ """Returns package-specific environment under which the configure command should be run."""
+ return dict()
+
+ def spack_transitive_include_path(self):
+ return ';'.join(
+ os.path.join(dep, 'include')
+ for dep in os.environ['SPACK_DEPENDENCIES'].split(os.pathsep)
+ )
+
+ def install_setup(self):
+ cmd = [str(which('cmake'))] + \
+ spack.build_environment.get_std_cmake_args(self) + \
+ ['-DCMAKE_INSTALL_PREFIX=%s' % os.environ['SPACK_PREFIX'],
+ '-DCMAKE_C_COMPILER=%s' % os.environ['SPACK_CC'],
+ '-DCMAKE_CXX_COMPILER=%s' % os.environ['SPACK_CXX'],
+ '-DCMAKE_Fortran_COMPILER=%s' % os.environ['SPACK_FC']] + \
+ self.configure_args()
+
+ env = dict()
+ env['PATH'] = os.environ['PATH']
+ env['SPACK_TRANSITIVE_INCLUDE_PATH'] = self.spack_transitive_include_path()
+ env['CMAKE_PREFIX_PATH'] = os.environ['CMAKE_PREFIX_PATH']
+
+ setup_fname = 'spconfig.py'
+ with open(setup_fname, 'w') as fout:
+ fout.write(\
+r"""#!%s
+#
+
+import sys
+import os
+import subprocess
+
+def cmdlist(str):
+ return list(x.strip().replace("'",'') for x in str.split('\n') if x)
+env = dict(os.environ)
+""" % sys.executable)
+
+ env_vars = sorted(list(env.keys()))
+ for name in env_vars:
+ val = env[name]
+ if string.find(name, 'PATH') < 0:
+ fout.write('env[%s] = %s\n' % (repr(name),repr(val)))
+ else:
+ if name == 'SPACK_TRANSITIVE_INCLUDE_PATH':
+ sep = ';'
+ else:
+ sep = ':'
+
+ fout.write('env[%s] = "%s".join(cmdlist("""\n' % (repr(name),sep))
+ for part in string.split(val, sep):
+ fout.write(' %s\n' % part)
+ fout.write('"""))\n')
+
+ fout.write("env['CMAKE_TRANSITIVE_INCLUDE_PATH'] = env['SPACK_TRANSITIVE_INCLUDE_PATH'] # Deprecated\n")
+ fout.write('\ncmd = cmdlist("""\n')
+ fout.write('%s\n' % cmd[0])
+ for arg in cmd[1:]:
+ fout.write(' %s\n' % arg)
+ fout.write('""") + sys.argv[1:]\n')
+ fout.write('\nproc = subprocess.Popen(cmd, env=env)\nproc.wait()\n')
+ make_executable(setup_fname)
+
+
+ def install_configure(self):
+ cmake = which('cmake')
+ with working_dir(self.build_directory, create=True):
+ os.environ.update(self.configure_env())
+ os.environ['SPACK_TRANSITIVE_INCLUDE_PATH'] = self.spack_transitive_include_path()
+ options = self.configure_args() + spack.build_environment.get_std_cmake_args(self)
+ cmake(self.source_directory, *options)
+
+ def install_build(self):
+ make = self.make_make()
+ with working_dir(self.build_directory, create=False):
+ make()
+
+ def install_install(self):
+ make = self.make_make()
+ with working_dir(self.build_directory, create=False):
+ make('install')
+
class FetchError(spack.error.SpackError):
"""Raised when something goes wrong during fetch."""
diff --git a/lib/spack/spack/repository.py b/lib/spack/spack/repository.py
index 70134964ad..2c160a5f45 100644
--- a/lib/spack/spack/repository.py
+++ b/lib/spack/spack/repository.py
@@ -30,7 +30,7 @@ import imp
import re
import traceback
from bisect import bisect_left
-from external import yaml
+import yaml
import llnl.util.tty as tty
from llnl.util.filesystem import *
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 54219ec1b4..77bc57147d 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -2216,7 +2216,7 @@ class SpecParser(spack.parse.Parser):
for spec in specs:
for s in spec.traverse():
if s.architecture.os_string or s.architecture.target_string:
- s._set_platform(spack.architecture.sys_type())
+ s._set_platform(spack.architecture.platform())
return specs
def parse_compiler(self, text):
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index a76ec168ad..b08cce43b8 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -304,6 +304,7 @@ class Stage(object):
# Add URL strategies for all the mirrors with the digest
for url in urls:
fetchers.insert(0, fs.URLFetchStrategy(url, digest))
+ fetchers.insert(0, spack.cache.fetcher(self.mirror_path, digest))
for fetcher in fetchers:
try:
@@ -320,6 +321,7 @@ class Stage(object):
self.fetcher = self.default_fetcher
raise fs.FetchError(errMessage, None)
+
def check(self):
"""Check the downloaded archive against a checksum digest.
No-op if this stage checks code out of a repository."""
@@ -333,6 +335,11 @@ class Stage(object):
else:
self.fetcher.check()
+
+ def cache_local(self):
+ spack.cache.store(self.fetcher, self.mirror_path)
+
+
def expand_archive(self):
"""Changes to the stage directory and attempt to expand the downloaded
archive. Fail if the stage is not set up or if the archive is not yet
@@ -436,7 +443,7 @@ class ResourceStage(Stage):
shutil.move(source_path, destination_path)
-@pattern.composite(method_list=['fetch', 'create', 'check', 'expand_archive', 'restage', 'destroy'])
+@pattern.composite(method_list=['fetch', 'create', 'check', 'expand_archive', 'restage', 'destroy', 'cache_local'])
class StageComposite:
"""
Composite for Stage type objects. The first item in this composite is considered to be the root package, and
@@ -511,6 +518,9 @@ class DIYStage(object):
# No need to destroy DIY stage.
pass
+ def cache_local(self):
+ tty.msg("Sources for DIY stages are not cached")
+
def _get_mirrors():
"""Get mirrors from spack configuration."""
diff --git a/lib/spack/spack/test/architecture.py b/lib/spack/spack/test/architecture.py
index a6847c5744..ae3f08deed 100644
--- a/lib/spack/spack/test/architecture.py
+++ b/lib/spack/spack/test/architecture.py
@@ -5,7 +5,7 @@ import unittest
import os
import platform as py_platform
import spack
-from spack.architecture import *
+import spack.architecture
from spack.spec import *
from spack.platforms.cray_xc import CrayXc
from spack.platforms.linux import Linux
@@ -19,14 +19,14 @@ class ArchitectureTest(MockPackagesTest):
def setUp(self):
super(ArchitectureTest, self).setUp()
- self.platform = sys_type()
+ self.platform = spack.architecture.platform()
def tearDown(self):
super(ArchitectureTest, self).tearDown()
def test_dict_functions_for_architecture(self):
- arch = Arch()
- arch.platform = spack.architecture.sys_type()
+ arch = spack.architecture.Arch()
+ arch.platform = spack.architecture.platform()
arch.platform_os = arch.platform.operating_system('default_os')
arch.target = arch.platform.target('default_target')
@@ -36,18 +36,23 @@ class ArchitectureTest(MockPackagesTest):
self.assertEqual(arch, new_arch)
- self.assertTrue( isinstance(arch, Arch) )
- self.assertTrue( isinstance(arch.platform, Platform) )
- self.assertTrue( isinstance(arch.platform_os, OperatingSystem) )
- self.assertTrue( isinstance(arch.target, Target) )
- self.assertTrue( isinstance(new_arch, Arch) )
- self.assertTrue( isinstance(new_arch.platform, Platform) )
- self.assertTrue( isinstance(new_arch.platform_os, OperatingSystem) )
- self.assertTrue( isinstance(new_arch.target, Target) )
-
-
- def test_sys_type(self):
- output_platform_class = sys_type()
+ self.assertTrue( isinstance(arch, spack.architecture.Arch) )
+ self.assertTrue( isinstance(arch.platform, spack.architecture.Platform) )
+ self.assertTrue( isinstance(arch.platform_os,
+ spack.architecture.OperatingSystem) )
+ self.assertTrue( isinstance(arch.target,
+ spack.architecture.Target) )
+ self.assertTrue( isinstance(new_arch, spack.architecture.Arch) )
+ self.assertTrue( isinstance(new_arch.platform,
+ spack.architecture.Platform) )
+ self.assertTrue( isinstance(new_arch.platform_os,
+ spack.architecture.OperatingSystem) )
+ self.assertTrue( isinstance(new_arch.target,
+ spack.architecture.Target) )
+
+
+ def test_platform(self):
+ output_platform_class = spack.architecture.platform()
my_arch_class = None
if os.path.exists('/opt/cray/craype'):
my_platform_class = CrayXc()
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py
index ab201f406a..ce02b08bc3 100644
--- a/lib/spack/spack/test/concretize.py
+++ b/lib/spack/spack/test/concretize.py
@@ -257,8 +257,8 @@ class ConcretizeTest(MockPackagesTest):
def test_external_package_module(self):
# No tcl modules on darwin/linux machines
# TODO: improved way to check for this.
- if (spack.architecture.sys_type().name == 'darwin' or
- spack.architecture.sys_type().name == 'linux'):
+ if (spack.architecture.platform().name == 'darwin' or
+ spack.architecture.platform().name == 'linux'):
return
spec = Spec('externalmodule')
diff --git a/lib/spack/spack/test/install.py b/lib/spack/spack/test/install.py
index cfe6ea9b27..390ec096a9 100644
--- a/lib/spack/spack/test/install.py
+++ b/lib/spack/spack/test/install.py
@@ -28,6 +28,7 @@ import tempfile
import spack
from llnl.util.filesystem import *
from spack.directory_layout import YamlDirectoryLayout
+from spack.database import Database
from spack.fetch_strategy import URLFetchStrategy, FetchStrategyComposite
from spack.test.mock_packages_test import *
from spack.test.mock_repo import MockArchive
@@ -49,7 +50,10 @@ class InstallTest(MockPackagesTest):
# installed pkgs and mock packages.
self.tmpdir = tempfile.mkdtemp()
self.orig_layout = spack.install_layout
+ self.orig_db = spack.installed_db
+
spack.install_layout = YamlDirectoryLayout(self.tmpdir)
+ spack.installed_db = Database(self.tmpdir)
def tearDown(self):
@@ -61,6 +65,7 @@ class InstallTest(MockPackagesTest):
# restore spack's layout.
spack.install_layout = self.orig_layout
+ spack.installed_db = self.orig_db
shutil.rmtree(self.tmpdir, ignore_errors=True)
@@ -71,7 +76,7 @@ class InstallTest(MockPackagesTest):
pkg.fetcher = fetcher
- def ztest_install_and_uninstall(self):
+ def test_install_and_uninstall(self):
# Get a basic concrete spec for the trivial install package.
spec = Spec('trivial_install_test_package')
spec.concretize()
diff --git a/lib/spack/spack/test/mock_packages_test.py b/lib/spack/spack/test/mock_packages_test.py
index a56bd8ebdc..e1acc32cb7 100644
--- a/lib/spack/spack/test/mock_packages_test.py
+++ b/lib/spack/spack/test/mock_packages_test.py
@@ -34,7 +34,7 @@ from ordereddict_backport import OrderedDict
from spack.repository import RepoPath
from spack.spec import Spec
-platform = spack.architecture.sys_type()
+platform = spack.architecture.platform()
linux_os_name = 'debian'
linux_os_version = '6'
@@ -56,7 +56,7 @@ compilers:
fc: None
modules: 'None'
- compiler:
- spec: gcc@4.5.0
+ spec: gcc@4.5.0
operating_system: {0}{1}
paths:
cc: /path/to/gcc
@@ -144,7 +144,7 @@ compilers:
fc: /path/to/gfortran
operating_system: elcapitan
spec: gcc@4.5.0
- modules: 'None'
+ modules: 'None'
- compiler:
spec: clang@3.3
operating_system: elcapitan
@@ -201,6 +201,10 @@ class MockPackagesTest(unittest.TestCase):
spack.config.ConfigScope('site', self.mock_site_config)
spack.config.ConfigScope('user', self.mock_user_config)
+ # Keep tests from interfering with the actual module path.
+ self.real_share_path = spack.share_path
+ spack.share_path = tempfile.mkdtemp()
+
# Store changes to the package's dependencies so we can
# restore later.
self.saved_deps = {}
@@ -235,6 +239,9 @@ class MockPackagesTest(unittest.TestCase):
pkg.dependencies.clear()
pkg.dependencies.update(deps)
+ shutil.rmtree(spack.share_path, ignore_errors=True)
+ spack.share_path = self.real_share_path
+
def setUp(self):
self.initmock()
diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py
index 582e067860..6d2e3705bd 100644
--- a/lib/spack/spack/test/modules.py
+++ b/lib/spack/spack/test/modules.py
@@ -27,6 +27,7 @@ from contextlib import contextmanager
import StringIO
import spack.modules
+import unittest
from spack.test.mock_packages_test import MockPackagesTest
FILE_REGISTRY = collections.defaultdict(StringIO.StringIO)
@@ -67,6 +68,24 @@ configuration_autoload_all = {
}
}
+configuration_prerequisites_direct = {
+ 'enable': ['tcl'],
+ 'tcl': {
+ 'all': {
+ 'prerequisites': 'direct'
+ }
+ }
+}
+
+configuration_prerequisites_all = {
+ 'enable': ['tcl'],
+ 'tcl': {
+ 'all': {
+ 'prerequisites': 'all'
+ }
+ }
+}
+
configuration_alter_environment = {
'enable': ['tcl'],
'tcl': {
@@ -74,8 +93,13 @@ configuration_alter_environment = {
'filter': {'environment_blacklist': ['CMAKE_PREFIX_PATH']}
},
'platform=test target=x86_64': {
- 'environment': {'set': {'FOO': 'foo'},
- 'unset': ['BAR']}
+ 'environment': {
+ 'set': {'FOO': 'foo'},
+ 'unset': ['BAR']
+ }
+ },
+ 'platform=test target=x86_32': {
+ 'load': ['foo/bar']
}
}
}
@@ -83,7 +107,8 @@ configuration_alter_environment = {
configuration_blacklist = {
'enable': ['tcl'],
'tcl': {
- 'blacklist': ['callpath'],
+ 'whitelist': ['zmpi'],
+ 'blacklist': ['callpath', 'mpi'],
'all': {
'autoload': 'direct'
}
@@ -100,8 +125,68 @@ configuration_conflicts = {
}
}
+configuration_wrong_conflicts = {
+ 'enable': ['tcl'],
+ 'tcl': {
+ 'naming_scheme': '{name}/{version}-{compiler.name}',
+ 'all': {
+ 'conflict': ['{name}/{compiler.name}']
+ }
+ }
+}
+
+configuration_suffix = {
+ 'enable': ['tcl'],
+ 'tcl': {
+ 'mpileaks': {
+ 'suffixes': {
+ '+debug': 'foo',
+ '~debug': 'bar'
+ }
+ }
+ }
+}
+
+
+class HelperFunctionsTests(MockPackagesTest):
+
+ def test_update_dictionary_extending_list(self):
+ target = {
+ 'foo': {
+ 'a': 1,
+ 'b': 2,
+ 'd': 4
+ },
+ 'bar': [1, 2, 4],
+ 'baz': 'foobar'
+ }
+ update = {
+ 'foo': {
+ 'c': 3,
+ },
+ 'bar': [3],
+ 'baz': 'foobaz',
+ 'newkey': {
+ 'd': 4
+ }
+ }
+ spack.modules.update_dictionary_extending_lists(target, update)
+ self.assertTrue(len(target) == 4)
+ self.assertTrue(len(target['foo']) == 4)
+ self.assertTrue(len(target['bar']) == 4)
+ self.assertEqual(target['baz'], 'foobaz')
+
+ def test_inspect_path(self):
+ env = spack.modules.inspect_path('/usr')
+ names = [item.name for item in env]
+ self.assertTrue('PATH' in names)
+ self.assertTrue('LIBRARY_PATH' in names)
+ self.assertTrue('LD_LIBRARY_PATH' in names)
+ self.assertTrue('CPATH' in names)
+
class TclTests(MockPackagesTest):
+
def setUp(self):
super(TclTests, self).setUp()
self.configuration_obj = spack.modules.CONFIGURATION
@@ -116,7 +201,6 @@ class TclTests(MockPackagesTest):
def get_modulefile_content(self, spec):
spec.concretize()
- print spec, '&&&&&'
generator = spack.modules.TclModule(spec)
generator.write()
content = FILE_REGISTRY[generator.file_name].split('\n')
@@ -127,6 +211,8 @@ class TclTests(MockPackagesTest):
spec = spack.spec.Spec('mpich@3.0.4')
content = self.get_modulefile_content(spec)
self.assertTrue('module-whatis "mpich @3.0.4"' in content)
+ self.assertRaises(TypeError, spack.modules.dependencies,
+ spec, 'non-existing-tag')
def test_autoload(self):
spack.modules.CONFIGURATION = configuration_autoload_direct
@@ -141,11 +227,21 @@ class TclTests(MockPackagesTest):
self.assertEqual(len([x for x in content if 'is-loaded' in x]), 5)
self.assertEqual(len([x for x in content if 'module load ' in x]), 5)
+ def test_prerequisites(self):
+ spack.modules.CONFIGURATION = configuration_prerequisites_direct
+ spec = spack.spec.Spec('mpileaks arch=x86-linux')
+ content = self.get_modulefile_content(spec)
+ self.assertEqual(len([x for x in content if 'prereq' in x]), 2)
+
+ spack.modules.CONFIGURATION = configuration_prerequisites_all
+ spec = spack.spec.Spec('mpileaks arch=x86-linux')
+ content = self.get_modulefile_content(spec)
+ self.assertEqual(len([x for x in content if 'prereq' in x]), 5)
+
def test_alter_environment(self):
spack.modules.CONFIGURATION = configuration_alter_environment
spec = spack.spec.Spec('mpileaks platform=test target=x86_64')
content = self.get_modulefile_content(spec)
- print content
self.assertEqual(
len([x
for x in content
@@ -156,7 +252,6 @@ class TclTests(MockPackagesTest):
spec = spack.spec.Spec('libdwarf %clang platform=test target=x86_32')
content = self.get_modulefile_content(spec)
- print content
self.assertEqual(
len([x
for x in content
@@ -164,6 +259,10 @@ class TclTests(MockPackagesTest):
self.assertEqual(
len([x for x in content if 'setenv FOO "foo"' in x]), 0)
self.assertEqual(len([x for x in content if 'unsetenv BAR' in x]), 0)
+ self.assertEqual(
+ len([x for x in content if 'is-loaded foo/bar' in x]), 1)
+ self.assertEqual(
+ len([x for x in content if 'module load foo/bar' in x]), 1)
def test_blacklist(self):
spack.modules.CONFIGURATION = configuration_blacklist
@@ -171,6 +270,13 @@ class TclTests(MockPackagesTest):
content = self.get_modulefile_content(spec)
self.assertEqual(len([x for x in content if 'is-loaded' in x]), 1)
self.assertEqual(len([x for x in content if 'module load ' in x]), 1)
+ spec = spack.spec.Spec('callpath arch=x86-linux')
+ # Returns a StringIO instead of a string as no module file was written
+ self.assertRaises(AttributeError, self.get_modulefile_content, spec)
+ spec = spack.spec.Spec('zmpi arch=x86-linux')
+ content = self.get_modulefile_content(spec)
+ self.assertEqual(len([x for x in content if 'is-loaded' in x]), 1)
+ self.assertEqual(len([x for x in content if 'module load ' in x]), 1)
def test_conflicts(self):
spack.modules.CONFIGURATION = configuration_conflicts
@@ -182,3 +288,57 @@ class TclTests(MockPackagesTest):
len([x for x in content if x == 'conflict mpileaks']), 1)
self.assertEqual(
len([x for x in content if x == 'conflict intel/14.0.1']), 1)
+
+ spack.modules.CONFIGURATION = configuration_wrong_conflicts
+ self.assertRaises(SystemExit, self.get_modulefile_content, spec)
+
+ def test_suffixes(self):
+ spack.modules.CONFIGURATION = configuration_suffix
+ spec = spack.spec.Spec('mpileaks+debug arch=x86-linux')
+ spec.concretize()
+ generator = spack.modules.TclModule(spec)
+ self.assertTrue('foo' in generator.use_name)
+
+ spec = spack.spec.Spec('mpileaks~debug arch=x86-linux')
+ spec.concretize()
+ generator = spack.modules.TclModule(spec)
+ self.assertTrue('bar' in generator.use_name)
+
+
+configuration_dotkit = {
+ 'enable': ['dotkit'],
+ 'dotkit': {
+ 'all': {
+ 'prerequisites': 'direct'
+ }
+ }
+}
+
+
+class DotkitTests(MockPackagesTest):
+
+ def setUp(self):
+ super(DotkitTests, self).setUp()
+ self.configuration_obj = spack.modules.CONFIGURATION
+ spack.modules.open = mock_open
+ # Make sure that a non-mocked configuration will trigger an error
+ spack.modules.CONFIGURATION = None
+
+ def tearDown(self):
+ del spack.modules.open
+ spack.modules.CONFIGURATION = self.configuration_obj
+ super(DotkitTests, self).tearDown()
+
+ def get_modulefile_content(self, spec):
+ spec.concretize()
+ generator = spack.modules.Dotkit(spec)
+ generator.write()
+ content = FILE_REGISTRY[generator.file_name].split('\n')
+ return content
+
+ def test_dotkit(self):
+ spack.modules.CONFIGURATION = configuration_dotkit
+ spec = spack.spec.Spec('mpileaks arch=x86-linux')
+ content = self.get_modulefile_content(spec)
+ self.assertTrue('#c spack' in content)
+ self.assertTrue('#d mpileaks @2.3' in content)
diff --git a/lib/spack/spack/test/multimethod.py b/lib/spack/spack/test/multimethod.py
index 034e6b3923..c233ea4fd6 100644
--- a/lib/spack/spack/test/multimethod.py
+++ b/lib/spack/spack/test/multimethod.py
@@ -93,7 +93,7 @@ class MultiMethodTest(MockPackagesTest):
def test_target_match(self):
- platform = spack.architecture.sys_type()
+ platform = spack.architecture.platform()
targets = platform.targets.values()
for target in targets[:-1]:
pkg = spack.repo.get('multimethod target='+target.name)
diff --git a/lib/spack/spack/test/spec_dag.py b/lib/spack/spack/test/spec_dag.py
index 712f07ac4d..c56c70b1fe 100644
--- a/lib/spack/spack/test/spec_dag.py
+++ b/lib/spack/spack/test/spec_dag.py
@@ -242,7 +242,7 @@ class SpecDagTest(MockPackagesTest):
def test_unsatisfiable_architecture(self):
- platform = spack.architecture.sys_type()
+ platform = spack.architecture.platform()
self.set_pkg_dep('mpileaks', 'mpich platform=test target=be')
spec = Spec('mpileaks ^mpich platform=test target=fe ^callpath ^dyninst ^libelf ^libdwarf')
diff --git a/lib/spack/spack/test/spec_semantics.py b/lib/spack/spack/test/spec_semantics.py
index 9876bfd5a8..b174e5305c 100644
--- a/lib/spack/spack/test/spec_semantics.py
+++ b/lib/spack/spack/test/spec_semantics.py
@@ -141,7 +141,6 @@ class SpecSematicsTest(MockPackagesTest):
def test_satisfies_architecture(self):
- platform = spack.architecture.sys_type()
self.check_satisfies(
'foo platform=test target=frontend os=frontend',
'platform=test target=frontend os=frontend')
@@ -396,7 +395,7 @@ class SpecSematicsTest(MockPackagesTest):
self.check_constrain_changed('libelf', 'debug=2')
self.check_constrain_changed('libelf', 'cppflags="-O3"')
- platform = spack.architecture.sys_type()
+ platform = spack.architecture.platform()
self.check_constrain_changed('libelf', 'target='+platform.target('default_target').name)
self.check_constrain_changed('libelf', 'os='+platform.operating_system('default_os').name)
@@ -412,7 +411,7 @@ class SpecSematicsTest(MockPackagesTest):
self.check_constrain_not_changed('libelf debug=2', 'debug=2')
self.check_constrain_not_changed('libelf cppflags="-O3"', 'cppflags="-O3"')
- platform = spack.architecture.sys_type()
+ platform = spack.architecture.platform()
default_target = platform.target('default_target').name
self.check_constrain_not_changed('libelf target='+default_target, 'target='+default_target)
@@ -425,7 +424,7 @@ class SpecSematicsTest(MockPackagesTest):
self.check_constrain_changed('libelf^foo', 'libelf^foo+debug')
self.check_constrain_changed('libelf^foo', 'libelf^foo~debug')
- platform = spack.architecture.sys_type()
+ platform = spack.architecture.platform()
default_target = platform.target('default_target').name
self.check_constrain_changed('libelf^foo', 'libelf^foo target='+default_target)
@@ -439,6 +438,6 @@ class SpecSematicsTest(MockPackagesTest):
self.check_constrain_not_changed('libelf^foo~debug', 'libelf^foo~debug')
self.check_constrain_not_changed('libelf^foo cppflags="-O3"', 'libelf^foo cppflags="-O3"')
- platform = spack.architecture.sys_type()
+ platform = spack.architecture.platform()
default_target = platform.target('default_target').name
self.check_constrain_not_changed('libelf^foo target='+default_target, 'libelf^foo target='+default_target)
diff --git a/var/spack/repos/builtin.mock/packages/multimethod/package.py b/var/spack/repos/builtin.mock/packages/multimethod/package.py
index 649afa5945..ca991632dd 100644
--- a/var/spack/repos/builtin.mock/packages/multimethod/package.py
+++ b/var/spack/repos/builtin.mock/packages/multimethod/package.py
@@ -106,17 +106,11 @@ class Multimethod(Package):
#
# Make sure we can switch methods on different target
#
-# for platform_name in ['cray_xc', 'darwin', 'linux']:
-# file_path = join_path(spack.platform_path, platform_name)
-# platform_mod = imp.load_source('spack.platforms', file_path + '.py')
-# cls = getattr(platform_mod, mod_to_class(platform_name))
-
-# platform = cls()
- platform = spack.architecture.sys_type()
+ platform = spack.architecture.platform()
targets = platform.targets.values()
if len(targets) > 1:
targets = targets[:-1]
-
+
for target in targets:
@when('target='+target.name)
def different_by_target(self):
diff --git a/var/spack/packages/adios/package.py b/var/spack/repos/builtin/packages/adios/package.py
index 260dcbe851..9e0452ba6f 100644
--- a/var/spack/packages/adios/package.py
+++ b/var/spack/repos/builtin/packages/adios/package.py
@@ -1,15 +1,18 @@
import os
from spack import *
+
+
class Adios(Package):
- """The Adaptable IO System (ADIOS) provides a simple,
- flexible way for scientists to describe the
- data in their code that may need to be written,
- read, or processed outside of the running simulation
"""
-
+ The Adaptable IO System (ADIOS) provides a simple,
+ flexible way for scientists to describe the
+ data in their code that may need to be written,
+ read, or processed outside of the running simulation
+ """
+
homepage = "http://www.olcf.ornl.gov/center-projects/adios/"
- url = "http://users.nccs.gov/~pnorbert/adios-1.9.0.tar.gz"
+ url = "http://users.nccs.gov/~pnorbert/adios-1.9.0.tar.gz"
version('1.9.0', 'dbf5cb10e32add2f04c9b4052b7ffa76')
@@ -22,13 +25,13 @@ class Adios(Package):
depends_on('mxml')
def install(self, spec, prefix):
- configure_args = ["--prefix=%s" % prefix,
- "--with-mxml=%s" % spec['mxml'].prefix,
+ configure_args = ["--prefix=%s" % prefix,
+ "--with-mxml=%s" % spec['mxml'].prefix,
"--with-hdf5=%s" % spec['hdf5'].prefix,
"--with-netcdf=%s" % os.environ["NETCDF_DIR"],
"--with-infiniband=no",
- "MPICC=cc","MPICXX=CC","MPIFC=ftn",
- "CPPFLAGS=-DMPICH_IGNORE_CXX_SEEK"]
+ "MPICC=cc", "MPICXX=CC", "MPIFC=ftn",
+ "CPPFLAGS=-DMPICH_IGNORE_CXX_SEEK"]
if spec.satisfies('%gcc'):
configure_args.extend(["CC=gcc", "CXX=g++", "FC=gfortran"])
diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py
index d920855a2f..770ceed48b 100644
--- a/var/spack/repos/builtin/packages/autoconf/package.py
+++ b/var/spack/repos/builtin/packages/autoconf/package.py
@@ -24,18 +24,36 @@
##############################################################################
from spack import *
+
class Autoconf(Package):
- """Autoconf -- system configuration part of autotools"""
- homepage = "https://www.gnu.org/software/autoconf/"
- url = "http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz"
+ """
+ Autoconf -- system configuration part of autotools
+ """
+ homepage = 'https://www.gnu.org/software/autoconf/'
+ url = 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz'
version('2.69', '82d05e03b93e45f5a39b828dc9c6c29b')
version('2.62', '6c1f3b3734999035d77da5024aab4fbd')
- depends_on("m4")
+ depends_on('m4')
+
+ def _make_executable(self, name):
+ return Executable(join_path(self.prefix.bin, name))
+
+ def setup_dependent_package(self, module, dependent_spec):
+ # Autoconf is very likely to be a build dependency,
+ # so we add the tools it provides to the dependent module
+ executables = ['autoconf',
+ 'autoheader',
+ 'autom4te',
+ 'autoreconf',
+ 'autoscan',
+ 'autoupdate',
+ 'ifnames']
+ for name in executables:
+ setattr(module, name, self._make_executable(name))
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
-
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/automake/package.py b/var/spack/repos/builtin/packages/automake/package.py
index 331b364496..78b0a5b34f 100644
--- a/var/spack/repos/builtin/packages/automake/package.py
+++ b/var/spack/repos/builtin/packages/automake/package.py
@@ -24,10 +24,13 @@
##############################################################################
from spack import *
+
class Automake(Package):
- """Automake -- make file builder part of autotools"""
- homepage = "http://www.gnu.org/software/automake/"
- url = "http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz"
+ """
+ Automake -- make file builder part of autotools
+ """
+ homepage = 'http://www.gnu.org/software/automake/'
+ url = 'http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz'
version('1.15', '716946a105ca228ab545fc37a70df3a3')
version('1.14.1', 'd052a3e884631b9c7892f2efce542d75')
@@ -35,8 +38,17 @@ class Automake(Package):
depends_on('autoconf')
+ def _make_executable(self, name):
+ return Executable(join_path(self.prefix.bin, name))
+
+ def setup_dependent_package(self, module, dependent_spec):
+ # Automake is very likely to be a build dependency,
+ # so we add the tools it provides to the dependent module
+ executables = ['aclocal', 'automake']
+ for name in executables:
+ setattr(module, name, self._make_executable(name))
+
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
-
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/curl/package.py b/var/spack/repos/builtin/packages/curl/package.py
index e3de6ee5a1..79570205fa 100644
--- a/var/spack/repos/builtin/packages/curl/package.py
+++ b/var/spack/repos/builtin/packages/curl/package.py
@@ -24,6 +24,7 @@
##############################################################################
from spack import *
+
class Curl(Package):
"""cURL is an open source command line tool and library for
transferring data with URL syntax"""
@@ -31,6 +32,7 @@ class Curl(Package):
homepage = "http://curl.haxx.se"
url = "http://curl.haxx.se/download/curl-7.46.0.tar.bz2"
+ version('7.49.1', '6bb1f7af5b58b30e4e6414b8c1abccab')
version('7.47.1', '9ea3123449439bbd960cd25cf98796fb')
version('7.46.0', '9979f989a2a9930d10f1b3deeabc2148')
version('7.45.0', '62c1a352b28558f25ba6209214beadc8')
diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py
index 23ec74abed..068dbec10a 100644
--- a/var/spack/repos/builtin/packages/dealii/package.py
+++ b/var/spack/repos/builtin/packages/dealii/package.py
@@ -245,7 +245,7 @@ class Dealii(Package):
# change Linear Algebra to Trilinos
# The below filter_file should be different for versions
# before and after 8.4.0
- if spec.satisfies('@8.4.0:'):
+ if spec.satisfies('@8.4.0:') or spec.satisfies('@dev'):
filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)',
('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc')
else:
@@ -257,7 +257,7 @@ class Dealii(Package):
# the rest of the tests on step 40 only works for
# dealii version 8.4.0 and after
- if spec.satisfies('@8.4.0:'):
+ if spec.satisfies('@8.4.0:') or spec.satisfies('@dev'):
print('=====================================')
print('=== Step-40 Trilinos SuperluDist ====')
print('=====================================')
diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py
index e20fcffdd7..9ff4107619 100644
--- a/var/spack/repos/builtin/packages/eigen/package.py
+++ b/var/spack/repos/builtin/packages/eigen/package.py
@@ -28,7 +28,9 @@ from spack import *
class Eigen(Package):
"""
- Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms
+ Eigen is a C++ template library for linear algebra
+
+ Matrices, vectors, numerical solvers, and related algorithms
"""
homepage = 'http://eigen.tuxfamily.org/'
@@ -42,16 +44,16 @@ class Eigen(Package):
variant('scotch', default=True, description='Enables scotch backend')
variant('fftw', default=True, description='Enables FFTW backend')
variant('suitesparse', default=True, description='Enables SuiteSparse support')
+ variant('mpfr', default=True, description='Enables support for multi-precisions floating points via mpfr')
# TODO : dependency on googlehash, superlu, adolc missing
-
depends_on('cmake')
depends_on('metis@5:', when='+metis')
depends_on('scotch', when='+scotch')
depends_on('fftw', when='+fftw')
depends_on('suite-sparse', when='+suitesparse')
- depends_on('mpfr@2.3.0:') # Eigen 3.2.7 requires at least 2.3.0
- depends_on('gmp')
+ depends_on('mpfr@2.3.0:', when="+mpfr")
+ depends_on('gmp', when="+mpfr")
def install(self, spec, prefix):
diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py
index 4b05864a1e..a9ebd6d42f 100644
--- a/var/spack/repos/builtin/packages/emacs/package.py
+++ b/var/spack/repos/builtin/packages/emacs/package.py
@@ -23,23 +23,44 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
+import llnl.util.tty as tty
+
class Emacs(Package):
"""The Emacs programmable text editor."""
+
homepage = "https://www.gnu.org/software/emacs"
url = "http://ftp.gnu.org/gnu/emacs/emacs-24.5.tar.gz"
version('24.5', 'd74b597503a68105e61b5b9f6d065b44')
+ variant('X', default=True, description="Enable a X toolkit (GTK+)")
+ variant('gtkplus', default=False, description="Enable a GTK+ as X toolkit (this variant is ignored if ~X)")
+
depends_on('ncurses')
- # Emacs also depends on:
- # GTK or other widget library
- # libtiff, png, etc.
- # For now, we assume the system provides all that stuff.
- # For Ubuntu 14.04 LTS:
- # sudo apt-get install libgtk-3-dev libxpm-dev libtiff5-dev libjpeg8-dev libgif-dev libpng12-dev
+ depends_on('libtiff', when='+X')
+ depends_on('libpng', when='+X')
+ depends_on('libxpm', when='+X')
+ depends_on('giflib', when='+X')
+ depends_on('gtkplus', when='+X+gtkplus')
def install(self, spec, prefix):
- configure('--prefix=%s' % prefix)
+ args = []
+ if '+X' in spec:
+ if '+gtkplus' in spec:
+ toolkit = 'gtk{0}'.format(spec['gtkplus'].version.up_to(1))
+ else:
+ toolkit = 'no'
+ args = [
+ '--with-x',
+ '--with-x-toolkit={0}'.format(toolkit)
+ ]
+ else:
+ args = ['--without-x']
+ if '+gtkplus' in spec:
+ tty.warn('The variant +gtkplus is ignored if ~X is selected.')
+
+ configure('--prefix={0}'.format(prefix), *args)
+
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/fenics/package.py b/var/spack/repos/builtin/packages/fenics/package.py
index 0845237656..465ab651be 100644
--- a/var/spack/repos/builtin/packages/fenics/package.py
+++ b/var/spack/repos/builtin/packages/fenics/package.py
@@ -57,6 +57,9 @@ class Fenics(Package):
# variant('slepc4py', default=True, description='Uses SLEPc4py')
# variant('pastix', default=True, description='Compile with Pastix')
+ patch('petsc-3.7.patch', when='^petsc@3.7:')
+ patch('petsc-version-detection.patch', when='@:1.6.1')
+
extends('python')
depends_on('py-numpy')
diff --git a/var/spack/repos/builtin/packages/fenics/petsc-3.7.patch b/var/spack/repos/builtin/packages/fenics/petsc-3.7.patch
new file mode 100644
index 0000000000..c1ba5c4da6
--- /dev/null
+++ b/var/spack/repos/builtin/packages/fenics/petsc-3.7.patch
@@ -0,0 +1,394 @@
+diff -Naur dolfin-1.6.0/dolfin/common/SubSystemsManager.cpp dolfin-1.6.0.new/dolfin/common/SubSystemsManager.cpp
+--- dolfin-1.6.0/dolfin/common/SubSystemsManager.cpp 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/common/SubSystemsManager.cpp 2016-06-26 23:42:56.391929550 +0200
+@@ -179,7 +179,7 @@
+ PetscInitialized(&is_initialized);
+ if (is_initialized)
+ {
+- PetscOptionsInsert(&argc, &argv, PETSC_NULL);
++ PetscOptionsInsert(NULL, &argc, &argv, PETSC_NULL);
+ }
+ else
+ {
+@@ -187,12 +187,12 @@
+ PetscInitializeNoArguments();
+
+ // Set options to avoid common failures with some 3rd party solvers
+- PetscOptionsSetValue("-mat_mumps_icntl_7", "0");
+- PetscOptionsSetValue("-mat_superlu_dist_colperm", "MMD_AT_PLUS_A");
++ PetscOptionsSetValue(NULL, "-mat_mumps_icntl_7", "0");
++ PetscOptionsSetValue(NULL, "-mat_superlu_dist_colperm", "MMD_AT_PLUS_A");
+
+ // Pass command line arguments to PETSc (will overwrite any
+ // default above)
+- PetscOptionsInsert(&argc, &argv, PETSC_NULL);
++ PetscOptionsInsert(NULL, &argc, &argv, PETSC_NULL);
+ }
+
+ // Set PETSc
+diff -Naur dolfin-1.6.0/dolfin/la/PETScKrylovSolver.cpp dolfin-1.6.0.new/dolfin/la/PETScKrylovSolver.cpp
+--- dolfin-1.6.0/dolfin/la/PETScKrylovSolver.cpp 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/la/PETScKrylovSolver.cpp 2016-06-26 23:33:02.418351380 +0200
+@@ -564,6 +564,11 @@
+ return solve(x, b);
+ }
+ //-----------------------------------------------------------------------------
++PetscErrorCode PETScKrylovSolver::ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *vf)
++{
++ KSPMonitorTrueResidualNorm(ksp, n, rnorm, static_cast<PetscViewerAndFormat *>(vf));
++}
++//-----------------------------------------------------------------------------
+ void PETScKrylovSolver::set_petsc_ksp_options()
+ {
+ PetscErrorCode ierr;
+@@ -585,7 +590,8 @@
+ const bool monitor_convergence = parameters["monitor_convergence"];
+ if (monitor_convergence)
+ {
+- ierr = KSPMonitorSet(_ksp, KSPMonitorTrueResidualNorm, 0, 0);
++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &_vf);
++ ierr = KSPMonitorSet(_ksp, ksp_monitor_norm, _vf, 0);
+ if (ierr != 0) petsc_error(ierr, __FILE__, "KSPMonitorSet");
+ }
+
+diff -Naur dolfin-1.6.0/dolfin/la/PETScKrylovSolver.h dolfin-1.6.0.new/dolfin/la/PETScKrylovSolver.h
+--- dolfin-1.6.0/dolfin/la/PETScKrylovSolver.h 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/la/PETScKrylovSolver.h 2016-06-26 23:19:40.767042975 +0200
+@@ -179,6 +179,12 @@
+ // PETSc solver pointer
+ KSP _ksp;
+
++ // viewer for monitoring
++ PetscViewerAndFormat* _vf;
++
++ // monitoring function
++ static PetscErrorCode ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx);
++
+ // DOLFIN-defined PETScUserPreconditioner
+ PETScUserPreconditioner* pc_dolfin;
+
+diff -Naur dolfin-1.6.0/dolfin/la/PETScLUSolver.cpp dolfin-1.6.0.new/dolfin/la/PETScLUSolver.cpp
+--- dolfin-1.6.0/dolfin/la/PETScLUSolver.cpp 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/la/PETScLUSolver.cpp 2016-06-26 23:13:36.903732301 +0200
+@@ -246,14 +246,14 @@
+ if (parameters["num_threads"].is_set())
+ {
+ // Use number of threads specified for LU solver
+- ierr = PetscOptionsSetValue("-mat_pastix_threadnbr",
++ ierr = PetscOptionsSetValue(NULL, "-mat_pastix_threadnbr",
+ parameters["num_threads"].value_str().c_str());
+ if (ierr != 0) petsc_error(ierr, __FILE__, "PetscOptionsSetValue");
+ }
+ else
+ {
+ // Use global number of threads
+- ierr = PetscOptionsSetValue("-mat_pastix_threadnbr",
++ ierr = PetscOptionsSetValue(NULL, "-mat_pastix_threadnbr",
+ dolfin::parameters["num_threads"].value_str().c_str());
+ if (ierr != 0) petsc_error(ierr, __FILE__, "PetscOptionsSetValue");
+ }
+diff -Naur dolfin-1.6.0/dolfin/la/PETScOptions.cpp dolfin-1.6.0.new/dolfin/la/PETScOptions.cpp
+--- dolfin-1.6.0/dolfin/la/PETScOptions.cpp 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/la/PETScOptions.cpp 2016-06-26 23:37:58.613121118 +0200
+@@ -54,7 +54,7 @@
+ {
+ SubSystemsManager::init_petsc();
+ PetscErrorCode ierr;
+- ierr = PetscOptionsClearValue(option.c_str());
++ ierr = PetscOptionsClearValue(NULL, option.c_str());
+ if (ierr != 0)
+ {
+ dolfin_error("PETScOptions.cpp",
+diff -Naur dolfin-1.6.0/dolfin/la/PETScOptions.h dolfin-1.6.0.new/dolfin/la/PETScOptions.h
+--- dolfin-1.6.0/dolfin/la/PETScOptions.h 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/la/PETScOptions.h 2016-06-26 23:37:54.352023709 +0200
+@@ -65,7 +65,7 @@
+
+ PetscErrorCode ierr;
+ std::string _option = "-" + option;
+- ierr = PetscOptionsSetValue(_option.c_str(),
++ ierr = PetscOptionsSetValue(NULL, _option.c_str(),
+ boost::lexical_cast<std::string>(value).c_str());
+ if (ierr != 0)
+ {
+diff -Naur dolfin-1.6.0/dolfin/la/SLEPcEigenSolver.cpp dolfin-1.6.0.new/dolfin/la/SLEPcEigenSolver.cpp
+--- dolfin-1.6.0/dolfin/la/SLEPcEigenSolver.cpp 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/la/SLEPcEigenSolver.cpp 2016-06-26 23:35:25.930631132 +0200
+@@ -99,6 +99,19 @@
+ solve(_matA->size(0));
+ }
+ //-----------------------------------------------------------------------------
++PetscErrorCode SLEPcEigenSolver::eps_monitor(EPS eps, PetscInt its, PetscInt nconv, PetscScalar* eigr,
++ PetscScalar* eigi, PetscReal* errest,
++ PetscInt nest, void *vf)
++{
++ EPSMonitorAll(eps, its, nconv, eigr, eigi, errest, nest,
++ static_cast<PetscViewerAndFormat *>(vf));
++}
++//-----------------------------------------------------------------------------
++PetscErrorCode SLEPcEigenSolver::ksp_monitor(KSP ksp, PetscInt n, PetscReal rnorm, void *vf)
++{
++ KSPMonitorDefault(ksp, n, rnorm, static_cast<PetscViewerAndFormat *>(vf));
++}
++//-----------------------------------------------------------------------------
+ void SLEPcEigenSolver::solve(std::size_t n)
+ {
+ dolfin_assert(_matA);
+@@ -139,10 +152,11 @@
+ {
+ KSP ksp;
+ ST st;
+- EPSMonitorSet(_eps, EPSMonitorAll, NULL, NULL);
++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &_vf);
++ EPSMonitorSet(_eps, eps_monitor, _vf, NULL);
+ EPSGetST(_eps, &st);
+ STGetKSP(st, &ksp);
+- KSPMonitorSet(ksp, KSPMonitorDefault, NULL, NULL);
++ KSPMonitorSet(ksp, ksp_monitor, _vf, NULL);
+ EPSView(_eps, PETSC_VIEWER_STDOUT_SELF);
+ }
+
+diff -Naur dolfin-1.6.0/dolfin/la/SLEPcEigenSolver.h dolfin-1.6.0.new/dolfin/la/SLEPcEigenSolver.h
+--- dolfin-1.6.0/dolfin/la/SLEPcEigenSolver.h 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/la/SLEPcEigenSolver.h 2016-06-26 23:36:08.784610612 +0200
+@@ -231,6 +231,11 @@
+ // SLEPc solver pointer
+ EPS _eps;
+
++ PetscViewerAndFormat* _vf;
++ static PetscErrorCode eps_monitor(EPS eps, int its, int nconv, PetscScalar *eigr,
++ PetscScalar *eigi, PetscReal* errest,
++ int nest, void *mctx);
++ static PetscErrorCode ksp_monitor(KSP ksp, PetscInt n, PetscReal rnorm, void *vf);
+ };
+
+ }
+diff -Naur dolfin-1.6.0/dolfin/nls/PETScSNESSolver.cpp dolfin-1.6.0.new/dolfin/nls/PETScSNESSolver.cpp
+--- dolfin-1.6.0/dolfin/nls/PETScSNESSolver.cpp 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/nls/PETScSNESSolver.cpp 2016-06-26 23:19:40.166029256 +0200
+@@ -195,6 +195,15 @@
+ return this->solve(nonlinear_problem, x);
+ }
+ //-----------------------------------------------------------------------------
++PetscErrorCode
++PETScSNESSolver::snes_monitor(SNES snes, PetscInt its,
++ PetscReal fgnorm, void *vf)
++{
++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf);
++ SNESMonitorDefault(snes, its, fgnorm, _vf);
++ return(0);
++}
++//-----------------------------------------------------------------------------
+ void
+ PETScSNESSolver::init(NonlinearProblem& nonlinear_problem,
+ GenericVector& x)
+@@ -237,9 +246,11 @@
+ }
+
+ // Set some options from the parameters
+- if (report)
+- SNESMonitorSet(_snes, SNESMonitorDefault, PETSC_NULL, PETSC_NULL);
+-
++ if (report) {
++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &_snes_ctx.vf);
++ SNESMonitorSet(_snes, PETScSNESSolver::snes_monitor, _snes_ctx.vf, PETSC_NULL);
++ }
++
+ // Set the bounds, if any
+ set_bounds(x);
+
+@@ -293,8 +304,8 @@
+ SNESGetLineSearch(_snes, &linesearch);
+ #endif
+
+- if (report)
+- SNESLineSearchSetMonitor(linesearch, PETSC_TRUE);
++ // if (report)
++ // SNESLineSearchSetMonitor(linesearch, PETSC_TRUE);
+ const std::string line_search_type = std::string(parameters["line_search"]);
+ SNESLineSearchSetType(linesearch, line_search_type.c_str());
+
+@@ -466,6 +477,24 @@
+ }
+ #endif
+ //-----------------------------------------------------------------------------
++PetscErrorCode
++PETScSNESSolver::ksp_monitor(KSP ksp, PetscInt n,
++ PetscReal rnorm, void *vf)
++{
++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf);
++ KSPMonitorDefault(ksp, n, rnorm, _vf);
++ return(0);
++}
++//-----------------------------------------------------------------------------
++PetscErrorCode
++PETScSNESSolver::ksp_monitor_norm(KSP ksp, PetscInt n,
++ PetscReal rnorm, void *vf)
++{
++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf);
++ KSPMonitorTrueResidualNorm(ksp, n, rnorm, _vf);
++ return(0);
++}
++//-----------------------------------------------------------------------------
+ void PETScSNESSolver::set_linear_solver_parameters()
+ {
+ KSP ksp;
+@@ -482,7 +511,7 @@
+ PetscObjectGetComm((PetscObject)_snes, &comm);
+
+ if (parameters["report"])
+- KSPMonitorSet(ksp, KSPMonitorDefault, PETSC_NULL, PETSC_NULL);
++ KSPMonitorSet(ksp, PETScSNESSolver::ksp_monitor, _snes_ctx.vf, PETSC_NULL);
+
+ const std::string linear_solver = parameters["linear_solver"];
+ const std::string preconditioner = parameters["preconditioner"];
+@@ -518,7 +547,7 @@
+ KSPSetInitialGuessNonzero(ksp, PETSC_FALSE);
+
+ if (krylov_parameters["monitor_convergence"])
+- KSPMonitorSet(ksp, KSPMonitorTrueResidualNorm, 0, 0);
++ KSPMonitorSet(ksp, PETScSNESSolver::ksp_monitor_norm, _snes_ctx.vf, 0);
+
+ // Set tolerances
+ const int max_iters = krylov_parameters["maximum_iterations"];
+diff -Naur dolfin-1.6.0/dolfin/nls/PETScSNESSolver.h dolfin-1.6.0.new/dolfin/nls/PETScSNESSolver.h
+--- dolfin-1.6.0/dolfin/nls/PETScSNESSolver.h 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/nls/PETScSNESSolver.h 2016-06-26 22:31:21.554129282 +0200
+@@ -24,6 +24,7 @@
+
+ #include <map>
+ #include <petscsnes.h>
++#include <petscviewer.h>
+ #include <memory>
+ #include <dolfin/nls/NewtonSolver.h>
+ #include <dolfin/parameter/Parameters.h>
+@@ -124,8 +125,15 @@
+ Vec f_tmp;
+ const PETScVector* xl;
+ const PETScVector* xu;
++ PetscViewerAndFormat* vf;
+ };
+
++
++ // monitoring functions
++ static PetscErrorCode snes_monitor(SNES snes, PetscInt its, PetscReal fgnorm, void* ctx);
++ static PetscErrorCode ksp_monitor(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx);
++ static PetscErrorCode ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx);
++
+ // PETSc solver pointer
+ SNES _snes;
+
+diff -Naur dolfin-1.6.0/dolfin/nls/PETScTAOSolver.cpp dolfin-1.6.0.new/dolfin/nls/PETScTAOSolver.cpp
+--- dolfin-1.6.0/dolfin/nls/PETScTAOSolver.cpp 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/nls/PETScTAOSolver.cpp 2016-06-27 19:14:47.367885081 +0200
+@@ -186,6 +186,15 @@
+ init(optimisation_problem, x.down_cast<PETScVector>(), lb, ub);
+ }
+ //-----------------------------------------------------------------------------
++PetscErrorCode
++PETScTAOSolver::ksp_monitor_norm(KSP ksp, PetscInt n,
++ PetscReal rnorm, void * vf)
++{
++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf);
++ KSPMonitorTrueResidualNorm(ksp, n, rnorm, _vf);
++ return(0);
++}
++//-----------------------------------------------------------------------------
+ void PETScTAOSolver::init(OptimisationProblem& optimisation_problem,
+ PETScVector& x,
+ const PETScVector& lb,
+@@ -365,9 +374,7 @@
+ set_tao(parameters["method"]);
+
+ // Set tolerances
+- TaoSetTolerances(_tao, parameters["function_absolute_tol"],
+- parameters["function_relative_tol"],
+- parameters["gradient_absolute_tol"],
++ TaoSetTolerances(_tao, parameters["gradient_absolute_tol"],
+ parameters["gradient_relative_tol"],
+ parameters["gradient_t_tol"]);
+
+@@ -490,8 +497,10 @@
+ KSPSetInitialGuessNonzero(ksp, PETSC_FALSE);
+
+ // KSP monitor
+- if (krylov_parameters["monitor_convergence"])
+- KSPMonitorSet(ksp, KSPMonitorTrueResidualNorm, 0, 0);
++ if (krylov_parameters["monitor_convergence"]) {
++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &vf);
++ KSPMonitorSet(ksp, ksp_monitor_norm, vf, 0);
++ }
+
+ // Get integer tolerances (to take care of casting to PetscInt)
+ const int max_iter = krylov_parameters["maximum_iterations"];
+diff -Naur dolfin-1.6.0/dolfin/nls/PETScTAOSolver.h dolfin-1.6.0.new/dolfin/nls/PETScTAOSolver.h
+--- dolfin-1.6.0/dolfin/nls/PETScTAOSolver.h 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/nls/PETScTAOSolver.h 2016-06-27 19:08:00.634361160 +0200
+@@ -146,6 +146,10 @@
+ // TAO pointer
+ Tao _tao;
+
++ // monitoring functions
++ PetscViewerAndFormat* vf;
++ static PetscErrorCode ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx);
++
+ // Update parameters when tao/ksp/pc_types are explictly given
+ void update_parameters(const std::string tao_type,
+ const std::string ksp_type,
+diff -Naur dolfin-1.6.0/dolfin/nls/TAOLinearBoundSolver.cpp dolfin-1.6.0.new/dolfin/nls/TAOLinearBoundSolver.cpp
+--- dolfin-1.6.0/dolfin/nls/TAOLinearBoundSolver.cpp 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/nls/TAOLinearBoundSolver.cpp 2016-06-27 19:17:10.390216576 +0200
+@@ -313,9 +313,7 @@
+ dolfin_assert(_tao);
+
+ // Set tolerances
+- TaoSetTolerances(_tao, parameters["function_absolute_tol"],
+- parameters["function_relative_tol"],
+- parameters["gradient_absolute_tol"],
++ TaoSetTolerances(_tao, parameters["gradient_absolute_tol"],
+ parameters["gradient_relative_tol"],
+ parameters["gradient_t_tol"]);
+
+@@ -340,6 +338,15 @@
+ set_solver(method);
+ }
+ //-----------------------------------------------------------------------------
++PetscErrorCode
++TAOLinearBoundSolver::ksp_monitor_norm(KSP ksp, PetscInt n,
++ PetscReal rnorm, void * vf)
++{
++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf);
++ KSPMonitorTrueResidualNorm(ksp, n, rnorm, _vf);
++ return(0);
++}
++//-----------------------------------------------------------------------------
+ void TAOLinearBoundSolver::set_ksp_options()
+ {
+ dolfin_assert(_tao);
+@@ -360,8 +367,10 @@
+ else
+ KSPSetInitialGuessNonzero(ksp, PETSC_FALSE);
+
+- if (krylov_parameters["monitor_convergence"])
+- KSPMonitorSet(ksp, KSPMonitorTrueResidualNorm, 0, 0);
++ if (krylov_parameters["monitor_convergence"]) {
++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &vf);
++ KSPMonitorSet(ksp, ksp_monitor_norm, vf, 0);
++ }
+
+ // Set tolerances
+ const int max_ksp_it = krylov_parameters["maximum_iterations"];
+diff -Naur dolfin-1.6.0/dolfin/nls/TAOLinearBoundSolver.h dolfin-1.6.0.new/dolfin/nls/TAOLinearBoundSolver.h
+--- dolfin-1.6.0/dolfin/nls/TAOLinearBoundSolver.h 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0.new/dolfin/nls/TAOLinearBoundSolver.h 2016-06-27 19:08:09.157561005 +0200
+@@ -174,6 +174,10 @@
+ // Tao solver pointer
+ Tao _tao;
+
++ // monitoring functions
++ PetscViewerAndFormat* vf;
++ static PetscErrorCode ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx);
++
+ // Petsc preconditioner
+ std::shared_ptr<PETScPreconditioner> preconditioner;
+
diff --git a/var/spack/repos/builtin/packages/fenics/petsc-version-detection.patch b/var/spack/repos/builtin/packages/fenics/petsc-version-detection.patch
new file mode 100644
index 0000000000..1429cd7bc6
--- /dev/null
+++ b/var/spack/repos/builtin/packages/fenics/petsc-version-detection.patch
@@ -0,0 +1,39 @@
+--- dolfin-1.6.0.orig/cmake/modules/FindPETSc.cmake 2015-07-28 17:05:55.000000000 +0200
++++ dolfin-1.6.0/cmake/modules/FindPETSc.cmake 2016-06-27 17:16:02.484402705 +0200
+@@ -207,13 +207,7 @@
+
+ endif()
+
+-# Build PETSc test program
+-if (DOLFIN_SKIP_BUILD_TESTS)
+- set(PETSC_TEST_RUNS TRUE)
+- set(PETSC_VERSION "UNKNOWN")
+- set(PETSC_VERSION_OK TRUE)
+-elseif (FOUND_PETSC_CONF)
+-
++if (FOUND_PETSC_CONF)
+ # Set flags for building test program
+ set(CMAKE_REQUIRED_INCLUDES ${PETSC_INCLUDE_DIRS})
+ set(CMAKE_REQUIRED_LIBRARIES ${PETSC_LIBRARIES})
+@@ -271,7 +265,10 @@
+ set(PETSC_VERSION_OK TRUE)
+ endif()
+ mark_as_advanced(PETSC_VERSION_OK)
++endif()
+
++ # Build PETSc test program
++if (NOT DOLFIN_SKIP_BUILD_TESTS AND FOUND_PETSC_CONF)
+ # Run PETSc test program
+ set(PETSC_TEST_LIB_CPP
+ "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/petsc_test_lib.cpp")
+@@ -359,7 +356,9 @@
+ else()
+ message(STATUS "PETSc configured without Cusp support")
+ endif()
+-
++else()
++ set(PETSC_TEST_RUNS TRUE)
++
+ endif()
+
+ # Check sizeof(PetscInt)
diff --git a/var/spack/repos/builtin/packages/foam-extend/package.py b/var/spack/repos/builtin/packages/foam-extend/package.py
new file mode 100644
index 0000000000..4479fc9bee
--- /dev/null
+++ b/var/spack/repos/builtin/packages/foam-extend/package.py
@@ -0,0 +1,235 @@
+from spack import *
+from spack.environment import *
+
+import multiprocessing
+import os
+
+
+class FoamExtend(Package):
+ """The foam-extend project is a fork of the OpenFOAM open source library
+ for Computational Fluid Dynamics (CFD)."""
+
+ homepage = "http://www.extend-project.de/"
+
+ version('3.2', git='http://git.code.sf.net/p/foam-extend/foam-extend-3.2')
+ version('3.1', git='http://git.code.sf.net/p/foam-extend/foam-extend-3.1')
+ version('3.0', git='http://git.code.sf.net/p/foam-extend/foam-extend-3.0')
+
+ variant('paraview', default=False, description='Enable ParaFOAM')
+ variant('scotch', default=True, description='Activate Scotch as a possible decomposition library')
+ variant('ptscotch', default=True, description='Activate PT-Scotch as a possible decomposition library')
+ variant('metis', default=True, description='Activate Metis as a possible decomposition library')
+ variant('parmetis', default=True, description='Activate Parmetis as a possible decomposition library')
+ variant('parmgridgen', default=True, description='Activate Parmgridgen support')
+ variant('source', default=True, description='Installs also the source folder')
+
+ supported_compilers = {'clang': 'Clang', 'gcc': 'Gcc', 'intel': 'Icc'}
+
+ depends_on('mpi')
+ depends_on('python')
+ depends_on('flex@:2.5.99')
+ depends_on('zlib')
+
+ depends_on('scotch ~ metis', when='~ptscotch+scotch')
+ depends_on('scotch ~ metis + mpi', when='+ptscotch')
+ depends_on('metis@5:', when='+metis')
+ depends_on('parmetis', when='+parmetis')
+ depends_on('parmgridgen', when='+parmgridgen')
+
+ depends_on('paraview', when='+paraview')
+
+ def set_arch(self):
+ (sysname, nodename, release, version, machine) = os.uname()
+
+ if self.compiler.name not in self.supported_compilers:
+ raise RuntimeError('{0} is not a supported compiler \
+ to compile OpenFOAM'.format(self.compiler.name))
+
+ foam_compiler = self.supported_compilers[self.compiler.name]
+ if sysname == 'Linux':
+ arch = 'linux'
+ if foam_compiler == 'Clang':
+ raise RuntimeError('OS, compiler combination not\
+ supported ({0} {1})'.format(sysname, foam_compiler))
+ elif sysname == 'Darwin':
+ if machine == 'x86_64':
+ arch = 'darwinIntel'
+ if foam_compiler == 'Icc':
+ raise RuntimeError('OS, compiler combination not\
+ supported ({0} {1})'.format(sysname, foam_compiler))
+ else:
+ raise RuntimeError('{0} {1} is not a \
+ supported architecture'.format(sysname, machine))
+
+ return (arch, foam_compiler)
+
+ def get_openfoam_environment(self):
+ return EnvironmentModifications.from_sourcing_files(
+ join_path(self.stage.source_path,
+ 'etc/bashrc'))
+
+ def patch(self):
+ # change names to match the package and not the one patch in
+ # the Third-Party of foam-extend
+ if '+parmgridgen' in self.spec:
+ filter_file(r'-lMGridGen',
+ r'-lmgrid',
+ 'src/dbns/Make/options')
+
+ filter_file(
+ r'-lMGridGen',
+ r'-lmgrid',
+ 'src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options') # NOQA: ignore=501
+
+ # Get the wmake arch and compiler
+ (arch, foam_compiler) = self.set_arch()
+
+ prefs_dict = {
+ 'compilerInstall': 'System',
+ 'WM_COMPILER': foam_compiler,
+ 'WM_ARCH_OPTION': '64',
+ 'WM_PRECISION_OPTION': 'DP',
+ 'WM_COMPILE_OPTION': 'SPACKOpt',
+ 'WM_MPLIB': 'SPACK',
+
+ 'CMAKE_DIR': self.spec['cmake'].prefix,
+ 'CMAKE_BIN_DIR': self.spec['cmake'].prefix.bin,
+ 'PYTHON_DIR': self.spec['python'].prefix,
+ 'PYTHON_BIN_DIR': self.spec['python'].prefix.bin,
+
+ 'FLEX_SYSTEM': 1,
+ 'FLEX_DIR': self.spec['flex'].prefix,
+
+ 'BISON_SYSTEM': 1,
+ 'BISON_DIR': self.spec['flex'].prefix,
+
+ 'ZLIB_SYSTEM': 1,
+ 'ZLIB_DIR': self.spec['zlib'].prefix,
+ }
+
+ if '+scotch' in self.spec or '+ptscotch' in self.spec:
+ prefs_dict['SCOTCH_SYSTEM'] = 1
+ prefs_dict['SCOTCH_DIR'] = self.spec['scotch'].prefix
+ prefs_dict['SCOTCH_BIN_DIR'] = self.spec['scotch'].prefix.bin
+ prefs_dict['SCOTCH_LIB_DIR'] = self.spec['scotch'].prefix.lib
+ prefs_dict['SCOTCH_INCLUDE_DIR'] = \
+ self.spec['scotch'].prefix.include
+
+ if '+metis' in self.spec:
+ prefs_dict['METIS_SYSTEM'] = 1
+ prefs_dict['METIS_DIR'] = self.spec['metis'].prefix
+ prefs_dict['METIS_BIN_DIR'] = self.spec['metis'].prefix.bin
+ prefs_dict['METIS_LIB_DIR'] = self.spec['metis'].prefix.lib
+ prefs_dict['METIS_INCLUDE_DIR'] = self.spec['metis'].prefix.include
+
+ if '+parmetis' in self.spec:
+ prefs_dict['PARMETIS_SYSTEM'] = 1
+ prefs_dict['PARMETIS_DIR'] = self.spec['parmetis'].prefix
+ prefs_dict['PARMETIS_BIN_DIR'] = self.spec['parmetis'].prefix.bin
+ prefs_dict['PARMETIS_LIB_DIR'] = self.spec['parmetis'].prefix.lib
+ prefs_dict['PARMETIS_INCLUDE_DIR'] = \
+ self.spec['parmetis'].prefix.include
+
+ if '+parmgridgen' in self.spec:
+ prefs_dict['PARMGRIDGEN_SYSTEM'] = 1
+ prefs_dict['PARMGRIDGEN_DIR'] = self.spec['parmgridgen'].prefix
+ prefs_dict['PARMGRIDGEN_BIN_DIR'] = \
+ self.spec['parmgridgen'].prefix.bin
+ prefs_dict['PARMGRIDGEN_LIB_DIR'] = \
+ self.spec['parmgridgen'].prefix.lib
+ prefs_dict['PARMGRIDGEN_INCLUDE_DIR'] = \
+ self.spec['parmgridgen'].prefix.include
+
+ if '+paraview' in self.spec:
+ prefs_dict['PARAVIEW_SYSTEM'] = 1
+ prefs_dict['PARAVIEW_DIR'] = self.spec['paraview'].prefix,
+ prefs_dict['PARAVIEW_BIN_DIR'] = self.spec['paraview'].prefix.bin,
+ prefs_dict['QT_SYSTEM'] = 1
+ prefs_dict['QT_DIR'] = self.spec['qt'].prefix,
+ prefs_dict['QT_BIN_DIR'] = self.spec['qt'].prefix.bin,
+
+ # write the prefs files to define the configuration needed,
+ # only the prefs.sh is used by this script but both are
+ # installed for end users
+ with working_dir('.'):
+ with open("etc/prefs.sh", "w") as fh:
+ for key in sorted(prefs_dict):
+ fh.write('export {0}={1}\n'.format(key, prefs_dict[key]))
+
+ with open("etc/prefs.csh", "w") as fh:
+ for key in sorted(prefs_dict):
+ fh.write('setenv {0}={1}\n'.format(key, prefs_dict[key]))
+
+ # Defining a different mpi and optimisation file to be able to
+ # make wmake get spack info with minimum modifications on
+ # configurations scripts
+ mpi_info = [
+ 'PFLAGS = -DOMPI_SKIP_MPICXX -DMPICH_IGNORE_CXX_SEEK',
+ 'PINC = -I{0}'.format(self.spec['mpi'].prefix.include),
+ 'PLIBS = -L{0} -lmpi'.format(self.spec['mpi'].prefix.lib)
+ ]
+
+ arch_path = ''.join([arch, prefs_dict['WM_ARCH_OPTION'],
+ foam_compiler])
+ option_path = ''.join([arch_path,
+ prefs_dict['WM_PRECISION_OPTION'],
+ prefs_dict['WM_COMPILE_OPTION']])
+ rule_path = join_path("wmake", "rules", arch_path)
+ build_path = join_path(self.stage.source_path, 'lib', option_path)
+ install_path = \
+ join_path(self.prefix,
+ 'foam-extend-{0}'.format(self.version.up_to(2)),
+ option_path)
+
+ rpaths_foam = ' '.join([
+ '{0}{1}'.format(self.compiler.cxx_rpath_arg,
+ install_path),
+ '{0}{1}'.format(self.compiler.cxx_rpath_arg,
+ build_path)
+ ])
+
+ compiler_flags = {
+ 'DBUG': rpaths_foam,
+ 'OPT': '-O3',
+ }
+
+ with working_dir(rule_path):
+ with open('mplibSPACK', "w") as fh:
+ fh.write('\n'.join(mpi_info))
+
+ for comp in ['c', 'c++']:
+ with open('{0}SPACKOpt'.format(comp), "w") as fh:
+ for key, val in compiler_flags.iteritems():
+ fh.write('{0}{1} = {2}\n'.format(comp, key, val))
+
+ def setup_environment(self, spack_env, run_env):
+ with working_dir(self.stage.path):
+ spack_env.set('FOAM_INST_DIR', os.path.abspath('.'))
+
+ (arch, foam_compiler) = self.set_arch()
+
+ run_env.set('FOAM_INST_DIR', self.prefix)
+
+ def install(self, spec, prefix):
+ env_openfoam = self.get_openfoam_environment()
+ env_openfoam.apply_modifications()
+
+ if self.parallel:
+ os.environ['WM_NCOMPPROCS'] = str(self.make_jobs) \
+ if self.make_jobs else str(multiprocessing.cpu_count())
+
+ allwmake = Executable('./Allwmake')
+ allwmake()
+
+ install_path = \
+ join_path(self.prefix,
+ 'foam-extend-{0}'.format(self.version.up_to(2)))
+
+ if '+source' in spec:
+ install_tree('src', join_path(install_path, 'src'))
+
+ install_tree('lib', join_path(install_path, 'lib'))
+ install_tree('bin', join_path(install_path, 'bin'))
+ install_tree('applications', join_path(install_path, 'applications'))
+ install_tree('etc', join_path(install_path, 'etc'))
+ install_tree('wmake', join_path(install_path, 'wmake'))
diff --git a/var/spack/repos/builtin/packages/giflib/package.py b/var/spack/repos/builtin/packages/giflib/package.py
new file mode 100644
index 0000000000..7082384b9b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/giflib/package.py
@@ -0,0 +1,41 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Giflib(Package):
+ """The GIFLIB project maintains the giflib service library, which has
+ been pulling images out of GIFs since 1989."""
+
+ homepage = "http://giflib.sourceforge.net/"
+ url = "https://downloads.sourceforge.net/project/giflib/giflib-5.1.4.tar.bz2"
+
+ version('5.1.4', '2c171ced93c0e83bb09e6ccad8e3ba2b')
+
+ def install(self, spec, prefix):
+ configure('--prefix=%s' % prefix)
+
+ make()
+ make("install")
diff --git a/var/spack/repos/builtin/packages/glib/g_date_strftime.patch b/var/spack/repos/builtin/packages/glib/g_date_strftime.patch
new file mode 100644
index 0000000000..532c743277
--- /dev/null
+++ b/var/spack/repos/builtin/packages/glib/g_date_strftime.patch
@@ -0,0 +1,34 @@
+From 00148329967adb196138372771052a3f606a6ea3 Mon Sep 17 00:00:00 2001
+From: coypu <coypu@sdf.org>
+Date: Wed, 2 Mar 2016 19:43:10 +0200
+Subject: [PATCH 2/2] gdate: Suppress string format literal warning
+
+Newer versions of GCC emit an error here, but we know it's safe.
+https://bugzilla.gnome.org/761550
+---
+ glib/gdate.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/glib/gdate.c b/glib/gdate.c
+index 4aece02..92c34d2 100644
+--- a/glib/gdate.c
++++ b/glib/gdate.c
+@@ -2439,6 +2439,9 @@ win32_strftime_helper (const GDate *d,
+ *
+ * Returns: number of characters written to the buffer, or 0 the buffer was too small
+ */
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wformat-nonliteral"
++
+ gsize
+ g_date_strftime (gchar *s,
+ gsize slen,
+@@ -2549,3 +2552,5 @@ g_date_strftime (gchar *s,
+ return retval;
+ #endif
+ }
++
++#pragma GCC diagnostic pop
+--
+2.7.1
+
diff --git a/var/spack/repos/builtin/packages/glib/package.py b/var/spack/repos/builtin/packages/glib/package.py
index b146ea63d8..342a61a6a1 100644
--- a/var/spack/repos/builtin/packages/glib/package.py
+++ b/var/spack/repos/builtin/packages/glib/package.py
@@ -25,20 +25,24 @@
from spack import *
import sys
+
class Glib(Package):
"""The GLib package contains a low-level libraries useful for
providing data structure handling for C, portability wrappers
and interfaces for such runtime functionality as an event loop,
threads, dynamic loading and an object system."""
homepage = "https://developer.gnome.org/glib/"
- url = "http://ftp.gnome.org/pub/gnome/sources/glib/2.42/glib-2.42.1.tar.xz"
+ url = "http://ftp.gnome.org/pub/gnome/sources/glib/2.42/glib-2.42.1.tar.xz"
version('2.42.1', '89c4119e50e767d3532158605ee9121a')
depends_on("libffi")
depends_on("zlib")
depends_on("pkg-config")
- depends_on('gettext', sys.platform=='darwin')
+ depends_on('gettext', sys.platform == 'darwin')
+
+ # The following patch is needed for gcc-6.1
+ patch('g_date_strftime.patch')
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
diff --git a/var/spack/repos/builtin/packages/gmsh/package.py b/var/spack/repos/builtin/packages/gmsh/package.py
index e425d460c2..0951b86d57 100644
--- a/var/spack/repos/builtin/packages/gmsh/package.py
+++ b/var/spack/repos/builtin/packages/gmsh/package.py
@@ -27,39 +27,51 @@ from spack import *
class Gmsh(Package):
"""
- Gmsh is a free 3D finite element grid generator with a built-in CAD engine and post-processor. Its design goal is
- to provide a fast, light and user-friendly meshing tool with parametric input and advanced visualization
- capabilities. Gmsh is built around four modules: geometry, mesh, solver and post-processing. The specification of
- any input to these modules is done either interactively using the graphical user interface or in ASCII text files
- using Gmsh's own scripting language.
+ Gmsh is a free 3D finite element grid generator with a built-in CAD engine
+ and post-processor. Its design goal is to provide a fast, light and
+ user-friendly meshing tool with parametric input and advanced visualization
+ capabilities. Gmsh is built around four modules: geometry, mesh, solver and
+ post-processing. The specification of any input to these modules is done
+ either interactively using the graphical user interface or in ASCII text
+ files using Gmsh's own scripting language.
"""
homepage = 'http://gmsh.info'
url = 'http://gmsh.info/src/gmsh-2.11.0-source.tgz'
+ version('2.12.0', '7fbd2ec8071e79725266e72744d21e902d4fe6fa9e7c52340ad5f4be5c159d09')
version('2.11.0', 'f15b6e7ac9ca649c9a74440e1259d0db')
- # FIXME : Misses dependencies on gmm, PetsC, TetGen
-
- variant('shared', default=True, description='Enables the build of shared libraries')
- variant('debug', default=False, description='Builds the library in debug mode')
- variant('mpi', default=False, description='Builds MPI support for parser and solver')
- variant('fltk', default=False, description='Enables the build of the FLTK GUI')
- variant('hdf5', default=False, description='Enables HDF5 support')
- variant('compression', default=True, description='Enables IO compression through zlib')
+ variant('shared', default=True, description='Enables the build of shared libraries')
+ variant('debug', default=False, description='Builds the library in debug mode')
+ variant('mpi', default=False, description='Builds MPI support for parser and solver')
+ variant('fltk', default=False, description='Enables the build of the FLTK GUI')
+ variant('hdf5', default=False, description='Enables HDF5 support')
+ variant('compression', default=True, description='Enables IO compression through zlib')
+ variant('oce', default=False, description='Build with OCE')
+ variant('petsc', default=False, description='Build with PETSc')
+ variant('slepc', default=False, description='Build with SLEPc (only when PETSc is enabled)')
depends_on('blas')
depends_on('lapack')
+ depends_on('cmake@2.8:')
depends_on('gmp')
- depends_on('mpi', when='+mpi')
- depends_on('fltk', when='+fltk') # Assumes OpenGL with GLU is already provided by the system
+ depends_on('mpi', when='+mpi')
+ # Assumes OpenGL with GLU is already provided by the system:
+ depends_on('fltk', when='+fltk')
depends_on('hdf5', when='+hdf5')
- depends_on('zlib', when='+compression')
+ depends_on('oce', when='+oce')
+ depends_on('petsc+mpi', when='+petsc+mpi')
+ depends_on('petsc', when='+petsc~mpi')
+ depends_on('slepc', when='+slepc+petsc')
+ depends_on('zlib', when='+compression')
def install(self, spec, prefix):
-
options = []
options.extend(std_cmake_args)
+ # Make sure native file dialogs are used
+ options.extend(['-DENABLE_NATIVE_FILE_CHOOSER=ON'])
+
build_directory = join_path(self.stage.path, 'spack-build')
source_directory = self.stage.source_path
@@ -68,11 +80,45 @@ class Gmsh(Package):
# Prevent GMsh from using its own strange directory structure on OSX
options.append('-DENABLE_OS_SPECIFIC_INSTALL=OFF')
+ # Make sure GMSH picks up correct BlasLapack by providing linker flags
+ options.append('-DBLAS_LAPACK_LIBRARIES=%s %s' %
+ (to_link_flags(spec['lapack'].lapack_shared_lib),
+ to_link_flags(spec['blas'].blas_shared_lib)))
+
+ # Gmsh does not have an option to compile against external metis.
+ # Its own Metis, however, fails to build
+ options.append('-DENABLE_METIS=OFF')
+
+ if '+fltk' in spec:
+ options.append('-DENABLE_FLTK=ON')
+ else:
+ options.append('-DENABLE_FLTK=OFF')
+
+ if '+oce' in spec:
+ env['CASROOT'] = self.spec['oce'].prefix
+ options.extend(['-DENABLE_OCC=ON'])
+ else:
+ options.extend(['-DENABLE_OCC=OFF'])
+
+ if '+petsc' in spec:
+ env['PETSC_DIR'] = self.spec['petsc'].prefix
+ options.extend(['-DENABLE_PETSC=ON'])
+ else:
+ options.extend(['-DENABLE_PETSC=OFF'])
+
+ if '+slepc' in spec:
+ env['SLEPC_DIR'] = self.spec['slepc'].prefix
+ options.extend(['-DENABLE_SLEPC=ON'])
+ else:
+ options.extend(['-DENABLE_SLEPC=OFF'])
+
if '+shared' in spec:
+ # Builds dynamic executable and installs shared library
options.extend(['-DENABLE_BUILD_SHARED:BOOL=ON',
- '-DENABLE_BUILD_DYNAMIC:BOOL=ON']) # Builds dynamic executable and installs shared library
+ '-DENABLE_BUILD_DYNAMIC:BOOL=ON'])
else:
- options.append('-DENABLE_BUILD_LIB:BOOL=ON') # Builds and installs static library
+ # Builds and installs static library
+ options.append('-DENABLE_BUILD_LIB:BOOL=ON')
if '+debug' in spec:
options.append('-DCMAKE_BUILD_TYPE:STRING=Debug')
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
index e46f432be5..51a5823aa5 100644
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -70,7 +70,8 @@ class Hdf5(Package):
raise RuntimeError(msg)
if '+threadsafe' in spec and ('+cxx' in spec or '+fortran' in spec):
- raise RuntimeError("cannot use variant +threadsafe with either +cxx or +fortran")
+ msg = 'cannot use variant +threadsafe with either +cxx or +fortran'
+ raise RuntimeError(msg)
def install(self, spec, prefix):
self.validate(spec)
@@ -164,7 +165,7 @@ int main(int argc, char **argv) {
"""
expected = """\
HDF5 version {version} {version}
-""".format(version=str(spec.version))
+""".format(version=str(spec.version.up_to(3)))
with open("check.c", 'w') as f:
f.write(source)
if '+mpi' in spec:
@@ -185,24 +186,30 @@ HDF5 version {version} {version}
if not success:
print "Produced output does not match expected output."
print "Expected output:"
- print '-'*80
+ print '-' * 80
print expected
- print '-'*80
+ print '-' * 80
print "Produced output:"
- print '-'*80
+ print '-' * 80
print output
- print '-'*80
+ print '-' * 80
raise RuntimeError("HDF5 install check failed")
shutil.rmtree(checkdir)
def url_for_version(self, version):
- v = str(version)
+ base_url = "http://www.hdfgroup.org/ftp/HDF5/releases"
if version == Version("1.2.2"):
- return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + v + ".tar.gz"
+ return "{0}/hdf5-{1}.tar.gz".format(base_url, version)
+ elif version < Version("1.6.6"):
+ return "{0}/hdf5-{1}/hdf5-{2}.tar.gz".format(
+ base_url, version.up_to(2), version)
elif version < Version("1.7"):
- return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + version.up_to(2) + "/hdf5-" + v + ".tar.gz"
+ return "{0}/hdf5-{1}/hdf5-{2}/src/hdf5-{2}.tar.gz".format(
+ base_url, version.up_to(2), version)
elif version < Version("1.10"):
- return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + v + "/src/hdf5-" + v + ".tar.gz"
+ return "{0}/hdf5-{1}/src/hdf5-{1}.tar.gz".format(
+ base_url, version)
else:
- return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + version.up_to(2) + "/hdf5-" + v + "/src/hdf5-" + v + ".tar.gz"
+ return "{0}/hdf5-{1}/hdf5-{2}/src/hdf5-{2}.tar.gz".format(
+ base_url, version.up_to(2), version)
diff --git a/var/spack/repos/builtin/packages/ibmisc/package.py b/var/spack/repos/builtin/packages/ibmisc/package.py
new file mode 100644
index 0000000000..8e6cf429a7
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ibmisc/package.py
@@ -0,0 +1,46 @@
+from spack import *
+
+class Ibmisc(CMakePackage):
+ """Misc. reusable utilities used by IceBin."""
+
+ homepage = "https://github.com/citibeth/ibmisc"
+ url = "https://github.com/citibeth/ibmisc/tarball/123"
+
+ version('0.1.0', '12f2a32432a11db48e00217df18e59fa')
+
+ variant('everytrace', default=False, description='Report errors through Everytrace')
+ variant('proj', default=True, description='Compile utilities for PROJ.4 library')
+ variant('blitz', default=True, description='Compile utilities for Blitz library')
+ variant('netcdf', default=True, description='Compile utilities for NetCDF library')
+ variant('boost', default=True, description='Compile utilities for Boost library')
+ variant('udunits2', default=True, description='Compile utilities for UDUNITS2 library')
+ variant('googletest', default=True, description='Compile utilities for Google Test library')
+ variant('python', default=True, description='Compile utilities for use with Python/Cython')
+
+ extends('python')
+
+ depends_on('eigen')
+ depends_on('everytrace', when='+everytrace')
+ depends_on('proj', when='+proj')
+ depends_on('blitz', when='+blitz')
+ depends_on('netcdf-cxx4', when='+netcdf')
+ depends_on('udunits2', when='+udunits2')
+ depends_on('googletest', when='+googletest')
+ depends_on('py-cython', when='+python')
+ depends_on('py-numpy', when='+python')
+ depends_on('boost', when='+boost')
+
+ # Build dependencies
+ depends_on('cmake')
+ depends_on('doxygen')
+
+ def configure_args(self):
+ spec = self.spec
+ return [
+ '-DUSE_EVERYTRACE=%s' % ('YES' if '+everytrace' in spec else 'NO'),
+ '-DUSE_PROJ4=%s' % ('YES' if '+proj' in spec else 'NO'),
+ '-DUSE_BLITZ=%s' % ('YES' if '+blitz' in spec else 'NO'),
+ '-DUSE_NETCDF=%s' % ('YES' if '+netcdf' in spec else 'NO'),
+ '-DUSE_BOOST=%s' % ('YES' if '+boost' in spec else 'NO'),
+ '-DUSE_UDUNITS2=%s' % ('YES' if '+udunits2' in spec else 'NO'),
+ '-DUSE_GTEST=%s' % ('YES' if '+googletest' in spec else 'NO')]
diff --git a/var/spack/repos/builtin/packages/intel/package.py b/var/spack/repos/builtin/packages/intel/package.py
index ec3192380a..56d9fabddf 100644
--- a/var/spack/repos/builtin/packages/intel/package.py
+++ b/var/spack/repos/builtin/packages/intel/package.py
@@ -73,7 +73,7 @@ CONTINUE_WITH_OPTIONAL_ERROR=yes
COMPONENTS=%s
""" % (self.intel_prefix, self.global_license_file, self.intel_components))
- install_script = which("install.sh")
+ install_script = Executable("./install.sh")
install_script('--silent', silent_config_filename)
diff --git a/var/spack/repos/builtin/packages/julia/package.py b/var/spack/repos/builtin/packages/julia/package.py
index 69b52130e9..99d138dcff 100644
--- a/var/spack/repos/builtin/packages/julia/package.py
+++ b/var/spack/repos/builtin/packages/julia/package.py
@@ -22,8 +22,9 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
+
from spack import *
-import os
+
class Julia(Package):
"""The Julia Language: A fresh approach to technical computing"""
@@ -32,10 +33,14 @@ class Julia(Package):
version('master',
git='https://github.com/JuliaLang/julia.git', branch='master')
+ version('release-0.4',
+ git='https://github.com/JuliaLang/julia.git', branch='release-0.4')
+ version('0.4.6', 'd88db18c579049c23ab8ef427ccedf5d', preferred=True)
version('0.4.5', '69141ff5aa6cee7c0ec8c85a34aa49a6')
version('0.4.3', '8a4a59fd335b05090dd1ebefbbe5aaac')
- patch('gc.patch')
+ patch('gc.patch', when='@0.4:0.4.5')
+ patch('gc.patch', when='@release-0.4')
patch('openblas.patch', when='@0.4:0.4.5')
# Build-time dependencies:
@@ -92,25 +97,21 @@ class Julia(Package):
depends_on("mpi")
def install(self, spec, prefix):
- if '@master' in spec:
- # Julia needs to know the offset from a specific commit
- git = which('git')
- git('fetch', '--unshallow')
-
# Explicitly setting CC, CXX, or FC breaks building libuv, one
# of Julia's dependencies. This might be a Darwin-specific
# problem. Given how Spack sets up compilers, Julia should
# still use Spack's compilers, even if we don't specify them
# explicitly.
- options = [#"CC=cc",
- #"CXX=c++",
- #"FC=fc",
- #"USE_SYSTEM_ARPACK=1",
- #"USE_SYSTEM_FFTW=1",
- #"USE_SYSTEM_GMP=1",
- #"USE_SYSTEM_MPFR=1",
- #TODO "USE_SYSTEM_PCRE=1",
- "prefix=%s" % prefix]
+ options = [
+ # "CC=cc",
+ # "CXX=c++",
+ # "FC=fc",
+ # "USE_SYSTEM_ARPACK=1",
+ # "USE_SYSTEM_FFTW=1",
+ # "USE_SYSTEM_GMP=1",
+ # "USE_SYSTEM_MPFR=1",
+ # "USE_SYSTEM_PCRE=1",
+ "prefix=%s" % prefix]
with open('Make.user', 'w') as f:
f.write('\n'.join(options) + '\n')
make()
diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py
index 90e7b3b643..0e410a5061 100644
--- a/var/spack/repos/builtin/packages/libtool/package.py
+++ b/var/spack/repos/builtin/packages/libtool/package.py
@@ -24,18 +24,30 @@
##############################################################################
from spack import *
+
class Libtool(Package):
- """libtool -- library building part of autotools"""
- homepage = "https://www.gnu.org/software/libtool/"
- url = "http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz"
+ """
+ libtool -- library building part of autotools
+ """
+ homepage = 'https://www.gnu.org/software/libtool/'
+ url = 'http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz'
- version('2.4.6' , 'addf44b646ddb4e3919805aa88fa7c5e')
- version('2.4.2' , 'd2f3b7d4627e69e13514a40e72a24d50')
+ version('2.4.6', 'addf44b646ddb4e3919805aa88fa7c5e')
+ version('2.4.2', 'd2f3b7d4627e69e13514a40e72a24d50')
depends_on('m4')
+ def _make_executable(self, name):
+ return Executable(join_path(self.prefix.bin, name))
+
+ def setup_dependent_package(self, module, dependent_spec):
+ # Automake is very likely to be a build dependency,
+ # so we add the tools it provides to the dependent module
+ executables = ['libtoolize', 'libtool']
+ for name in executables:
+ setattr(module, name, self._make_executable(name))
+
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
-
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/libxpm/package.py b/var/spack/repos/builtin/packages/libxpm/package.py
new file mode 100644
index 0000000000..10ca8158c2
--- /dev/null
+++ b/var/spack/repos/builtin/packages/libxpm/package.py
@@ -0,0 +1,44 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Libxpm(Package):
+ """Xpm file format library"""
+
+ homepage = "https://www.x.org/"
+ url = "https://www.x.org/archive//individual/lib/libXpm-3.5.11.tar.gz"
+
+ version('3.5.11', '7c67c878ee048206b070bc0b24154f04')
+ version('3.5.10', 'a70507638d74541bf30a771f1e5938bb')
+ version('3.5.9', 'd6d4b0f76248a6b346eb42dfcdaa72a6')
+ version('3.5.8', '2d81d6633e67ac5562e2fbee126b2897')
+ version('3.5.7', '7bbc8f112f7143ed6961a58ce4e14558')
+
+ def install(self, spec, prefix):
+ configure('--prefix=%s' % prefix)
+
+ make()
+ make("install")
diff --git a/var/spack/repos/builtin/packages/lrzip/package.py b/var/spack/repos/builtin/packages/lrzip/package.py
new file mode 100644
index 0000000000..42542acfdb
--- /dev/null
+++ b/var/spack/repos/builtin/packages/lrzip/package.py
@@ -0,0 +1,61 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Lrzip(Package):
+ """A compression utility that excels at compressing large files
+ (usually > 10-50 MB). Larger files and/or more free RAM means that the
+ utility will be able to more effectively compress your files (ie: faster /
+ smaller size), especially if the filesize(s) exceed 100 MB. You can either
+ choose to optimise for speed (fast compression / decompression) or size,
+ but not both."""
+
+ homepage = 'http://lrzip.kolivas.org'
+ url = 'https://github.com/ckolivas/lrzip/archive/v0.630.tar.gz'
+
+ version('master', git='https://github.com/ckolivas/lrzip.git')
+ version('0.630', '3ca7f1d1365aa105089d1fbfc6b0924a')
+ version('0.621', '1f07227b39ae81a98934411e8611e341')
+ version('0.616', 'd40bdb046d0807ef602e36b1e9782cc0')
+ version('0.615', 'f1c01e7f3de07f54d916b61c989dfaf2')
+
+ # depends_on('coreutils')
+ depends_on('lzo')
+ depends_on('zlib')
+ depends_on('bzip2')
+
+ def install(self, spec, prefix):
+ set_executable('./autogen.sh')
+ autogen = Executable('./autogen.sh')
+
+ configure_args = [
+ '--prefix={0}'.format(prefix),
+ '--disable-dependency-tracking'
+ ]
+ autogen(*configure_args)
+
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/lzo/package.py b/var/spack/repos/builtin/packages/lzo/package.py
new file mode 100644
index 0000000000..0961bbb58c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/lzo/package.py
@@ -0,0 +1,49 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Lzo(Package):
+ """Real-time data compression library"""
+
+ homepage = 'https://www.oberhumer.com/opensource/lzo/'
+ url = 'https://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz'
+
+ version('2.09', 'c7ffc9a103afe2d1bba0b015e7aa887f')
+ version('2.08', 'fcec64c26a0f4f4901468f360029678f')
+ version('2.07', '4011935e95171e78ad4894f7335c982a')
+ version('2.06', '95380bd4081f85ef08c5209f4107e9f8')
+ version('2.05', 'c67cda5fa191bab761c7cb06fe091e36')
+
+ def install(self, spec, prefix):
+ configure_args = [
+ '--prefix={0}'.format(prefix),
+ '--disable-dependency-tracking',
+ '--enable-shared'
+ ]
+ configure(*configure_args)
+ make()
+ make('check')
+ make('install')
diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py
index 504efb5e35..1b4456380b 100644
--- a/var/spack/repos/builtin/packages/mfem/package.py
+++ b/var/spack/repos/builtin/packages/mfem/package.py
@@ -31,11 +31,13 @@ class Mfem(Package):
homepage = 'http://www.mfem.org'
url = 'https://github.com/mfem/mfem'
-# version('3.1', git='https://github.com/mfem/mfem.git',
-# commit='dbae60fe32e071989b52efaaf59d7d0eb2a3b574')
+ version('3.2', '2938c3deed4ec4f7fd5b5f5cfe656845282e86e2dcd477d292390058b7b94340',
+ url='http://goo.gl/Y9T75B', expand=False, preferred=True)
version('3.1', '841ea5cf58de6fae4de0f553b0e01ebaab9cd9c67fa821e8a715666ecf18fc57',
url='http://goo.gl/xrScXn', expand=False)
+# version('3.1', git='https://github.com/mfem/mfem.git',
+# commit='dbae60fe32e071989b52efaaf59d7d0eb2a3b574')
variant('metis', default=False, description='Activate support for metis')
variant('hypre', default=False, description='Activate support for hypre')
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py
index ea1844aea0..90670ee517 100644
--- a/var/spack/repos/builtin/packages/mpich/package.py
+++ b/var/spack/repos/builtin/packages/mpich/package.py
@@ -50,6 +50,11 @@ class Mpich(Package):
provides('mpi@:1.3', when='@1:')
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
+ spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc'))
+ spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpic++'))
+ spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77'))
+ spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90'))
+
spack_env.set('MPICH_CC', spack_cc)
spack_env.set('MPICH_CXX', spack_cxx)
spack_env.set('MPICH_F77', spack_f77)
diff --git a/var/spack/repos/builtin/packages/mumps/mumps-shared.patch b/var/spack/repos/builtin/packages/mumps/mumps-shared.patch
deleted file mode 100644
index 592f48037c..0000000000
--- a/var/spack/repos/builtin/packages/mumps/mumps-shared.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-diff -Naur MUMPS_5.0.1/libseq/Makefile MUMPS_5.0.1.new/libseq/Makefile
---- MUMPS_5.0.1/libseq/Makefile 2015-07-23 19:08:32.000000000 +0200
-+++ MUMPS_5.0.1.new/libseq/Makefile 2016-06-07 10:41:16.585179151 +0200
-@@ -8,11 +8,15 @@
-
- include ../Makefile.inc
-
--libmpiseq: libmpiseq$(PLAT)$(LIBEXT)
-+libmpiseq: libmpiseq$(PLAT)$(LIBEXT) libmpiseq$(PLAT)$(SHLIBEXT)
-
- libmpiseq$(PLAT)$(LIBEXT): mpi.o mpic.o elapse.o
- $(AR)$@ mpi.o mpic.o elapse.o
- $(RANLIB) $@
-+
-+libmpiseq$(PLAT)$(SHLIBEXT): mpi.o mpic.o elapse.o
-+ $(FC) $(LDFLAGS) $^ -o libmpiseq$(PLAT)$(SHLIBEXT)
-+
- .f.o:
- $(FC) $(OPTF) -c $*.f $(OUTF)$*.o
- .c.o:
-diff -Naur MUMPS_5.0.1/Makefile MUMPS_5.0.1.new/Makefile
---- MUMPS_5.0.1/Makefile 2015-07-23 19:08:29.000000000 +0200
-+++ MUMPS_5.0.1.new/Makefile 2016-06-07 10:50:21.863281217 +0200
-@@ -51,7 +51,7 @@
- dexamples: d
- (cd examples ; $(MAKE) d)
-
--requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT)$(LIBEXT)
-+requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT)$(LIBEXT) $(libdir)/libpord$(PLAT)$(SHLIBEXT)
-
- # dummy MPI library (sequential version)
-
-@@ -62,16 +62,25 @@
- $(libdir)/libpord$(PLAT)$(LIBEXT):
- if [ "$(LPORDDIR)" != "" ] ; then \
- cd $(LPORDDIR); \
-- $(MAKE) CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" RANLIB="$(RANLIB)" OUTC="$(OUTC)" LIBEXT=$(LIBEXT); \
-+ $(MAKE) CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" OUTC="$(OUTC)" LIBEXT=$(LIBEXT) PLAT=$(PLAT) SHLIBEXT=$(SHLIBEXT); \
- fi;
- if [ "$(LPORDDIR)" != "" ] ; then \
- cp $(LPORDDIR)/libpord$(LIBEXT) $@; \
- fi;
-
-+$(libdir)/libpord$(PLAT)$(SHLIBEXT):
-+ if [ "$(LPORDDIR)" != "" ] ; then \
-+ cd $(LPORDDIR); \
-+ $(MAKE) CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" OUTC="$(OUTC)" LIBEXT=$(LIBEXT) PLAT=$(PLAT) SHLIBEXT=$(SHLIBEXT) libpord$(PLAT)$(SHLIBEXT); \
-+ fi;
-+ if [ "$(LPORDDIR)" != "" ] ; then \
-+ cp $(LPORDDIR)/libpord$(PLAT)$(SHLIBEXT) $@; \
-+ fi;
-+
- clean:
- (cd src; $(MAKE) clean)
- (cd examples; $(MAKE) clean)
-- (cd $(libdir); $(RM) *$(PLAT)$(LIBEXT))
-+ (cd $(libdir); $(RM) *$(PLAT)$(LIBEXT) *$(PLAT)$(SHLIBEXT))
- (cd libseq; $(MAKE) clean)
- if [ "$(LPORDDIR)" != "" ] ; then \
- cd $(LPORDDIR); $(MAKE) realclean; \
-diff -Naur MUMPS_5.0.1/PORD/lib/Makefile MUMPS_5.0.1.new/PORD/lib/Makefile
---- MUMPS_5.0.1/PORD/lib/Makefile 2015-07-23 19:08:29.000000000 +0200
-+++ MUMPS_5.0.1.new/PORD/lib/Makefile 2016-06-07 10:49:48.889000958 +0200
-@@ -13,7 +13,7 @@
-
- OBJS = graph.o gbipart.o gbisect.o ddcreate.o ddbisect.o nestdiss.o \
- multisector.o gelim.o bucket.o tree.o \
-- symbfac.o interface.o sort.o minpriority.o
-+ symbfac.o interface.o sort.o minpriority.o
-
- # Note: numfac.c read.c mapping.c triangular.c matrix.c kernel.c
- # were not direcly used by MUMPS and have been removed from the
-@@ -24,12 +24,15 @@
- .c.o:
- $(CC) $(COPTIONS) -c $*.c $(OUTC)$*.o
-
--libpord$(LIBEXT):$(OBJS)
-+libpord$(PLAT)$(LIBEXT):$(OBJS)
- $(AR)$@ $(OBJS)
- $(RANLIB) $@
-
-+libpord$(PLAT)$(SHLIBEXT): $(OBJS)
-+ $(CC) $(LDFLAGS) $(OBJS) -o libpord$(PLAT)$(SHLIBEXT)
-+
- clean:
- rm -f *.o
-
- realclean:
-- rm -f *.o libpord.a
-+ rm -f *.o libpord$(PLAT)$(SHLIBEXT) libpord$(PLAT)$(LIBEXT)
-diff -Naur MUMPS_5.0.1/src/Makefile MUMPS_5.0.1.new/src/Makefile
---- MUMPS_5.0.1/src/Makefile 2015-07-23 19:08:29.000000000 +0200
-+++ MUMPS_5.0.1.new/src/Makefile 2016-06-07 10:40:52.534703722 +0200
-@@ -24,7 +24,10 @@
- include $(topdir)/Makefile.inc
-
- mumps_lib: $(libdir)/libmumps_common$(PLAT)$(LIBEXT) \
-- $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT)
-+ $(libdir)/libmumps_common$(PLAT)$(SHLIBEXT) \
-+ $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT) \
-+ $(libdir)/lib$(ARITH)mumps$(PLAT)$(SHLIBEXT)
-+
-
- OBJS_COMMON_MOD = \
- ana_omp_m.o\
-@@ -162,6 +165,13 @@
- $(AR)$@ $?
- $(RANLIB) $@
-
-+$(libdir)/libmumps_common$(PLAT)$(SHLIBEXT): $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
-+ $(FC) $(LDFLAGS) $^ -L$(libdir) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS) -o $(libdir)/libmumps_common$(PLAT)$(SHLIBEXT)
-+
-+
-+$(libdir)/lib$(ARITH)mumps$(PLAT)$(SHLIBEXT): $(OBJS_MOD) $(OBJS_OTHER)
-+ $(FC) $(LDFLAGS) $^ -L$(libdir) -lmumps_common$(PLAT) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS) -o $(libdir)/lib$(ARITH)mumps$(PLAT)$(SHLIBEXT)
-+
- # Dependencies between modules:
- $(ARITH)mumps_load.o: $(ARITH)mumps_comm_buffer.o \
- $(ARITH)mumps_struc_def.o \
diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py
index 8a90ef72d0..92c45c9b95 100644
--- a/var/spack/repos/builtin/packages/mumps/package.py
+++ b/var/spack/repos/builtin/packages/mumps/package.py
@@ -23,10 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
-import os
-import sys
-import subprocess
-
+import os, sys, glob
class Mumps(Package):
"""MUMPS: a MUltifrontal Massively Parallel sparse direct Solver"""
@@ -47,6 +44,7 @@ class Mumps(Package):
variant('idx64', default=False, description='Use int64_t/integer*8 as default index type')
variant('shared', default=True, description='Build shared libraries')
+
depends_on('scotch + esmumps', when='~ptscotch+scotch')
depends_on('scotch + esmumps + mpi', when='+ptscotch')
depends_on('metis@5:', when='+metis')
@@ -56,64 +54,49 @@ class Mumps(Package):
depends_on('scalapack', when='+mpi')
depends_on('mpi', when='+mpi')
- patch('mumps-shared.patch', when='+shared')
-
# this function is not a patch function because in case scalapack
# is needed it uses self.spec['scalapack'].fc_link set by the
# setup_dependent_environment in scalapck. This happen after patch
# end before install
# def patch(self):
def write_makefile_inc(self):
- if (('+parmetis' in self.spec or
- '+ptscotch' in self.spec)) and '+mpi' not in self.spec:
- raise RuntimeError('You cannot use the variants parmetis or ptscotch without mpi') # NOQA: E501
+ if ('+parmetis' in self.spec or '+ptscotch' in self.spec) and '+mpi' not in self.spec:
+ raise RuntimeError('You cannot use the variants parmetis or ptscotch without mpi')
- makefile_conf = [
- "LIBBLAS = -L%s -lblas" % self.spec['blas'].prefix.lib
- ]
+ makefile_conf = ["LIBBLAS = -L%s -lblas" % self.spec['blas'].prefix.lib]
orderings = ['-Dpord']
if '+ptscotch' in self.spec or '+scotch' in self.spec:
join_lib = ' -l%s' % ('pt' if '+ptscotch' in self.spec else '')
- makefile_conf.extend([
- "ISCOTCH = -I%s" % self.spec['scotch'].prefix.include,
- "LSCOTCH = -L%s %s%s" % (self.spec['scotch'].prefix.lib,
- join_lib,
- join_lib.join(['esmumps',
- 'scotch',
- 'scotcherr']))
- ])
+ makefile_conf.extend(
+ ["ISCOTCH = -I%s" % self.spec['scotch'].prefix.include,
+ "LSCOTCH = -L%s %s%s" % (self.spec['scotch'].prefix.lib,
+ join_lib,
+ join_lib.join(['esmumps', 'scotch', 'scotcherr']))])
orderings.append('-Dscotch')
if '+ptscotch' in self.spec:
orderings.append('-Dptscotch')
if '+parmetis' in self.spec and '+metis' in self.spec:
- makefile_conf.extend([
- "IMETIS = -I%s" % self.spec['parmetis'].prefix.include,
- "LMETIS = -L%s -l%s -L%s -l%s" % (
- self.spec['parmetis'].prefix.lib, 'parmetis',
- self.spec['metis'].prefix.lib, 'metis')
- ])
+ libname = 'parmetis' if '+parmetis' in self.spec else 'metis'
+ makefile_conf.extend(
+ ["IMETIS = -I%s" % self.spec['parmetis'].prefix.include,
+ "LMETIS = -L%s -l%s -L%s -l%s" % (self.spec['parmetis'].prefix.lib, 'parmetis',self.spec['metis'].prefix.lib, 'metis')])
orderings.append('-Dparmetis')
elif '+metis' in self.spec:
- makefile_conf.extend([
- "IMETIS = -I%s" % self.spec['metis'].prefix.include,
- "LMETIS = -L%s -l%s" % (self.spec['metis'].prefix.lib,
- 'metis')
- ])
+ makefile_conf.extend(
+ ["IMETIS = -I%s" % self.spec['metis'].prefix.include,
+ "LMETIS = -L%s -l%s" % (self.spec['metis'].prefix.lib, 'metis')])
orderings.append('-Dmetis')
makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings)))
- # when building shared libs need -fPIC, otherwise /usr/bin/ld:
- # graph.o: relocation R_X86_64_32 against `.rodata.str1.1' can
- # not be used when making a shared object; recompile with
- # -fPIC
+ # when building shared libs need -fPIC, otherwise
+ # /usr/bin/ld: graph.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
fpic = '-fPIC' if '+shared' in self.spec else ''
-
# TODO: test this part, it needs a full blas, scalapack and
# partitionning environment with 64bit integers
if '+idx64' in self.spec:
@@ -121,7 +104,7 @@ class Mumps(Package):
# the fortran compilation flags most probably are
# working only for intel and gnu compilers this is
# perhaps something the compiler should provide
- ['OPTF = %s -O -DALLOW_NON_INIT %s' % (fpic, '-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8'), # NOQA: E501
+ ['OPTF = %s -O -DALLOW_NON_INIT %s' % (fpic,'-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8'),
'OPTL = %s -O ' % fpic,
'OPTC = %s -O -DINTSIZE64' % fpic])
else:
@@ -130,47 +113,49 @@ class Mumps(Package):
'OPTL = %s -O ' % fpic,
'OPTC = %s -O ' % fpic])
+
if '+mpi' in self.spec:
makefile_conf.extend(
- ["CC = %s" % self.spec['mpi'].mpicc,
- "FC = %s" % self.spec['mpi'].mpifc,
+ ["CC = %s" % join_path(self.spec['mpi'].prefix.bin, 'mpicc'),
+ "FC = %s" % join_path(self.spec['mpi'].prefix.bin, 'mpif90'),
+ "FL = %s" % join_path(self.spec['mpi'].prefix.bin, 'mpif90'),
"SCALAP = %s" % self.spec['scalapack'].fc_link,
"MUMPS_TYPE = par"])
else:
makefile_conf.extend(
["CC = cc",
"FC = fc",
+ "FL = fc",
"MUMPS_TYPE = seq"])
# TODO: change the value to the correct one according to the
# compiler possible values are -DAdd_, -DAdd__ and/or -DUPPER
- makefile_conf.extend([
- 'CDEFS = -DAdd_',
- 'FL = $(FC)',
- ])
+ makefile_conf.append("CDEFS = -DAdd_")
if '+shared' in self.spec:
- makefile_conf.append('SHLIBEXT = .%s' % dso_suffix)
if sys.platform == 'darwin':
- makefile_conf.append(
- 'LDFLAGS = -dynamiclib -Wl,-install_name -Wl,{0}/$(notdir $@) {1}{0} -undefined dynamic_lookup'.format(prefix.lib, self.compiler.fc_rpath_arg) # NOQA: E501
- )
+ # Building dylibs with mpif90 causes segfaults on 10.8 and 10.10. Use gfortran. (Homebrew)
+ makefile_conf.extend([
+ 'LIBEXT=.dylib',
+ 'AR=%s -dynamiclib -Wl,-install_name -Wl,%s/$(notdir $@) -undefined dynamic_lookup -o ' % (os.environ['FC'],prefix.lib),
+ 'RANLIB=echo'
+ ])
else:
- makefile_conf.append(
- 'LDFLAGS = -shared {0}{1}'.format(
- self.compiler.fc_rpath_arg,
- prefix.lib)
- )
-
- makefile_conf.extend([
- 'LIBEXT = .a',
- 'AR = ar vr ',
- 'RANLIB = ranlib'
- ])
-
- makefile_inc_template = \
- join_path(os.path.dirname(self.module.__file__),
- 'Makefile.inc')
+ makefile_conf.extend([
+ 'LIBEXT=.so',
+ 'AR=$(FL) -shared -Wl,-soname -Wl,%s/$(notdir $@) -o' % prefix.lib,
+ 'RANLIB=echo'
+ ])
+ else:
+ makefile_conf.extend([
+ 'LIBEXT = .a',
+ 'AR = ar vr',
+ 'RANLIB = ranlib'
+ ])
+
+
+ makefile_inc_template = join_path(os.path.dirname(self.module.__file__),
+ 'Makefile.inc')
with open(makefile_inc_template, "r") as fh:
makefile_conf.extend(fh.read().split('\n'))
@@ -179,53 +164,46 @@ class Mumps(Package):
makefile_inc = '\n'.join(makefile_conf)
fh.write(makefile_inc)
+
+
def install(self, spec, prefix):
make_libs = []
# the choice to compile ?examples is to have kind of a sanity
# check on the libraries generated.
if '+float' in spec:
- make_libs.append('s')
+ make_libs.append('sexamples')
if '+complex' in spec:
- make_libs.append('c')
+ make_libs.append('cexamples')
if '+double' in spec:
- make_libs.append('d')
+ make_libs.append('dexamples')
if '+complex' in spec:
- make_libs.append('z')
+ make_libs.append('zexamples')
self.write_makefile_inc()
- make('mumps_lib', parallel=False)
- make(*make_libs)
+ # Build fails in parallel
+ make(*make_libs, parallel=False)
install_tree('lib', prefix.lib)
install_tree('include', prefix.include)
- if '~mpi' in spec:
- install('libseq/libmpiseq.a', prefix.lib)
- if '+shared' in spec:
- install('libseq/libmpiseq.{0}'.format(dso_suffix), prefix.lib)
- install('libseq/mpi.h', prefix.include)
- install('libseq/mpif.h', prefix.include)
-
- # FIXME: extend the tests to mpirun -np 2 (or alike) when
- # build with MPI
- # FIXME: use something like numdiff to compare blessed output
- # with the current
- # TODO: test the installed mumps and not the one in stage
- if '~mpi' in spec:
- for t in make_libs:
- make('{0}examples'.format(t))
-
- with working_dir('examples'):
- for t in make_libs:
- input_file = 'input_simpletest_{0}'.format(
- 'real' if t in ['s', 'd'] else 'cmplx')
- with open(input_file) as input:
- test = './{0}simpletest'.format(t)
- ret = subprocess.call(test,
- stdin=input)
- if ret is not 0:
- raise RuntimeError(
- 'The test {0} did not pass'.format(test))
+ if '~mpi' in spec:
+ lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so'
+ lib_suffix = lib_dsuffix if '+shared' in spec else '.a'
+ install('libseq/libmpiseq%s' % lib_suffix, prefix.lib)
+ for f in glob.glob(join_path('libseq','*.h')):
+ install(f, prefix.include)
+
+ # FIXME: extend the tests to mpirun -np 2 (or alike) when build with MPI
+ # FIXME: use something like numdiff to compare blessed output with the current
+ with working_dir('examples'):
+ if '+float' in spec:
+ os.system('./ssimpletest < input_simpletest_real')
+ if '+complex' in spec:
+ os.system('./csimpletest < input_simpletest_real')
+ if '+double' in spec:
+ os.system('./dsimpletest < input_simpletest_real')
+ if '+complex' in spec:
+ os.system('./zsimpletest < input_simpletest_cmplx')
diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py
index 34bace10d6..da386445bb 100644
--- a/var/spack/repos/builtin/packages/mvapich2/package.py
+++ b/var/spack/repos/builtin/packages/mvapich2/package.py
@@ -191,6 +191,11 @@ class Mvapich2(Package):
run_env.set('SLURM_MPI_TYPE', 'pmi2')
def setup_dependent_environment(self, spack_env, run_env, extension_spec):
+ spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc'))
+ spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpicxx'))
+ spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77'))
+ spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90'))
+
spack_env.set('MPICH_CC', spack_cc)
spack_env.set('MPICH_CXX', spack_cxx)
spack_env.set('MPICH_F77', spack_f77)
diff --git a/var/spack/packages/mxml/package.py b/var/spack/repos/builtin/packages/mxml/package.py
index f79251d312..254a5f1595 100644
--- a/var/spack/packages/mxml/package.py
+++ b/var/spack/repos/builtin/packages/mxml/package.py
@@ -1,14 +1,15 @@
-import os
from spack import *
+
class Mxml(Package):
- """Mini-XML is a small XML library that you can use to read and write XML
- and XML-like data files in your application without requiring large
- non-standard libraries
+ """
+ Mini-XML is a small XML library that you can use to read and write XML
+ and XML-like data files in your application without requiring large
+ non-standard libraries
"""
homepage = "http://www.msweet.org"
- url = "http://www.msweet.org/files/project3/mxml-2.9.tar.gz"
+ url = "http://www.msweet.org/files/project3/mxml-2.9.tar.gz"
version('2.9', 'e21cad0f7aacd18f942aa0568a8dee19')
version('2.8', 'd85ee6d30de053581242c4a86e79a5d2')
@@ -16,11 +17,11 @@ class Mxml(Package):
version('2.6', '68977789ae64985dddbd1a1a1652642e')
version('2.5', 'f706377fba630b39fa02fd63642b17e5')
- # module swap PrgEnv-intel PrgEnv-$COMP (Can use whatever compiler you want to use)
+ # module swap PrgEnv-intel PrgEnv-$COMP
+ # (Can use whatever compiler you want to use)
# Case statement to change CC and CXX flags
def install(self, spec, prefix):
configure('--prefix=%s' % prefix, "--disable-shared", 'CFLAGS=-static')
make()
make("install")
-
diff --git a/var/spack/repos/builtin/packages/netcdf-fortran/package.py b/var/spack/repos/builtin/packages/netcdf-fortran/package.py
index 3d1951ceee..e52ff1af87 100644
--- a/var/spack/repos/builtin/packages/netcdf-fortran/package.py
+++ b/var/spack/repos/builtin/packages/netcdf-fortran/package.py
@@ -24,12 +24,14 @@
##############################################################################
from spack import *
+
class NetcdfFortran(Package):
"""Fortran interface for NetCDF4"""
homepage = "http://www.unidata.ucar.edu/software/netcdf"
url = "http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.4.3.tar.gz"
+ version('4.4.4', 'e855c789cd72e1b8bc1354366bf6ac72')
version('4.4.3', 'bfd4ae23a34635b273d3eb0d91cbde9e')
depends_on('netcdf')
diff --git a/var/spack/repos/builtin/packages/octave-splines/package.py b/var/spack/repos/builtin/packages/octave-splines/package.py
new file mode 100644
index 0000000000..11c9cc5ba7
--- /dev/null
+++ b/var/spack/repos/builtin/packages/octave-splines/package.py
@@ -0,0 +1,44 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class OctaveSplines(Package):
+ """Additional spline functions."""
+
+ homepage = "http://octave.sourceforge.net/splines/index.html"
+ url = "http://downloads.sourceforge.net/octave/splines-1.3.1.tar.gz"
+
+ version('1.3.1', 'f9665d780c37aa6a6e17d1f424c49bdeedb89d1192319a4e39c08784122d18f9')
+
+ extends('octave@3.6.0:')
+
+ def install(self, spec, prefix):
+ octave('--quiet',
+ '--norc',
+ '--built-in-docstrings-file=/dev/null',
+ '--texi-macros-file=/dev/null',
+ '--eval', 'pkg prefix %s; pkg install %s' %
+ (prefix, self.stage.archive_file))
diff --git a/var/spack/repos/builtin/packages/octave/package.py b/var/spack/repos/builtin/packages/octave/package.py
index 72ff0ee6fc..f97bfc7d12 100644
--- a/var/spack/repos/builtin/packages/octave/package.py
+++ b/var/spack/repos/builtin/packages/octave/package.py
@@ -36,6 +36,8 @@ class Octave(Package):
homepage = "https://www.gnu.org/software/octave/"
url = "ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz"
+ extendable = True
+
version('4.0.2', 'c2a5cacc6e4c52f924739cdf22c2c687')
version('4.0.0', 'a69f8320a4f20a8480c1b278b1adb799')
@@ -212,3 +214,16 @@ class Octave(Package):
make()
make("install")
+
+ # ========================================================================
+ # Set up environment to make install easy for Octave extensions.
+ # ========================================================================
+
+ def setup_dependent_package(self, module, ext_spec):
+ """Called before Octave modules' install() methods.
+
+ In most cases, extensions will only need to have one line:
+ octave('--eval', 'pkg install %s' % self.stage.archive_file)
+ """
+ # Octave extension builds can have a global Octave executable function
+ module.octave = Executable(join_path(self.spec.prefix.bin, 'octave'))
diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py
index 588d862d96..15c8eefe96 100644
--- a/var/spack/repos/builtin/packages/openmpi/package.py
+++ b/var/spack/repos/builtin/packages/openmpi/package.py
@@ -109,6 +109,11 @@ class Openmpi(Package):
return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version) # NOQA: ignore=E501
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
+ spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc'))
+ spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpic++'))
+ spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77'))
+ spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90'))
+
spack_env.set('OMPI_CC', spack_cc)
spack_env.set('OMPI_CXX', spack_cxx)
spack_env.set('OMPI_FC', spack_fc)
diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py
index 377bffe723..a0747f229d 100644
--- a/var/spack/repos/builtin/packages/openssl/package.py
+++ b/var/spack/repos/builtin/packages/openssl/package.py
@@ -35,7 +35,7 @@ class Openssl(Package):
Transport Layer Security (TLS v1) protocols as well as a
full-strength general purpose cryptography library."""
homepage = "http://www.openssl.org"
- url = "https://www.openssl.org/source/openssl-1.0.1h.tar.gz"
+ url = "https://www.openssl.org/source/openssl-1.0.1h.tar.gz"
version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf')
version('1.0.1r', '1abd905e079542ccae948af37e393d28')
@@ -50,21 +50,24 @@ class Openssl(Package):
parallel = False
def url_for_version(self, version):
- # This URL is computed pinging the place where the latest version is stored. To avoid slowdown
- # due to repeated pinging, we store the URL in a private class attribute to do the job only once per version
+ # This URL is computed pinging the place where the latest version is
+ # stored. To avoid slowdown due to repeated pinging, we store the URL
+ # in a private class attribute to do the job only once per version
openssl_urls = getattr(Openssl, '_openssl_url', {})
openssl_url = openssl_urls.get(version, None)
# Same idea, but just to avoid issuing the same message multiple times
warnings_given_to_user = getattr(Openssl, '_warnings_given', {})
if openssl_url is None:
- if self.spec.satisfies('@external'):
- # The version @external is reserved to system openssl. In that case return a fake url and exit
- openssl_url = '@external (reserved version for system openssl)'
+ if self.spec.satisfies('@system'):
+ # The version @system is reserved to system openssl. In that
+ # case return a fake url and exit
+ openssl_url = '@system (reserved version for system openssl)'
if not warnings_given_to_user.get(version, False):
- tty.msg('Using openssl@external : the version @external is reserved for system openssl')
+ tty.msg('Using openssl@system : the version @system is reserved for system openssl') # NOQA: ignore=E501
warnings_given_to_user[version] = True
else:
- openssl_url = self.check_for_outdated_release(version, warnings_given_to_user) # Store the computed URL
+ openssl_url = self.check_for_outdated_release(
+ version, warnings_given_to_user) # Store the computed URL
openssl_urls[version] = openssl_url
# Store the updated dictionary of URLS
Openssl._openssl_url = openssl_urls
@@ -75,22 +78,23 @@ class Openssl(Package):
def check_for_outdated_release(self, version, warnings_given_to_user):
latest = 'ftp://ftp.openssl.org/source/openssl-{version}.tar.gz'
- older = 'http://www.openssl.org/source/old/{version_number}/openssl-{version_full}.tar.gz'
- # Try to use the url where the latest tarballs are stored. If the url does not exist (404), then
- # return the url for older format
+ older = 'http://www.openssl.org/source/old/{version_number}/openssl-{version_full}.tar.gz' # NOQA: ignore=E501
+ # Try to use the url where the latest tarballs are stored.
+ # If the url does not exist (404), then return the url for
+ # older format
version_number = '.'.join([str(x) for x in version[:-1]])
try:
openssl_url = latest.format(version=version)
urllib.urlopen(openssl_url)
except IOError:
- openssl_url = older.format(version_number=version_number, version_full=version)
- # Checks if we already warned the user for this particular version of OpenSSL.
- # If not we display a warning message and mark this version
+ openssl_url = older.format(version_number=version_number, version_full=version) # NOQA:ignore=E501
+ # Checks if we already warned the user for this particular
+ # version of OpenSSL. If not we display a warning message
+ # and mark this version
if not warnings_given_to_user.get(version, False):
- tty.warn(
- 'This installation depends on an old version of OpenSSL, which may have known security issues. ')
- tty.warn('Consider updating to the latest version of this package.')
- tty.warn('More details at {homepage}'.format(homepage=Openssl.homepage))
+ tty.warn('This installation depends on an old version of OpenSSL, which may have known security issues. ') # NOQA: ignore=E501
+ tty.warn('Consider updating to the latest version of this package.') # NOQA: ignore=E501
+ tty.warn('More details at {homepage}'.format(homepage=Openssl.homepage)) # NOQA: ignore=E501
warnings_given_to_user[version] = True
return openssl_url
diff --git a/var/spack/repos/builtin/packages/parmgridgen/package.py b/var/spack/repos/builtin/packages/parmgridgen/package.py
new file mode 100644
index 0000000000..02be777c36
--- /dev/null
+++ b/var/spack/repos/builtin/packages/parmgridgen/package.py
@@ -0,0 +1,71 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+
+from spack import *
+
+
+class Parmgridgen(Package):
+ """MGRIDGEN is a serial library written entirely in ANSI C that implements
+ (serial) algorithms for obtaining a sequence of successive coarse grids
+ that are well-suited for geometric multigrid methods.
+ ParMGridGen is the parallel version of MGridGen
+ """
+
+ homepage = "http://www-users.cs.umn.edu/~moulitsa/software.html"
+ url = "http://www-users.cs.umn.edu/~moulitsa/download/ParMGridGen-1.0.tar.gz"
+
+ version('1.0', '2872fa95b7fb91d6bd525490eed62038')
+
+ depends_on('mpi')
+
+ def install(self, spec, prefix):
+ make_opts = [
+ 'make=make',
+ 'COPTIONS=-fPIC',
+ 'LDOPTIONS=-fPIC',
+ 'CC={0}'.format(self.compiler.cc),
+ 'PARCC={0}'.format(spec['mpi'].mpicc),
+ 'LD={0}'.format(self.compiler.cc),
+ 'PARLD={0}'.format(spec['mpi'].mpicc),
+ 'LIBDIR=-L../..',
+ 'PARLIBS=-L../../ -lparmgrid -lmgrid -lm',
+ 'LIBS=-L../../ -lmgrid -lm',
+ 'parallel'
+ ]
+
+ make(*make_opts, parallel=False)
+
+ mkdirp(prefix.include, prefix.lib, prefix.bin)
+
+ install("mgridgen.h", prefix.include)
+ install("parmgridgen.h", prefix.include)
+
+ install("MGridGen/IMlib/libIMlib.a",
+ join_path(prefix.lib, 'libIMlib.a'))
+ install("libmgrid.a", prefix.lib)
+ install("libparmgrid.a", prefix.lib)
+
+ install("mgridgen", prefix.bin)
+ install("parmgridgen", prefix.bin)
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py
index 8dd1d8d2b9..6a7bee9788 100644
--- a/var/spack/repos/builtin/packages/petsc/package.py
+++ b/var/spack/repos/builtin/packages/petsc/package.py
@@ -148,6 +148,22 @@ class Petsc(Package):
make('MAKE_NP=%s' % make_jobs, parallel=False)
make("install")
+ # solve Poisson equation in 2D to make sure nothing is broken:
+ with working_dir('src/ksp/ksp/examples/tutorials'):
+ cc = os.environ['CC'] if '~mpi' in self.spec else self.spec['mpi'].mpicc # NOQA: ignore=E501
+ os.system('%s ex50.c -I%s -L%s -lpetsc -o ex50' % (
+ cc, prefix.include, prefix.lib))
+ ex50 = Executable('./ex50')
+ ex50('-da_grid_x', '4', '-da_grid_y', '4')
+ if 'superlu-dist' in spec:
+ ex50('-da_grid_x', '4', '-da_grid_y', '4', '-pc_type', 'lu', '-pc_factor_mat_solver_package', 'superlu_dist') # NOQA: ignore=E501
+
+ if 'mumps' in spec:
+ ex50('-da_grid_x', '4', '-da_grid_y', '4', '-pc_type', 'lu', '-pc_factor_mat_solver_package', 'mumps') # NOQA: ignore=E501
+
+ if 'hypre' in spec:
+ ex50('-da_grid_x', '4', '-da_grid_y', '4', '-pc_type', 'hypre', '-pc_hypre_type', 'boomeramg') # NOQA: ignore=E501
+
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# set up PETSC_DIR for everyone using PETSc package
spack_env.set('PETSC_DIR', self.prefix)
diff --git a/var/spack/repos/builtin/packages/py-docutils/package.py b/var/spack/repos/builtin/packages/py-docutils/package.py
new file mode 100644
index 0000000000..3a938d918b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-docutils/package.py
@@ -0,0 +1,43 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class PyDocutils(Package):
+ """Docutils is an open-source text processing system for processing
+ plaintext documentation into useful formats, such as HTML, LaTeX,
+ man-pages, open-document or XML. It includes reStructuredText, the
+ easy to read, easy to use, what-you-see-is-what-you-get plaintext
+ markup language."""
+
+ homepage = "http://docutils.sourceforge.net/"
+ url = "https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz"
+
+ version('0.12', '4622263b62c5c771c03502afa3157768')
+
+ extends('python')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix={0}'.format(prefix))
diff --git a/var/spack/repos/builtin/packages/py-protobuf/package.py b/var/spack/repos/builtin/packages/py-protobuf/package.py
new file mode 100644
index 0000000000..da3a65c22e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-protobuf/package.py
@@ -0,0 +1,50 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class PyProtobuf(Package):
+ """Protocol buffers are Google's language-neutral, platform-neutral,
+ extensible mechanism for serializing structured data - think XML, but
+ smaller, faster, and simpler. You define how you want your data to be
+ structured once, then you can use special generated source code to easily
+ write and read your structured data to and from a variety of data streams
+ and using a variety of languages."""
+
+ homepage = 'https://developers.google.com/protocol-buffers/'
+ url = 'https://pypi.python.org/packages/source/p/protobuf/protobuf-3.0.0b2.tar.gz'
+
+ version('3.0.0b2', 'f0d3bd2394345a9af4a277cd0302ae83')
+ version('2.6.1', '6bf843912193f70073db7f22e2ea55e2')
+ version('2.5.0', '338813f3629d59e9579fed9035ecd457')
+ version('2.4.1', '72f5141d20ab1bcae6b1e00acfb1068a')
+ version('2.3.0', 'bb020c962f252fe81bfda8fb433bafdd')
+
+ extends('python')
+
+ depends_on('py-setuptools')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix={0}'.format(prefix))
diff --git a/var/spack/repos/builtin/packages/py-restview/package.py b/var/spack/repos/builtin/packages/py-restview/package.py
new file mode 100644
index 0000000000..91b1db993e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-restview/package.py
@@ -0,0 +1,41 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class PyRestview(Package):
+ """A viewer for ReStructuredText documents that renders them on the fly."""
+
+ homepage = "https://mg.pov.lt/restview/"
+ url = "https://pypi.python.org/packages/source/r/restview/restview-2.6.1.tar.gz"
+
+ version('2.6.1', 'ac8b70e15b8f1732d1733d674813666b')
+
+ extends('python')
+ depends_on('py-docutils')
+ depends_on('py-pygments')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix={0}'.format(prefix))
diff --git a/var/spack/repos/builtin/packages/r-bh/package.py b/var/spack/repos/builtin/packages/r-bh/package.py
new file mode 100644
index 0000000000..a0f30b779f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-bh/package.py
@@ -0,0 +1,54 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RBh(Package):
+ """Boost provides free peer-reviewed portable C++ source libraries. A large
+ part of Boost is provided as C++ template code which is resolved entirely
+ at compile-time without linking. This package aims to provide the most
+ useful subset of Boost libraries for template use among CRAN package. By
+ placing these libraries in this package, we offer a more efficient
+ distribution system for CRAN as replication of this code in the sources of
+ other packages is avoided. As of release 1.60.0-2, the following Boost
+ libraries are included: 'algorithm' 'any' 'bimap' 'bind' 'circular_buffer'
+ 'concept' 'config' 'container' 'date'_'time' 'detail' 'dynamic_bitset'
+ 'exception' 'filesystem' 'flyweight' 'foreach' 'functional' 'fusion'
+ 'geometry' 'graph' 'heap' 'icl' 'integer' 'interprocess' 'intrusive' 'io'
+ 'iostreams' 'iterator' 'math' 'move' 'mpl' 'multiprcecision' 'numeric'
+ 'pending' 'phoenix' 'preprocessor' 'random' 'range' 'smart_ptr' 'spirit'
+ 'tuple' 'type_trains' 'typeof' 'unordered' 'utility' 'uuid'."""
+
+ homepage = "https://cran.r-project.org/web/packages/BH/index.html"
+ url = "https://cran.r-project.org/src/contrib/BH_1.60.0-2.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/BH"
+
+ version('1.60.0-2', 'b50fdc85285da05add4e9da664a2d551')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-colorspace/package.py b/var/spack/repos/builtin/packages/r-colorspace/package.py
new file mode 100644
index 0000000000..a7622cad95
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-colorspace/package.py
@@ -0,0 +1,44 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RColorspace(Package):
+ """Carries out mapping between assorted color spaces including RGB, HSV,
+ HLS, CIEXYZ, CIELUV, HCL (polar CIELUV), CIELAB and polar CIELAB.
+ Qualitative, sequential, and diverging color palettes based on HCL colors
+ are provided."""
+
+ homepage = "https://cran.r-project.org/web/packages/colorspace/index.html"
+ url = "https://cran.r-project.org/src/contrib/colorspace_1.2-6.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/colorspace"
+
+ version('1.2-6', 'a30191e9caf66f77ff4e99c062e9dce1')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-dichromat/package.py b/var/spack/repos/builtin/packages/r-dichromat/package.py
new file mode 100644
index 0000000000..663e5295af
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-dichromat/package.py
@@ -0,0 +1,42 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RDichromat(Package):
+ """Collapse red-green or green-blue distinctions to simulate the effects of
+ different types of color-blindness."""
+
+ homepage = "https://cran.r-project.org/web/packages/dichromat/index.html"
+ url = "https://cran.r-project.org/src/contrib/dichromat_2.0-0.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/dichromat"
+
+ version('2.0-0', '84e194ac95a69763d740947a7ee346a6')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-ggplot2/package.py b/var/spack/repos/builtin/packages/r-ggplot2/package.py
new file mode 100644
index 0000000000..2d1f53af26
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-ggplot2/package.py
@@ -0,0 +1,54 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RGgplot2(Package):
+ """An implementation of the grammar of graphics in R. It combines the
+ advantages of both base and lattice graphics: conditioning and shared axes
+ are handled automatically, and you can still build up a plot step by step
+ from multiple data sources. It also implements a sophisticated
+ multidimensional conditioning system and a consistent interface to map data
+ to aesthetic attributes. See http://ggplot2.org for more information,
+ documentation and examples."""
+
+ homepage = "http://ggplot2.org/"
+ url = "https://cran.r-project.org/src/contrib/ggplot2_2.1.0.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/ggplot2"
+
+ version('2.1.0', '771928cfb97c649c720423deb3ec7fd3')
+
+ extends('R')
+
+ depends_on('r-digest')
+ depends_on('r-gtable')
+ depends_on('r-mass')
+ depends_on('r-plyr')
+ depends_on('r-reshape2')
+ depends_on('r-scales')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-gridextra/package.py b/var/spack/repos/builtin/packages/r-gridextra/package.py
new file mode 100644
index 0000000000..d215d10678
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-gridextra/package.py
@@ -0,0 +1,44 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RGridextra(Package):
+ """Provides a number of user-level functions to work with "grid" graphics,
+ notably to arrange multiple grid-based plots on a page, and draw tables."""
+
+ homepage = "https://github.com/baptiste/gridextra"
+ url = "https://cran.r-project.org/src/contrib/gridExtra_2.2.1.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/gridExtra"
+
+ version('2.2.1', '7076c2122d387c7ef3add69a1c4fc1b2')
+
+ extends('R')
+
+ depends_on('r-gtable')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-gtable/package.py b/var/spack/repos/builtin/packages/r-gtable/package.py
new file mode 100644
index 0000000000..74dee0b3d5
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-gtable/package.py
@@ -0,0 +1,41 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RGtable(Package):
+ """Tools to make it easier to work with "tables" of 'grobs'."""
+
+ homepage = "https://cran.r-project.org/web/packages/gtable/index.html"
+ url = "https://cran.r-project.org/src/contrib/gtable_0.2.0.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/gtable"
+
+ version('0.2.0', '124090ae40b2dd3170ae11180e0d4cab')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-inline/package.py b/var/spack/repos/builtin/packages/r-inline/package.py
new file mode 100644
index 0000000000..35eb8ca76f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-inline/package.py
@@ -0,0 +1,43 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RInline(Package):
+ """Functionality to dynamically define R functions and S4 methods with
+ inlined C, C++ or Fortran code supporting .C and .Call calling
+ conventions."""
+
+ homepage = "https://cran.r-project.org/web/packages/inline/index.html"
+ url = "https://cran.r-project.org/src/contrib/inline_0.3.14.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/inline"
+
+ version('0.3.14', '9fe304a6ebf0e3889c4c6a7ad1c50bca')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-labeling/package.py b/var/spack/repos/builtin/packages/r-labeling/package.py
new file mode 100644
index 0000000000..02e5da9d85
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-labeling/package.py
@@ -0,0 +1,41 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RLabeling(Package):
+ """Provides a range of axis labeling algorithms."""
+
+ homepage = "https://cran.r-project.org/web/packages/labeling/index.html"
+ url = "https://cran.r-project.org/src/contrib/labeling_0.3.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/labeling"
+
+ version('0.3', 'ccd7082ec0b211aba8a89d85176bb534')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-lattice/package.py b/var/spack/repos/builtin/packages/r-lattice/package.py
new file mode 100644
index 0000000000..ba29feefc4
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-lattice/package.py
@@ -0,0 +1,44 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RLattice(Package):
+ """A powerful and elegant high-level data visualization system inspired by
+ Trellis graphics, with an emphasis on multivariate data. Lattice is
+ sufficient for typical graphics needs, and is also flexible enough to
+ handle most nonstandard requirements. See ?Lattice for an introduction."""
+
+ homepage = "http://lattice.r-forge.r-project.org/"
+ url = "https://cran.r-project.org/src/contrib/lattice_0.20-33.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/lattice"
+
+ version('0.20-33', 'd487c94db1bfe00a27270f4c71baf53e')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-magrittr/package.py b/var/spack/repos/builtin/packages/r-magrittr/package.py
new file mode 100644
index 0000000000..11476c3d1e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-magrittr/package.py
@@ -0,0 +1,45 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RMagrittr(Package):
+ """Provides a mechanism for chaining commands with a new forward-pipe
+ operator, %>%. This operator will forward a value, or the result of an
+ expression, into the next function call/expression. There is flexible
+ support for the type of right-hand side expressions. For more information,
+ see package vignette."""
+
+ homepage = "https://cran.r-project.org/web/packages/magrittr/index.html"
+ url = "https://cran.r-project.org/src/contrib/magrittr_1.5.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/magrittr"
+
+ version('1.5', 'e74ab7329f2b9833f0c3c1216f86d65a')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-mass/package.py b/var/spack/repos/builtin/packages/r-mass/package.py
new file mode 100644
index 0000000000..1ab01d2256
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-mass/package.py
@@ -0,0 +1,42 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RMass(Package):
+ """Functions and datasets to support Venables and Ripley, "Modern Applied
+ Statistics with S" (4th edition, 2002)."""
+
+ homepage = "http://www.stats.ox.ac.uk/pub/MASS4/"
+ url = "https://cran.r-project.org/src/contrib/MASS_7.3-45.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/MASS"
+
+ version('7.3-45', 'aba3d12fab30f1793bee168a1efea88b')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-matrix/package.py b/var/spack/repos/builtin/packages/r-matrix/package.py
new file mode 100644
index 0000000000..fbd8a7b4df
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-matrix/package.py
@@ -0,0 +1,44 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RMatrix(Package):
+ """Classes and methods for dense and sparse matrices and operations on them
+ using 'LAPACK' and 'SuiteSparse'."""
+
+ homepage = "http://matrix.r-forge.r-project.org/"
+ url = "https://cran.r-project.org/src/contrib/Matrix_1.2-6.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/Matrix"
+
+ version('1.2-6', 'f545307fb1284861e9266c4e9712c55e')
+
+ extends('R')
+
+ depends_on('r-lattice')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-munsell/package.py b/var/spack/repos/builtin/packages/r-munsell/package.py
new file mode 100644
index 0000000000..3216c95e00
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-munsell/package.py
@@ -0,0 +1,47 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RMunsell(Package):
+ """Provides easy access to, and manipulation of, the Munsell colours.
+ Provides a mapping between Munsell's original notation (e.g. "5R 5/10") and
+ hexadecimal strings suitable for use directly in R graphics. Also provides
+ utilities to explore slices through the Munsell colour tree, to transform
+ Munsell colours and display colour palettes."""
+
+ homepage = "https://cran.r-project.org/web/packages/munsell/index.html"
+ url = "https://cran.r-project.org/src/contrib/munsell_0.4.3.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/munsell"
+
+ version('0.4.3', 'ebd205323dc37c948f499ee08be9c476')
+
+ extends('R')
+
+ depends_on('r-colorspace')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-plyr/package.py b/var/spack/repos/builtin/packages/r-plyr/package.py
new file mode 100644
index 0000000000..192e7e8b18
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-plyr/package.py
@@ -0,0 +1,49 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RPlyr(Package):
+ """A set of tools that solves a common set of problems: you need to break a
+ big problem down into manageable pieces, operate on each piece and then put
+ all the pieces back together. For example, you might want to fit a model to
+ each spatial location or time point in your study, summarise data by panels
+ or collapse high-dimensional arrays to simpler summary statistics. The
+ development of 'plyr' has been generously supported by 'Becton
+ Dickinson'."""
+
+ homepage = "http://had.co.nz/plyr"
+ url = "https://cran.r-project.org/src/contrib/plyr_1.8.4.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/plyr"
+
+ version('1.8.4', 'ef455cf7fc06e34837692156b7b2587b')
+
+ extends('R')
+
+ depends_on('r-rcpp')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-rcolorbrewer/package.py b/var/spack/repos/builtin/packages/r-rcolorbrewer/package.py
new file mode 100644
index 0000000000..b81ec2561c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-rcolorbrewer/package.py
@@ -0,0 +1,42 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RRcolorbrewer(Package):
+ """Provides color schemes for maps (and other graphics) designed by Cynthia
+ Brewer as described at http://colorbrewer2.org"""
+
+ homepage = "http://colorbrewer2.org"
+ url = "https://cran.r-project.org/src/contrib/RColorBrewer_1.1-2.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/RColorBrewer"
+
+ version('1.1-2', '66054d83eade4dff8a43ad4732691182')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-rcpp/package.py b/var/spack/repos/builtin/packages/r-rcpp/package.py
new file mode 100644
index 0000000000..2428f4af3b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-rcpp/package.py
@@ -0,0 +1,49 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RRcpp(Package):
+ """The 'Rcpp' package provides R functions as well as C++ classes which
+ offer a seamless integration of R and C++. Many R data types and objects
+ can be mapped back and forth to C++ equivalents which facilitates both
+ writing of new code as well as easier integration of third-party libraries.
+ Documentation about 'Rcpp' is provided by several vignettes included in
+ this package, via the 'Rcpp Gallery' site at <http://gallery.rcpp.org>, the
+ paper by Eddelbuettel and Francois (2011, JSS), and the book by
+ Eddelbuettel (2013, Springer); see 'citation("Rcpp")' for details on these
+ last two."""
+
+ homepage = "http://dirk.eddelbuettel.com/code/rcpp.html"
+ url = "https://cran.r-project.org/src/contrib/Rcpp_0.12.5.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/Rcpp"
+
+ version('0.12.5', 'f03ec05b4e391cc46e7ce330e82ff5e2')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-rcppeigen/package.py b/var/spack/repos/builtin/packages/r-rcppeigen/package.py
new file mode 100644
index 0000000000..3175628a73
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-rcppeigen/package.py
@@ -0,0 +1,56 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RRcppeigen(Package):
+ """R and 'Eigen' integration using 'Rcpp'. 'Eigen' is a C++ template
+ library for linear algebra: matrices, vectors, numerical solvers and
+ related algorithms. It supports dense and sparse matrices on integer,
+ floating point and complex numbers, decompositions of such matrices, and
+ solutions of linear systems. Its performance on many algorithms is
+ comparable with some of the best implementations based on 'Lapack' and
+ level-3 'BLAS'. The 'RcppEigen' package includes the header files from the
+ 'Eigen' C++ template library (currently version 3.2.8). Thus users do not
+ need to install 'Eigen' itself in order to use 'RcppEigen'. Since version
+ 3.1.1, 'Eigen' is licensed under the Mozilla Public License (version 2);
+ earlier version were licensed under the GNU LGPL version 3 or later.
+ 'RcppEigen' (the 'Rcpp' bindings/bridge to 'Eigen') is licensed under the
+ GNU GPL version 2 or later, as is the rest of 'Rcpp'."""
+
+ homepage = "http://eigen.tuxfamily.org/"
+ url = "https://cran.r-project.org/src/contrib/RcppEigen_0.3.2.8.1.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/RcppEigen"
+
+ version('0.3.2.8.1', '4146e06e4fdf7f4d08db7839069d479f')
+
+ extends('R')
+
+ depends_on('r-matrix')
+ depends_on('r-rcpp')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-reshape2/package.py b/var/spack/repos/builtin/packages/r-reshape2/package.py
new file mode 100644
index 0000000000..a96a314008
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-reshape2/package.py
@@ -0,0 +1,46 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RReshape2(Package):
+ """Flexibly restructure and aggregate data using just two functions: melt
+ and dcast (or acast)."""
+
+ homepage = "https://github.com/hadley/reshape"
+ url = "https://cran.r-project.org/src/contrib/reshape2_1.4.1.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/reshape2"
+
+ version('1.4.1', '41e9dffdf5c6fa830321ac9c8ebffe00')
+
+ extends('R')
+
+ depends_on('r-plyr')
+ depends_on('r-stringr')
+ depends_on('r-rcpp')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-rstan/package.py b/var/spack/repos/builtin/packages/r-rstan/package.py
new file mode 100644
index 0000000000..00fd5116d9
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-rstan/package.py
@@ -0,0 +1,57 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RRstan(Package):
+ """User-facing R functions are provided to parse, compile, test, estimate,
+ and analyze Stan models by accessing the header-only Stan library provided
+ by the 'StanHeaders' package. The Stan project develops a probabilistic
+ programming language that implements full Bayesian statistical inference
+ via Markov Chain Monte Carlo, rough Bayesian inference via variational
+ approximation, and (optionally penalized) maximum likelihood estimation via
+ optimization. In all three cases, automatic differentiation is used to
+ quickly and accurately evaluate gradients without burdening the user with
+ the need to derive the partial derivatives."""
+
+ homepage = "http://mc-stan.org/"
+ url = "https://cran.r-project.org/src/contrib/rstan_2.10.1.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/rstan"
+
+ version('2.10.1', 'f5d212f6f8551bdb91fe713d05d4052a')
+
+ extends('R')
+
+ depends_on('r-ggplot2')
+ depends_on('r-stanheaders')
+ depends_on('r-inline')
+ depends_on('r-gridextra')
+ depends_on('r-rcpp')
+ depends_on('r-rcppeigen')
+ depends_on('r-bh')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-scales/package.py b/var/spack/repos/builtin/packages/r-scales/package.py
new file mode 100644
index 0000000000..046a05d48e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-scales/package.py
@@ -0,0 +1,49 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RScales(Package):
+ """Graphical scales map data to aesthetics, and provide methods for
+ automatically determining breaks and labels for axes and legends."""
+
+ homepage = "https://github.com/hadley/scales"
+ url = "https://cran.r-project.org/src/contrib/scales_0.4.0.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/scales"
+
+ version('0.4.0', '7b5602d9c55595901192248bca25c099')
+
+ extends('R')
+
+ depends_on('r-rcolorbrewer')
+ depends_on('r-dichromat')
+ depends_on('r-plyr')
+ depends_on('r-munsell')
+ depends_on('r-labeling')
+ depends_on('r-rcpp')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-stanheaders/package.py b/var/spack/repos/builtin/packages/r-stanheaders/package.py
new file mode 100644
index 0000000000..c77b5aa8b6
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-stanheaders/package.py
@@ -0,0 +1,55 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RStanheaders(Package):
+ """The C++ header files of the Stan project are provided by this package,
+ but it contains no R code, vignettes, or function documentation. There is a
+ shared object containing part of the CVODES library, but it is not
+ accessible from R. StanHeaders is only useful for developers who want to
+ utilize the LinkingTo directive of their package's DESCRIPTION file to
+ build on the Stan library without incurring unnecessary dependencies. The
+ Stan project develops a probabilistic programming language that implements
+ full or approximate Bayesian statistical inference via Markov Chain Monte
+ Carlo or variational methods and implements (optionally penalized) maximum
+ likelihood estimation via optimization. The Stan library includes an
+ advanced automatic differentiation scheme, templated statistical and linear
+ algebra functions that can handle the automatically differentiable scalar
+ types (and doubles, ints, etc.), and a parser for the Stan language. The
+ 'rstan' package provides user-facing R functions to parse, compile, test,
+ estimate, and analyze Stan models."""
+
+ homepage = "http://mc-stan.org/"
+ url = "https://cran.r-project.org/src/contrib/StanHeaders_2.10.0-2.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/StanHeaders"
+
+ version('2.10.0-2', '9d09b1e9278f08768f7a988ad9082d57')
+
+ extends('R')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-stringi/package.py b/var/spack/repos/builtin/packages/r-stringi/package.py
new file mode 100644
index 0000000000..22774dedec
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-stringi/package.py
@@ -0,0 +1,51 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RStringi(Package):
+ """Allows for fast, correct, consistent, portable, as well as convenient
+ character string/text processing in every locale and any native encoding.
+ Owing to the use of the ICU library, the package provides R users with
+ platform-independent functions known to Java, Perl, Python, PHP, and Ruby
+ programmers. Among available features there are: pattern searching (e.g.,
+ with ICU Java-like regular expressions or the Unicode Collation Algorithm),
+ random string generation, case mapping, string transliteration,
+ concatenation, Unicode normalization, date-time formatting and parsing,
+ etc."""
+
+ homepage = "http://www.gagolewski.com/software/stringi/"
+ url = "https://cran.r-project.org/src/contrib/stringi_1.1.1.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/stringi"
+
+ version('1.1.1', '32b919ee3fa8474530c4942962a6d8d9')
+
+ extends('R')
+
+ depends_on('icu')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/r-stringr/package.py b/var/spack/repos/builtin/packages/r-stringr/package.py
new file mode 100644
index 0000000000..01fd969522
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-stringr/package.py
@@ -0,0 +1,48 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class RStringr(Package):
+ """A consistent, simple and easy to use set of wrappers around the
+ fantastic 'stringi' package. All function and argument names (and
+ positions) are consistent, all functions deal with "NA"'s and zero length
+ vectors in the same way, and the output from one function is easy to feed
+ into the input of another."""
+
+ homepage = "https://cran.r-project.org/web/packages/stringr/index.html"
+ url = "https://cran.r-project.org/src/contrib/stringr_1.0.0.tar.gz"
+ list_url = "https://cran.r-project.org/src/contrib/Archive/stringr"
+
+ version('1.0.0', '5ca977c90351f78b1b888b379114a7b4')
+
+ extends('R')
+
+ depends_on('r-stringi')
+ depends_on('r-magrittr')
+
+ def install(self, spec, prefix):
+ R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
+ self.stage.source_path)
diff --git a/var/spack/repos/builtin/packages/ruby/package.py b/var/spack/repos/builtin/packages/ruby/package.py
index dd71913fc9..8dc314c171 100644
--- a/var/spack/repos/builtin/packages/ruby/package.py
+++ b/var/spack/repos/builtin/packages/ruby/package.py
@@ -35,9 +35,20 @@ class Ruby(Package):
extendable = True
version('2.2.0', 'cd03b28fd0b555970f5c4fd481700852')
+ depends_on('libffi')
+ depends_on('zlib')
+ variant('openssl', default=False, description="Enable OpenSSL support")
+ depends_on('openssl', when='+openssl')
+ variant('readline', default=False, description="Enable Readline support")
+ depends_on('readline', when='+readline')
def install(self, spec, prefix):
- configure("--prefix=%s" % prefix)
+ options = ["--prefix=%s" % prefix]
+ if '+openssl' in spec:
+ options.append("--with-openssl-dir=%s" % spec['openssl'].prefix)
+ if '+readline' in spec:
+ options.append("--with-readline-dir=%s" % spec['readline'].prefix)
+ configure(*options)
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py
index 3c2b4993ac..2f6e42c439 100644
--- a/var/spack/repos/builtin/packages/scotch/package.py
+++ b/var/spack/repos/builtin/packages/scotch/package.py
@@ -171,15 +171,13 @@ class Scotch(Package):
target == 'ptscotch'))
make(target, parallel=can_make_parallel)
- # todo change this to take into account darwin systems
- lib_ext = '.so' if '+shared' in self.spec else '.a'
+ lib_ext = dso_suffix if '+shared' in self.spec else 'a'
# It seams easier to remove metis wrappers from the folder that will be
# installed than to tweak the Makefiles
if '+metis' not in self.spec:
with working_dir('lib'):
- lib_ext = '.so' if '+shared' in self.spec else '.a'
- force_remove('libscotchmetis{0}'.format(lib_ext))
- force_remove('libptscotchparmetis{0}'.format(lib_ext))
+ force_remove('libscotchmetis.{0}'.format(lib_ext))
+ force_remove('libptscotchparmetis.{0}'.format(lib_ext))
with working_dir('include'):
force_remove('metis.h')
@@ -187,8 +185,8 @@ class Scotch(Package):
if '~esmumps' in self.spec and self.spec.version < Version('6.0.0'):
with working_dir('lib'):
- force_remove('libesmumps{0}'.format(lib_ext))
- force_remove('libptesmumps{0}'.format(lib_ext))
+ force_remove('libesmumps.{0}'.format(lib_ext))
+ force_remove('libptesmumps.{0}'.format(lib_ext))
with working_dir('include'):
force_remove('esmumps.h')
diff --git a/var/spack/repos/builtin/packages/swiftsim/package.py b/var/spack/repos/builtin/packages/swiftsim/package.py
new file mode 100644
index 0000000000..42e8fb466a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/swiftsim/package.py
@@ -0,0 +1,77 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+
+from spack import *
+
+import llnl.util.tty as tty
+
+
+class Swiftsim(Package):
+ """
+ SPH With Inter-dependent Fine-grained Tasking (SWIFT) provides
+ astrophysicists with a state of the art framework to perform
+ particle based simulations.
+ """
+
+ homepage = 'http://icc.dur.ac.uk/swift/'
+ url = 'http://gitlab.cosma.dur.ac.uk/swift/swiftsim/repository/archive.tar.gz?ref=v0.3.0'
+
+ version('0.3.0', git='https://gitlab.cosma.dur.ac.uk/swift/swiftsim.git', commit='254cc1b563b2f88ddcf437b1f71da123bb9db733')
+
+ variant('mpi', default=True, description='Enable distributed memory parallelism')
+
+ # Build dependencies
+ depends_on('autoconf')
+ depends_on('automake')
+ depends_on('libtool')
+ depends_on('m4')
+ # link-time / run-time dependencies
+ depends_on('mpi', when='+mpi')
+ depends_on('metis')
+ depends_on('hdf5~mpi', when='~mpi')
+ depends_on('hdf5+mpi', when='+mpi')
+
+ def setup_environment(self, spack_env, run_env):
+ # Needed to be able to download from the Durham gitlab repository
+ tty.warn('Setting "GIT_SSL_NO_VERIFY=1"')
+ tty.warn('This is needed to clone SWIFT repository')
+ spack_env.set('GIT_SSL_NO_VERIFY', 1)
+
+ def install(self, spec, prefix):
+ # Generate configure from configure.ac
+ # and Makefile.am
+ libtoolize()
+ aclocal()
+ autoconf()
+ autogen = Executable('./autogen.sh')
+ autogen()
+
+ # Configure and install
+ options = ['--prefix=%s' % prefix,
+ '--enable-mpi' if '+mpi' in spec else '--disable-mpi',
+ '--enable-optimization']
+ configure(*options)
+ make()
+ make("install")