summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/docs/basic_usage.rst4
-rw-r--r--lib/spack/docs/packaging_guide.rst6
-rw-r--r--lib/spack/spack/architecture.py19
-rw-r--r--lib/spack/spack/build_environment.py1
-rw-r--r--lib/spack/spack/directives.py2
-rw-r--r--lib/spack/spack/platforms/cray_xc.py27
-rw-r--r--lib/spack/spack/spec.py7
-rw-r--r--var/spack/repos/builtin/packages/armadillo/package.py8
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py2
-rw-r--r--var/spack/repos/builtin/packages/ilmbase/package.py42
10 files changed, 94 insertions, 24 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/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/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/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/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')