Merge branch 'develop' of https://github.com/LLNL/spack into features/env_objects_flying_around
This commit is contained in:
commit
f9438c75d0
9 changed files with 128 additions and 28 deletions
|
@ -38,7 +38,7 @@ contains tarballs for each package, named after each package.
|
|||
|
||||
.. note::
|
||||
|
||||
Archives are **not** named exactly they were in the package's fetch
|
||||
Archives are **not** named exactly the way they were in the package's fetch
|
||||
URL. They have the form ``<name>-<version>.<extension>``, where
|
||||
``<name>`` is Spack's name for the package, ``<version>`` is the
|
||||
version of the tarball, and ``<extension>`` is whatever format the
|
||||
|
|
|
@ -2160,6 +2160,62 @@ package, this allows us to avoid race conditions in the library's
|
|||
build system.
|
||||
|
||||
|
||||
.. _sanity-checks:
|
||||
|
||||
Sanity checking an intallation
|
||||
--------------------------------
|
||||
|
||||
By default, Spack assumes that a build has failed if nothing is
|
||||
written to the install prefix, and that it has succeeded if anything
|
||||
(a file, a directory, etc.) is written to the install prefix after
|
||||
``install()`` completes.
|
||||
|
||||
Consider a simple autotools build like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def install(self, spec, prefix):
|
||||
configure("--prefix=" + prefix)
|
||||
make()
|
||||
make("install")
|
||||
|
||||
If you are using using standard autotools or CMake, ``configure`` and
|
||||
``make`` will not write anything to the install prefix. Only ``make
|
||||
install`` writes the files, and only once the build is already
|
||||
complete. Not all builds are like this. Many builds of scientific
|
||||
software modify the install prefix *before* ``make install``. Builds
|
||||
like this can falsely report that they were successfully installed if
|
||||
an error occurs before the install is complete but after files have
|
||||
been written to the ``prefix``.
|
||||
|
||||
|
||||
``sanity_check_is_file`` and ``sanity_check_is_dir``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can optionally specify *sanity checks* to deal with this problem.
|
||||
Add properties like this to your package:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class MyPackage(Package):
|
||||
...
|
||||
|
||||
sanity_check_is_file = ['include/libelf.h']
|
||||
sanity_check_is_dir = [lib]
|
||||
|
||||
def install(self, spec, prefix):
|
||||
configure("--prefix=" + prefix)
|
||||
make()
|
||||
make("install")
|
||||
|
||||
Now, after ``install()`` runs, Spack will check whether
|
||||
``$prefix/include/libelf.h`` exists and is a file, and whether
|
||||
``$prefix/lib`` exists and is a directory. If the checks fail, then
|
||||
the build will fail and the install prefix will be removed. If they
|
||||
succeed, Spack considers the build succeeful and keeps the prefix in
|
||||
place.
|
||||
|
||||
|
||||
.. _file-manipulation:
|
||||
|
||||
File manipulation functions
|
||||
|
|
|
@ -312,6 +312,18 @@ class SomePackage(Package):
|
|||
"""Most packages are NOT extendable. Set to True if you want extensions."""
|
||||
extendable = False
|
||||
|
||||
"""List of prefix-relative file paths (or a single path). If these do
|
||||
not exist after install, or if they exist but are not files,
|
||||
sanity checks fail.
|
||||
"""
|
||||
sanity_check_is_file = []
|
||||
|
||||
"""List of prefix-relative directory paths (or a single path). If
|
||||
these do not exist after install, or if they exist but are not
|
||||
directories, sanity checks will fail.
|
||||
"""
|
||||
sanity_check_is_dir = []
|
||||
|
||||
|
||||
def __init__(self, spec):
|
||||
# this determines how the package should be built.
|
||||
|
@ -903,7 +915,7 @@ def build_process():
|
|||
raise e
|
||||
|
||||
# Ensure that something was actually installed.
|
||||
self._sanity_check_install()
|
||||
self.sanity_check_prefix()
|
||||
|
||||
# Copy provenance into the install directory on success
|
||||
log_install_path = spack.install_layout.build_log_path(self.spec)
|
||||
|
@ -946,7 +958,21 @@ def build_process():
|
|||
spack.hooks.post_install(self)
|
||||
|
||||
|
||||
def _sanity_check_install(self):
|
||||
def sanity_check_prefix(self):
|
||||
"""This function checks whether install succeeded."""
|
||||
def check_paths(path_list, filetype, predicate):
|
||||
if isinstance(path_list, basestring):
|
||||
path_list = [path_list]
|
||||
|
||||
for path in path_list:
|
||||
abs_path = os.path.join(self.prefix, path)
|
||||
if not predicate(abs_path):
|
||||
raise InstallError("Install failed for %s. No such %s in prefix: %s"
|
||||
% (self.name, filetype, path))
|
||||
|
||||
check_paths(self.sanity_check_is_file, 'file', os.path.isfile)
|
||||
check_paths(self.sanity_check_is_dir, 'directory', os.path.isdir)
|
||||
|
||||
installed = set(os.listdir(self.prefix))
|
||||
installed.difference_update(spack.install_layout.hidden_file_paths)
|
||||
if not installed:
|
||||
|
|
|
@ -4,10 +4,13 @@ class Binutils(Package):
|
|||
"""GNU binutils, which contain the linker, assembler, objdump and others"""
|
||||
homepage = "http://www.gnu.org/software/binutils/"
|
||||
|
||||
version('2.25', 'd9f3303f802a5b6b0bb73a335ab89d66',url="ftp://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.bz2")
|
||||
version('2.24', 'e0f71a7b2ddab0f8612336ac81d9636b',url="ftp://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.bz2")
|
||||
version('2.23.2', '4f8fa651e35ef262edc01d60fb45702e',url="ftp://ftp.gnu.org/gnu/binutils/binutils-2.23.2.tar.bz2")
|
||||
version('2.20.1', '2b9dc8f2b7dbd5ec5992c6e29de0b764',url="ftp://ftp.gnu.org/gnu/binutils/binutils-2.20.1.tar.bz2")
|
||||
url="https://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.bz2"
|
||||
|
||||
version('2.26', '64146a0faa3b411ba774f47d41de239f')
|
||||
version('2.25', 'd9f3303f802a5b6b0bb73a335ab89d66')
|
||||
version('2.24', 'e0f71a7b2ddab0f8612336ac81d9636b')
|
||||
version('2.23.2', '4f8fa651e35ef262edc01d60fb45702e')
|
||||
version('2.20.1', '2b9dc8f2b7dbd5ec5992c6e29de0b764')
|
||||
|
||||
# Add a patch that creates binutils libiberty_pic.a which is preferred by OpenSpeedShop and cbtf-krell
|
||||
variant('krellpatch', default=False, description="build with openspeedshop based patch.")
|
||||
|
|
|
@ -7,6 +7,7 @@ class Curl(Package):
|
|||
homepage = "http://curl.haxx.se"
|
||||
url = "http://curl.haxx.se/download/curl-7.46.0.tar.bz2"
|
||||
|
||||
version('7.47.1', '9ea3123449439bbd960cd25cf98796fb')
|
||||
version('7.46.0', '9979f989a2a9930d10f1b3deeabc2148')
|
||||
version('7.45.0', '62c1a352b28558f25ba6209214beadc8')
|
||||
version('7.44.0', '6b952ca00e5473b16a11f05f06aa8dae')
|
||||
|
|
|
@ -5,14 +5,22 @@ class Git(Package):
|
|||
system designed to handle everything from small to very large
|
||||
projects with speed and efficiency."""
|
||||
homepage = "http://git-scm.com"
|
||||
url = "https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz"
|
||||
url = "https://github.com/git/git/tarball/v2.7.1"
|
||||
|
||||
version('2.6.3', 'b711be7628a4a2c25f38d859ee81b423')
|
||||
version('2.6.2', 'da293290da69f45a86a311ad3cd43dc8')
|
||||
version('2.6.1', '4c62ee9c5991fe93d99cf2a6b68397fd')
|
||||
version('2.6.0', 'eb76a07148d94802a1745d759716a57e')
|
||||
version('2.5.4', '3eca2390cf1fa698b48e2a233563a76b')
|
||||
version('2.2.1', 'ff41fdb094eed1ec430aed8ee9b9849c')
|
||||
version('2.8.0-rc2', 'c2cf9f2cc70e35f2fafbaf9258f82e4c')
|
||||
version('2.7.3', 'fa1c008b56618c355a32ba4a678305f6')
|
||||
version('2.7.1', 'bf0706b433a8dedd27a63a72f9a66060')
|
||||
|
||||
|
||||
# See here for info on vulnerable Git versions:
|
||||
# http://www.theregister.co.uk/2016/03/16/git_server_client_patch_now/
|
||||
# All the following are vulnerable
|
||||
#version('2.6.3', 'b711be7628a4a2c25f38d859ee81b423')
|
||||
#version('2.6.2', 'da293290da69f45a86a311ad3cd43dc8')
|
||||
#version('2.6.1', '4c62ee9c5991fe93d99cf2a6b68397fd')
|
||||
#version('2.6.0', 'eb76a07148d94802a1745d759716a57e')
|
||||
#version('2.5.4', '3eca2390cf1fa698b48e2a233563a76b')
|
||||
#version('2.2.1', 'ff41fdb094eed1ec430aed8ee9b9849c')
|
||||
|
||||
|
||||
# Git compiles with curl support by default on but if your system
|
||||
|
@ -24,6 +32,7 @@ class Git(Package):
|
|||
variant("expat", default=False, description="Add the internal support of expat for https push")
|
||||
|
||||
depends_on("openssl")
|
||||
depends_on("autoconf")
|
||||
depends_on("curl", when="+curl")
|
||||
depends_on("expat", when="+expat")
|
||||
|
||||
|
@ -47,6 +56,7 @@ def install(self, spec, prefix):
|
|||
if '+expat' in spec:
|
||||
configure_args.append("--with-expat=%s" % spec['expat'].prefix)
|
||||
|
||||
which('autoreconf')('-i')
|
||||
configure(*configure_args)
|
||||
make()
|
||||
make("install")
|
||||
|
|
|
@ -38,6 +38,8 @@ class Libelf(Package):
|
|||
|
||||
provides('elf')
|
||||
|
||||
sanity_check_is_file = 'include/libelf.h'
|
||||
|
||||
def install(self, spec, prefix):
|
||||
configure("--prefix=" + prefix,
|
||||
"--enable-shared",
|
||||
|
|
|
@ -5,6 +5,7 @@ class Openblas(Package):
|
|||
homepage = "http://www.openblas.net"
|
||||
url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz"
|
||||
|
||||
version('0.2.16', 'fef46ab92463bdbb1479dcec594ef6dc')
|
||||
version('0.2.15', 'b1190f3d3471685f17cfd1ec1d252ac9')
|
||||
|
||||
# virtual dependency
|
||||
|
|
|
@ -13,6 +13,7 @@ class Papi(Package):
|
|||
homepage = "http://icl.cs.utk.edu/papi/index.html"
|
||||
|
||||
url = "http://icl.cs.utk.edu/projects/papi/downloads/papi-5.4.1.tar.gz"
|
||||
version('5.4.3', '3211b5a5bb389fe692370f5cf4cc2412')
|
||||
version('5.4.1', '9134a99219c79767a11463a76b0b01a2')
|
||||
version('5.3.0', '367961dd0ab426e5ae367c2713924ffb')
|
||||
|
||||
|
|
Loading…
Reference in a new issue