diff options
21 files changed, 213 insertions, 31 deletions
diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst index 50a161a175..948092047b 100644 --- a/lib/spack/docs/basic_usage.rst +++ b/lib/spack/docs/basic_usage.rst @@ -1866,6 +1866,10 @@ to call the Cray compiler wrappers during build time. For more on compiler configuration, check out :ref:`compiler-config`. +Spack sets the default Cray link type to dynamic, to better match other +other platforms. Individual packages can enable static linking (which is the +default outside of Spack on cray systems) using the -static flag. + Setting defaults and using Cray modules ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index 6bafaecc7d..70def5c39a 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -1307,9 +1307,9 @@ The dependency types are: If not specified, ``type`` is assumed to be ``("build", "link")``. This is the common case for compiled language usage. Also available are the aliases -``alldeps`` for all dependency types and ``nolink`` (``("build", "run")``) for -use by dependencies which are not expressed via a linker (e.g., Python or Lua -module loading). +``"alldeps"`` for all dependency types and ``"nolink"`` (``("build", "run")``) +for use by dependencies which are not expressed via a linker (e.g., Python or +Lua module loading). .. _setup-dependent-environment: diff --git a/lib/spack/env/cc b/lib/spack/env/cc index bf98b4c354..c6bb50d261 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -110,13 +110,13 @@ case "$command" in comp="CXX" lang_flags=CXX ;; - f90|fc|f95|gfortran|ifort|pgfortran|xlf90|nagfor) + ftn|f90|fc|f95|gfortran|ifort|pgfortran|xlf90|nagfor) command="$SPACK_FC" language="Fortran 90" comp="FC" lang_flags=F ;; - f77|gfortran|ifort|pgfortran|xlf|nagfor) + f77|gfortran|ifort|pgfortran|xlf|nagfor|ftn) command="$SPACK_F77" language="Fortran 77" comp="F77" diff --git a/lib/spack/env/craype/CC b/lib/spack/env/craype/CC new file mode 120000 index 0000000000..82c2b8e90a --- /dev/null +++ b/lib/spack/env/craype/CC @@ -0,0 +1 @@ +../cc
\ No newline at end of file diff --git a/lib/spack/env/craype/cc b/lib/spack/env/craype/cc new file mode 120000 index 0000000000..82c2b8e90a --- /dev/null +++ b/lib/spack/env/craype/cc @@ -0,0 +1 @@ +../cc
\ No newline at end of file diff --git a/lib/spack/env/craype/ftn b/lib/spack/env/craype/ftn new file mode 120000 index 0000000000..82c2b8e90a --- /dev/null +++ b/lib/spack/env/craype/ftn @@ -0,0 +1 @@ +../cc
\ No newline at end of file diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py index a7cda2bf68..974505ee3a 100644 --- a/lib/spack/spack/architecture.py +++ b/lib/spack/spack/architecture.py @@ -76,7 +76,6 @@ attributes front_os and back_os. The operating system as described earlier, will be responsible for compiler detection. """ import os -import imp import inspect from llnl.util.lang import memoized, list_modules, key_ordering @@ -190,6 +189,12 @@ class Platform(object): return self.operating_sys.get(name, None) + @classmethod + def setup_platform_environment(self, pkg, env): + """ Subclass can override this method if it requires any + platform-specific build environment modifications. + """ + pass @classmethod def detect(self): @@ -200,15 +205,12 @@ class Platform(object): """ raise NotImplementedError() - def __repr__(self): return self.__str__() - def __str__(self): return self.name - def _cmp_key(self): t_keys = ''.join(str(t._cmp_key()) for t in sorted(self.targets.values())) @@ -279,7 +281,7 @@ class OperatingSystem(object): # ensure all the version calls we made are cached in the parent # process, as well. This speeds up Spack a lot. - clist = reduce(lambda x, y: x+y, compiler_lists) + clist = reduce(lambda x, y: x + y, compiler_lists) return clist def find_compiler(self, cmp_cls, *path): @@ -320,7 +322,7 @@ class OperatingSystem(object): # prefer the one with more compilers. prev_paths = [prev.cc, prev.cxx, prev.f77, prev.fc] - newcount = len([p for p in paths if p is not None]) + newcount = len([p for p in paths if p is not None]) prevcount = len([p for p in prev_paths if p is not None]) # Don't add if it's not an improvement over prev compiler. @@ -337,6 +339,7 @@ class OperatingSystem(object): d['version'] = self.version return d + @key_ordering class Arch(object): """Architecture is now a class to help with setting attributes. @@ -377,11 +380,9 @@ class Arch(object): else: return '' - def __contains__(self, string): return string in str(self) - def _cmp_key(self): if isinstance(self.platform, Platform): platform = self.platform.name @@ -424,7 +425,7 @@ def _operating_system_from_dict(os_name, plat=None): if isinstance(os_name, dict): name = os_name['name'] version = os_name['version'] - return plat.operating_system(name+version) + return plat.operating_system(name + version) else: return plat.operating_system(os_name) diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 93fb0690f7..5affd3c7c5 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -444,6 +444,7 @@ def setup_package(pkg, dirty=False): set_compiler_environment_variables(pkg, spack_env) set_build_environment_variables(pkg, spack_env, dirty) + pkg.spec.architecture.platform.setup_platform_environment(pkg, spack_env) load_external_modules(pkg) # traverse in postorder so package can use vars from its dependencies spec = pkg.spec diff --git a/lib/spack/spack/directives.py b/lib/spack/spack/directives.py index 88d2aaf472..e92dd6fb67 100644 --- a/lib/spack/spack/directives.py +++ b/lib/spack/spack/directives.py @@ -189,7 +189,7 @@ def _depends_on(pkg, spec, when=None, type=None): type = ('build', 'link') if isinstance(type, str): - type = (type,) + type = spack.spec.special_types.get(type, (type,)) for deptype in type: if deptype not in spack.spec.alldeps: diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 6a92c548fb..c916bfaaa2 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1439,6 +1439,13 @@ def install_dependency_symlinks(pkg, spec, prefix): flatten_dependencies(spec, prefix) +def use_cray_compiler_names(): + """Compiler names for builds that rely on cray compiler names.""" + os.environ['CC'] = 'cc' + os.environ['CXX'] = 'CC' + os.environ['FC'] = 'ftn' + os.environ['F77'] = 'ftn' + def flatten_dependencies(spec, flat_dir): """Make each dependency of spec present in dir via symlink.""" for dep in spec.traverse(root=False): diff --git a/lib/spack/spack/platforms/cray_xc.py b/lib/spack/spack/platforms/cray_xc.py index 0f6599ab30..2b065d5bbd 100644 --- a/lib/spack/spack/platforms/cray_xc.py +++ b/lib/spack/spack/platforms/cray_xc.py @@ -4,6 +4,7 @@ from spack.operating_systems.linux_distro import LinuxDistro from spack.operating_systems.cnl import Cnl from spack.util.executable import which + class CrayXc(Platform): priority = 20 front_end = 'sandybridge' @@ -35,7 +36,7 @@ class CrayXc(Platform): self.add_target('ivybridge', Target('ivybridge', 'craype-ivybridge')) self.add_target('haswell', - Target('haswell','craype-haswell')) + Target('haswell', 'craype-haswell')) # Front end of the cray platform is a linux distro. linux_dist = LinuxDistro() @@ -44,11 +45,25 @@ class CrayXc(Platform): self.add_operating_system('CNL10', Cnl()) @classmethod + def setup_platform_environment(self, pkg, env): + """ Change the linker to default dynamic to be more + similar to linux/standard linker behavior + """ + env.set('CRAYPE_LINK_TYPE', 'dynamic') + cray_wrapper_names = join_path(spack.build_env_path, 'cray') + if os.path.isdir(cray_wrapper_names): + env.prepend_path('PATH', cray_wrapper_names) + + @classmethod def detect(self): - if os.path.exists('/cray_home'): - cc_verbose = which('cc') - cc_verbose.add_default_arg('-craype-verbose') - text = cc_verbose(output=str, error=str, ignore_errors=True).split() + try: + cc_verbose = which('ftn') + text = cc_verbose('-craype-verbose', + output=str, error=str, + ignore_errors=True).split() if '-D__CRAYXC' in text: return True - return False + else: + return False + except: + return False diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index e694f2b2da..8bdae0445e 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -155,6 +155,10 @@ _any_version = VersionList([':']) # Special types of dependencies. alldeps = ('build', 'link', 'run') nolink = ('build', 'run') +special_types = { + 'alldeps': alldeps, + 'nolink': nolink, +} def index_specs(specs): @@ -542,7 +546,8 @@ class Spec(object): return alldeps # Force deptype to be a set object so that we can do set intersections. if isinstance(deptype, str): - return (deptype,) + # Support special deptypes. + return special_types.get(deptype, (deptype,)) return deptype def _find_deps(self, where, deptype): diff --git a/var/spack/repos/builtin/packages/adios/package.py b/var/spack/repos/builtin/packages/adios/package.py index 9e0452ba6f..59e0a451a9 100644 --- a/var/spack/repos/builtin/packages/adios/package.py +++ b/var/spack/repos/builtin/packages/adios/package.py @@ -12,9 +12,9 @@ class Adios(Package): """ homepage = "http://www.olcf.ornl.gov/center-projects/adios/" - url = "http://users.nccs.gov/~pnorbert/adios-1.9.0.tar.gz" + url = "https://github.com/ornladios/ADIOS/archive/v1.9.0.tar.gz" - version('1.9.0', 'dbf5cb10e32add2f04c9b4052b7ffa76') + version('1.9.0', '310ff02388bbaa2b1c1710ee970b5678') # Lots of setting up here for this package # module swap PrgEnv-intel PrgEnv-$COMP diff --git a/var/spack/repos/builtin/packages/armadillo/package.py b/var/spack/repos/builtin/packages/armadillo/package.py index b3e5994e30..4356f60aca 100644 --- a/var/spack/repos/builtin/packages/armadillo/package.py +++ b/var/spack/repos/builtin/packages/armadillo/package.py @@ -33,11 +33,13 @@ class Armadillo(Package): homepage = "http://arma.sourceforge.net/" url = "http://sourceforge.net/projects/arma/files/armadillo-7.200.1.tar.xz" + version('7.200.2', 'b21585372d67a8876117fd515d8cf0a2') version('7.200.1', 'ed86d6df0058979e107502e1fe3e469e') variant('hdf5', default=False, description='Include HDF5 support') - depends_on('arpack') + depends_on('cmake@2.8:', type='build') + depends_on('arpack-ng') # old arpack causes undefined symbols depends_on('blas') depends_on('lapack') depends_on('superlu@5.2:') @@ -46,8 +48,8 @@ class Armadillo(Package): def install(self, spec, prefix): cmake_args = [ # ARPACK support - '-DARPACK_LIBRARY={0}/libarpack.a'.format( - spec['arpack'].prefix.lib), + '-DARPACK_LIBRARY={0}/libarpack.{1}'.format( + spec['arpack-ng'].prefix.lib, dso_suffix), # BLAS support '-DBLAS_LIBRARY={0}'.format(spec['blas'].blas_shared_lib), # LAPACK support diff --git a/var/spack/repos/builtin/packages/cdo/package.py b/var/spack/repos/builtin/packages/cdo/package.py new file mode 100644 index 0000000000..7400c3a56c --- /dev/null +++ b/var/spack/repos/builtin/packages/cdo/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 Cdo(Package): + """CDO is a collection of command line Operators to manipulate and analyse + Climate and NWP model Data. """ + + homepage = "https://code.zmaw.de/projects/cdo" + url = "https://code.zmaw.de/attachments/download/10198/cdo-1.6.9.tar.gz" + + version('1.6.9', 'bf0997bf20e812f35e10188a930e24e2') + + depends_on('netcdf') + + def install(self, spec, prefix): + configure('--prefix={0}'.format(prefix)) + make() + make('install') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 51a5823aa5..d169940c86 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -40,7 +40,7 @@ class Hdf5(Package): version('1.10.0-patch1', '9180ff0ef8dc2ef3f61bd37a7404f295') version('1.10.0', 'bdc935337ee8282579cd6bc4270ad199') - version('1.8.16', 'b8ed9a36ae142317f88b0c7ef4b9c618', preferred=True) + version('1.8.16', 'b8ed9a36ae142317f88b0c7ef4b9c618') version('1.8.15', '03cccb5b33dbe975fdcd8ae9dc021f24') version('1.8.13', 'c03426e9e77d7766944654280b467289') diff --git a/var/spack/repos/builtin/packages/ilmbase/package.py b/var/spack/repos/builtin/packages/ilmbase/package.py new file mode 100644 index 0000000000..873c830623 --- /dev/null +++ b/var/spack/repos/builtin/packages/ilmbase/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 Ilmbase(Package): + """OpenEXR ILM Base libraries (high dynamic-range image file format)""" + + homepage = "http://www.openexr.com/" + url = "http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.2.0.tar.gz" + + version('2.2.0', 'b540db502c5fa42078249f43d18a4652') + version('2.1.0', 'af1115f4d759c574ce84efcde9845d29') + version('2.0.1', '74c0d0d2873960bd0dc1993f8e03f0ae') + version('1.0.2', '26c133ee8ca48e1196fbfb3ffe292ab4') + version('0.9.0', '4df45f8116cb7a013b286caf6da30a2e') + + def install(self, spec, prefix): + configure('--prefix={0}'.format(prefix)) + make('install') diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 063d38e4f9..ad4ee59640 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -33,6 +33,7 @@ class Netcdf(Package): homepage = "http://www.unidata.ucar.edu/software/netcdf" url = "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.3.3.tar.gz" + version('4.4.1', '7843e35b661c99e1d49e60791d5072d8') version('4.4.0', 'cffda0cbd97fdb3a06e9274f7aef438e') version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') @@ -47,8 +48,10 @@ class Netcdf(Package): # Required for NetCDF-4 support depends_on("zlib") - depends_on("hdf5+mpi", when='+mpi') - depends_on("hdf5~mpi", when='~mpi') + depends_on('hdf5@:1.8+mpi', when='@:4.4.0+mpi') + depends_on('hdf5+mpi', when='@4.4.1:+mpi') + depends_on('hdf5@:1.8~mpi', when='@:4.4.0~mpi') + depends_on('hdf5~mpi', when='@4.4.1:~mpi') def install(self, spec, prefix): # Environment variables diff --git a/var/spack/repos/builtin/packages/openexr/package.py b/var/spack/repos/builtin/packages/openexr/package.py new file mode 100644 index 0000000000..3619bd063c --- /dev/null +++ b/var/spack/repos/builtin/packages/openexr/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 Openexr(Package): + """OpenEXR Graphics Tools (high dynamic-range image file format)""" + + homepage = "http://www.openexr.com/" + url = "https://savannah.nongnu.org/download/openexr/openexr-2.2.0.tar.gz" + + version('2.2.0', 'b64e931c82aa3790329c21418373db4e') + version('2.1.0', '33735d37d2ee01c6d8fbd0df94fb8b43') + version('2.0.1', '4387e6050d2faa65dd5215618ff2ddce') + version('1.7.0', '27113284f7d26a58f853c346e0851d7a') + version('1.6.1', '11951f164f9c872b183df75e66de145a') + version('1.5.0', '55342d2256ab3ae99da16f16b2e12ce9') + version('1.4.0a', 'd0a4b9a930c766fa51561b05fb204afe') + version('1.3.2', '1522fe69135016c52eb88fc7d8514409') + + variant('debug', default=False, + description='Builds a debug version of the libraries') + + depends_on('pkg-config', type='build') + depends_on('ilmbase') + + def install(self, spec, prefix): + configure_options = ['--prefix={0}'.format(prefix)] + if '+debug' not in spec: + configure_options.append('--disable-debug') + configure(*configure_options) + make('install') diff --git a/var/spack/repos/builtin/packages/py-h5py/package.py b/var/spack/repos/builtin/packages/py-h5py/package.py index c1950a91ac..f96cb9b4cd 100644 --- a/var/spack/repos/builtin/packages/py-h5py/package.py +++ b/var/spack/repos/builtin/packages/py-h5py/package.py @@ -46,6 +46,7 @@ class PyH5py(Package): depends_on('hdf5@1.8.4:') depends_on('hdf5+mpi', when='+mpi') depends_on('mpi', when='+mpi') + depends_on('py-mpi4py', when='+mpi') # Build and runtime dependencies depends_on('py-numpy@1.6.1:', type=nolink) diff --git a/var/spack/repos/builtin/packages/the_silver_searcher/package.py b/var/spack/repos/builtin/packages/the_silver_searcher/package.py index 988619df30..c98e964efa 100644 --- a/var/spack/repos/builtin/packages/the_silver_searcher/package.py +++ b/var/spack/repos/builtin/packages/the_silver_searcher/package.py @@ -24,11 +24,13 @@ ############################################################################## from spack import * + class TheSilverSearcher(Package): """Fast recursive grep alternative""" homepage = "http://geoff.greer.fm/ag/" - url = "http://geoff.greer.fm/ag/releases/the_silver_searcher-0.30.0.tar.gz" + url = "http://geoff.greer.fm/ag/releases/the_silver_searcher-0.32.0.tar.gz" + version('0.32.0', '3fdfd5836924246073d5344257a06823') version('0.30.0', '95e2e7859fab1156c835aff7413481db') depends_on('pcre') |