From 8821715377147ae017d428d8c1216576de0b79e1 Mon Sep 17 00:00:00 2001 From: Cyrus Harrison Date: Wed, 19 Aug 2015 14:18:02 -0700 Subject: add version-based url map for cmake, provide md5 for cmake 3.3.1 --- var/spack/packages/cmake/package.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'var') diff --git a/var/spack/packages/cmake/package.py b/var/spack/packages/cmake/package.py index 9efa370c8b..ad3b69f76f 100644 --- a/var/spack/packages/cmake/package.py +++ b/var/spack/packages/cmake/package.py @@ -23,21 +23,30 @@ # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +import llnl.util.tty as tty class Cmake(Package): """A cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software.""" homepage = 'https://www.cmake.org' - version('2.8.10.2', '097278785da7182ec0aea8769d06860c', - url = 'http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz') - - version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f', - url = 'http://www.cmake.org/files/v3.0/cmake-3.0.2.tar.gz') - + version('2.8.10.2', '097278785da7182ec0aea8769d06860c') + version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f') + version('3.3.1', '52638576f4e1e621fed6c3410d3a1b12') + # version('3.0.1', 'e2e05d84cb44a42f1371d9995631dcf5') # version('3.0.0', '21a1c85e1a3b803c4b48e7ff915a863e') + def url_for_version(self, version): + """Handle CMake's version-based custom URLs.""" + parts = [str(p) for p in Version(version)] + if len(parts) < 3: + tty.error("Version '%s'does not match CMake's version naming scheme (z.y.x)." % version) + version_short = ".".join(parts[:2]) + version_full = ".".join(parts) + return "http://www.cmake.org/files/v%s/cmake-%s.tar.gz" % (version_short,version_full) + + def install(self, spec, prefix): configure('--prefix=' + prefix, '--parallel=' + str(make_jobs)) -- cgit v1.2.3-70-g09d2 From ee68a76a193890231d6df7fa7934d42e3708540b Mon Sep 17 00:00:00 2001 From: Matthew LeGendre Date: Fri, 29 May 2015 14:57:24 -0700 Subject: Bug fixes from testing spack preferred packages --- lib/spack/spack/preferred_packages.py | 7 +++---- var/spack/mock_packages/mpich/package.py | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/preferred_packages.py b/lib/spack/spack/preferred_packages.py index 248508fe80..bc5271f693 100644 --- a/lib/spack/spack/preferred_packages.py +++ b/lib/spack/spack/preferred_packages.py @@ -112,9 +112,8 @@ class PreferredPackages(object): elif a_index == None and b_index != None: return 1 elif a_index != None and b_index == a_index: return -1 * cmp(a, b) elif a_index != None and b_index != None and a_index != b_index: return cmp(a_index, b_index) - elif a < b: return 1 * reverse - elif b < a: return -1 * reverse - else: return 0 + else: return cmp(a, b) * reverse + # Given a sort order specified by the pkgname/component/second_key, return @@ -148,7 +147,7 @@ class PreferredPackages(object): """Return less-than-0, 0, or greater than 0 if version a of pkgname is respecively less-than, equal-to, or greater-than version b of pkgname. One version is less-than another if it is preferred over the other.""" - return self._spec_compare(pkgname, 'version', a, b, False, None) + return self._spec_compare(pkgname, 'version', a, b, True, None) def variant_compare(self, pkgname, a, b): diff --git a/var/spack/mock_packages/mpich/package.py b/var/spack/mock_packages/mpich/package.py index f77d3efc5d..e4110ad530 100644 --- a/var/spack/mock_packages/mpich/package.py +++ b/var/spack/mock_packages/mpich/package.py @@ -38,6 +38,7 @@ class Mpich(Package): version('3.0.2', 'foobarbaz') version('3.0.1', 'foobarbaz') version('3.0', 'foobarbaz') + version('1.0', 'foobarbas') provides('mpi@:3', when='@3:') provides('mpi@:1', when='@:1') -- cgit v1.2.3-70-g09d2 From 650c9d4e36c6a58cf6bca0e6abd580ee54d8e175 Mon Sep 17 00:00:00 2001 From: Matthew LeGendre Date: Wed, 16 Sep 2015 10:56:11 -0700 Subject: Allow spack to build against external non-spack-installed packages. --- lib/spack/spack/__init__.py | 6 ++ lib/spack/spack/abi.py | 128 ++++++++++++++++++++++++++++++ lib/spack/spack/concretize.py | 140 ++++++++++++++++++++++++++++++--- lib/spack/spack/config.py | 59 +++++++++++++- lib/spack/spack/directory_layout.py | 8 ++ lib/spack/spack/package.py | 3 + lib/spack/spack/preferred_packages.py | 10 ++- lib/spack/spack/spec.py | 58 ++++++++------ var/spack/packages/mpich/package.py | 1 + var/spack/packages/mvapich2/package.py | 17 +++- 10 files changed, 387 insertions(+), 43 deletions(-) create mode 100644 lib/spack/spack/abi.py (limited to 'var') diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py index bd8478fb98..5783005b5b 100644 --- a/lib/spack/spack/__init__.py +++ b/lib/spack/spack/__init__.py @@ -77,6 +77,12 @@ install_layout = YamlDirectoryLayout(install_path) from spack.preferred_packages import PreferredPackages pkgsort = PreferredPackages() +# +# This tests ABI compatibility between packages +# +from spack.abi import ABI +abi = ABI() + # # This controls how things are concretized in spack. # Replace it with a subclass if you want different diff --git a/lib/spack/spack/abi.py b/lib/spack/spack/abi.py new file mode 100644 index 0000000000..f0a997703c --- /dev/null +++ b/lib/spack/spack/abi.py @@ -0,0 +1,128 @@ +############################################################################## +# Copyright (c) 2015, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/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 os +import spack +import spack.spec +from spack.spec import CompilerSpec +from spack.util.executable import Executable, ProcessError +from llnl.util.lang import memoized + +class ABI(object): + """This class provides methods to test ABI compatibility between specs. + The current implementation is rather rough and could be improved.""" + + def architecture_compatible(self, parent, child): + """Returns true iff the parent and child specs have ABI compatible architectures.""" + return not parent.architecture or not child.architecture or parent.architecture == child.architecture + + + @memoized + def _gcc_get_libstdcxx_version(self, version): + """Returns gcc ABI compatibility info by getting the library version of + a compiler's libstdc++.so or libgcc_s.so""" + spec = CompilerSpec("gcc", version) + compilers = spack.compilers.compilers_for_spec(spec) + if not compilers: + return None + compiler = compilers[0] + rungcc = None + libname = None + output = None + if compiler.cxx: + rungcc = Executable(compiler.cxx) + libname = "libstdc++.so" + elif compiler.cc: + rungcc = Executable(compiler.cc) + libname = "libgcc_s.so" + else: + return None + try: + output = rungcc("--print-file-name=%s" % libname, return_output=True) + except ProcessError, e: + return None + if not output: + return None + libpath = os.readlink(output.strip()) + if not libpath: + return None + return os.path.basename(libpath) + + + @memoized + def _gcc_compiler_compare(self, pversion, cversion): + """Returns true iff the gcc version pversion and cversion + are ABI compatible.""" + plib = self._gcc_get_libstdcxx_version(pversion) + clib = self._gcc_get_libstdcxx_version(cversion) + if not plib or not clib: + return False + return plib == clib + + + def _intel_compiler_compare(self, pversion, cversion): + """Returns true iff the intel version pversion and cversion + are ABI compatible""" + + #Test major and minor versions. Ignore build version. + if (len(pversion.version) < 2 or len(cversion.version) < 2): + return False + return (pversion.version[0] == cversion.version[0]) and \ + (pversion.version[1] == cversion.version[1]) + + + def compiler_compatible(self, parent, child, **kwargs): + """Returns true iff the compilers for parent and child specs are ABI compatible""" + if not parent.compiler or not child.compiler: + return True + + if parent.compiler.name != child.compiler.name: + #Different compiler families are assumed ABI incompatible + return False + + if kwargs.get('loose', False): + return True + + for pversion in parent.compiler.versions: + for cversion in child.compiler.versions: + #For a few compilers use specialized comparisons. Otherwise + # match on version match. + if pversion.satisfies(cversion): + return True + elif parent.compiler.name == "gcc" and \ + self._gcc_compiler_compare(pversion, cversion): + return True + elif parent.compiler.name == "intel" and \ + self._intel_compiler_compare(pversion, cversion): + return True + return False + + + def compatible(self, parent, child, **kwargs): + """Returns true iff a parent and child spec are ABI compatible""" + loosematch = kwargs.get('loose', False) + return self.architecture_compatible(parent, child) and \ + self.compiler_compatible(parent, child, loose=loosematch) + diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index 0f258c9096..01ff163493 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -33,13 +33,16 @@ or user preferences. TODO: make this customizable and allow users to configure concretization policies. """ +import spack import spack.spec import spack.compilers import spack.architecture import spack.error from spack.version import * from functools import partial - +from spec import DependencyMap +from itertools import chain +from spack.config import * class DefaultConcretizer(object): @@ -48,6 +51,107 @@ class DefaultConcretizer(object): default concretization strategies, or you can override all of them. """ + def _find_other_spec(self, spec, condition): + """Searches the dag from spec in an intelligent order and looks + for a spec that matches a condition""" + dagiter = chain(spec.traverse(direction='parents'), spec.traverse(direction='children')) + found = next((x for x in dagiter if x is not spec and condition(x)), None) + if found: + return found + dagiter = chain(spec.traverse(direction='parents'), spec.traverse(direction='children')) + searched = list(dagiter) + found = next((x for x in spec.root.traverse() if x not in searched and x is not spec and condition(x)), None) + if found: + return found + if condition(spec): + return spec + return None + + + def _valid_virtuals_and_externals(self, spec): + """Returns a list of spec/external-path pairs for both virtuals and externals + that can concretize this spec.""" + + # Get a list of candidate packages that could satisfy this spec + packages = [] + if spec.virtual: + providers = spack.db.providers_for(spec) + if not providers: + raise UnsatisfiableProviderSpecError(providers[0], spec) + spec_w_preferred_providers = self._find_other_spec(spec, \ + lambda(x): spack.pkgsort.spec_has_preferred_provider(x.name, spec.name)) + if not spec_w_preferred_providers: + spec_w_preferred_providers = spec + provider_cmp = partial(spack.pkgsort.provider_compare, spec_w_preferred_providers.name, spec.name) + packages = sorted(providers, cmp=provider_cmp) + else: + if not spec_externals(spec) or spec.external: + return None + packages = [spec] + + # For each candidate package, if it has externals add those to the candidates + # if it's a nobuild, then only add the externals. + result = [] + all_compilers = spack.compilers.all_compilers() + for pkg in packages: + externals = spec_externals(pkg) + buildable = not is_spec_nobuild(pkg) + if buildable: + result.append((pkg, None)) + if externals: + sorted_externals = sorted(externals, cmp=lambda a,b: a[0].__cmp__(b[0])) + for external in sorted_externals: + if external[0].satisfies(spec): + result.append(external) + if not result: + raise NoBuildError(spec) + return result + + + def concretize_virtual_and_external(self, spec): + """From a list of candidate virtual and external packages, concretize to one that + is ABI compatible with the rest of the DAG.""" + candidates = self._valid_virtuals_and_externals(spec) + if not candidates: + return False + + #Find the another spec in the dag that has a compiler. We'll use that + # spec to test compiler compatibility. + other_spec = self._find_other_spec(spec, lambda(x): x.compiler) + if not other_spec: + other_spec = spec.root + + #Choose an ABI-compatible candidate, or the first match otherwise. + candidate = None + if other_spec: + candidate = next((c for c in candidates if spack.abi.compatible(c[0], other_spec)), None) + if not candidate: + #Try a looser ABI matching + candidate = next((c for c in candidates if spack.abi.compatible(c[0], other_spec, loose=True)), None) + if not candidate: + #Pick the first choice + candidate = candidates[0] + external = candidate[1] + candidate_spec = candidate[0] + + #Refine this spec to the candidate. + changed = False + if spec.virtual: + spec._replace_with(candidate_spec) + changed = True + if spec._dup(candidate_spec, deps=False, cleardeps=False): + changed = True + if not spec.external and external: + spec.external = external + changed = True + #If we're external then trim the dependencies + if external and spec.dependencies: + changed = True + spec.depencencies = DependencyMap() + + return changed + + def concretize_version(self, spec): """If the spec is already concrete, return. Otherwise take the preferred version from spackconfig, and default to the package's @@ -150,31 +254,32 @@ class DefaultConcretizer(object): link to this one, to maximize compatibility. """ all_compilers = spack.compilers.all_compilers() - + if (spec.compiler and spec.compiler.concrete and spec.compiler in all_compilers): return False - # Find the parent spec that has a compiler, or the root if none do - parent_spec = next(p for p in spec.traverse(direction='parents') - if p.compiler is not None or not p.dependents) - parent_compiler = parent_spec.compiler - assert(parent_spec) + #Find the another spec that has a compiler, or the root if none do + other_spec = self._find_other_spec(spec, lambda(x) : x.compiler) + if not other_spec: + other_spec = spec.root + other_compiler = other_spec.compiler + assert(other_spec) # Check if the compiler is already fully specified - if parent_compiler in all_compilers: - spec.compiler = parent_compiler.copy() + if other_compiler in all_compilers: + spec.compiler = other_compiler.copy() return True # Filter the compilers into a sorted list based on the compiler_order from spackconfig - compiler_list = all_compilers if not parent_compiler else spack.compilers.find(parent_compiler) - cmp_compilers = partial(spack.pkgsort.compiler_compare, parent_spec.name) + compiler_list = all_compilers if not other_compiler else spack.compilers.find(other_compiler) + cmp_compilers = partial(spack.pkgsort.compiler_compare, other_spec.name) matches = sorted(compiler_list, cmp=cmp_compilers) if not matches: - raise UnavailableCompilerVersionError(parent_compiler) + raise UnavailableCompilerVersionError(other_compiler) - # copy concrete version into parent_compiler + # copy concrete version into other_compiler spec.compiler = matches[0].copy() assert(spec.compiler.concrete) return True # things changed. @@ -210,3 +315,12 @@ class NoValidVersionError(spack.error.SpackError): def __init__(self, spec): super(NoValidVersionError, self).__init__( "There are no valid versions for %s that match '%s'" % (spec.name, spec.versions)) + + +class NoBuildError(spack.error.SpackError): + """Raised when a package is configured with the nobuild option, but + no satisfactory external versions can be found""" + def __init__(self, spec): + super(NoBuildError, self).__init__( + "The spec '%s' is configured as nobuild, and no matching external installs were found" % spec.name) + diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index f3526b19fa..60577c45b3 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -90,9 +90,12 @@ import os import exceptions import sys import copy - -from llnl.util.lang import memoized +import inspect +import glob +import imp +import spack.spec import spack.error +from llnl.util.lang import memoized from external import yaml from external.yaml.error import MarkedYAMLError @@ -116,6 +119,9 @@ class _ConfigCategory: _ConfigCategory('compilers', 'compilers.yaml', True) _ConfigCategory('mirrors', 'mirrors.yaml', True) _ConfigCategory('preferred', 'preferred.yaml', True) +_ConfigCategory('view', 'views.yaml', True) +_ConfigCategory('preferred', 'preferred.yaml', True) +_ConfigCategory('packages', 'packages.yaml', True) """Names of scopes and their corresponding configuration files.""" config_scopes = [('site', os.path.join(spack.etc_path, 'spack')), @@ -233,6 +239,55 @@ def get_preferred_config(): return get_config('preferred') +@memoized +def get_packages_config(): + """Get the externals configuration from config files""" + package_config = get_config('packages') + if not package_config: + return {} + indexed_packages = {} + for p in package_config: + package_name = spack.spec.Spec(p.keys()[0]).name + if package_name not in indexed_packages: + indexed_packages[package_name] = [] + indexed_packages[package_name].append({ spack.spec.Spec(key) : val for key, val in p.iteritems() }) + return indexed_packages + + +def is_spec_nobuild(spec): + """Return true if the spec pkgspec is configured as nobuild""" + allpkgs = get_packages_config() + name = spec.name + if not name in allpkgs: + return False + for itm in allpkgs[name]: + for pkg,conf in itm.iteritems(): + if pkg.satisfies(spec): + if conf.get('nobuild', False): + return True + return False + + +def spec_externals(spec): + """Return a list of spec, directory pairs for each external location for spec""" + allpkgs = get_packages_config() + name = spec.name + spec_locations = [] + + if not name in allpkgs: + return [] + for itm in allpkgs[name]: + for pkg,conf in itm.iteritems(): + if not pkg.satisfies(spec): + continue + path = conf.get('path', None) + if not path: + continue + spec_locations.append( (pkg, path) ) + return spec_locations + + + def get_config_scope_dirname(scope): """For a scope return the config directory""" global config_scopes diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index 85ecc1ce2b..83e6eb566a 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -187,6 +187,14 @@ class YamlDirectoryLayout(DirectoryLayout): def relative_path_for_spec(self, spec): _check_concrete(spec) + + if spec.external: + return spec.external + + enabled_variants = ( + '-' + v.name for v in spec.variants.values() + if v.enabled) + dir_name = "%s-%s-%s" % ( spec.name, spec.version, diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 61606d0590..1e2f0378c8 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -752,6 +752,9 @@ class Package(object): if not self.spec.concrete: raise ValueError("Can only install concrete packages.") + if self.spec.external: + return + if os.path.exists(self.prefix): tty.msg("%s is already installed in %s." % (self.name, self.prefix)) return diff --git a/lib/spack/spack/preferred_packages.py b/lib/spack/spack/preferred_packages.py index bc5271f693..bc2a4ac234 100644 --- a/lib/spack/spack/preferred_packages.py +++ b/lib/spack/spack/preferred_packages.py @@ -35,9 +35,10 @@ class PreferredPackages(object): #Given a package name, sort component (e.g, version, compiler, ...), and # a second_key (used by providers), return the list - def _order_for_package(self, pkgname, component, second_key): + def _order_for_package(self, pkgname, component, second_key, test_all=True): pkglist = [pkgname] - pkglist.append('all') + if test_all: + pkglist.append('all') for pkg in pkglist: if not pkg in self.preferred: continue @@ -143,6 +144,11 @@ class PreferredPackages(object): return self._spec_compare(pkgname, 'providers', a, b, False, provider_str) + def spec_has_preferred_provider(self, pkgname, provider_str): + """Return True iff the named package has a list of preferred provider""" + return bool(self._order_for_package(pkgname, 'providers', provider_str, False)) + + def version_compare(self, pkgname, a, b): """Return less-than-0, 0, or greater than 0 if version a of pkgname is respecively less-than, equal-to, or greater-than version b of pkgname. diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 41496b0e9d..6984b4a174 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -419,6 +419,7 @@ class Spec(object): # package.py files for. self._normal = kwargs.get('normal', False) self._concrete = kwargs.get('concrete', False) + self.external = None # This allows users to construct a spec DAG with literals. # Note that given two specs a and b, Spec(a) copies a, but @@ -426,7 +427,7 @@ class Spec(object): for dep in dep_like: spec = dep if isinstance(dep, Spec) else Spec(dep) self._add_dependency(spec) - + # # Private routines here are called by the parser when building a spec. @@ -751,12 +752,11 @@ class Spec(object): # Concretize virtual dependencies last. Because they're added # to presets below, their constraints will all be merged, but we'll # still need to select a concrete package later. - if not self.virtual: - changed |= any( - (spack.concretizer.concretize_architecture(self), - spack.concretizer.concretize_compiler(self), - spack.concretizer.concretize_version(self), - spack.concretizer.concretize_variants(self))) + changed |= any( + (spack.concretizer.concretize_architecture(self), + spack.concretizer.concretize_compiler(self), + spack.concretizer.concretize_version(self), + spack.concretizer.concretize_variants(self))) presets[self.name] = self visited.add(self.name) @@ -789,21 +789,18 @@ class Spec(object): a problem. """ changed = False - while True: - virtuals =[v for v in self.traverse() if v.virtual] - if not virtuals: - return changed - - for spec in virtuals: - providers = spack.db.providers_for(spec) - concrete = spack.concretizer.choose_provider(self, spec, providers) - concrete = concrete.copy() - spec._replace_with(concrete) - changed = True + done = False + while not done: + done = True + for spec in list(self.traverse()): + if spack.concretizer.concretize_virtual_and_external(spec): + done = False + changed = True - # If there are duplicate providers or duplicate provider deps, this - # consolidates them and merge constraints. - changed |= self.normalize(force=True) + # If there are duplicate providers or duplicate provider deps, this + # consolidates them and merge constraints. + changed |= self.normalize(force=True) + return changed def concretize(self): @@ -830,7 +827,6 @@ class Spec(object): self._concretize_helper()) changed = any(changes) force=True - self._concrete = True @@ -1346,15 +1342,26 @@ class Spec(object): Whether deps should be copied too. Set to false to copy a spec but not its dependencies. """ + + # We don't count dependencies as changes here + changed = True + if hasattr(self, 'name'): + changed = (self.name != other.name and self.versions != other.versions and \ + self.architecture != other.architecture and self.compiler != other.compiler and \ + self.variants != other.variants and self._normal != other._normal and \ + self.concrete != other.concrete and self.external != other.external) + # Local node attributes get copied first. self.name = other.name self.versions = other.versions.copy() self.architecture = other.architecture self.compiler = other.compiler.copy() if other.compiler else None - self.dependents = DependencyMap() - self.dependencies = DependencyMap() + if kwargs.get('cleardeps', True): + self.dependents = DependencyMap() + self.dependencies = DependencyMap() self.variants = other.variants.copy() self.variants.spec = self + self.external = other.external # If we copy dependencies, preserve DAG structure in the new spec if kwargs.get('deps', True): @@ -1372,6 +1379,8 @@ class Spec(object): # Since we preserved structure, we can copy _normal safely. self._normal = other._normal self._concrete = other._concrete + self.external = other.external + return changed def copy(self, **kwargs): @@ -1796,6 +1805,7 @@ class SpecParser(spack.parse.Parser): spec.variants = VariantMap(spec) spec.architecture = None spec.compiler = None + spec.external = None spec.dependents = DependencyMap() spec.dependencies = DependencyMap() diff --git a/var/spack/packages/mpich/package.py b/var/spack/packages/mpich/package.py index b6b2dfde21..dfff22152d 100644 --- a/var/spack/packages/mpich/package.py +++ b/var/spack/packages/mpich/package.py @@ -45,6 +45,7 @@ class Mpich(Package): os.environ['MPICH_F77'] = 'f77' os.environ['MPICH_F90'] = 'f90' + module.mpicc = join_path(self.prefix.bin, 'mpicc') def install(self, spec, prefix): config_args = ["--prefix=" + prefix, diff --git a/var/spack/packages/mvapich2/package.py b/var/spack/packages/mvapich2/package.py index ca0b1287c1..93bce011b7 100644 --- a/var/spack/packages/mvapich2/package.py +++ b/var/spack/packages/mvapich2/package.py @@ -11,10 +11,17 @@ class Mvapich2(Package): version('2.0', '9fbb68a4111a8b6338e476dc657388b4', url='http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.0.tar.gz') + + version('2.1', '0095ceecb19bbb7fb262131cb9c2cdd6', + url='http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.1.tar.gz') provides('mpi@:2.2', when='@1.9') # MVAPICH2-1.9 supports MPI 2.2 provides('mpi@:3.0', when='@2.0') # MVAPICH2-2.0 supports MPI 3.0 + variant('psm', default=False, description="build with psm") + + variant('pmi', default=False, description="build with pmi") + depends_on('pmgr_collective', when='+pmi') def install(self, spec, prefix): # we'll set different configure flags depending on our environment @@ -80,7 +87,13 @@ class Mvapich2(Package): configure_args.append("--with-device=ch3:psm") else: # throw this flag on IB systems - configure_args.append("--with-device=ch3:mrail", "--with-rdma=gen2") + configure_args.append("--with-device=ch3:mrail") + configure_args.append("--with-rdma=gen2") + + if "+pmi" in spec: + configure_args.append("--with-pmi=pmgr_collective" % spec['pmgr_collective'].prefix) + else: + configure_args.append("--with-pmi=slurm") # TODO: shared-memory build @@ -93,7 +106,7 @@ class Mvapich2(Package): "--enable-f77", "--enable-fc", "--enable-cxx", "--enable-shared", "--enable-sharedlibs=gcc", "--enable-debuginfo", - "--with-pm=no", "--with-pmi=slurm", + "--with-pm=no", "--enable-romio", "--with-file-system=lustre+nfs+ufs", "--disable-mpe", "--without-mpe", "--disable-silent-rules", -- cgit v1.2.3-70-g09d2 From 18f0b24a7f21ec7b46510f45867386b7600bbc55 Mon Sep 17 00:00:00 2001 From: Matthew LeGendre Date: Mon, 5 Oct 2015 11:30:48 -0700 Subject: Add tests for spack external dependencies, plus fixes for issues found by those tests. --- lib/spack/spack/concretize.py | 9 +++--- lib/spack/spack/spec.py | 2 +- lib/spack/spack/test/concretize.py | 28 ++++++++++++++++ .../mock_configs/site_spackconfig/packages.yaml | 13 ++++++++ var/spack/mock_packages/externalprereq/package.py | 34 ++++++++++++++++++++ var/spack/mock_packages/externaltest/package.py | 37 ++++++++++++++++++++++ var/spack/mock_packages/externaltool/package.py | 36 +++++++++++++++++++++ var/spack/mock_packages/externalvirtual/package.py | 37 ++++++++++++++++++++++ 8 files changed, 191 insertions(+), 5 deletions(-) create mode 100644 var/spack/mock_configs/site_spackconfig/packages.yaml create mode 100644 var/spack/mock_packages/externalprereq/package.py create mode 100644 var/spack/mock_packages/externaltest/package.py create mode 100644 var/spack/mock_packages/externaltool/package.py create mode 100644 var/spack/mock_packages/externalvirtual/package.py (limited to 'var') diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index 01ff163493..c27a023136 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -85,8 +85,8 @@ class DefaultConcretizer(object): provider_cmp = partial(spack.pkgsort.provider_compare, spec_w_preferred_providers.name, spec.name) packages = sorted(providers, cmp=provider_cmp) else: - if not spec_externals(spec) or spec.external: - return None + if spec.external: + return False packages = [spec] # For each candidate package, if it has externals add those to the candidates @@ -129,7 +129,7 @@ class DefaultConcretizer(object): #Try a looser ABI matching candidate = next((c for c in candidates if spack.abi.compatible(c[0], other_spec, loose=True)), None) if not candidate: - #Pick the first choice + #No ABI matches. Pick the top choice based on the orignal preferences. candidate = candidates[0] external = candidate[1] candidate_spec = candidate[0] @@ -144,10 +144,11 @@ class DefaultConcretizer(object): if not spec.external and external: spec.external = external changed = True + #If we're external then trim the dependencies if external and spec.dependencies: changed = True - spec.depencencies = DependencyMap() + spec.dependencies = DependencyMap() return changed diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 6984b4a174..49b67cd361 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -1022,7 +1022,7 @@ class Spec(object): # if we descend into a virtual spec, there's nothing more # to normalize. Concretize will finish resolving it later. - if self.virtual: + if self.virtual or self.external: return False # Combine constraints from package deps with constraints from diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index b3a77d076a..f81a2f5af8 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -192,3 +192,31 @@ class ConcretizeTest(MockPackagesTest): # TODO: not exactly the syntax I would like. self.assertTrue(spec['libdwarf'].compiler.satisfies('clang')) self.assertTrue(spec['libelf'].compiler.satisfies('clang')) + + + def test_external_package(self): + spec = Spec('externaltool') + spec.concretize() + + self.assertEqual(spec['externaltool'].external, '/path/to/external_tool') + self.assertFalse('externalprereq' in spec) + self.assertTrue(spec['externaltool'].compiler.satisfies('gcc')) + + + def test_nobuild_package(self): + got_error = False + spec = Spec('externaltool%clang') + try: + spec.concretize() + except spack.concretize.NoBuildError: + got_error = True + self.assertTrue(got_error) + + + def test_external_and_virtual(self): + spec = Spec('externaltest') + spec.concretize() + self.assertTrue(spec['externaltool'].external, '/path/to/external_tool') + self.assertTrue(spec['stuff'].external, '/path/to/external_virtual_gcc') + self.assertTrue(spec['externaltool'].compiler.satisfies('gcc')) + self.assertTrue(spec['stuff'].compiler.satisfies('gcc')) diff --git a/var/spack/mock_configs/site_spackconfig/packages.yaml b/var/spack/mock_configs/site_spackconfig/packages.yaml new file mode 100644 index 0000000000..eb52c6cf11 --- /dev/null +++ b/var/spack/mock_configs/site_spackconfig/packages.yaml @@ -0,0 +1,13 @@ +packages: + - externaltool: + nobuild: True + - externaltool@1.0%gcc@4.5.0: + path: /path/to/external_tool + - externalvirtual@2.0%clang@3.3: + path: /path/to/external_virtual_clang + nobuild: True + - externalvirtual@1.0%gcc@4.5.0: + path: /path/to/external_virtual_gcc + nobuild: True + + diff --git a/var/spack/mock_packages/externalprereq/package.py b/var/spack/mock_packages/externalprereq/package.py new file mode 100644 index 0000000000..7d63925693 --- /dev/null +++ b/var/spack/mock_packages/externalprereq/package.py @@ -0,0 +1,34 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/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 +############################################################################## +from spack import * + +class Externalprereq(Package): + homepage = "http://somewhere.com" + url = "http://somewhere.com/prereq-1.0.tar.gz" + + version('1.4', 'f1234567890abcdef1234567890abcde') + + def install(self, spec, prefix): + pass diff --git a/var/spack/mock_packages/externaltest/package.py b/var/spack/mock_packages/externaltest/package.py new file mode 100644 index 0000000000..c546922f87 --- /dev/null +++ b/var/spack/mock_packages/externaltest/package.py @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/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 +############################################################################## +from spack import * + +class Externaltest(Package): + homepage = "http://somewhere.com" + url = "http://somewhere.com/test-1.0.tar.gz" + + version('1.0', '1234567890abcdef1234567890abcdef') + + depends_on('stuff') + depends_on('externaltool') + + def install(self, spec, prefix): + pass diff --git a/var/spack/mock_packages/externaltool/package.py b/var/spack/mock_packages/externaltool/package.py new file mode 100644 index 0000000000..af902bd70e --- /dev/null +++ b/var/spack/mock_packages/externaltool/package.py @@ -0,0 +1,36 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/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 +############################################################################## +from spack import * + +class Externaltool(Package): + homepage = "http://somewhere.com" + url = "http://somewhere.com/tool-1.0.tar.gz" + + version('1.0', '1234567890abcdef1234567890abcdef') + + depends_on('externalprereq') + + def install(self, spec, prefix): + pass diff --git a/var/spack/mock_packages/externalvirtual/package.py b/var/spack/mock_packages/externalvirtual/package.py new file mode 100644 index 0000000000..722c1e1c53 --- /dev/null +++ b/var/spack/mock_packages/externalvirtual/package.py @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/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 +############################################################################## +from spack import * + +class Externalvirtual(Package): + homepage = "http://somewhere.com" + url = "http://somewhere.com/stuff-1.0.tar.gz" + + version('1.0', '1234567890abcdef1234567890abcdef') + version('2.0', '234567890abcdef1234567890abcdef1') + + provides('stuff') + + def install(self, spec, prefix): + pass -- cgit v1.2.3-70-g09d2 From 50727527bc69a1b8ed26aa84a40039086db33827 Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Mon, 11 Jan 2016 15:51:02 -0800 Subject: This commit makes the following changes: There are two sensible defaults for building boost libraries: build all of them or build none of them. Previously the Spack boost package took the first approach. This commit changes to building no libraries by default. The user can specify which libraries they need using variants (e.g. +iostreams to compile the boost iostreams library). If no libraries are built then a header-only install is performed (no compilation, just copy header files to prefix). The consequence of this change is that packages which specify a dependency on boost may now fail (until they are updated to specify exactly which boost libraries they need compiled). The user may now specify whether to build shared libraries (static libraries are always built) and whether to build libraries with/out multi-threading support (default is to only build with multi-threading support). The executable on the user-config.jam toolset line is set to Spack's cc script. Before, without this, the desired toolset was used but Spack deferred to the boost build system to choose the compiler version. bzip2 and zlib are always specified as dependencies when iostreams is built (before this could be controlled with the +compression variant). --- var/spack/packages/boost/package.py | 88 ++++++++++++++++++++++++++----------- 1 file changed, 63 insertions(+), 25 deletions(-) (limited to 'var') diff --git a/var/spack/packages/boost/package.py b/var/spack/packages/boost/package.py index 3427b74ad6..5fb6c9dc04 100644 --- a/var/spack/packages/boost/package.py +++ b/var/spack/packages/boost/package.py @@ -1,4 +1,5 @@ from spack import * +import spack class Boost(Package): """Boost provides free peer-reviewed portable C++ source @@ -44,15 +45,35 @@ class Boost(Package): version('1.34.1', '2d938467e8a448a2c9763e0a9f8ca7e5') version('1.34.0', 'ed5b9291ffad776f8757a916e1726ad0') + libs = ['chrono', + 'date_time', + 'filesystem', + 'iostreams', + 'random', + 'regex', + 'serialization', + 'signals', + 'system', + 'thread', + 'wave', + 'mpi', + 'python'] + + for lib in libs: + variant(lib, default=False, description="Compile with {0} library" + .format(lib)) + variant('debug', default=False, description='Switch to the debug version of Boost') - variant('python', default=False, description='Activate the component Boost.Python') - variant('mpi', default=False, description='Activate the component Boost.MPI') - variant('compression', default=True, description='Activate the compression Boost.iostreams') + variant('shared', default=True, description="Additionally build shared libraries") + variant('multithreaded', default=True, description="Build multi-threaded versions of libraries") + variant('singlethreaded', default=False, description="Build single-threaded versions of libraries") + variant('regex_icu', default=False, description="Include regex ICU support (by default false even if regex library is compiled)") + depends_on('icu', when='+regex_icu') depends_on('python', when='+python') depends_on('mpi', when='+mpi') - depends_on('bzip2', when='+compression') - depends_on('zlib', when='+compression') + depends_on('bzip2', when='+iostreams') + depends_on('zlib', when='+iostreams') def url_for_version(self, version): """Handle Boost's weird URLs, which write the version two different ways.""" @@ -77,22 +98,20 @@ class Boost(Package): # fallback to gcc if no toolset found return 'gcc' - def determine_bootstrap_options(self, spec, options): - options.append('--with-toolset=%s' % self.determine_toolset(spec)) + def determine_bootstrap_options(self, spec, withLibs, options): + boostToolsetId = self.determine_toolset(spec) + options.append('--with-toolset=%s' % boostToolsetId) + options.append("--with-libraries=%s" % ','.join(withLibs)) - without_libs = [] - if '~mpi' in spec: - without_libs.append('mpi') - if '~python' in spec: - without_libs.append('python') - else: + if '+python' in spec: options.append('--with-python=%s' % join_path(spec['python'].prefix.bin, 'python')) - if without_libs: - options.append('--without-libraries=%s' % ','.join(without_libs)) - with open('user-config.jam', 'w') as f: + compiler_wrapper = join_path(spack.build_env_path, 'c++') + f.write("using {0} : : {1} ;\n".format(boostToolsetId, + compiler_wrapper)) + if '+mpi' in spec: f.write('using mpi : %s ;\n' % join_path(spec['mpi'].prefix.bin, 'mpicxx')) @@ -107,12 +126,7 @@ class Boost(Package): else: options.append('variant=release') - if '~compression' in spec: - options.extend([ - '-s', 'NO_BZIP2=1', - '-s', 'NO_ZLIB=1']) - - if '+compression' in spec: + if '+iostreams' in spec: options.extend([ '-s', 'BZIP2_INCLUDE=%s' % spec['bzip2'].prefix.include, '-s', 'BZIP2_LIBPATH=%s' % spec['bzip2'].prefix.lib, @@ -120,20 +134,44 @@ class Boost(Package): '-s', 'ZLIB_LIBPATH=%s' % spec['zlib'].prefix.lib, ]) + linkTypes = ['static'] + if '+shared' in spec: + linkTypes.append('shared') + + #TODO: at least one of these two options must be active + threadingOpts = [] + if '+multithreaded' in spec: + threadingOpts.append('multi') + if '+singlethreaded' in spec: + threadingOpts.append('single') + options.extend([ 'toolset=%s' % self.determine_toolset(spec), - 'link=static,shared', - 'threading=single,multi', + 'link=%s' % ','.join(linkTypes), + 'threading=%s' % ','.join(threadingOpts), '--layout=tagged']) def install(self, spec, prefix): + withLibs = list() + for lib in Boost.libs: + if "+{0}".format(lib) in spec: + withLibs.append(lib) + if not withLibs: + # if no libraries are specified for compilation, then you dont have + # to configure/build anything, just copy over to the prefix directory. + src = join_path(self.stage.source_path, 'boost') + mkdirp(join_path(prefix, 'include')) + dst = join_path(prefix, 'include', 'boost') + install_tree(src, dst) + return + # to make Boost find the user-config.jam env['BOOST_BUILD_PATH'] = './' bootstrap = Executable('./bootstrap.sh') bootstrap_options = ['--prefix=%s' % prefix] - self.determine_bootstrap_options(spec, bootstrap_options) + self.determine_bootstrap_options(spec, withLibs, bootstrap_options) bootstrap(*bootstrap_options) -- cgit v1.2.3-70-g09d2 From 9b3e0255f4e8c1ec02aae2a75a11383ad274507d Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 12 Jan 2016 11:55:42 -0600 Subject: Add HDF package --- var/spack/packages/hdf/package.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 var/spack/packages/hdf/package.py (limited to 'var') diff --git a/var/spack/packages/hdf/package.py b/var/spack/packages/hdf/package.py new file mode 100644 index 0000000000..7882665dba --- /dev/null +++ b/var/spack/packages/hdf/package.py @@ -0,0 +1,35 @@ +from spack import * + +class Hdf(Package): + """HDF4 (also known as HDF) is a library and multi-object + file format for storing and managing data between machines.""" + + homepage = "https://www.hdfgroup.org/products/hdf4/" + url = "https://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.11/src/hdf-4.2.11.tar.gz" + list_url = "https://www.hdfgroup.org/ftp/HDF/releases/" + list_depth = 3 + + version('4.2.11', '063f9928f3a19cc21367b71c3b8bbf19') + + depends_on("jpeg") + depends_on("szip@2.1") + depends_on("zlib") + + + def url_for_version(self, version): + return "https://www.hdfgroup.org/ftp/HDF/releases/HDF" + str(version) + "/src/hdf-" + str(version) + ".tar.gz" + + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix, + '--with-jpeg=%s' % spec['jpeg'].prefix, + '--with-szlib=%s' % spec['szip'].prefix, + '--with-zlib=%s' % spec['zlib'].prefix, + '--disable-netcdf', + '--enable-fortran', + '--disable-shared', + '--enable-static', + '--enable-production') + + make() + make("install") -- cgit v1.2.3-70-g09d2 From 5520ce3c4a46476f5eec7a340471dd044932ac06 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 12 Jan 2016 12:19:03 -0600 Subject: Removed unnecessary URLs --- var/spack/packages/xz/package.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/packages/xz/package.py b/var/spack/packages/xz/package.py index ba6c9733a7..fdcac95345 100644 --- a/var/spack/packages/xz/package.py +++ b/var/spack/packages/xz/package.py @@ -8,11 +8,9 @@ class Xz(Package): homepage = "http://tukaani.org/xz/" url = "http://tukaani.org/xz/xz-5.2.0.tar.bz2" - version('5.2.0', '867cc8611760240ebf3440bd6e170bb9', - url = 'http://tukaani.org/xz/xz-5.2.0.tar.bz2') - version('5.2.2', 'f90c9a0c8b259aee2234c4e0d7fd70af', - url = 'http://tukaani.org/xz/xz-5.2.2.tar.bz2') - + version('5.2.0', '867cc8611760240ebf3440bd6e170bb9') + version('5.2.2', 'f90c9a0c8b259aee2234c4e0d7fd70af') + def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() -- cgit v1.2.3-70-g09d2 From 6985d2c914159f7978c304530f7fb1eb38b2b78d Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 12 Jan 2016 13:00:05 -0600 Subject: Add url_for_version function to calculate url --- var/spack/packages/hwloc/package.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/packages/hwloc/package.py b/var/spack/packages/hwloc/package.py index 7ebede76a3..60b315119b 100644 --- a/var/spack/packages/hwloc/package.py +++ b/var/spack/packages/hwloc/package.py @@ -14,15 +14,18 @@ class Hwloc(Package): efficiently.""" homepage = "http://www.open-mpi.org/projects/hwloc/" url = "http://www.open-mpi.org/software/hwloc/v1.9/downloads/hwloc-1.9.tar.gz" + list_url = "http://www.open-mpi.org/software/hwloc/" + list_depth = 3 - version('1.11.2', '486169cbe111cdea57be12638828ebbf', - url='http://www.open-mpi.org/software/hwloc/v1.11/downloads/hwloc-1.11.2.tar.bz2') - version('1.11.1', '002742efd3a8431f98d6315365a2b543', - url='http://www.open-mpi.org/software/hwloc/v1.11/downloads/hwloc-1.11.1.tar.bz2') - version('1.9', '1f9f9155682fe8946a97c08896109508') + version('1.11.2', '486169cbe111cdea57be12638828ebbf') + version('1.11.1', '002742efd3a8431f98d6315365a2b543') + version('1.9', '1f9f9155682fe8946a97c08896109508') depends_on('libpciaccess') + def url_for_version(self, version): + return "http://www.open-mpi.org/software/hwloc/v%s/downloads/hwloc-%s.tar.gz" % (version.up_to(2), version) + def install(self, spec, prefix): configure("--prefix=%s" % prefix) -- cgit v1.2.3-70-g09d2 From 180c673c782d10864dce6cd7df43465dd05579a1 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 12 Jan 2016 13:21:53 -0600 Subject: Add different URL for older source code --- var/spack/packages/mpc/package.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/mpc/package.py b/var/spack/packages/mpc/package.py index 50477a0ccb..65c0ba7ea1 100644 --- a/var/spack/packages/mpc/package.py +++ b/var/spack/packages/mpc/package.py @@ -34,8 +34,14 @@ class Mpc(Package): version('1.0.3', 'd6a1d5f8ddea3abd2cc3e98f58352d26') version('1.0.2', '68fadff3358fb3e7976c7a398a0af4c3') - depends_on("gmp") - depends_on("mpfr") + depends_on("gmp@4.3.2:") + depends_on("mpfr@2.4.2:") + + def url_for_version(self, version): + if version < Version("1.0.1"): + return "http://www.multiprecision.org/mpc/download/mpc-%s.tar.gz" % version + else: + return "ftp://ftp.gnu.org/gnu/mpc/mpc-%s.tar.gz" % version def install(self, spec, prefix): configure("--prefix=%s" % prefix) -- cgit v1.2.3-70-g09d2 From 7d0256c9fb5c3b8824cdeb0455d2a3e3b3f1eeb4 Mon Sep 17 00:00:00 2001 From: Nicola Varini Date: Fri, 15 Jan 2016 10:27:38 +0100 Subject: Quantum-ESPRESSO package --- var/spack/packages/espresso/package.py | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 var/spack/packages/espresso/package.py (limited to 'var') diff --git a/var/spack/packages/espresso/package.py b/var/spack/packages/espresso/package.py new file mode 100644 index 0000000000..f9df74c0c0 --- /dev/null +++ b/var/spack/packages/espresso/package.py @@ -0,0 +1,61 @@ +# FIXME: +# This is a template package file for Spack. We've conveniently +# put "FIXME" labels next to all the things you'll want to change. +# +# Once you've edited all the FIXME's, delete this whole message, +# save this file, and test out your package like this: +# +# spack install espresso +# +# You can always get back here to change things with: +# +# spack edit espresso +# +# See the spack documentation for more information on building +# packages. +# +from spack import * + +class Espresso(Package): + """FIXME: put a proper description of your package here.""" + # FIXME: add a proper url for your package's homepage here. + homepage = "http://quantum-espresso.org" + url = "http://www.qe-forge.org/gf/download/frsrelease/199/855/espresso-5.2.1.tar.gz" + + version('5.2.1', 'da3ec5302e4343804e65de60f6004c2d') + variant('mpi', default=True, description='Build Quantum-ESPRESSO with mpi support') + variant('openmp', default=False, description='Build Quantum-ESPRESSO with mpi openmp') + variant('scalapack', default=False, description='Build Quantum-ESPRESSO with mpi openmp') + + + # FIXME: Add dependencies if this package requires them. + # depends_on("foo") + depends_on('mpi', when='+mpi') + + +# def install(self, spec, prefix): + # FIXME: Modify the configure line to suit your build system here. +# configure('--prefix=%s' % prefix) + + # FIXME: Add logic to build and install here +# make() +# make("install") + + def install(self, spec, prefix): + # TAU isn't happy with directories that have '@' in the path. Sigh. + + # TAU configure, despite the name , seems to be a manually written script (nothing related to autotools). + # As such it has a few #peculiarities# that make this build quite hackish. + options = ["-prefix=%s" % prefix, + "--enable-parallel"] + + if '+openmp' in spec: + options.append('--enable-openmp') + + if '+scalapack' in spec: + options.append('--with-scalapack=yes') + + configure(*options) + make("all") + make("install") + -- cgit v1.2.3-70-g09d2 From 7fc308ed26d7abfcb71af8165523b421a1f315c0 Mon Sep 17 00:00:00 2001 From: Nicola Varini Date: Fri, 15 Jan 2016 17:04:25 +0100 Subject: Update to version 5.3 --- var/spack/packages/espresso/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/espresso/package.py b/var/spack/packages/espresso/package.py index f9df74c0c0..ce5dcc2acc 100644 --- a/var/spack/packages/espresso/package.py +++ b/var/spack/packages/espresso/package.py @@ -20,9 +20,9 @@ class Espresso(Package): """FIXME: put a proper description of your package here.""" # FIXME: add a proper url for your package's homepage here. homepage = "http://quantum-espresso.org" - url = "http://www.qe-forge.org/gf/download/frsrelease/199/855/espresso-5.2.1.tar.gz" + url = "http://www.qe-forge.org/gf/download/frsrelease/204/912/espresso-5.3.0.tar.gz" - version('5.2.1', 'da3ec5302e4343804e65de60f6004c2d') + version('5.3.0', '6848fcfaeb118587d6be36bd10b7f2c3') variant('mpi', default=True, description='Build Quantum-ESPRESSO with mpi support') variant('openmp', default=False, description='Build Quantum-ESPRESSO with mpi openmp') variant('scalapack', default=False, description='Build Quantum-ESPRESSO with mpi openmp') -- cgit v1.2.3-70-g09d2 From d22cf1aed1d033610481cb451909c93916848ccc Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Fri, 15 Jan 2016 18:07:41 -0800 Subject: 1. raise an exception if the multithreaded and singlethreaded options are both disabled 2. invoke the b2 installation once for each enabled threading option (apparently the install fails if a single call has both options enabled for mpi) --- var/spack/packages/boost/package.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/packages/boost/package.py b/var/spack/packages/boost/package.py index 5fb6c9dc04..1992d4d39a 100644 --- a/var/spack/packages/boost/package.py +++ b/var/spack/packages/boost/package.py @@ -138,18 +138,20 @@ class Boost(Package): if '+shared' in spec: linkTypes.append('shared') - #TODO: at least one of these two options must be active threadingOpts = [] if '+multithreaded' in spec: threadingOpts.append('multi') if '+singlethreaded' in spec: threadingOpts.append('single') + if not threadingOpts: + raise RuntimeError("At least one of {singlethreaded, multithreaded} must be enabled") options.extend([ 'toolset=%s' % self.determine_toolset(spec), 'link=%s' % ','.join(linkTypes), - 'threading=%s' % ','.join(threadingOpts), '--layout=tagged']) + + return threadingOpts def install(self, spec, prefix): withLibs = list() @@ -181,6 +183,10 @@ class Boost(Package): b2 = Executable(b2name) b2_options = ['-j', '%s' % make_jobs] - self.determine_b2_options(spec, b2_options) + threadingOpts = self.determine_b2_options(spec, b2_options) - b2('install', *b2_options) + # In theory it could be done on one call but it fails on + # Boost.MPI if the threading options are not separated. + for threadingOpt in threadingOpts: + b2('install', 'threading=%s' % threadingOpt, *b2_options) + -- cgit v1.2.3-70-g09d2 From 58162ec17070db5476b3aeffe1ef40d676a62949 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 18 Jan 2016 16:03:41 -0600 Subject: Add verbs variant, remove deprecated configure flags --- var/spack/packages/mpich/package.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/mpich/package.py b/var/spack/packages/mpich/package.py index 00b7dfda75..128a1f44ae 100644 --- a/var/spack/packages/mpich/package.py +++ b/var/spack/packages/mpich/package.py @@ -41,6 +41,8 @@ class Mpich(Package): version('3.1', '5643dd176499bfb7d25079aaff25f2ec') version('3.0.4', '9c5d5d4fe1e17dd12153f40bc5b6dbc0') + variant('verbs', default=False, description='Build support for OpenFabrics verbs.') + provides('mpi@:3.0', when='@3:') provides('mpi@:1.3', when='@1:') @@ -56,14 +58,20 @@ class Mpich(Package): config_args = ["--prefix=" + prefix, "--enable-shared"] + # Variants + if '+verbs' in spec: + config_args.append("--with-ibverbs") + else: + config_args.append("--without-ibverbs") + # TODO: Spack should make it so that you can't actually find # these compilers if they're "disabled" for the current # compiler configuration. if not self.compiler.f77: - config_args.append("--disable-f77") + config_args.append("--disable-fortran=f77") if not self.compiler.fc: - config_args.append("--disable-fc") + config_args.append("--disable-fortran=fc") configure(*config_args) make() -- cgit v1.2.3-70-g09d2 From f48fc0d8b184e26accc570910b8f4244d4d9e63f Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 19 Jan 2016 09:43:28 -0600 Subject: Revert deprecated configure flags --- var/spack/repos/builtin/packages/mpich/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 128a1f44ae..c856cfe277 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -68,10 +68,10 @@ class Mpich(Package): # these compilers if they're "disabled" for the current # compiler configuration. if not self.compiler.f77: - config_args.append("--disable-fortran=f77") + config_args.append("--disable-f77") if not self.compiler.fc: - config_args.append("--disable-fortran=fc") + config_args.append("--disable-fc") configure(*config_args) make() -- cgit v1.2.3-70-g09d2 From 0d42cdaffdf12fa3717135b07fade947dcb6b3b7 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 19 Jan 2016 10:09:25 -0600 Subject: Merge branch 'develop' into features/hdf --- var/spack/packages/hdf/package.py | 35 ------------------------- var/spack/repos/builtin/packages/hdf/package.py | 35 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 var/spack/packages/hdf/package.py create mode 100644 var/spack/repos/builtin/packages/hdf/package.py (limited to 'var') diff --git a/var/spack/packages/hdf/package.py b/var/spack/packages/hdf/package.py deleted file mode 100644 index 7882665dba..0000000000 --- a/var/spack/packages/hdf/package.py +++ /dev/null @@ -1,35 +0,0 @@ -from spack import * - -class Hdf(Package): - """HDF4 (also known as HDF) is a library and multi-object - file format for storing and managing data between machines.""" - - homepage = "https://www.hdfgroup.org/products/hdf4/" - url = "https://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.11/src/hdf-4.2.11.tar.gz" - list_url = "https://www.hdfgroup.org/ftp/HDF/releases/" - list_depth = 3 - - version('4.2.11', '063f9928f3a19cc21367b71c3b8bbf19') - - depends_on("jpeg") - depends_on("szip@2.1") - depends_on("zlib") - - - def url_for_version(self, version): - return "https://www.hdfgroup.org/ftp/HDF/releases/HDF" + str(version) + "/src/hdf-" + str(version) + ".tar.gz" - - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix, - '--with-jpeg=%s' % spec['jpeg'].prefix, - '--with-szlib=%s' % spec['szip'].prefix, - '--with-zlib=%s' % spec['zlib'].prefix, - '--disable-netcdf', - '--enable-fortran', - '--disable-shared', - '--enable-static', - '--enable-production') - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/hdf/package.py b/var/spack/repos/builtin/packages/hdf/package.py new file mode 100644 index 0000000000..7882665dba --- /dev/null +++ b/var/spack/repos/builtin/packages/hdf/package.py @@ -0,0 +1,35 @@ +from spack import * + +class Hdf(Package): + """HDF4 (also known as HDF) is a library and multi-object + file format for storing and managing data between machines.""" + + homepage = "https://www.hdfgroup.org/products/hdf4/" + url = "https://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.11/src/hdf-4.2.11.tar.gz" + list_url = "https://www.hdfgroup.org/ftp/HDF/releases/" + list_depth = 3 + + version('4.2.11', '063f9928f3a19cc21367b71c3b8bbf19') + + depends_on("jpeg") + depends_on("szip@2.1") + depends_on("zlib") + + + def url_for_version(self, version): + return "https://www.hdfgroup.org/ftp/HDF/releases/HDF" + str(version) + "/src/hdf-" + str(version) + ".tar.gz" + + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix, + '--with-jpeg=%s' % spec['jpeg'].prefix, + '--with-szlib=%s' % spec['szip'].prefix, + '--with-zlib=%s' % spec['zlib'].prefix, + '--disable-netcdf', + '--enable-fortran', + '--disable-shared', + '--enable-static', + '--enable-production') + + make() + make("install") -- cgit v1.2.3-70-g09d2 From e121faffa1974bff9570eb8b7a2ba83fdd624f0e Mon Sep 17 00:00:00 2001 From: alalazo Date: Tue, 19 Jan 2016 17:26:26 +0100 Subject: eigen : added package --- var/spack/repos/builtin/packages/eigen/package.py | 68 +++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 var/spack/repos/builtin/packages/eigen/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py new file mode 100644 index 0000000000..44ee6819f5 --- /dev/null +++ b/var/spack/repos/builtin/packages/eigen/package.py @@ -0,0 +1,68 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by David Beckingsale, david@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 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 +############################################################################## + +from spack import * + + +class Eigen(Package): + """ + Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms + """ + + homepage = 'http://eigen.tuxfamily.org/' + url = 'http://bitbucket.org/eigen/eigen/get/3.2.7.tar.bz2' + + version('3.2.7', 'cc1bacbad97558b97da6b77c9644f184', url='http://bitbucket.org/eigen/eigen/get/3.2.7.tar.bz2') + + variant('debug', default=False, description='Builds the library in debug mode') + + variant('metis', default=True, description='Enables metis backend') + variant('scotch', default=True, description='Enables scotch backend') + variant('fftw', default=True, description='Enables FFTW backend') + + # TODO : dependency on SuiteSparse, googlehash, superlu, adolc missing + + depends_on('metis', when='+metis') + depends_on('scotch', when='+scotch') + depends_on('fftw', when='+fftw') + + depends_on('mpfr@2.3.0:') # Eigen 3.2.7 requires at least 2.3.0 + depends_on('gmp') + + def install(self, spec, prefix): + + options = [] + options.extend(std_cmake_args) + + build_directory = join_path(self.stage.path, 'spack-build') + source_directory = self.stage.source_path + + if '+debug' in spec: + options.append('-DCMAKE_BUILD_TYPE:STRING=Debug') + + with working_dir(build_directory, create=True): + cmake(source_directory, *options) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 98706d31dca0773c51acfabb8f1a399d4720a875 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 19 Jan 2016 12:46:15 -0600 Subject: Various updates to MVAPICH2 package Use url_for_version function to specify urls Add version 2.2b Add dedicated MRAIL variant Fix typo Make fortran compiler flags more specific --- .../repos/builtin/packages/mvapich2/package.py | 34 +++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py index 23a11b3171..af5ed1b088 100644 --- a/var/spack/repos/builtin/packages/mvapich2/package.py +++ b/var/spack/repos/builtin/packages/mvapich2/package.py @@ -4,15 +4,13 @@ import os class Mvapich2(Package): """MVAPICH2 is an MPI implementation for Infiniband networks.""" homepage = "http://mvapich.cse.ohio-state.edu/" + url = "http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.2b.tar.gz" - version('2.2a', 'b8ceb4fc5f5a97add9b3ff1b9cbe39d2', - url='http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.2a.tar.gz') + version('2.2b', '5651e8b7a72d7c77ca68da48f3a5d108') + version('2.2a', 'b8ceb4fc5f5a97add9b3ff1b9cbe39d2') + version('2.0', '9fbb68a4111a8b6338e476dc657388b4') + version('1.9', '5dc58ed08fd3142c260b70fe297e127c') - version('2.0', '9fbb68a4111a8b6338e476dc657388b4', - url='http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.0.tar.gz') - - version('1.9', '5dc58ed08fd3142c260b70fe297e127c', - url="http://mvapich.cse.ohio-state.edu/download/mvapich2/mv2/mvapich2-1.9.tgz") patch('ad_lustre_rwcontig_open_source.patch', when='@1.9') provides('mpi@:2.2', when='@1.9') # MVAPICH2-1.9 supports MPI 2.2 @@ -41,16 +39,25 @@ class Mvapich2(Package): NEMESISIBTCP = 'nemesisibtcp' NEMESISIB = 'nemesisib' NEMESIS = 'nemesis' + MRAIL = 'mrail' SUPPORTED_NETWORKS = (PSM, SOCK, NEMESIS, NEMESISIB, NEMESISIBTCP) variant(PSM, default=False, description='Configures a build for QLogic PSM-CH3') variant(SOCK, default=False, description='Configures a build for TCP/IP-CH3') variant(NEMESISIBTCP, default=False, description='Configures a build for both OFA-IB-Nemesis and TCP/IP-Nemesis') variant(NEMESISIB, default=False, description='Configures a build for OFA-IB-Nemesis') variant(NEMESIS, default=False, description='Configures a build for TCP/IP-Nemesis') + variant(MRAIL, default=False, description='Configures a build for OFA-IB-CH3') ########## # FIXME : CUDA support is missing + def url_for_version(self, version): + base_url = "http://mvapich.cse.ohio-state.edu/download" + if version < Version('2.0'): + return "%s/mvapich2/mv2/mvapich2-%s.tar.gz" % (base_url, version) + else: + return "%s/mvapich/mv2/mvapich2-%s.tar.gz" % (base_url, version) + @staticmethod def enabled(x): """ @@ -117,7 +124,7 @@ class Mvapich2(Package): if count > 1: raise RuntimeError('network variants are mutually exclusive (only one can be selected at a time)') - # From here on I can suppose that ony one variant has been selected + # From here on I can suppose that only one variant has been selected if self.enabled(Mvapich2.PSM) in spec: network_options = ["--with-device=ch3:psm"] elif self.enabled(Mvapich2.SOCK) in spec: @@ -128,7 +135,7 @@ class Mvapich2(Package): network_options = ["--with-device=ch3:nemesis:ib"] elif self.enabled(Mvapich2.NEMESIS) in spec: network_options = ["--with-device=ch3:nemesis"] - else: + elif self.enabled(Mvapich2.MRAIL) in spec: network_options = ["--with-device=ch3:mrail", "--with-rdma=gen2"] configure_args.extend(network_options) @@ -141,7 +148,14 @@ class Mvapich2(Package): "--enable-romio", "--disable-silent-rules", ] - if not self.compiler.f77 and not self.compiler.fc: + + if self.compiler.f77 and self.compiler.fc: + configure_args.append("--enable-fortran=all") + elif self.compiler.f77: + configure_args.append("--enable-fortran=f77") + elif self.compiler.fc: + configure_args.append("--enable-fortran=fc") + else: configure_args.append("--enable-fortran=none") # Set the type of the build (debug, release) -- cgit v1.2.3-70-g09d2 From ab27fdc692193fa2deeacfbb2aabc1f6feb06f6d Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 20 Jan 2016 09:35:15 +0100 Subject: elpa : commit partial package. Blocked by missing scalapack --- var/spack/repos/builtin/packages/elpa/package.py | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 var/spack/repos/builtin/packages/elpa/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/elpa/package.py b/var/spack/repos/builtin/packages/elpa/package.py new file mode 100644 index 0000000000..6825056a04 --- /dev/null +++ b/var/spack/repos/builtin/packages/elpa/package.py @@ -0,0 +1,46 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written 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 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 +############################################################################## + +from spack import * + + +class Elpa(Package): + """ + Eigenvalue solvers for Petaflop-Applications (ELPA) + """ + + homepage = 'http://elpa.mpcdf.mpg.de/' + url = 'http://elpa.mpcdf.mpg.de/elpa-2015.11.001.tar.gz' + + version('2015.11.001', 'de0f35b7ee7c971fd0dca35c900b87e6', url='http://elpa.mpcdf.mpg.de/elpa-2015.11.001.tar.gz') + + depends_on('mpi') + depends_on('blas') + depends_on('lapack') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 65f65ec4e47289e15e5d6a25913beb8e6bb4831b Mon Sep 17 00:00:00 2001 From: Nicolas Richart Date: Wed, 20 Jan 2016 10:03:24 +0100 Subject: Adding MUMPS and ScaLAPACK --- var/spack/packages/mumps/Makefile.inc | 41 +++++++++ var/spack/packages/mumps/package.py | 121 +++++++++++++++++++++++++ var/spack/packages/netlib-scalapack/package.py | 43 +++++++++ 3 files changed, 205 insertions(+) create mode 100644 var/spack/packages/mumps/Makefile.inc create mode 100644 var/spack/packages/mumps/package.py create mode 100644 var/spack/packages/netlib-scalapack/package.py (limited to 'var') diff --git a/var/spack/packages/mumps/Makefile.inc b/var/spack/packages/mumps/Makefile.inc new file mode 100644 index 0000000000..4b6696db5c --- /dev/null +++ b/var/spack/packages/mumps/Makefile.inc @@ -0,0 +1,41 @@ +LPORDDIR = $(topdir)/PORD/lib/ +IPORD = -I$(topdir)/PORD/include/ +LPORD = -L$(LPORDDIR) -lpord + +ORDERINGSC = $(ORDERINGSF) +LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH) +IORDERINGSF = $(ISCOTCH) +IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH) + +PLAT = +LIBEXT = .a +OUTC = -o +OUTF = -o +RM = /bin/rm -f +AR = ar vr +RANLIB = ranlib + +INCSEQ = -I$(topdir)/libseq +LIBSEQ = -L$(topdir)/libseq -lmpiseq + +INCPAR = +LIBPAR = $(SCALAP) + +LIBOTHERS = -lpthread + +#Preprocessor defs for calling Fortran from C (-DAdd_ or -DAdd__ or -DUPPER) +CDEFS = -DAdd_ + +#Sequential: +ifeq ($(MUMPS_TYPE),seq) +INCS = $(INCSEQ) +LIBS = $(LIBSEQ) +LIBSEQNEEDED = libseqneeded +endif + +#Parallel: +ifeq ($(MUMPS_TYPE),par) +INCS = $(INCPAR) +LIBS = $(LIBPAR) +LIBSEQNEEDED = +endif diff --git a/var/spack/packages/mumps/package.py b/var/spack/packages/mumps/package.py new file mode 100644 index 0000000000..b4e38c02de --- /dev/null +++ b/var/spack/packages/mumps/package.py @@ -0,0 +1,121 @@ +from spack import * +import os + + +class Mumps(Package): + """MUMPS: a MUltifrontal Massively Parallel sparse direct Solver""" + + homepage = "http://mumps.enseeiht.fr" + url = "http://mumps.enseeiht.fr/MUMPS_5.0.1.tar.gz" + + version('5.0.1', 'b477573fdcc87babe861f62316833db0') + + variant('mpi', default=True, description='Activate the compilation of MUMPS with the MPI support') + variant('scotch', default=False, description='Activate Scotch as a possible ordering library') + variant('ptscotch', default=False, description='Activate PT-Scotch as a possible ordering library') + variant('metis', default=False, description='Activate Metis as a possible ordering library') + variant('parmetis', default=False, description='Activate Parmetis as a possible ordering library') + variant('double', default=True, description='Activate dmumps') + variant('float', default=True, description='Activate smumps') + variant('complex', default=True, description='Activate cmumps and/or zmumps') + variant('idx64', default=False, description='Use int64_t/integer*8 as default index type') + variant('double', default=False, description='Use double precision floating point types') + + + depends_on('scotch + esmumps', when='~ptscotch+scotch') + depends_on('scotch + esmumps + mpi', when='+ptscotch') + depends_on('metis', when='~parmetis+metis') + depends_on('parmetis', when="+parmetis") + depends_on('blas') + depends_on('scalapack', when='+mpi') + depends_on('mpi', when='+mpi') + + def patch(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') + + 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']))]) + orderings.append('-Dscotch') + if '+ptscotch' in self.spec: + orderings.append('-Dptscotch') + + if '+parmetis' in self.spec or '+metis' in self.spec: + libname = 'parmetis' if '+parmetis' in self.spec else 'metis' + makefile_conf.extend( + ["IMETIS = -I%s" % self.spec[libname].prefix.include, + "LMETIS = -L%s -l%s" % (self.spec[libname].prefix.lib, libname)]) + + orderings.append('-Dmetis') + if '+parmetis' in self.spec: + orderings.append('-Dparmetis') + + makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings))) + + if '+idx64' in self.spec: + makefile_conf.extend( + ['OPTF = -O -DALLOW_NON_INIT %s' % '-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8', + 'OPTL = -O ', + 'OPTC = -O -DINTSIZE64']) + else: + makefile_conf.extend( + ['OPTF = -O -DALLOW_NON_INIT', + 'OPTL = -O ', + 'OPTC = -O ']) + + + if '+mpi' in self.spec: + makefile_conf.extend( + ["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]) + else: + makefile_conf.extend( + ["CC = cc", + "FC = fc", + "FL = fc", + "MUMPS_TYPE = seq"]) + + 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')) + + with working_dir('.'): + with open("Makefile.inc", "w") as fh: + makefile_inc = '\n'.join(makefile_conf) + fh.write(makefile_inc) + + + + def install(self, spec, prefix): + make_libs = [] + + # the coice to compile ?examples is to have kind of a sanity + # check on the libraries generated. + if '+float' in spec: + make_libs.append('sexamples') + if '+complex' in spec: + make_libs.append('cexamples') + + if '+double' in spec: + make_libs.append('dexamples') + if '+complex' in spec: + make_libs.append('zexamples') + + make(*make_libs) + + install_tree('lib', prefix.lib) + install_tree('include', prefix.include) + if '~mpi' in spec: + install('libseq/libmpiseq.a', prefix.lib) diff --git a/var/spack/packages/netlib-scalapack/package.py b/var/spack/packages/netlib-scalapack/package.py new file mode 100644 index 0000000000..69df4d9da7 --- /dev/null +++ b/var/spack/packages/netlib-scalapack/package.py @@ -0,0 +1,43 @@ +from spack import * + +class NetlibScalapack(Package): + """ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines""" + + homepage = "http://www.netlib.org/scalapack/" + url = "http://www.netlib.org/scalapack/scalapack-2.0.2.tgz" + + version('2.0.2', '2f75e600a2ba155ed9ce974a1c4b536f') + version('2.0.1', '17b8cde589ea0423afe1ec43e7499161') + version('2.0.0', '9e76ae7b291be27faaad47cfc256cbfe') + + variant('shared', default=True, description='Build the shared library version') + + provides('scalapack') + + depends_on('mpi') + depends_on('blas') + depends_on('lapack') + + def install(self, spec, prefix): + options = [ + "-DBUILD_SHARED_LIBS:BOOL=%s" % 'ON' if '+shared' in spec else 'OFF', + "-DBUILD_STATIC_LIBS:BOOL=%s" % 'OFF' if '+shared' in spec else 'ON', + "-DCMAKE_C_FLAGS=-fPIC", + "-DCMAKE_Fortran_FLAGS=-fPIC", + ] + + options.extend(std_cmake_args) + + with working_dir('spack-build', create=True): + cmake('..', *options) + make() + make("install") + + def setup_dependent_environment(self, module, spec, dependent_spec): + # TODO treat OS that are not Linux... + lib_suffix = '.so' if '+shared' in spec['scalapack'] else '.a' + + spec['scalapack'].fc_link = '-L%s -lscalapack' % spec['scalapack'].prefix.lib + spec['scalapack'].cc_link = spec['scalapack'].fc_link + spec['scalapack'].libraries = [join_path(spec['scalapack'].prefix.lib, + 'libscalapack%s' % lib_suffix)] -- cgit v1.2.3-70-g09d2 From 974fc65e0f15ac87d2422858d71e0c7624fb7726 Mon Sep 17 00:00:00 2001 From: Nicolas Richart Date: Wed, 20 Jan 2016 14:38:55 +0100 Subject: renaming packages to follow changes on develop --- var/spack/packages/mumps/Makefile.inc | 41 ------- var/spack/packages/mumps/package.py | 121 --------------------- var/spack/packages/netlib-scalapack/package.py | 43 -------- .../repos/builtin/packages/mumps/Makefile.inc | 41 +++++++ var/spack/repos/builtin/packages/mumps/package.py | 121 +++++++++++++++++++++ .../builtin/packages/netlib-scalapack/package.py | 43 ++++++++ 6 files changed, 205 insertions(+), 205 deletions(-) delete mode 100644 var/spack/packages/mumps/Makefile.inc delete mode 100644 var/spack/packages/mumps/package.py delete mode 100644 var/spack/packages/netlib-scalapack/package.py create mode 100644 var/spack/repos/builtin/packages/mumps/Makefile.inc create mode 100644 var/spack/repos/builtin/packages/mumps/package.py create mode 100644 var/spack/repos/builtin/packages/netlib-scalapack/package.py (limited to 'var') diff --git a/var/spack/packages/mumps/Makefile.inc b/var/spack/packages/mumps/Makefile.inc deleted file mode 100644 index 4b6696db5c..0000000000 --- a/var/spack/packages/mumps/Makefile.inc +++ /dev/null @@ -1,41 +0,0 @@ -LPORDDIR = $(topdir)/PORD/lib/ -IPORD = -I$(topdir)/PORD/include/ -LPORD = -L$(LPORDDIR) -lpord - -ORDERINGSC = $(ORDERINGSF) -LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH) -IORDERINGSF = $(ISCOTCH) -IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH) - -PLAT = -LIBEXT = .a -OUTC = -o -OUTF = -o -RM = /bin/rm -f -AR = ar vr -RANLIB = ranlib - -INCSEQ = -I$(topdir)/libseq -LIBSEQ = -L$(topdir)/libseq -lmpiseq - -INCPAR = -LIBPAR = $(SCALAP) - -LIBOTHERS = -lpthread - -#Preprocessor defs for calling Fortran from C (-DAdd_ or -DAdd__ or -DUPPER) -CDEFS = -DAdd_ - -#Sequential: -ifeq ($(MUMPS_TYPE),seq) -INCS = $(INCSEQ) -LIBS = $(LIBSEQ) -LIBSEQNEEDED = libseqneeded -endif - -#Parallel: -ifeq ($(MUMPS_TYPE),par) -INCS = $(INCPAR) -LIBS = $(LIBPAR) -LIBSEQNEEDED = -endif diff --git a/var/spack/packages/mumps/package.py b/var/spack/packages/mumps/package.py deleted file mode 100644 index b4e38c02de..0000000000 --- a/var/spack/packages/mumps/package.py +++ /dev/null @@ -1,121 +0,0 @@ -from spack import * -import os - - -class Mumps(Package): - """MUMPS: a MUltifrontal Massively Parallel sparse direct Solver""" - - homepage = "http://mumps.enseeiht.fr" - url = "http://mumps.enseeiht.fr/MUMPS_5.0.1.tar.gz" - - version('5.0.1', 'b477573fdcc87babe861f62316833db0') - - variant('mpi', default=True, description='Activate the compilation of MUMPS with the MPI support') - variant('scotch', default=False, description='Activate Scotch as a possible ordering library') - variant('ptscotch', default=False, description='Activate PT-Scotch as a possible ordering library') - variant('metis', default=False, description='Activate Metis as a possible ordering library') - variant('parmetis', default=False, description='Activate Parmetis as a possible ordering library') - variant('double', default=True, description='Activate dmumps') - variant('float', default=True, description='Activate smumps') - variant('complex', default=True, description='Activate cmumps and/or zmumps') - variant('idx64', default=False, description='Use int64_t/integer*8 as default index type') - variant('double', default=False, description='Use double precision floating point types') - - - depends_on('scotch + esmumps', when='~ptscotch+scotch') - depends_on('scotch + esmumps + mpi', when='+ptscotch') - depends_on('metis', when='~parmetis+metis') - depends_on('parmetis', when="+parmetis") - depends_on('blas') - depends_on('scalapack', when='+mpi') - depends_on('mpi', when='+mpi') - - def patch(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') - - 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']))]) - orderings.append('-Dscotch') - if '+ptscotch' in self.spec: - orderings.append('-Dptscotch') - - if '+parmetis' in self.spec or '+metis' in self.spec: - libname = 'parmetis' if '+parmetis' in self.spec else 'metis' - makefile_conf.extend( - ["IMETIS = -I%s" % self.spec[libname].prefix.include, - "LMETIS = -L%s -l%s" % (self.spec[libname].prefix.lib, libname)]) - - orderings.append('-Dmetis') - if '+parmetis' in self.spec: - orderings.append('-Dparmetis') - - makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings))) - - if '+idx64' in self.spec: - makefile_conf.extend( - ['OPTF = -O -DALLOW_NON_INIT %s' % '-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8', - 'OPTL = -O ', - 'OPTC = -O -DINTSIZE64']) - else: - makefile_conf.extend( - ['OPTF = -O -DALLOW_NON_INIT', - 'OPTL = -O ', - 'OPTC = -O ']) - - - if '+mpi' in self.spec: - makefile_conf.extend( - ["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]) - else: - makefile_conf.extend( - ["CC = cc", - "FC = fc", - "FL = fc", - "MUMPS_TYPE = seq"]) - - 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')) - - with working_dir('.'): - with open("Makefile.inc", "w") as fh: - makefile_inc = '\n'.join(makefile_conf) - fh.write(makefile_inc) - - - - def install(self, spec, prefix): - make_libs = [] - - # the coice to compile ?examples is to have kind of a sanity - # check on the libraries generated. - if '+float' in spec: - make_libs.append('sexamples') - if '+complex' in spec: - make_libs.append('cexamples') - - if '+double' in spec: - make_libs.append('dexamples') - if '+complex' in spec: - make_libs.append('zexamples') - - make(*make_libs) - - install_tree('lib', prefix.lib) - install_tree('include', prefix.include) - if '~mpi' in spec: - install('libseq/libmpiseq.a', prefix.lib) diff --git a/var/spack/packages/netlib-scalapack/package.py b/var/spack/packages/netlib-scalapack/package.py deleted file mode 100644 index 69df4d9da7..0000000000 --- a/var/spack/packages/netlib-scalapack/package.py +++ /dev/null @@ -1,43 +0,0 @@ -from spack import * - -class NetlibScalapack(Package): - """ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines""" - - homepage = "http://www.netlib.org/scalapack/" - url = "http://www.netlib.org/scalapack/scalapack-2.0.2.tgz" - - version('2.0.2', '2f75e600a2ba155ed9ce974a1c4b536f') - version('2.0.1', '17b8cde589ea0423afe1ec43e7499161') - version('2.0.0', '9e76ae7b291be27faaad47cfc256cbfe') - - variant('shared', default=True, description='Build the shared library version') - - provides('scalapack') - - depends_on('mpi') - depends_on('blas') - depends_on('lapack') - - def install(self, spec, prefix): - options = [ - "-DBUILD_SHARED_LIBS:BOOL=%s" % 'ON' if '+shared' in spec else 'OFF', - "-DBUILD_STATIC_LIBS:BOOL=%s" % 'OFF' if '+shared' in spec else 'ON', - "-DCMAKE_C_FLAGS=-fPIC", - "-DCMAKE_Fortran_FLAGS=-fPIC", - ] - - options.extend(std_cmake_args) - - with working_dir('spack-build', create=True): - cmake('..', *options) - make() - make("install") - - def setup_dependent_environment(self, module, spec, dependent_spec): - # TODO treat OS that are not Linux... - lib_suffix = '.so' if '+shared' in spec['scalapack'] else '.a' - - spec['scalapack'].fc_link = '-L%s -lscalapack' % spec['scalapack'].prefix.lib - spec['scalapack'].cc_link = spec['scalapack'].fc_link - spec['scalapack'].libraries = [join_path(spec['scalapack'].prefix.lib, - 'libscalapack%s' % lib_suffix)] diff --git a/var/spack/repos/builtin/packages/mumps/Makefile.inc b/var/spack/repos/builtin/packages/mumps/Makefile.inc new file mode 100644 index 0000000000..4b6696db5c --- /dev/null +++ b/var/spack/repos/builtin/packages/mumps/Makefile.inc @@ -0,0 +1,41 @@ +LPORDDIR = $(topdir)/PORD/lib/ +IPORD = -I$(topdir)/PORD/include/ +LPORD = -L$(LPORDDIR) -lpord + +ORDERINGSC = $(ORDERINGSF) +LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH) +IORDERINGSF = $(ISCOTCH) +IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH) + +PLAT = +LIBEXT = .a +OUTC = -o +OUTF = -o +RM = /bin/rm -f +AR = ar vr +RANLIB = ranlib + +INCSEQ = -I$(topdir)/libseq +LIBSEQ = -L$(topdir)/libseq -lmpiseq + +INCPAR = +LIBPAR = $(SCALAP) + +LIBOTHERS = -lpthread + +#Preprocessor defs for calling Fortran from C (-DAdd_ or -DAdd__ or -DUPPER) +CDEFS = -DAdd_ + +#Sequential: +ifeq ($(MUMPS_TYPE),seq) +INCS = $(INCSEQ) +LIBS = $(LIBSEQ) +LIBSEQNEEDED = libseqneeded +endif + +#Parallel: +ifeq ($(MUMPS_TYPE),par) +INCS = $(INCPAR) +LIBS = $(LIBPAR) +LIBSEQNEEDED = +endif diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py new file mode 100644 index 0000000000..b4e38c02de --- /dev/null +++ b/var/spack/repos/builtin/packages/mumps/package.py @@ -0,0 +1,121 @@ +from spack import * +import os + + +class Mumps(Package): + """MUMPS: a MUltifrontal Massively Parallel sparse direct Solver""" + + homepage = "http://mumps.enseeiht.fr" + url = "http://mumps.enseeiht.fr/MUMPS_5.0.1.tar.gz" + + version('5.0.1', 'b477573fdcc87babe861f62316833db0') + + variant('mpi', default=True, description='Activate the compilation of MUMPS with the MPI support') + variant('scotch', default=False, description='Activate Scotch as a possible ordering library') + variant('ptscotch', default=False, description='Activate PT-Scotch as a possible ordering library') + variant('metis', default=False, description='Activate Metis as a possible ordering library') + variant('parmetis', default=False, description='Activate Parmetis as a possible ordering library') + variant('double', default=True, description='Activate dmumps') + variant('float', default=True, description='Activate smumps') + variant('complex', default=True, description='Activate cmumps and/or zmumps') + variant('idx64', default=False, description='Use int64_t/integer*8 as default index type') + variant('double', default=False, description='Use double precision floating point types') + + + depends_on('scotch + esmumps', when='~ptscotch+scotch') + depends_on('scotch + esmumps + mpi', when='+ptscotch') + depends_on('metis', when='~parmetis+metis') + depends_on('parmetis', when="+parmetis") + depends_on('blas') + depends_on('scalapack', when='+mpi') + depends_on('mpi', when='+mpi') + + def patch(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') + + 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']))]) + orderings.append('-Dscotch') + if '+ptscotch' in self.spec: + orderings.append('-Dptscotch') + + if '+parmetis' in self.spec or '+metis' in self.spec: + libname = 'parmetis' if '+parmetis' in self.spec else 'metis' + makefile_conf.extend( + ["IMETIS = -I%s" % self.spec[libname].prefix.include, + "LMETIS = -L%s -l%s" % (self.spec[libname].prefix.lib, libname)]) + + orderings.append('-Dmetis') + if '+parmetis' in self.spec: + orderings.append('-Dparmetis') + + makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings))) + + if '+idx64' in self.spec: + makefile_conf.extend( + ['OPTF = -O -DALLOW_NON_INIT %s' % '-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8', + 'OPTL = -O ', + 'OPTC = -O -DINTSIZE64']) + else: + makefile_conf.extend( + ['OPTF = -O -DALLOW_NON_INIT', + 'OPTL = -O ', + 'OPTC = -O ']) + + + if '+mpi' in self.spec: + makefile_conf.extend( + ["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]) + else: + makefile_conf.extend( + ["CC = cc", + "FC = fc", + "FL = fc", + "MUMPS_TYPE = seq"]) + + 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')) + + with working_dir('.'): + with open("Makefile.inc", "w") as fh: + makefile_inc = '\n'.join(makefile_conf) + fh.write(makefile_inc) + + + + def install(self, spec, prefix): + make_libs = [] + + # the coice to compile ?examples is to have kind of a sanity + # check on the libraries generated. + if '+float' in spec: + make_libs.append('sexamples') + if '+complex' in spec: + make_libs.append('cexamples') + + if '+double' in spec: + make_libs.append('dexamples') + if '+complex' in spec: + make_libs.append('zexamples') + + make(*make_libs) + + install_tree('lib', prefix.lib) + install_tree('include', prefix.include) + if '~mpi' in spec: + install('libseq/libmpiseq.a', prefix.lib) diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py new file mode 100644 index 0000000000..69df4d9da7 --- /dev/null +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -0,0 +1,43 @@ +from spack import * + +class NetlibScalapack(Package): + """ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines""" + + homepage = "http://www.netlib.org/scalapack/" + url = "http://www.netlib.org/scalapack/scalapack-2.0.2.tgz" + + version('2.0.2', '2f75e600a2ba155ed9ce974a1c4b536f') + version('2.0.1', '17b8cde589ea0423afe1ec43e7499161') + version('2.0.0', '9e76ae7b291be27faaad47cfc256cbfe') + + variant('shared', default=True, description='Build the shared library version') + + provides('scalapack') + + depends_on('mpi') + depends_on('blas') + depends_on('lapack') + + def install(self, spec, prefix): + options = [ + "-DBUILD_SHARED_LIBS:BOOL=%s" % 'ON' if '+shared' in spec else 'OFF', + "-DBUILD_STATIC_LIBS:BOOL=%s" % 'OFF' if '+shared' in spec else 'ON', + "-DCMAKE_C_FLAGS=-fPIC", + "-DCMAKE_Fortran_FLAGS=-fPIC", + ] + + options.extend(std_cmake_args) + + with working_dir('spack-build', create=True): + cmake('..', *options) + make() + make("install") + + def setup_dependent_environment(self, module, spec, dependent_spec): + # TODO treat OS that are not Linux... + lib_suffix = '.so' if '+shared' in spec['scalapack'] else '.a' + + spec['scalapack'].fc_link = '-L%s -lscalapack' % spec['scalapack'].prefix.lib + spec['scalapack'].cc_link = spec['scalapack'].fc_link + spec['scalapack'].libraries = [join_path(spec['scalapack'].prefix.lib, + 'libscalapack%s' % lib_suffix)] -- cgit v1.2.3-70-g09d2 From 19caac69d8b3c8383c7b59c2b39ec3bf54406fa8 Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 20 Jan 2016 15:22:49 +0100 Subject: openmpi : turned torque support into a variant (default false) hdf5 : fixed a few bugs, removed suspicious macro deinition, etc. --- var/spack/repos/builtin/packages/hdf5/package.py | 84 +++++++++++++++++----- .../repos/builtin/packages/openmpi/package.py | 24 +++---- 2 files changed, 79 insertions(+), 29 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 9a40164341..ac78d8e961 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -1,5 +1,31 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written 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 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 +############################################################################## + from spack import * + class Hdf5(Package): """HDF5 is a data model, library, and file format for storing and managing data. It supports an unlimited variety of datatypes, and is designed for @@ -7,7 +33,7 @@ class Hdf5(Package): """ homepage = "http://www.hdfgroup.org/HDF5/" - url = "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.13/src/hdf5-1.8.13.tar.gz" + url = "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.13/src/hdf5-1.8.13.tar.gz" list_url = "http://www.hdfgroup.org/ftp/HDF5/releases" list_depth = 3 @@ -15,26 +41,53 @@ class Hdf5(Package): version('1.8.15', '03cccb5b33dbe975fdcd8ae9dc021f24') version('1.8.13', 'c03426e9e77d7766944654280b467289') + variant('debug', default=False, description='Builds a debug version of the library') + variant('cxx', default=True, description='Enable C++ support') variant('fortran', default=True, description='Enable Fortran support') + variant('unsupported', default=False, description='Enables unsupported configuration options') + variant('mpi', default=False, description='Enable MPI support') - variant('threadsafe', default=False, description='Enable multithreading') + variant('threadsafe', default=False, description='Enable thread-safe capabilities') depends_on("mpi", when='+mpi') depends_on("zlib") - # TODO: currently hard-coded to use OpenMPI + def validate(self, spec): + """ + Checks if incompatible variants have been activated at the same time + + :param spec: spec of the package + :raises RuntimeError: in case of inconsistencies + """ + if '+fortran' in spec and not self.compiler.fc: + msg = 'cannot build a fortran variant without a fortran compiler' + 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") + def install(self, spec, prefix): + self.validate(spec) + # Handle compilation after spec validation extra_args = [] + if '+debug' in spec: + extra_args.append('--enable-debug=all') + else: + extra_args.append('--enable-production') + + if '+unsupported' in spec: + extra_args.append("--enable-unsupported") + if '+cxx' in spec: - extra_args.extend([ - '--enable-cxx' - ]) + extra_args.append('--enable-cxx') + if '+fortran' in spec: extra_args.extend([ '--enable-fortran', '--enable-fortran2003' ]) + if '+mpi' in spec: # The HDF5 configure script warns if cxx and mpi are enabled # together. There doesn't seem to be a real reason for this, except @@ -43,27 +96,26 @@ class Hdf5(Package): # this is not actually a problem. extra_args.extend([ "--enable-parallel", - "--enable-unsupported", "CC=%s" % spec['mpi'].prefix.bin + "/mpicc", - "CXX=%s" % spec['mpi'].prefix.bin + "/mpic++", - "FC=%s" % spec['mpi'].prefix.bin + "/mpifort", ]) - if '+threads' in spec: - if '+cxx' in spec or '+fortran' in spec: - die("Cannot use variant +threads with either +cxx or +fortran") + + if '+cxx' in spec: + extra_args.append("CXX=%s" % spec['mpi'].prefix.bin + "/mpic++") + + if '+fortran' in spec: + extra_args.append("FC=%s" % spec['mpi'].prefix.bin + "/mpifort") + + if '+threadsafe' in spec: extra_args.extend([ '--enable-threadsafe', '--disable-hl', - 'CPPFLAGS=-DHDatexit=""', - 'CFLAGS=-DHDatexit=""' ]) configure( "--prefix=%s" % prefix, "--with-zlib=%s" % spec['zlib'].prefix, - "--enable-shared", + "--enable-shared", # TODO : this should be enabled by default, remove it? *extra_args) - make() make("install") diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 463719f9db..1b7f1c2011 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -19,43 +19,44 @@ class Openmpi(Package): version('1.10.1', 'f0fcd77ed345b7eafb431968124ba16e') version('1.10.0', '280cf952de68369cebaca886c5ce0304') - version('1.8.8', '0dab8e602372da1425e9242ae37faf8c') - version('1.6.5', '03aed2a4aa4d0b27196962a2a65fc475') + version('1.8.8', '0dab8e602372da1425e9242ae37faf8c') + version('1.6.5', '03aed2a4aa4d0b27196962a2a65fc475') patch('ad_lustre_rwcontig_open_source.patch', when="@1.6.5") patch('llnl-platforms.patch', when="@1.6.5") patch('configure.patch', when="@1.10.0:") - variant('psm', default=False, description='Build support for the PSM library.') + variant('psm', default=False, description='Build support for the PSM library.') variant('verbs', default=False, description='Build support for OpenFabrics verbs.') + # TODO : variant support for other schedulers is missing + variant('tm', default=False, description='Build TM (Torque, PBSPro, and compatible) support') + provides('mpi@:2.2', when='@1.6.5') provides('mpi@:3.0', when='@1.7.5:') - depends_on('hwloc') - def url_for_version(self, version): return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version) - def setup_dependent_environment(self, module, spec, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" - os.environ['OMPI_CC'] = 'cc' + os.environ['OMPI_CC'] = 'cc' os.environ['OMPI_CXX'] = 'c++' os.environ['OMPI_FC'] = 'f90' os.environ['OMPI_F77'] = 'f77' - def install(self, spec, prefix): config_args = ["--prefix=%s" % prefix, "--with-hwloc=%s" % spec['hwloc'].prefix, - "--with-tm", # necessary for Torque support "--enable-shared", "--enable-static"] # Variants + if '+tm' in spec: + config_args.append("--with-tm") # necessary for Torque support + if '+psm' in spec: config_args.append("--with-psm") @@ -85,7 +86,6 @@ class Openmpi(Package): self.filter_compilers() - def filter_compilers(self): """Run after install to make the MPI compilers use the compilers that Spack built the package with. @@ -94,7 +94,7 @@ class Openmpi(Package): to Spack's generic cc, c++ and f90. We want them to be bound to whatever compiler they were built with. """ - kwargs = { 'ignore_absent' : True, 'backup' : False, 'string' : False } + kwargs = {'ignore_absent': True, 'backup': False, 'string': False} dir = os.path.join(self.prefix, 'share/openmpi/') cc_wrappers = ['mpicc-vt-wrapper-data.txt', 'mpicc-wrapper-data.txt', @@ -132,5 +132,3 @@ class Openmpi(Package): if not os.path.islink(path): filter_file('compiler=.*', 'compiler=%s' % self.compiler.fc, path, **kwargs) - - -- cgit v1.2.3-70-g09d2 From b71b478a3626ae9e1a0d3b5c7ab9945b5c478200 Mon Sep 17 00:00:00 2001 From: Nicolas Richart Date: Wed, 20 Jan 2016 18:31:02 +0100 Subject: Minor correction to install mumps+mpi --- .../repos/builtin/packages/mumps/Makefile.inc | 3 -- var/spack/repos/builtin/packages/mumps/package.py | 32 +++++++++++++++++----- .../builtin/packages/netlib-scalapack/package.py | 17 ++++++++---- 3 files changed, 37 insertions(+), 15 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/mumps/Makefile.inc b/var/spack/repos/builtin/packages/mumps/Makefile.inc index 4b6696db5c..2e6a041878 100644 --- a/var/spack/repos/builtin/packages/mumps/Makefile.inc +++ b/var/spack/repos/builtin/packages/mumps/Makefile.inc @@ -23,9 +23,6 @@ LIBPAR = $(SCALAP) LIBOTHERS = -lpthread -#Preprocessor defs for calling Fortran from C (-DAdd_ or -DAdd__ or -DUPPER) -CDEFS = -DAdd_ - #Sequential: ifeq ($(MUMPS_TYPE),seq) INCS = $(INCSEQ) diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py index b4e38c02de..44a37903cc 100644 --- a/var/spack/repos/builtin/packages/mumps/package.py +++ b/var/spack/repos/builtin/packages/mumps/package.py @@ -15,11 +15,10 @@ class Mumps(Package): variant('ptscotch', default=False, description='Activate PT-Scotch as a possible ordering library') variant('metis', default=False, description='Activate Metis as a possible ordering library') variant('parmetis', default=False, description='Activate Parmetis as a possible ordering library') - variant('double', default=True, description='Activate dmumps') - variant('float', default=True, description='Activate smumps') - variant('complex', default=True, description='Activate cmumps and/or zmumps') + variant('double', default=True, description='Activate the compilation of dmumps') + variant('float', default=True, description='Activate the compilation of smumps') + variant('complex', default=True, description='Activate the compilation of cmumps and/or zmumps') variant('idx64', default=False, description='Use int64_t/integer*8 as default index type') - variant('double', default=False, description='Use double precision floating point types') depends_on('scotch + esmumps', when='~ptscotch+scotch') @@ -27,10 +26,16 @@ class Mumps(Package): depends_on('metis', when='~parmetis+metis') depends_on('parmetis', when="+parmetis") depends_on('blas') + depends_on('lapack') depends_on('scalapack', when='+mpi') depends_on('mpi', when='+mpi') - - def patch(self): + + # 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') @@ -61,8 +66,13 @@ class Mumps(Package): makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings))) + # TODO: test this part, it needs a full blas, scalapack and + # partitionning environment with 64bit integers if '+idx64' in self.spec: makefile_conf.extend( + # the fortran compilation flags most probably are + # working only for intel and gnu compilers this is + # perhaps something the compiler should provide ['OPTF = -O -DALLOW_NON_INIT %s' % '-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8', 'OPTL = -O ', 'OPTC = -O -DINTSIZE64']) @@ -78,7 +88,8 @@ class Mumps(Package): ["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]) + "SCALAP = %s" % self.spec['scalapack'].fc_link, + "MUMPS_TYPE = par"]) else: makefile_conf.extend( ["CC = cc", @@ -86,6 +97,11 @@ class Mumps(Package): "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.append("CDEFS = -DAdd_") + + makefile_inc_template = join_path(os.path.dirname(self.module.__file__), 'Makefile.inc') with open(makefile_inc_template, "r") as fh: @@ -113,6 +129,8 @@ class Mumps(Package): if '+complex' in spec: make_libs.append('zexamples') + self.write_makefile_inc() + make(*make_libs) install_tree('lib', prefix.lib) diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 69df4d9da7..5be91c4a40 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -9,23 +9,30 @@ class NetlibScalapack(Package): version('2.0.2', '2f75e600a2ba155ed9ce974a1c4b536f') version('2.0.1', '17b8cde589ea0423afe1ec43e7499161') version('2.0.0', '9e76ae7b291be27faaad47cfc256cbfe') - + # versions before 2.0.0 are not using cmake and requires blacs as + # a separated package + variant('shared', default=True, description='Build the shared library version') - + variant('fpic', default=False, description="Build with -fpic compiler option") + provides('scalapack') depends_on('mpi') - depends_on('blas') depends_on('lapack') def install(self, spec, prefix): options = [ "-DBUILD_SHARED_LIBS:BOOL=%s" % 'ON' if '+shared' in spec else 'OFF', "-DBUILD_STATIC_LIBS:BOOL=%s" % 'OFF' if '+shared' in spec else 'ON', - "-DCMAKE_C_FLAGS=-fPIC", - "-DCMAKE_Fortran_FLAGS=-fPIC", + "-DUSE_OPTIMIZED_LAPACK_BLAS:BOOL=ON", # forces scalapack to use find_package(LAPACK) ] + if '+fpic' in spec: + options.extend([ + "-DCMAKE_C_FLAGS=-fPIC", + "-DCMAKE_Fortran_FLAGS=-fPIC" + ]) + options.extend(std_cmake_args) with working_dir('spack-build', create=True): -- cgit v1.2.3-70-g09d2 From 785c01218ffb33b085c786f19b81ebbefcb3d0c6 Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 21 Jan 2016 10:06:43 +0100 Subject: elpa : added missing dependencies --- var/spack/repos/builtin/packages/elpa/package.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/elpa/package.py b/var/spack/repos/builtin/packages/elpa/package.py index 6825056a04..2ade5b0b37 100644 --- a/var/spack/repos/builtin/packages/elpa/package.py +++ b/var/spack/repos/builtin/packages/elpa/package.py @@ -36,11 +36,20 @@ class Elpa(Package): version('2015.11.001', 'de0f35b7ee7c971fd0dca35c900b87e6', url='http://elpa.mpcdf.mpg.de/elpa-2015.11.001.tar.gz') + variant('openmp', default=False, description='Activates OpenMP support') + depends_on('mpi') depends_on('blas') depends_on('lapack') + depends_on('scalapack') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + + options = ["--prefix=%s" % prefix] + + if '+openmp' in spec: + options.append("--enable-openmp") + + configure(*options) make() make("install") -- cgit v1.2.3-70-g09d2 From 950246b331c74700e01dc48a86f84bf47d528af3 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 21 Jan 2016 09:54:24 -0600 Subject: Remove constraint on dependency version --- var/spack/repos/builtin/packages/hdf/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hdf/package.py b/var/spack/repos/builtin/packages/hdf/package.py index 7882665dba..43b5980230 100644 --- a/var/spack/repos/builtin/packages/hdf/package.py +++ b/var/spack/repos/builtin/packages/hdf/package.py @@ -12,7 +12,7 @@ class Hdf(Package): version('4.2.11', '063f9928f3a19cc21367b71c3b8bbf19') depends_on("jpeg") - depends_on("szip@2.1") + depends_on("szip") depends_on("zlib") -- cgit v1.2.3-70-g09d2 From ea9d0c0263126c370119e5fc435652c7214e658a Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 21 Jan 2016 09:58:47 -0600 Subject: Remove constraints on dependency versions --- var/spack/repos/builtin/packages/mpc/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/mpc/package.py b/var/spack/repos/builtin/packages/mpc/package.py index 65c0ba7ea1..108fec678f 100644 --- a/var/spack/repos/builtin/packages/mpc/package.py +++ b/var/spack/repos/builtin/packages/mpc/package.py @@ -34,8 +34,8 @@ class Mpc(Package): version('1.0.3', 'd6a1d5f8ddea3abd2cc3e98f58352d26') version('1.0.2', '68fadff3358fb3e7976c7a398a0af4c3') - depends_on("gmp@4.3.2:") - depends_on("mpfr@2.4.2:") + depends_on("gmp") + depends_on("mpfr") def url_for_version(self, version): if version < Version("1.0.1"): -- cgit v1.2.3-70-g09d2 From 03d5ee6738e49c4402cffe7503ea92c25edf9720 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 21 Jan 2016 10:02:33 -0600 Subject: Remove constraint on dependency version --- var/spack/repos/builtin/packages/mpfr/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/mpfr/package.py b/var/spack/repos/builtin/packages/mpfr/package.py index 2758b0da2e..a1bd7529cf 100644 --- a/var/spack/repos/builtin/packages/mpfr/package.py +++ b/var/spack/repos/builtin/packages/mpfr/package.py @@ -33,7 +33,7 @@ class Mpfr(Package): version('3.1.3', '5fdfa3cfa5c86514ee4a241a1affa138') version('3.1.2', 'ee2c3ac63bf0c2359bf08fc3ee094c19') - depends_on('gmp@4.1.0:') + depends_on('gmp') def install(self, spec, prefix): configure("--prefix=%s" % prefix) -- cgit v1.2.3-70-g09d2 From 10848c2e9a7cd3771c469dfd5ddb235f76b229ba Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 21 Jan 2016 02:40:38 -0800 Subject: Refactor args for Executable.__call__ - simplify output, error, and input redirection - `return_output=True` is now `output=str` - `return_output=True` will still work for the time being but is deprecated. - previously you could say `return_output=True` and `output=`, which wouldn't actually write to the stream. Now you actually can't specify erroneous cases since there is only one parameter with mutually exclusive options.. --- lib/spack/spack/cmd/bootstrap.py | 2 +- lib/spack/spack/cmd/create.py | 2 +- lib/spack/spack/cmd/pkg.py | 2 +- lib/spack/spack/compiler.py | 3 +- lib/spack/spack/fetch_strategy.py | 6 +- lib/spack/spack/test/cc.py | 6 +- lib/spack/spack/test/make_executable.py | 48 ++++++------- lib/spack/spack/test/mock_repo.py | 4 +- lib/spack/spack/test/svn_fetch.py | 2 +- lib/spack/spack/util/executable.py | 95 ++++++++++++++++++++----- var/spack/repos/builtin/packages/gcc/package.py | 6 +- 11 files changed, 116 insertions(+), 60 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/cmd/bootstrap.py b/lib/spack/spack/cmd/bootstrap.py index e4ec7da35d..bdbd623b39 100644 --- a/lib/spack/spack/cmd/bootstrap.py +++ b/lib/spack/spack/cmd/bootstrap.py @@ -42,7 +42,7 @@ def get_origin_url(): git = which('git', required=True) origin_url = git( '--git-dir=%s' % git_dir, 'config', '--get', 'remote.origin.url', - return_output=True) + output=str) return origin_url.strip() diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py index 7cea39cb55..edcea0718c 100644 --- a/lib/spack/spack/cmd/create.py +++ b/lib/spack/spack/cmd/create.py @@ -132,7 +132,7 @@ class ConfigureGuesser(object): # Peek inside the tarball. tar = which('tar') output = tar( - "--exclude=*/*/*", "-tf", stage.archive_file, return_output=True) + "--exclude=*/*/*", "-tf", stage.archive_file, output=str) lines = output.split("\n") # Set the configure line to the one that matched. diff --git a/lib/spack/spack/cmd/pkg.py b/lib/spack/spack/cmd/pkg.py index 448f762841..cf478d3763 100644 --- a/lib/spack/spack/cmd/pkg.py +++ b/lib/spack/spack/cmd/pkg.py @@ -79,7 +79,7 @@ def list_packages(rev): git = get_git() relpath = spack.packages_path[len(spack.prefix + os.path.sep):] + os.path.sep output = git('ls-tree', '--full-tree', '--name-only', rev, relpath, - return_output=True) + output=str) return sorted(line[len(relpath):] for line in output.split('\n') if line) diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index 887e416dc5..12c02e0ea2 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -24,7 +24,6 @@ ############################################################################## import os import re -import subprocess import itertools from datetime import datetime @@ -52,7 +51,7 @@ _version_cache = {} def get_compiler_version(compiler_path, version_arg, regex='(.*)'): if not compiler_path in _version_cache: compiler = Executable(compiler_path) - output = compiler(version_arg, return_output=True, error=subprocess.STDOUT) + output = compiler(version_arg, output=str, error=str) match = re.search(regex, output) _version_cache[compiler_path] = match.group(1) if match else 'unknown' diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index 0657146bf6..337dd1e198 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -154,7 +154,7 @@ class URLFetchStrategy(FetchStrategy): # Run curl but grab the mime type from the http headers headers = spack.curl( - *curl_args, return_output=True, fail_on_error=False) + *curl_args, output=str, fail_on_error=False) if spack.curl.returncode != 0: # clean up archive on failure. @@ -375,7 +375,7 @@ class GitFetchStrategy(VCSFetchStrategy): @property def git_version(self): - vstring = self.git('--version', return_output=True).lstrip('git version ') + vstring = self.git('--version', output=str).lstrip('git version ') return Version(vstring) @@ -518,7 +518,7 @@ class SvnFetchStrategy(VCSFetchStrategy): def _remove_untracked_files(self): """Removes untracked files in an svn repository.""" - status = self.svn('status', '--no-ignore', return_output=True) + status = self.svn('status', '--no-ignore', output=str) self.svn('status', '--no-ignore') for line in status.split('\n'): if not re.match('^[I?]', line): diff --git a/lib/spack/spack/test/cc.py b/lib/spack/spack/test/cc.py index 4188b8d550..905af28a06 100644 --- a/lib/spack/spack/test/cc.py +++ b/lib/spack/spack/test/cc.py @@ -65,17 +65,17 @@ class CompilerTest(unittest.TestCase): def check_cc(self, command, args, expected): os.environ['SPACK_TEST_COMMAND'] = command - self.assertEqual(self.cc(*args, return_output=True).strip(), expected) + self.assertEqual(self.cc(*args, output=str).strip(), expected) def check_ld(self, command, args, expected): os.environ['SPACK_TEST_COMMAND'] = command - self.assertEqual(self.ld(*args, return_output=True).strip(), expected) + self.assertEqual(self.ld(*args, output=str).strip(), expected) def check_cpp(self, command, args, expected): os.environ['SPACK_TEST_COMMAND'] = command - self.assertEqual(self.cpp(*args, return_output=True).strip(), expected) + self.assertEqual(self.cpp(*args, output=str).strip(), expected) def test_vcheck_mode(self): diff --git a/lib/spack/spack/test/make_executable.py b/lib/spack/spack/test/make_executable.py index 09efec8580..d568a28d44 100644 --- a/lib/spack/spack/test/make_executable.py +++ b/lib/spack/spack/test/make_executable.py @@ -56,47 +56,47 @@ class MakeExecutableTest(unittest.TestCase): def test_make_normal(self): make = MakeExecutable('make', 8) - self.assertEqual(make(return_output=True).strip(), '-j8') - self.assertEqual(make('install', return_output=True).strip(), '-j8 install') + self.assertEqual(make(output=str).strip(), '-j8') + self.assertEqual(make('install', output=str).strip(), '-j8 install') def test_make_explicit(self): make = MakeExecutable('make', 8) - self.assertEqual(make(parallel=True, return_output=True).strip(), '-j8') - self.assertEqual(make('install', parallel=True, return_output=True).strip(), '-j8 install') + self.assertEqual(make(parallel=True, output=str).strip(), '-j8') + self.assertEqual(make('install', parallel=True, output=str).strip(), '-j8 install') def test_make_one_job(self): make = MakeExecutable('make', 1) - self.assertEqual(make(return_output=True).strip(), '') - self.assertEqual(make('install', return_output=True).strip(), 'install') + self.assertEqual(make(output=str).strip(), '') + self.assertEqual(make('install', output=str).strip(), 'install') def test_make_parallel_false(self): make = MakeExecutable('make', 8) - self.assertEqual(make(parallel=False, return_output=True).strip(), '') - self.assertEqual(make('install', parallel=False, return_output=True).strip(), 'install') + self.assertEqual(make(parallel=False, output=str).strip(), '') + self.assertEqual(make('install', parallel=False, output=str).strip(), 'install') def test_make_parallel_disabled(self): make = MakeExecutable('make', 8) os.environ['SPACK_NO_PARALLEL_MAKE'] = 'true' - self.assertEqual(make(return_output=True).strip(), '') - self.assertEqual(make('install', return_output=True).strip(), 'install') + self.assertEqual(make(output=str).strip(), '') + self.assertEqual(make('install', output=str).strip(), 'install') os.environ['SPACK_NO_PARALLEL_MAKE'] = '1' - self.assertEqual(make(return_output=True).strip(), '') - self.assertEqual(make('install', return_output=True).strip(), 'install') + self.assertEqual(make(output=str).strip(), '') + self.assertEqual(make('install', output=str).strip(), 'install') # These don't disable (false and random string) os.environ['SPACK_NO_PARALLEL_MAKE'] = 'false' - self.assertEqual(make(return_output=True).strip(), '-j8') - self.assertEqual(make('install', return_output=True).strip(), '-j8 install') + self.assertEqual(make(output=str).strip(), '-j8') + self.assertEqual(make('install', output=str).strip(), '-j8 install') os.environ['SPACK_NO_PARALLEL_MAKE'] = 'foobar' - self.assertEqual(make(return_output=True).strip(), '-j8') - self.assertEqual(make('install', return_output=True).strip(), '-j8 install') + self.assertEqual(make(output=str).strip(), '-j8') + self.assertEqual(make('install', output=str).strip(), '-j8 install') del os.environ['SPACK_NO_PARALLEL_MAKE'] @@ -106,20 +106,20 @@ class MakeExecutableTest(unittest.TestCase): # These should work os.environ['SPACK_NO_PARALLEL_MAKE'] = 'true' - self.assertEqual(make(parallel=True, return_output=True).strip(), '') - self.assertEqual(make('install', parallel=True, return_output=True).strip(), 'install') + self.assertEqual(make(parallel=True, output=str).strip(), '') + self.assertEqual(make('install', parallel=True, output=str).strip(), 'install') os.environ['SPACK_NO_PARALLEL_MAKE'] = '1' - self.assertEqual(make(parallel=True, return_output=True).strip(), '') - self.assertEqual(make('install', parallel=True, return_output=True).strip(), 'install') + self.assertEqual(make(parallel=True, output=str).strip(), '') + self.assertEqual(make('install', parallel=True, output=str).strip(), 'install') # These don't disable (false and random string) os.environ['SPACK_NO_PARALLEL_MAKE'] = 'false' - self.assertEqual(make(parallel=True, return_output=True).strip(), '-j8') - self.assertEqual(make('install', parallel=True, return_output=True).strip(), '-j8 install') + self.assertEqual(make(parallel=True, output=str).strip(), '-j8') + self.assertEqual(make('install', parallel=True, output=str).strip(), '-j8 install') os.environ['SPACK_NO_PARALLEL_MAKE'] = 'foobar' - self.assertEqual(make(parallel=True, return_output=True).strip(), '-j8') - self.assertEqual(make('install', parallel=True, return_output=True).strip(), '-j8 install') + self.assertEqual(make(parallel=True, output=str).strip(), '-j8') + self.assertEqual(make('install', parallel=True, output=str).strip(), '-j8 install') del os.environ['SPACK_NO_PARALLEL_MAKE'] diff --git a/lib/spack/spack/test/mock_repo.py b/lib/spack/spack/test/mock_repo.py index c454b1f106..9738ba4e72 100644 --- a/lib/spack/spack/test/mock_repo.py +++ b/lib/spack/spack/test/mock_repo.py @@ -141,7 +141,7 @@ class MockGitRepo(MockVCSRepo): self.url = self.path def rev_hash(self, rev): - return git('rev-parse', rev, return_output=True).strip() + return git('rev-parse', rev, output=str).strip() class MockSvnRepo(MockVCSRepo): @@ -193,4 +193,4 @@ class MockHgRepo(MockVCSRepo): def get_rev(self): """Get current mercurial revision.""" - return hg('id', '-i', return_output=True).strip() + return hg('id', '-i', output=str).strip() diff --git a/lib/spack/spack/test/svn_fetch.py b/lib/spack/spack/test/svn_fetch.py index 2ee4748fdb..7d150b42f4 100644 --- a/lib/spack/spack/test/svn_fetch.py +++ b/lib/spack/spack/test/svn_fetch.py @@ -65,7 +65,7 @@ class SvnFetchTest(MockPackagesTest): def assert_rev(self, rev): """Check that the current revision is equal to the supplied rev.""" def get_rev(): - output = svn('info', return_output=True) + output = svn('info', output=str) self.assertTrue("Revision" in output) for line in output.split('\n'): match = re.match(r'Revision: (\d+)', line) diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py index ba765eb662..fc27b789d0 100644 --- a/lib/spack/spack/util/executable.py +++ b/lib/spack/spack/util/executable.py @@ -55,24 +55,80 @@ class Executable(object): def __call__(self, *args, **kwargs): - """Run the executable with subprocess.check_output, return output.""" - return_output = kwargs.get("return_output", False) - fail_on_error = kwargs.get("fail_on_error", True) - ignore_errors = kwargs.get("ignore_errors", ()) + """Run this executable in a subprocess. + + Arguments + args + command line arguments to the executable to run. + + Optional arguments + + fail_on_error + + Raise an exception if the subprocess returns an + error. Default is True. When not set, the return code is + avaiale as `exe.returncode`. + + ignore_errors + + An optional list/tuple of error codes that can be + *ignored*. i.e., if these codes are returned, this will + not raise an exception when `fail_on_error` is `True`. + + output, error + + These arguments allow you to specify new stdout and stderr + values. They default to `None`, which means the + subprocess will inherit the parent's file descriptors. + + You can set these to: + - python streams, e.g. open Python file objects, or os.devnull; + - filenames, which will be automatically opened for writing; or + - `str`, as in the Python string type. If you set these to `str`, + output and error will be written to pipes and returned as + a string. If both `output` and `error` are set to `str`, + then one string is returned containing output concatenated + with error. + + input + + Same as output, error, but `str` is not an allowed value. + + Deprecated arguments + + return_output[=False] + + Setting this to True is the same as setting output=str. + This argument may be removed in future Spack versions. + + """ + fail_on_error = kwargs.pop("fail_on_error", True) + ignore_errors = kwargs.pop("ignore_errors", ()) + + # TODO: This is deprecated. Remove in a future version. + return_output = kwargs.pop("return_output", False) # Default values of None says to keep parent's file descriptors. - output = kwargs.get("output", None) - error = kwargs.get("error", None) - input = kwargs.get("input", None) + if return_output: + output = str + else: + output = kwargs.pop("output", None) + + error = kwargs.pop("error", None) + input = kwargs.pop("input", None) + if input is str: + raise ValueError("Cannot use `str` as input stream.") def streamify(arg, mode): if isinstance(arg, basestring): return open(arg, mode), True + elif arg is str: + return subprocess.PIPE, False else: return arg, False - output, ostream = streamify(output, 'w') - error, estream = streamify(error, 'w') - input, istream = streamify(input, 'r') + ostream, close_ostream = streamify(output, 'w') + estream, close_estream = streamify(error, 'w') + istream, close_istream = streamify(input, 'r') # if they just want to ignore one error code, make it a tuple. if isinstance(ignore_errors, int): @@ -92,19 +148,20 @@ class Executable(object): tty.debug(cmd_line) try: - if return_output: - output = subprocess.PIPE - proc = subprocess.Popen( - cmd, stdin=input, stderr=error, stdout=output) + cmd, stdin=istream, stderr=estream, stdout=ostream) out, err = proc.communicate() rc = self.returncode = proc.returncode if fail_on_error and rc != 0 and (rc not in ignore_errors): raise ProcessError("Command exited with status %d:" % proc.returncode, cmd_line) - if return_output: - return out + + if output is str or error is str: + result = '' + if output is str: result += out + if error is str: result += err + return result except OSError, e: raise ProcessError( @@ -119,9 +176,9 @@ class Executable(object): % (proc.returncode, cmd_line)) finally: - if ostream: output.close() - if estream: error.close() - if istream: input.close() + if close_ostream: output.close() + if close_estream: error.close() + if close_istream: input.close() def __eq__(self, other): diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 61b16f3fd8..3e5895cfb8 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -50,7 +50,7 @@ class Gcc(Package): version('4.5.4', '27e459c2566b8209ab064570e1b378f7') variant('gold', default=True, description="Build the gold linker plugin for ld-based LTO") - + depends_on("mpfr") depends_on("gmp") depends_on("mpc") # when @4.5: @@ -102,7 +102,7 @@ class Gcc(Package): configure(*options) make() make("install") - + self.write_rpath_specs() @@ -121,7 +121,7 @@ class Gcc(Package): return gcc = Executable(join_path(self.prefix.bin, 'gcc')) - lines = gcc('-dumpspecs', return_output=True).strip().split("\n") + lines = gcc('-dumpspecs', output=str).strip().split("\n") specs_file = join_path(self.spec_dir, 'specs') with closing(open(specs_file, 'w')) as out: for line in lines: -- cgit v1.2.3-70-g09d2 From 6b3f023d98c7d34ab859e53b2e0953f529325f6e Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 21 Jan 2016 14:05:16 -0500 Subject: Update OpenMPI to 1.10.2 --- var/spack/repos/builtin/packages/openmpi/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 1b7f1c2011..9d57f49427 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -17,6 +17,7 @@ class Openmpi(Package): list_url = "http://www.open-mpi.org/software/ompi/" list_depth = 3 + version('1.10.2', 'b2f43d9635d2d52826e5ef9feb97fd4c') version('1.10.1', 'f0fcd77ed345b7eafb431968124ba16e') version('1.10.0', '280cf952de68369cebaca886c5ce0304') version('1.8.8', '0dab8e602372da1425e9242ae37faf8c') -- cgit v1.2.3-70-g09d2 From 2f70c842b8bc7f897b5a18df10c72ae6a7277fbd Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 21 Jan 2016 14:13:39 -0500 Subject: Disable patch that was merged into upstream in 1.10.2 --- var/spack/repos/builtin/packages/openmpi/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 9d57f49427..e4484af8c5 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -25,7 +25,7 @@ class Openmpi(Package): patch('ad_lustre_rwcontig_open_source.patch', when="@1.6.5") patch('llnl-platforms.patch', when="@1.6.5") - patch('configure.patch', when="@1.10.0:") + patch('configure.patch', when="@1.10.0:1.10.1") variant('psm', default=False, description='Build support for the PSM library.') variant('verbs', default=False, description='Build support for OpenFabrics verbs.') -- cgit v1.2.3-70-g09d2 From 2e58bc31138ee172ea55ad652aaf49b09fe6e135 Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Thu, 21 Jan 2016 19:57:49 -0800 Subject: Sticking with additive approach but now most libraries are installed by default. --- var/spack/repos/builtin/packages/boost/package.py | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index 1992d4d39a..f31bc445b8 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -45,28 +45,36 @@ class Boost(Package): version('1.34.1', '2d938467e8a448a2c9763e0a9f8ca7e5') version('1.34.0', 'ed5b9291ffad776f8757a916e1726ad0') - libs = ['chrono', + default_install_libs = set(['chrono', 'date_time', 'filesystem', - 'iostreams', + 'graph', + 'iostreams', + 'log', + 'math', 'random', 'regex', 'serialization', 'signals', 'system', 'thread', - 'wave', - 'mpi', - 'python'] + 'wave']) - for lib in libs: - variant(lib, default=False, description="Compile with {0} library" - .format(lib)) + # These are not installed by default because they pull in many dependencies + # and/or because there is a great deal of customization possible (and it + # would be difficult or tedious to choose sensible defaults here). + default_noinstall_libs = set(['mpi', 'python']) + + all_libs = default_install_libs | default_noinstall_libs + + for lib in all_libs: + variant(lib, default=(lib in default_install_libs), + description="Compile with {0} library".format(lib)) variant('debug', default=False, description='Switch to the debug version of Boost') variant('shared', default=True, description="Additionally build shared libraries") variant('multithreaded', default=True, description="Build multi-threaded versions of libraries") - variant('singlethreaded', default=False, description="Build single-threaded versions of libraries") + variant('singlethreaded', default=True, description="Build single-threaded versions of libraries") variant('regex_icu', default=False, description="Include regex ICU support (by default false even if regex library is compiled)") depends_on('icu', when='+regex_icu') -- cgit v1.2.3-70-g09d2 From 4a55b97d11739a0ee6ca5ddcbdf35826ca292469 Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Fri, 22 Jan 2016 12:37:12 -0800 Subject: Fixed reference --- var/spack/repos/builtin/packages/boost/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index f31bc445b8..467e9a61c6 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -163,7 +163,7 @@ class Boost(Package): def install(self, spec, prefix): withLibs = list() - for lib in Boost.libs: + for lib in Boost.all_libs: if "+{0}".format(lib) in spec: withLibs.append(lib) if not withLibs: -- cgit v1.2.3-70-g09d2 From 10de5a3ec76fbf1244c43a843ae26a67fc879ddb Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Fri, 22 Jan 2016 13:02:18 -0800 Subject: Patch fix for boost@1.60.0%gcc@4.4.7 --- .../repos/builtin/packages/boost/boost_11856.patch | 34 ++++++++++++++++++++++ var/spack/repos/builtin/packages/boost/package.py | 3 ++ 2 files changed, 37 insertions(+) create mode 100644 var/spack/repos/builtin/packages/boost/boost_11856.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/boost/boost_11856.patch b/var/spack/repos/builtin/packages/boost/boost_11856.patch new file mode 100644 index 0000000000..3b4052ca18 --- /dev/null +++ b/var/spack/repos/builtin/packages/boost/boost_11856.patch @@ -0,0 +1,34 @@ +--- a/libs/container/src/pool_resource.cpp 2015-11-06 12:49:55.000000000 -0800 ++++ b/libs/container/src/pool_resource.cpp 2015-12-22 07:54:36.202131121 -0800 +@@ -32,11 +32,11 @@ + class pool_data_t + : public block_slist_base<> + { +- typedef block_slist_base<> block_slist_base; ++ typedef block_slist_base<> block_slist_base_t; + + public: + explicit pool_data_t(std::size_t initial_blocks_per_chunk) +- : block_slist_base(), next_blocks_per_chunk(initial_blocks_per_chunk) ++ : block_slist_base_t(), next_blocks_per_chunk(initial_blocks_per_chunk) + { slist_algo::init_header(&free_slist); } + + void *allocate_block() BOOST_NOEXCEPT +@@ -59,7 +59,7 @@ + void release(memory_resource &upstream) + { + slist_algo::init_header(&free_slist); +- this->block_slist_base::release(upstream); ++ this->block_slist_base_t::release(upstream); + next_blocks_per_chunk = pool_options_minimum_max_blocks_per_chunk; + } + +@@ -72,7 +72,7 @@ + + //Minimum block size is at least max_align, so all pools allocate sizes that are multiple of max_align, + //meaning that all blocks are max_align-aligned. +- char *p = static_cast(block_slist_base::allocate(blocks_per_chunk*pool_block, mr)); ++ char *p = static_cast(block_slist_base_t::allocate(blocks_per_chunk*pool_block, mr)); + + //Create header types. This is no-throw + for(std::size_t i = 0, max = blocks_per_chunk; i != max; ++i){ diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index 3427b74ad6..e3fb516be9 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -54,6 +54,9 @@ class Boost(Package): depends_on('bzip2', when='+compression') depends_on('zlib', when='+compression') + # Patch fix from https://svn.boost.org/trac/boost/ticket/11856 + patch('boost_11856.patch', when='@1.60.0%gcc@4.4.7') + def url_for_version(self, version): """Handle Boost's weird URLs, which write the version two different ways.""" parts = [str(p) for p in Version(version)] -- cgit v1.2.3-70-g09d2 From 9f99ee61c733e8fee8ae4058fb9198288af40fc6 Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Fri, 22 Jan 2016 13:25:45 -0800 Subject: 1. added default install libs (atomic, test, locale, program_options) 2. clarify comment for default_noinstall_libs 3. renamed regex_icu variant to icu_support (both the locale and regex libs can use it) 4. explicitly set b2 install ICU_PATH when regex_icu is activated --- var/spack/repos/builtin/packages/boost/package.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index 467e9a61c6..1403ea4411 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -45,24 +45,28 @@ class Boost(Package): version('1.34.1', '2d938467e8a448a2c9763e0a9f8ca7e5') version('1.34.0', 'ed5b9291ffad776f8757a916e1726ad0') - default_install_libs = set(['chrono', + default_install_libs = set(['atomic', + 'chrono', 'date_time', 'filesystem', 'graph', 'iostreams', + 'locale', 'log', 'math', + 'program_options', 'random', 'regex', 'serialization', 'signals', 'system', + 'test', 'thread', 'wave']) - # These are not installed by default because they pull in many dependencies - # and/or because there is a great deal of customization possible (and it - # would be difficult or tedious to choose sensible defaults here). + # mpi/python are not installed by default because they pull in many + # dependencies and/or because there is a great deal of customization + # possible (and it would be difficult to choose sensible defaults) default_noinstall_libs = set(['mpi', 'python']) all_libs = default_install_libs | default_noinstall_libs @@ -75,9 +79,9 @@ class Boost(Package): variant('shared', default=True, description="Additionally build shared libraries") variant('multithreaded', default=True, description="Build multi-threaded versions of libraries") variant('singlethreaded', default=True, description="Build single-threaded versions of libraries") - variant('regex_icu', default=False, description="Include regex ICU support (by default false even if regex library is compiled)") + variant('icu_support', default=False, description="Include ICU support (for regex/locale libraries)") - depends_on('icu', when='+regex_icu') + depends_on('icu', when='+icu_support') depends_on('python', when='+python') depends_on('mpi', when='+mpi') depends_on('bzip2', when='+iostreams') @@ -134,6 +138,9 @@ class Boost(Package): else: options.append('variant=release') + if '+icu_support' in spec: + options.extend(['-s', 'ICU_PATH=%s' % spec['icu'].prefix]) + if '+iostreams' in spec: options.extend([ '-s', 'BZIP2_INCLUDE=%s' % spec['bzip2'].prefix.include, -- cgit v1.2.3-70-g09d2 From a653d2f5e2f296ff66eb41ffb9f2f6e9b9bdb3b5 Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Fri, 22 Jan 2016 13:43:16 -0800 Subject: Slightly more robust approach for setting defaults for noinstall_libs --- var/spack/repos/builtin/packages/boost/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index 1403ea4411..a30cd7cc35 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -72,7 +72,7 @@ class Boost(Package): all_libs = default_install_libs | default_noinstall_libs for lib in all_libs: - variant(lib, default=(lib in default_install_libs), + variant(lib, default=(lib not in default_noinstall_libs), description="Compile with {0} library".format(lib)) variant('debug', default=False, description='Switch to the debug version of Boost') -- cgit v1.2.3-70-g09d2 From 1d18f2031c086b4f1e5bb52744c75b232cbf2e7f Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 25 Jan 2016 14:57:33 -0600 Subject: Add szip variant --- var/spack/repos/builtin/packages/hdf5/package.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index ac78d8e961..5321a191f0 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -48,9 +48,11 @@ class Hdf5(Package): variant('unsupported', default=False, description='Enables unsupported configuration options') variant('mpi', default=False, description='Enable MPI support') + variant('szip', default=False, description='Enable szip support') variant('threadsafe', default=False, description='Enable thread-safe capabilities') depends_on("mpi", when='+mpi') + depends_on("szip", when='+szip') depends_on("zlib") def validate(self, spec): @@ -105,6 +107,9 @@ class Hdf5(Package): if '+fortran' in spec: extra_args.append("FC=%s" % spec['mpi'].prefix.bin + "/mpifort") + if '+szip' in spec: + extra_args.append("--with-szlib=%s" % spec['szip'].prefix) + if '+threadsafe' in spec: extra_args.extend([ '--enable-threadsafe', -- cgit v1.2.3-70-g09d2 From c6bb00085f89b6db37a03674ba09714adab1f2f0 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 26 Jan 2016 12:04:48 -0600 Subject: Extensive modifications to NetCDF package --- var/spack/repos/builtin/packages/netcdf/package.py | 52 ++++++++++++++++------ 1 file changed, 39 insertions(+), 13 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 239644d894..93c4410146 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -2,27 +2,53 @@ from spack import * class Netcdf(Package): """NetCDF is a set of software libraries and self-describing, machine-independent - data formats that support the creation, access, and sharing of array-oriented - scientific data.""" + data formats that support the creation, access, and sharing of array-oriented + scientific data.""" 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.0', 'f01cb26a0126dd9a6224e76472d25f6c') version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') + variant('fortran', default=False, description="Download and install NetCDF-Fortran") + variant('hdf4', default=False, description="Enable HDF4 support") + patch('netcdf-4.3.3-mpi.patch') # Dependencies: - depends_on("cmake @2.8.12:") - # >HDF5 - depends_on("hdf5") + depends_on("curl") # required for DAP support + depends_on("hdf", when='+hdf4') + depends_on("hdf5") # required for NetCDF-4 support + depends_on("zlib") # required for NetCDF-4 support def install(self, spec, prefix): - with working_dir('spack-build', create=True): - cmake('..', - "-DCMAKE_INSTALL_PREFIX:PATH=%s" % prefix, - "-DENABLE_DAP:BOOL=OFF", # Disable DAP. - "-DBUILD_SHARED_LIBS:BOOL=OFF") # Don't build shared libraries (use static libs). - - make() - make("install") + config_args = [ + "--enable-fsync", + "--enable-v2", + "--enable-utilities", + "--enable-shared", + "--enable-static", + "--enable-largefile", + # necessary for HDF5 support + "--enable-netcdf-4", + "--enable-dynamic-loading", + # necessary for DAP support + "--enable-dap" + ] + + # HDF4 support + if '+hdf4' in spec: + config_args.append("--enable-hdf4") + + # Fortran support + # In version 4.2+, NetCDF-C and NetCDF-Fortran have split. + # They can be installed separately, but this bootstrap procedure + # should be able to install both at the same time. + # Note: this is a new experimental feature + if '+fortran' in spec: + config_args.append("--enable-remote-fortran-bootstrap") + + configure(*config_args) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 81ccba202c601edacaf483eacc7373d1947e4875 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 26 Jan 2016 15:38:22 -0600 Subject: Make szip a variant --- var/spack/repos/builtin/packages/hdf/package.py | 29 ++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hdf/package.py b/var/spack/repos/builtin/packages/hdf/package.py index 43b5980230..1ecb167183 100644 --- a/var/spack/repos/builtin/packages/hdf/package.py +++ b/var/spack/repos/builtin/packages/hdf/package.py @@ -11,8 +11,10 @@ class Hdf(Package): version('4.2.11', '063f9928f3a19cc21367b71c3b8bbf19') + variant('szip', default=False, description="Enable szip support") + depends_on("jpeg") - depends_on("szip") + depends_on("szip", when='+szip') depends_on("zlib") @@ -21,15 +23,22 @@ class Hdf(Package): def install(self, spec, prefix): - configure('--prefix=%s' % prefix, - '--with-jpeg=%s' % spec['jpeg'].prefix, - '--with-szlib=%s' % spec['szip'].prefix, - '--with-zlib=%s' % spec['zlib'].prefix, - '--disable-netcdf', - '--enable-fortran', - '--disable-shared', - '--enable-static', - '--enable-production') + config_args = [ + '--prefix=%s' % prefix, + '--with-jpeg=%s' % spec['jpeg'].prefix, + '--with-zlib=%s' % spec['zlib'].prefix, + '--disable-netcdf', + '--enable-fortran', + '--disable-shared', + '--enable-static', + '--enable-production' + ] + + # SZip support + if '+szip' in spec: + config_args.append('--with-szlib=%s' % spec['szip'].prefix) + + configure(*config_args) make() make("install") -- cgit v1.2.3-70-g09d2 From 23af31cb1c773cd5a01f93a4896d794ddf908bae Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Tue, 26 Jan 2016 17:55:32 -0800 Subject: adding the cmocka unit testing library --- var/spack/repos/builtin/packages/cmocka/package.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 var/spack/repos/builtin/packages/cmocka/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cmocka/package.py b/var/spack/repos/builtin/packages/cmocka/package.py new file mode 100644 index 0000000000..7377016a6b --- /dev/null +++ b/var/spack/repos/builtin/packages/cmocka/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Cmocka(Package): + """Unit-testing framework in pure C""" + homepage = "https://cmocka.org/" + url = "https://cmocka.org/files/1.0/cmocka-1.0.1.tar.xz" + + version('1.0.1', 'ed861e501a21a92b2af63e466df2015e') + parallel = False + + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + cmake('..', *std_cmake_args) + + make() + make("install") -- cgit v1.2.3-70-g09d2 From f1d8f30342f21d772b2bf4fc76a9a8b262e479c5 Mon Sep 17 00:00:00 2001 From: Nicolas Richart Date: Wed, 27 Jan 2016 10:54:41 +0100 Subject: Bug fix: precedence in % operator seems to change depending in the python version --- var/spack/repos/builtin/packages/netlib-scalapack/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 5be91c4a40..22d538560e 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -22,8 +22,8 @@ class NetlibScalapack(Package): def install(self, spec, prefix): options = [ - "-DBUILD_SHARED_LIBS:BOOL=%s" % 'ON' if '+shared' in spec else 'OFF', - "-DBUILD_STATIC_LIBS:BOOL=%s" % 'OFF' if '+shared' in spec else 'ON', + "-DBUILD_SHARED_LIBS:BOOL=%s" % ('ON' if '+shared' in spec else 'OFF'), + "-DBUILD_STATIC_LIBS:BOOL=%s" % ('OFF' if '+shared' in spec else 'ON'), "-DUSE_OPTIMIZED_LAPACK_BLAS:BOOL=ON", # forces scalapack to use find_package(LAPACK) ] -- cgit v1.2.3-70-g09d2 From 6122642b818a6f1cfa999482949fed7154b2dbf0 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 27 Jan 2016 16:16:33 -0600 Subject: More NetCDF changes --- var/spack/repos/builtin/packages/hdf/package.py | 9 +++--- .../builtin/packages/netcdf/netcdf-4.3.3-mpi.patch | 25 ---------------- var/spack/repos/builtin/packages/netcdf/package.py | 34 +++++++++++++++++++--- 3 files changed, 35 insertions(+), 33 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/netcdf/netcdf-4.3.3-mpi.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hdf/package.py b/var/spack/repos/builtin/packages/hdf/package.py index 1ecb167183..ac6435f2a2 100644 --- a/var/spack/repos/builtin/packages/hdf/package.py +++ b/var/spack/repos/builtin/packages/hdf/package.py @@ -24,12 +24,13 @@ class Hdf(Package): def install(self, spec, prefix): config_args = [ + 'CFLAGS=-fPIC', '--prefix=%s' % prefix, - '--with-jpeg=%s' % spec['jpeg'].prefix, - '--with-zlib=%s' % spec['zlib'].prefix, - '--disable-netcdf', + '--with-jpeg=%s' % spec['jpeg'].prefix, + '--with-zlib=%s' % spec['zlib'].prefix, + '--disable-netcdf', # must be disabled to build NetCDF with HDF4 support '--enable-fortran', - '--disable-shared', + '--disable-shared', # fortran and shared libraries are not compatible '--enable-static', '--enable-production' ] diff --git a/var/spack/repos/builtin/packages/netcdf/netcdf-4.3.3-mpi.patch b/var/spack/repos/builtin/packages/netcdf/netcdf-4.3.3-mpi.patch deleted file mode 100644 index 46dda5fc9d..0000000000 --- a/var/spack/repos/builtin/packages/netcdf/netcdf-4.3.3-mpi.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Nur netcdf-4.3.3/CMakeLists.txt netcdf-4.3.3.mpi/CMakeLists.txt ---- netcdf-4.3.3/CMakeLists.txt 2015-02-12 16:44:35.000000000 -0500 -+++ netcdf-4.3.3.mpi/CMakeLists.txt 2015-10-14 16:44:41.176300658 -0400 -@@ -753,6 +753,7 @@ - SET(USE_PARALLEL OFF CACHE BOOL "") - MESSAGE(STATUS "Cannot find HDF5 library built with parallel support. Disabling parallel build.") - ELSE() -+ FIND_PACKAGE(MPI REQUIRED) - SET(USE_PARALLEL ON CACHE BOOL "") - SET(STATUS_PARALLEL "ON") - ENDIF() -diff -Nur netcdf-4.3.3/liblib/CMakeLists.txt netcdf-4.3.3.mpi/liblib/CMakeLists.txt ---- netcdf-4.3.3/liblib/CMakeLists.txt 2015-02-12 16:44:35.000000000 -0500 -+++ netcdf-4.3.3.mpi/liblib/CMakeLists.txt 2015-10-14 16:44:57.757793634 -0400 -@@ -71,6 +71,10 @@ - SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARY}) - ENDIF() - -+IF(USE_PARALLEL) -+ SET(TLL_LIBS ${TLL_LIBS} ${MPI_C_LIBRARIES}) -+ENDIF() -+ - IF(USE_HDF4) - SET(TLL_LIBS ${TLL_LIBS} ${HDF4_LIBRARIES}) - ENDIF() diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 93c4410146..3cd0b2ee7a 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -12,9 +12,7 @@ class Netcdf(Package): version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') variant('fortran', default=False, description="Download and install NetCDF-Fortran") - variant('hdf4', default=False, description="Enable HDF4 support") - - patch('netcdf-4.3.3-mpi.patch') + variant('hdf4', default=False, description="Enable HDF4 support") # Dependencies: depends_on("curl") # required for DAP support @@ -23,7 +21,13 @@ class Netcdf(Package): depends_on("zlib") # required for NetCDF-4 support def install(self, spec, prefix): + # Environment variables + CPPFLAGS = [] + LDFLAGS = [] + LIBS = [] + config_args = [ + "--prefix=%s" % prefix, "--enable-fsync", "--enable-v2", "--enable-utilities", @@ -37,18 +41,40 @@ class Netcdf(Package): "--enable-dap" ] + CPPFLAGS.append("-I%s/include" % spec['hdf5'].prefix) + LDFLAGS.append( "-L%s/lib" % spec['hdf5'].prefix) + # HDF4 support + # As of NetCDF 4.1.3, "--with-hdf4=..." is no longer a valid option + # You must use the environment variables CPPFLAGS and LDFLAGS if '+hdf4' in spec: config_args.append("--enable-hdf4") + CPPFLAGS.append("-I%s/include" % spec['hdf'].prefix) + LDFLAGS.append( "-L%s/lib" % spec['hdf'].prefix) + LIBS.append( "-l%s" % "jpeg") + + if 'szip' in spec: + CPPFLAGS.append("-I%s/include" % spec['szip'].prefix) + LDFLAGS.append( "-L%s/lib" % spec['szip'].prefix) + LIBS.append( "-l%s" % "sz") # Fortran support # In version 4.2+, NetCDF-C and NetCDF-Fortran have split. # They can be installed separately, but this bootstrap procedure # should be able to install both at the same time. - # Note: this is a new experimental feature + # Note: this is a new experimental feature. if '+fortran' in spec: config_args.append("--enable-remote-fortran-bootstrap") + config_args.append('CPPFLAGS=%s' % ' '.join(CPPFLAGS)) + config_args.append('LDFLAGS=%s' % ' '.join(LDFLAGS)) + config_args.append('LIBS=%s' % ' '.join(LIBS)) + configure(*config_args) make() make("install") + + # After installing NetCDF-C, install NetCDF-Fortran + if '+fortran' in spec: + make("build-netcdf-fortran") + make("install-netcdf-fortran") -- cgit v1.2.3-70-g09d2 From 07bb6fef01bfe48aa22c39e53b75e4c779ac0c2e Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 28 Jan 2016 10:58:56 +0100 Subject: resource directive : now works with all the fetch strategies available --- lib/spack/spack/directives.py | 2 +- lib/spack/spack/fetch_strategy.py | 19 ++++++++++++++++--- lib/spack/spack/package.py | 1 - var/spack/repos/builtin/packages/llvm/package.py | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/directives.py b/lib/spack/spack/directives.py index 0b98211cb9..5745adce63 100644 --- a/lib/spack/spack/directives.py +++ b/lib/spack/spack/directives.py @@ -296,8 +296,8 @@ def resource(pkg, **kwargs): raise RuntimeError(message) when_spec = parse_anonymous_spec(when, pkg.name) resources = pkg.resources.setdefault(when_spec, []) - fetcher = from_kwargs(**kwargs) name = kwargs.get('name') + fetcher = from_kwargs(**kwargs) resources.append(Resource(name, fetcher, destination, placement)) diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index b2ff587a60..83a2dbb59c 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -44,6 +44,7 @@ import os import sys import re import shutil +import copy from functools import wraps import llnl.util.tty as tty from llnl.util.filesystem import * @@ -370,8 +371,12 @@ class GitFetchStrategy(VCSFetchStrategy): required_attributes = ('git',) def __init__(self, **kwargs): + # Discards the keywords in kwargs that may conflict with the next call to __init__ + forwarded_args = copy.copy(kwargs) + forwarded_args.pop('name', None) + super(GitFetchStrategy, self).__init__( - 'git', 'tag', 'branch', 'commit', **kwargs) + 'git', 'tag', 'branch', 'commit', **forwarded_args) self._git = None @property @@ -479,8 +484,12 @@ class SvnFetchStrategy(VCSFetchStrategy): required_attributes = ['svn'] def __init__(self, **kwargs): + # Discards the keywords in kwargs that may conflict with the next call to __init__ + forwarded_args = copy.copy(kwargs) + forwarded_args.pop('name', None) + super(SvnFetchStrategy, self).__init__( - 'svn', 'revision', **kwargs) + 'svn', 'revision', **forwarded_args) self._svn = None if self.revision is not None: self.revision = str(self.revision) @@ -556,8 +565,12 @@ class HgFetchStrategy(VCSFetchStrategy): required_attributes = ['hg'] def __init__(self, **kwargs): + # Discards the keywords in kwargs that may conflict with the next call to __init__ + forwarded_args = copy.copy(kwargs) + forwarded_args.pop('name', None) + super(HgFetchStrategy, self).__init__( - 'hg', 'revision', **kwargs) + 'hg', 'revision', **forwarded_args) self._hg = None @property diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index a1b8d12ec2..8019b29cba 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -435,7 +435,6 @@ class Package(object): def _make_resource_stage(self, root_stage, fetcher, resource): resource_stage_folder = self._resource_stage(resource) - # FIXME : works only for URLFetchStrategy resource_mirror = join_path(self.name, os.path.basename(fetcher.url)) stage = ResourceStage(resource.fetcher, root=root_stage, resource=resource, name=resource_stage_folder, mirror_path=resource_mirror) diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index a2b2c6eccc..1805d3ded8 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -171,6 +171,25 @@ class Llvm(Package): when='@%(version)s' % release, placement=resources[name].get('placement', None)) + # SVN - current develop + version('develop', svn='http://llvm.org/svn/llvm-project/llvm/trunk') + resource(name='clang', svn='http://llvm.org/svn/llvm-project/cfe/trunk', + destination='tools', when='@develop', placement='clang') + resource(name='compiler-rt', svn='http://llvm.org/svn/llvm-project/compiler-rt/trunk', + destination='projects', when='@develop', placement='compiler-rt') + resource(name='openmp', svn='http://llvm.org/svn/llvm-project/openmp/trunk', + destination='projects', when='@develop', placement='openmp') + resource(name='libcxx', svn='http://llvm.org/svn/llvm-project/libcxx/trunk', + destination='projects', when='@develop', placement='libcxx') + resource(name='libcxxabi', svn='http://llvm.org/svn/llvm-project/libcxxabi/trunk', + destination='projects', when='@develop', placement='libcxxabi') + resource(name='polly', svn='http://llvm.org/svn/llvm-project/polly/trunk', + destination='tools', when='@develop', placement='polly') + resource(name='lldb', svn='http://llvm.org/svn/llvm-project/lldb/trunk', + destination='tools', when='@develop', placement='lldb') + + + def install(self, spec, prefix): env['CXXFLAGS'] = self.compiler.cxx11_flag cmake_args = [ arg for arg in std_cmake_args if 'BUILD_TYPE' not in arg ] -- cgit v1.2.3-70-g09d2 From 06f3cc33baeb1c8a8e99b0e0e602f398b4d221bd Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 28 Jan 2016 11:41:12 -0600 Subject: Modify url settings for fish package --- var/spack/repos/builtin/packages/fish/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/fish/package.py b/var/spack/repos/builtin/packages/fish/package.py index 1225558705..b5a4a2d209 100644 --- a/var/spack/repos/builtin/packages/fish/package.py +++ b/var/spack/repos/builtin/packages/fish/package.py @@ -7,7 +7,8 @@ class Fish(Package): homepage = "http://fishshell.com/" url = "http://fishshell.com/files/2.2.0/fish-2.2.0.tar.gz" - list_url = homepage + list_url = "http://fishshell.com/files/" + list_depth = 2 version('2.2.0', 'a76339fd14ce2ec229283c53e805faac48c3e99d9e3ede9d82c0554acfc7b77a') -- cgit v1.2.3-70-g09d2 From 0e52c30bb8fbe954bdb2f74353865317cac18b85 Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Thu, 28 Jan 2016 10:42:46 -0800 Subject: added py-wheel package --- var/spack/repos/builtin/packages/py-wheel/package.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-wheel/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/py-wheel/package.py b/var/spack/repos/builtin/packages/py-wheel/package.py new file mode 100644 index 0000000000..3118e74519 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-wheel/package.py @@ -0,0 +1,15 @@ +from spack import * + +class PyWheel(Package): + """A built-package format for Python.""" + + homepage = "https://pypi.python.org/pypi/wheel" + url = "https://pypi.python.org/packages/source/w/wheel/wheel-0.26.0.tar.gz" + + version('0.26.0', '4cfc6e7e3dc7377d0164914623922a10') + + extends('python') + depends_on('py-setuptools') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 7e65f4da82cb9176247c1aa9ab72f40116cc6a8e Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 28 Jan 2016 13:22:56 -0800 Subject: Add the Caliper package --- .../repos/builtin/packages/caliper/package.py | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 var/spack/repos/builtin/packages/caliper/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/caliper/package.py b/var/spack/repos/builtin/packages/caliper/package.py new file mode 100644 index 0000000000..b14a562aa8 --- /dev/null +++ b/var/spack/repos/builtin/packages/caliper/package.py @@ -0,0 +1,25 @@ +from spack import * + +class Caliper(Package): + """ + Caliper is a generic context annotation system. It gives programmers the + ability to provide arbitrary program context information to (performance) + tools at runtime. + """ + + homepage = "https://github.com/LLNL/Caliper" + url = "" + + version('master', git='ssh://git@cz-stash.llnl.gov:7999/piper/caliper.git') + + variant('mpi', default=False, description='Enable MPI function wrappers.') + + depends_on('libunwind') + depends_on('papi') + depends_on('mpi', when='+mpi') + + def install(self, spec, prefix): + with working_dir('build', create=True): + cmake('..', *std_cmake_args) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 4f340315341a125bd01d0c844efc83454e531ca5 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 28 Jan 2016 15:41:58 -0600 Subject: Add PnetCDF and M4 packages --- var/spack/repos/builtin/packages/m4/package.py | 13 +++++++++++++ .../builtin/packages/parallel-netcdf/package.py | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 var/spack/repos/builtin/packages/m4/package.py create mode 100644 var/spack/repos/builtin/packages/parallel-netcdf/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py new file mode 100644 index 0000000000..5d76d8866b --- /dev/null +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -0,0 +1,13 @@ +from spack import * + +class M4(Package): + """GNU M4 is an implementation of the traditional Unix macro processor.""" + homepage = "https://www.gnu.org/software/m4/m4.html" + url = "ftp://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz" + + version('1.4.17', 'a5e9954b1dae036762f7b13673a2cf76') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/package.py b/var/spack/repos/builtin/packages/parallel-netcdf/package.py new file mode 100644 index 0000000000..62a8f7ca0b --- /dev/null +++ b/var/spack/repos/builtin/packages/parallel-netcdf/package.py @@ -0,0 +1,20 @@ +from spack import * + +class ParallelNetcdf(Package): + """Parallel netCDF (PnetCDF) is a library providing high-performance + parallel I/O while still maintaining file-format compatibility with + Unidata's NetCDF.""" + + homepage = "https://trac.mcs.anl.gov/projects/parallel-netcdf" + url = "http://cucis.ece.northwestern.edu/projects/PnetCDF/Release/parallel-netcdf-1.6.1.tar.gz" + + version('1.6.1', '62a094eb952f9d1e15f07d56e535052604f1ac34') + + depends_on("m4") + depends_on("mpi") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--with-mpi=%s" % spec['mpi'].prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From d9548c01afe555ee58019b2ef5cb8938cd71cee3 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 28 Jan 2016 15:47:37 -0700 Subject: Correct package URL --- var/spack/repos/builtin/packages/caliper/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/caliper/package.py b/var/spack/repos/builtin/packages/caliper/package.py index b14a562aa8..d51b4a4dd5 100644 --- a/var/spack/repos/builtin/packages/caliper/package.py +++ b/var/spack/repos/builtin/packages/caliper/package.py @@ -10,7 +10,7 @@ class Caliper(Package): homepage = "https://github.com/LLNL/Caliper" url = "" - version('master', git='ssh://git@cz-stash.llnl.gov:7999/piper/caliper.git') + version('master', git='ssh://git@github.com:LLNL/Caliper.git') variant('mpi', default=False, description='Enable MPI function wrappers.') -- cgit v1.2.3-70-g09d2 From 2bea7f8d69064f893a21cfc53f3d781b572e2f79 Mon Sep 17 00:00:00 2001 From: Abhishek Kulkarni Date: Fri, 29 Jan 2016 00:29:20 -0500 Subject: Add the HPX-5 package. --- var/spack/repos/builtin/packages/hpx/package.py | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 var/spack/repos/builtin/packages/hpx/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hpx/package.py b/var/spack/repos/builtin/packages/hpx/package.py new file mode 100644 index 0000000000..665d5c7407 --- /dev/null +++ b/var/spack/repos/builtin/packages/hpx/package.py @@ -0,0 +1,27 @@ +from spack import * +import os + +class Hpx(Package): + """The HPX-5 Runtime System. HPX-5 (High Performance ParalleX) is an + open source, portable, performance-oriented runtime developed at + CREST (Indiana University). HPX-5 provides a distributed + programming model allowing programs to run unmodified on systems + from a single SMP to large clusters and supercomputers with + thousands of nodes. HPX-5 supports a wide variety of Intel and ARM + platforms. It is being used by a broad range of scientific + applications enabling scientists to write code that performs and + scales better than contemporary runtimes.""" + homepage = "http://hpx.crest.iu.edu" + url = "http://hpx.crest.iu.edu/release/hpx-2.0.0.tar.gz" + + version('2.0.0', '3d2ff3aab6c46481f9ec65c5b2bfe7a6') + version('1.3.0', '2260ecc7f850e71a4d365a43017d8cee') + version('1.2.0', '4972005f85566af4afe8b71afbf1480f') + version('1.1.0', '646afb460ecb7e0eea713a634933ce4f') + version('1.0.0', '8020822adf6090bd59ed7fe465f6c6cb') + + def install(self, spec, prefix): + os.chdir("./hpx/") + configure('--prefix=%s' % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From b574c4ad5190bad375b9b8b38857222d5e79682a Mon Sep 17 00:00:00 2001 From: alalazo Date: Fri, 29 Jan 2016 08:57:07 +0100 Subject: trilinos : updated package to meet changes in dependencies --- var/spack/repos/builtin/packages/netcdf/package.py | 7 ++++- .../repos/builtin/packages/trilinos/package.py | 36 +++++++++++++--------- 2 files changed, 27 insertions(+), 16 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 3cd0b2ee7a..579282e7f7 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -11,13 +11,15 @@ class Netcdf(Package): version('4.4.0', 'f01cb26a0126dd9a6224e76472d25f6c') version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') + variant('mpi', default=True, description='Enables MPI parallelism') variant('fortran', default=False, description="Download and install NetCDF-Fortran") variant('hdf4', default=False, description="Enable HDF4 support") # Dependencies: depends_on("curl") # required for DAP support depends_on("hdf", when='+hdf4') - depends_on("hdf5") # required for NetCDF-4 support + depends_on("hdf5+mpi~cxx", when='+mpi') # required for NetCDF-4 support + depends_on("hdf5~mpi", when='~mpi') # required for NetCDF-4 support depends_on("zlib") # required for NetCDF-4 support def install(self, spec, prefix): @@ -41,6 +43,9 @@ class Netcdf(Package): "--enable-dap" ] + if '+mpi' in spec: + config_args.append('--enable-parallel') + CPPFLAGS.append("-I%s/include" % spec['hdf5'].prefix) LDFLAGS.append( "-L%s/lib" % spec['hdf5'].prefix) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 7c43f796a4..e6b97022d9 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -10,6 +10,7 @@ class Trilinos(Package): homepage = "https://trilinos.org/" url = "http://trilinos.csbsju.edu/download/files/trilinos-12.2.1-Source.tar.gz" + version('12.4.2', '7c830f7f0f68b8ad324690603baf404e') version('12.2.1', '6161926ea247863c690e927687f83be9') version('12.0.1', 'bd99741d047471e127b8296b2ec08017') version('11.14.3', '2f4f83f8333e4233c57d0f01c4b57426') @@ -17,33 +18,38 @@ class Trilinos(Package): version('11.14.1', '40febc57f76668be8b6a77b7607bb67f') variant('mpi', default=True, description='Add a dependency on MPI and enables MPI dependent packages') + variant('shared', default=True, description='Enables the build of shared libraries') + variant('debug', default=False, description='Builds a debug version of the libraries') # Everything should be compiled with -fpic depends_on('blas') depends_on('lapack') depends_on('boost') - depends_on('netcdf') depends_on('matio') depends_on('glm') depends_on('swig') + + # MPI related dependencies depends_on('mpi', when='+mpi') + depends_on('netcdf+mpi', when='+mpi') + depends_on('netcdf~mpi', when='~mpi') - def install(self, spec, prefix): + depends_on('python') # Needs py-numpy activated - options = [ - '-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON', - '-DTrilinos_ENABLE_TESTS:BOOL=OFF', - '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', - '-DBUILD_SHARED_LIBS:BOOL=ON', - '-DBLAS_LIBRARY_DIRS:PATH=%s' % spec['blas'].prefix, - '-DLAPACK_LIBRARY_DIRS:PATH=%s' % spec['lapack'].prefix - ] - if '+mpi' in spec: - mpi_options = ['-DTPL_ENABLE_MPI:BOOL=ON'] - options.extend(mpi_options) - - # -DCMAKE_INSTALL_PREFIX and all the likes... + def install(self, spec, prefix): + options = [] options.extend(std_cmake_args) + + options.extend(['-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON', + '-DTrilinos_ENABLE_TESTS:BOOL=OFF', + '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', + '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), + '-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'), + '-DTPL_ENABLE_MPI:BOOL=%s' % ('ON' if '+mpi' in spec else 'OFF'), + '-DBLAS_LIBRARY_DIRS:PATH=%s' % spec['blas'].prefix, + '-DLAPACK_LIBRARY_DIRS:PATH=%s' % spec['lapack'].prefix + ]) + with working_dir('spack-build', create=True): cmake('..', *options) make() -- cgit v1.2.3-70-g09d2 From cd547939138c00a45a2252f073ce21d3742d5dd0 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 29 Jan 2016 11:42:06 +0100 Subject: Cleaning up --- var/spack/repos/builtin/packages/openssl/package.py | 7 ++++--- var/spack/repos/builtin/packages/trilinos/package.py | 8 +++----- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index bbb169ec6b..3b790eca66 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -9,9 +9,10 @@ class Openssl(Package): homepage = "http://www.openssl.org" url = "http://www.openssl.org/source/openssl-1.0.1h.tar.gz" - version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') - version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') - version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') + version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') # Not available + version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') # Not available + version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') # Not available + version('1.0.2f', 'b3bf73f507172be9292ea2a8c28b659d') depends_on("zlib") parallel = False diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index e6b97022d9..edc40476e3 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -17,7 +17,6 @@ class Trilinos(Package): version('11.14.2', 'a43590cf896c677890d75bfe75bc6254') version('11.14.1', '40febc57f76668be8b6a77b7607bb67f') - variant('mpi', default=True, description='Add a dependency on MPI and enables MPI dependent packages') variant('shared', default=True, description='Enables the build of shared libraries') variant('debug', default=False, description='Builds a debug version of the libraries') @@ -30,9 +29,8 @@ class Trilinos(Package): depends_on('swig') # MPI related dependencies - depends_on('mpi', when='+mpi') - depends_on('netcdf+mpi', when='+mpi') - depends_on('netcdf~mpi', when='~mpi') + depends_on('mpi') + depends_on('netcdf+mpi') depends_on('python') # Needs py-numpy activated @@ -45,7 +43,7 @@ class Trilinos(Package): '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), '-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'), - '-DTPL_ENABLE_MPI:BOOL=%s' % ('ON' if '+mpi' in spec else 'OFF'), + '-DTPL_ENABLE_MPI:STRING=ON', '-DBLAS_LIBRARY_DIRS:PATH=%s' % spec['blas'].prefix, '-DLAPACK_LIBRARY_DIRS:PATH=%s' % spec['lapack'].prefix ]) -- cgit v1.2.3-70-g09d2 From 74225544c6ae27e3ae07d37fe15935364c665f6e Mon Sep 17 00:00:00 2001 From: Abhishek Kulkarni Date: Fri, 29 Jan 2016 10:22:52 -0500 Subject: Rename the hpx package to hpx-5. --- var/spack/repos/builtin/packages/hpx/package.py | 27 ------------ var/spack/repos/builtin/packages/hpx5/package.py | 52 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 27 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/hpx/package.py create mode 100644 var/spack/repos/builtin/packages/hpx5/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hpx/package.py b/var/spack/repos/builtin/packages/hpx/package.py deleted file mode 100644 index 665d5c7407..0000000000 --- a/var/spack/repos/builtin/packages/hpx/package.py +++ /dev/null @@ -1,27 +0,0 @@ -from spack import * -import os - -class Hpx(Package): - """The HPX-5 Runtime System. HPX-5 (High Performance ParalleX) is an - open source, portable, performance-oriented runtime developed at - CREST (Indiana University). HPX-5 provides a distributed - programming model allowing programs to run unmodified on systems - from a single SMP to large clusters and supercomputers with - thousands of nodes. HPX-5 supports a wide variety of Intel and ARM - platforms. It is being used by a broad range of scientific - applications enabling scientists to write code that performs and - scales better than contemporary runtimes.""" - homepage = "http://hpx.crest.iu.edu" - url = "http://hpx.crest.iu.edu/release/hpx-2.0.0.tar.gz" - - version('2.0.0', '3d2ff3aab6c46481f9ec65c5b2bfe7a6') - version('1.3.0', '2260ecc7f850e71a4d365a43017d8cee') - version('1.2.0', '4972005f85566af4afe8b71afbf1480f') - version('1.1.0', '646afb460ecb7e0eea713a634933ce4f') - version('1.0.0', '8020822adf6090bd59ed7fe465f6c6cb') - - def install(self, spec, prefix): - os.chdir("./hpx/") - configure('--prefix=%s' % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/hpx5/package.py b/var/spack/repos/builtin/packages/hpx5/package.py new file mode 100644 index 0000000000..3dae3c4170 --- /dev/null +++ b/var/spack/repos/builtin/packages/hpx5/package.py @@ -0,0 +1,52 @@ +from spack import * +import os + +class Hpx5(Package): + """The HPX-5 Runtime System. HPX-5 (High Performance ParalleX) is an + open source, portable, performance-oriented runtime developed at + CREST (Indiana University). HPX-5 provides a distributed + programming model allowing programs to run unmodified on systems + from a single SMP to large clusters and supercomputers with + thousands of nodes. HPX-5 supports a wide variety of Intel and ARM + platforms. It is being used by a broad range of scientific + applications enabling scientists to write code that performs and + scales better than contemporary runtimes.""" + homepage = "http://hpx.crest.iu.edu" + url = "http://hpx.crest.iu.edu/release/hpx-2.0.0.tar.gz" + + version('2.0.0', '3d2ff3aab6c46481f9ec65c5b2bfe7a6') + version('1.3.0', '2260ecc7f850e71a4d365a43017d8cee') + version('1.2.0', '4972005f85566af4afe8b71afbf1480f') + version('1.1.0', '646afb460ecb7e0eea713a634933ce4f') + version('1.0.0', '8020822adf6090bd59ed7fe465f6c6cb') + + variant('debug', default=False, description='Build a debug version of HPX-5') + variant('photon', default=False, description='Enable Photon support') + variant('mpi', default=False, description='Enable MPI support') + + depends_on("mpi", when='+mpi') + depends_on("mpi", when='+photon') + + def install(self, spec, prefix): + extra_args = [] + if '+debug' in spec: + extra_args.extend([ + '--enable-debug', + 'CFLAGS=-g -O0' + ]) + else: + extra_args.append('CFLAGS=-O3') + + if '+mpi' in spec: + extra_args.append('--enable-mpi') + + if '+photon' in spec: + extra_args.extend([ + '--enable-mpi', + '--enable-photon' + ]) + + os.chdir("./hpx/") + configure('--prefix=%s' % prefix, *extra_args) + make() + make("install") -- cgit v1.2.3-70-g09d2 From d14d50beb6dbb71c75a53902e70601c353496e09 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 29 Jan 2016 09:47:57 -0600 Subject: Checksum fix for hwloc --- var/spack/repos/builtin/packages/hwloc/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hwloc/package.py b/var/spack/repos/builtin/packages/hwloc/package.py index 60b315119b..ab7205646e 100644 --- a/var/spack/repos/builtin/packages/hwloc/package.py +++ b/var/spack/repos/builtin/packages/hwloc/package.py @@ -17,8 +17,8 @@ class Hwloc(Package): list_url = "http://www.open-mpi.org/software/hwloc/" list_depth = 3 - version('1.11.2', '486169cbe111cdea57be12638828ebbf') - version('1.11.1', '002742efd3a8431f98d6315365a2b543') + version('1.11.2', 'e4ca55c2a5c5656da4a4e37c8fc51b23') + version('1.11.1', 'feb4e416a1b25963ed565d8b42252fdc') version('1.9', '1f9f9155682fe8946a97c08896109508') depends_on('libpciaccess') -- cgit v1.2.3-70-g09d2 From 3bf6fed7b3536d3b38a9855c2129956b24a77529 Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Fri, 29 Jan 2016 11:29:27 -0800 Subject: updated openssl version --- var/spack/repos/builtin/packages/openssl/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index bbb169ec6b..05de35fca0 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -12,6 +12,7 @@ class Openssl(Package): version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') + version('1.0.2f', 'b3bf73f507172be9292ea2a8c28b659d') depends_on("zlib") parallel = False -- cgit v1.2.3-70-g09d2 From 360abb070a639711f740aa7ef73a84ab76aff14f Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 1 Feb 2016 08:33:03 +0100 Subject: netcdf : fixed typo in configure option openssl : smarter URL computation --- var/spack/repos/builtin/packages/netcdf/package.py | 3 ++- .../repos/builtin/packages/openssl/package.py | 28 +++++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 579282e7f7..89b40f4a90 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -1,5 +1,6 @@ from spack import * + class Netcdf(Package): """NetCDF is a set of software libraries and self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented @@ -44,7 +45,7 @@ class Netcdf(Package): ] if '+mpi' in spec: - config_args.append('--enable-parallel') + config_args.append('--enable-parallel4') CPPFLAGS.append("-I%s/include" % spec['hdf5'].prefix) LDFLAGS.append( "-L%s/lib" % spec['hdf5'].prefix) diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 3b790eca66..345fce0669 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -1,3 +1,5 @@ +import urllib + from spack import * class Openssl(Package): @@ -9,9 +11,10 @@ class Openssl(Package): homepage = "http://www.openssl.org" url = "http://www.openssl.org/source/openssl-1.0.1h.tar.gz" - version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') # Not available - version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') # Not available - version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') # Not available + version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') + version('1.0.1r', '1abd905e079542ccae948af37e393d28') + version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') + version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') version('1.0.2f', 'b3bf73f507172be9292ea2a8c28b659d') depends_on("zlib") @@ -39,3 +42,22 @@ class Openssl(Package): make() make("install") + + 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 attribute + openssl_url = getattr(self, '_openssl_url', None) + + if openssl_url is None: + latest = 'http://www.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 + version_number = '.'.join([str(x) for x in version[:-1]]) + older_url = older.format(version_number=version_number, version_full=version) + latest_url = latest.format(version=version) + response = urllib.urlopen(latest.format(version=version)) + openssl_url = older_url if response.getcode() == 404 else latest_url + self._openssl_url = openssl_url + + return openssl_url -- cgit v1.2.3-70-g09d2 From e67507478a9f662d7adfa891bcb2c7b830b69f5c Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 1 Feb 2016 10:55:39 +0100 Subject: opencv : reverted url_for_version modifications --- var/spack/repos/builtin/packages/openssl/package.py | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 345fce0669..36a33204fd 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -42,22 +42,3 @@ class Openssl(Package): make() make("install") - - 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 attribute - openssl_url = getattr(self, '_openssl_url', None) - - if openssl_url is None: - latest = 'http://www.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 - version_number = '.'.join([str(x) for x in version[:-1]]) - older_url = older.format(version_number=version_number, version_full=version) - latest_url = latest.format(version=version) - response = urllib.urlopen(latest.format(version=version)) - openssl_url = older_url if response.getcode() == 404 else latest_url - self._openssl_url = openssl_url - - return openssl_url -- cgit v1.2.3-70-g09d2 From c8d2275c06f05b8ddf2463c5aa110d1f44692038 Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 1 Feb 2016 10:56:48 +0100 Subject: opencv : reverted url_for_version modifications --- var/spack/repos/builtin/packages/openssl/package.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 36a33204fd..a225e30f6c 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -1,5 +1,3 @@ -import urllib - from spack import * class Openssl(Package): -- cgit v1.2.3-70-g09d2 From 2b140b9a34852cbada6a3c1045b3b021d5eabeb8 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 1 Feb 2016 11:46:33 -0500 Subject: hdf5: default +unsupported to on This flag can end up being required if a dependency tree ends up needing hdf5+cxx+parallel, but nothing turns it on. Since the core spack code puts this together, it ends up that the end user needs to specify it manually. Instead, just assume an unsupported configuration (since these *are* useful setups) and if anyone wants to seek upstream support, masking the flag can be done. --- var/spack/repos/builtin/packages/hdf5/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 5321a191f0..80f79539c0 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -45,7 +45,7 @@ class Hdf5(Package): variant('cxx', default=True, description='Enable C++ support') variant('fortran', default=True, description='Enable Fortran support') - variant('unsupported', default=False, description='Enables unsupported configuration options') + variant('unsupported', default=True, description='Enables unsupported configuration options') variant('mpi', default=False, description='Enable MPI support') variant('szip', default=False, description='Enable szip support') -- cgit v1.2.3-70-g09d2 From 422e87badbd073a9ca19e8c2e781a945d3a8e511 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 2 Feb 2016 10:57:58 -0600 Subject: Add latest libgpg-error version --- var/spack/repos/builtin/packages/libgpg-error/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/libgpg-error/package.py b/var/spack/repos/builtin/packages/libgpg-error/package.py index 6c1d1a10a7..dd5fc2408a 100644 --- a/var/spack/repos/builtin/packages/libgpg-error/package.py +++ b/var/spack/repos/builtin/packages/libgpg-error/package.py @@ -9,6 +9,7 @@ class LibgpgError(Package): homepage = "https://www.gnupg.org/related_software/libgpg-error" url = "ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.18.tar.bz2" + version('1.21', 'ab0b5aba6d0a185b41d07bda804fd8b2') version('1.18', '12312802d2065774b787cbfc22cc04e9') def install(self, spec, prefix): -- cgit v1.2.3-70-g09d2 From ab3698e3a45e96b8cdd8d99220011350fa0489d1 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 2 Feb 2016 11:42:31 -0600 Subject: Add latest qhull version --- var/spack/repos/builtin/packages/qhull/package.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/qhull/package.py b/var/spack/repos/builtin/packages/qhull/package.py index f6712ced38..bdca6db15d 100644 --- a/var/spack/repos/builtin/packages/qhull/package.py +++ b/var/spack/repos/builtin/packages/qhull/package.py @@ -8,20 +8,18 @@ class Qhull(Package): implements the Quickhull algorithm for computing the convex hull. It handles roundoff errors from floating point arithmetic. It computes volumes, surface areas, and - approximations to the convex hull. - - Qhull does not support triangulation of non-convex surfaces, - mesh generation of non-convex objects, medium-sized inputs in - 9-D and higher, alpha shapes, weighted Voronoi diagrams, - Voronoi volumes, or constrained Delaunay triangulations.""" + approximations to the convex hull.""" homepage = "http://www.qhull.org" + version('7.2.0', 'e6270733a826a6a7c32b796e005ec3dc', + url="http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz") + version('1.0', 'd0f978c0d8dfb2e919caefa56ea2953c', url="http://www.qhull.org/download/qhull-2012.1-src.tgz") # https://github.com/qhull/qhull/pull/5 - patch('qhull-iterator.patch') + patch('qhull-iterator.patch', when='@1.0') def install(self, spec, prefix): with working_dir('spack-build', create=True): -- cgit v1.2.3-70-g09d2 From d2fb1522a3524315a036cd5d46a99b2e05f1ad62 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 2 Feb 2016 12:54:24 -0600 Subject: Add Phonopy and PyYAML Python modules --- var/spack/repos/builtin/packages/py-phonopy/package.py | 18 ++++++++++++++++++ var/spack/repos/builtin/packages/py-pyyaml/package.py | 13 +++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-phonopy/package.py create mode 100644 var/spack/repos/builtin/packages/py-pyyaml/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/py-phonopy/package.py b/var/spack/repos/builtin/packages/py-phonopy/package.py new file mode 100644 index 0000000000..6d10fea74f --- /dev/null +++ b/var/spack/repos/builtin/packages/py-phonopy/package.py @@ -0,0 +1,18 @@ +from spack import * + +class PyPhonopy(Package): + """Phonopy is an open source package for phonon + calculations at harmonic and quasi-harmonic levels.""" + homepage = "http://atztogo.github.io/phonopy/index.html" + url = "http://sourceforge.net/projects/phonopy/files/phonopy/phonopy-1.10/phonopy-1.10.0.tar.gz" + + version('1.10.0', '973ed1bcea46e21b9bf747aab9061ff6') + + extends('python') + depends_on('py-numpy') + depends_on('py-scipy') + depends_on('py-matplotlib') + depends_on('py-pyyaml') + + def install(self, spec, prefix): + python('setup.py', 'install', '--home=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pyyaml/package.py b/var/spack/repos/builtin/packages/py-pyyaml/package.py new file mode 100644 index 0000000000..cae42f6e59 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pyyaml/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyPyyaml(Package): + """PyYAML is a YAML parser and emitter for Python.""" + homepage = "http://pyyaml.org/wiki/PyYAML" + url = "http://pyyaml.org/download/pyyaml/PyYAML-3.11.tar.gz" + + version('3.11', 'f50e08ef0fe55178479d3a618efe21db') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 587d356d6ec8820cf04043b3650ac66b82a651b2 Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 3 Feb 2016 08:58:34 +0100 Subject: openssl : added logic to version computation. The package now warns user if he depends on an old version of the library --- .../repos/builtin/packages/openssl/package.py | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 05de35fca0..c73102f05d 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -1,3 +1,6 @@ +import urllib +import llnl.util.tty as tty + from spack import * class Openssl(Package): @@ -10,6 +13,7 @@ class Openssl(Package): url = "http://www.openssl.org/source/openssl-1.0.1h.tar.gz" version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') + version('1.0.1r', '1abd905e079542ccae948af37e393d28') version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') version('1.0.2f', 'b3bf73f507172be9292ea2a8c28b659d') @@ -17,6 +21,42 @@ class Openssl(Package): depends_on("zlib") 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 + 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: + latest = 'http://www.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 + version_number = '.'.join([str(x) for x in version[:-1]]) + older_url = older.format(version_number=version_number, version_full=version) + latest_url = latest.format(version=version) + response = urllib.urlopen(latest.format(version=version)) + if response.getcode() == 404: + openssl_url = older_url + # 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)) + warnings_given_to_user[version] = True + else: + openssl_url = latest_url + # Store the computed URL + openssl_urls[version] = openssl_url + # Store the updated dictionary of URLS + Openssl._openssl_url = openssl_urls + # Store the updated dictionary of warnings + Openssl._warnings_given = warnings_given_to_user + + return openssl_url + def install(self, spec, prefix): # OpenSSL uses a variable APPS in its Makefile. If it happens to be set # in the environment, then this will override what is set in the -- cgit v1.2.3-70-g09d2 From 44c1b06609925307e0e522b10daecf1dbe2eddc4 Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 1 Feb 2016 10:53:27 +0100 Subject: opencv : added package --- var/spack/repos/builtin/packages/opencv/package.py | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 var/spack/repos/builtin/packages/opencv/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/opencv/package.py b/var/spack/repos/builtin/packages/opencv/package.py new file mode 100644 index 0000000000..99b555323f --- /dev/null +++ b/var/spack/repos/builtin/packages/opencv/package.py @@ -0,0 +1,50 @@ +from spack import * + + +class Opencv(Package): + """ + OpenCV is released under a BSD license and hence it's free for both academic and commercial use. It has C++, C, + Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android. OpenCV was designed for + computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the library + can take advantage of multi-core processing. Enabled with OpenCL, it can take advantage of the hardware + acceleration of the underlying heterogeneous compute platform. Adopted all around the world, OpenCV has more than + 47 thousand people of user community and estimated number of downloads exceeding 9 million. Usage ranges from + interactive art, to mines inspection, stitching maps on the web or through advanced robotics. + """ + homepage = 'http://opencv.org/' + url = 'https://github.com/Itseez/opencv/archive/3.1.0.tar.gz' + + version('3.1.0', '70e1dd07f0aa06606f1bc0e3fa15abd3') + + variant('shared', default=True, description='Enables the build of shared libraries') + variant('debug', default=False, description='Builds a debug version of the libraries') + + variant('eigen', default=True, description='Activates support for eigen') + variant('ipp', default=True, description='Activates support for IPP') + + depends_on('zlib') + depends_on('libpng') + depends_on('libjpeg-turbo') + depends_on('libtiff') + + depends_on('python') + depends_on('py-numpy') + + depends_on('eigen', when='+eigen') + + # FIXME : GUI extensions missing + # FIXME : CUDA extensions still missing + + def install(self, spec, prefix): + cmake_options = [] + cmake_options.extend(std_cmake_args) + + cmake_options.extend(['-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), + '-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'), + '-DENABLE_PRECOMPILED_HEADERS:BOOL=OFF', + '-DWITH_IPP:BOOL=%s' % ('ON' if '+ipp' in spec else 'OFF')]) + + with working_dir('spack_build', create=True): + cmake('..', *cmake_options) + make('VERBOSE=1') + make("install") -- cgit v1.2.3-70-g09d2 From e1b3c286ef3817c63b9566d6b64ea330fc739903 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 3 Feb 2016 16:28:09 -0600 Subject: Add url for cmake, simplify url_for_version --- var/spack/repos/builtin/packages/cmake/package.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index 408a90460b..e20c1e4aeb 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -23,13 +23,14 @@ # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -import llnl.util.tty as tty class Cmake(Package): """A cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software.""" homepage = 'https://www.cmake.org' + url = 'https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz' + version('3.4.3', '4cb3ff35b2472aae70f542116d616e63') version('3.4.0', 'cd3034e0a44256a0917e254167217fc8') version('3.3.1', '52638576f4e1e621fed6c3410d3a1b12') version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f') @@ -40,12 +41,7 @@ class Cmake(Package): def url_for_version(self, version): """Handle CMake's version-based custom URLs.""" - parts = [str(p) for p in Version(version)] - if len(parts) < 3: - tty.error("Version '%s'does not match CMake's version naming scheme (z.y.x)." % version) - version_short = ".".join(parts[:2]) - version_full = ".".join(parts) - return "http://www.cmake.org/files/v%s/cmake-%s.tar.gz" % (version_short,version_full) + return 'https://cmake.org/files/v%s/cmake-%s.tar.gz' % (version.up_to(2), version) def install(self, spec, prefix): -- cgit v1.2.3-70-g09d2 From 031c292136d18889e5cd6e8facb68bf2c50ec083 Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 4 Feb 2016 11:19:25 +0100 Subject: dakota : basic installation --- var/spack/repos/builtin/packages/dakota/package.py | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 var/spack/repos/builtin/packages/dakota/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dakota/package.py b/var/spack/repos/builtin/packages/dakota/package.py new file mode 100644 index 0000000000..5ec82ef83d --- /dev/null +++ b/var/spack/repos/builtin/packages/dakota/package.py @@ -0,0 +1,55 @@ +from spack import * + + +class Dakota(Package): + """ + The Dakota toolkit provides a flexible, extensible interface between analysis codes and iterative systems + analysis methods. Dakota contains algorithms for: + + - optimization with gradient and non gradient-based methods; + - uncertainty quantification with sampling, reliability, stochastic expansion, and epistemic methods; + - parameter estimation with nonlinear least squares methods; + - sensitivity/variance analysis with design of experiments and parameter study methods. + + These capabilities may be used on their own or as components within advanced strategies such as hybrid optimization, + surrogate-based optimization, mixed integer nonlinear programming, or optimization under uncertainty. + """ + + homepage = 'https://dakota.sandia.gov/' + url = 'https://dakota.sandia.gov/sites/default/files/distributions/public/dakota-6.3-public.src.tar.gz' + _url_str = 'https://dakota.sandia.gov/sites/default/files/distributions/public/dakota-{version}-public.src.tar.gz' + + version('6.3', '05a58d209fae604af234c894c3f73f6d') + + variant('debug', default=False, description='Builds a debug version of the libraries') + variant('shared', default=True, description='Enables the build of shared libraries') + variant('mpi', default=True, description='Activates MPI support') + + depends_on('blas') + depends_on('lapack') + depends_on('mpi', when='+mpi') + + depends_on('python') + depends_on('boost') + + def url_for_version(self, version): + return Dakota._url_str.format(version=version) + + def install(self, spec, prefix): + options = [] + options.extend(std_cmake_args) + + options.extend(['-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), + '-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF')]) + + if '+mpi' in spec: + options.extend(['-DDAKOTA_HAVE_MPI:BOOL=ON', + '-DMPI_CXX_COMPILER:STRING=%s' % join_path(spec['mpi'].prefix.bin, 'mpicxx')]) + + build_directory = join_path(self.stage.path, 'spack-build') + source_directory = self.stage.source_path + + with working_dir(build_directory, create=True): + cmake(source_directory, *options) + make() + make("install") -- cgit v1.2.3-70-g09d2 From e3a0e1881dce3b251608d4252c7aafaa2da34104 Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 4 Feb 2016 16:00:39 +0100 Subject: suitesparse : basic implementation --- .../repos/builtin/packages/SuiteSparse/package.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 var/spack/repos/builtin/packages/SuiteSparse/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/SuiteSparse/package.py b/var/spack/repos/builtin/packages/SuiteSparse/package.py new file mode 100644 index 0000000000..6e130d118f --- /dev/null +++ b/var/spack/repos/builtin/packages/SuiteSparse/package.py @@ -0,0 +1,27 @@ +from spack import * + + +class Suitesparse(Package): + """ + SuiteSparse is a suite of sparse matrix algorithms + """ + homepage = 'http://faculty.cse.tamu.edu/davis/suitesparse.html' + url = 'http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.1.tar.gz' + + version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319') + + depends_on('blas') + depends_on('lapack') + + depends_on('metis@5.1.0', when='@4.5.1') + + def install(self, spec, prefix): + # The build system of SuiteSparse is quite old-fashioned + # It's basically a plain Makefile which include an header (SuiteSparse_config/SuiteSparse_config.mk) + # with a lot of convoluted logic in it. + # Any kind of customization will need to go through filtering of that file + + # FIXME : this actually uses the current workaround + # FIXME : (blas / lapack always provide libblas and liblapack as aliases) + make('install', 'INSTALL=%s' % prefix, 'BLAS=-lblas', 'LAPACK=-llapack') + -- cgit v1.2.3-70-g09d2 From e2a95d4b5025a9965ab231e0c43fe9bebd88ca92 Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 4 Feb 2016 16:27:26 +0100 Subject: eigen : added support for SuiteSparse --- var/spack/repos/builtin/packages/eigen/package.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py index 44ee6819f5..e40046b452 100644 --- a/var/spack/repos/builtin/packages/eigen/package.py +++ b/var/spack/repos/builtin/packages/eigen/package.py @@ -41,13 +41,14 @@ class Eigen(Package): variant('metis', default=True, description='Enables metis backend') variant('scotch', default=True, description='Enables scotch backend') variant('fftw', default=True, description='Enables FFTW backend') + variant('suitesparse', default=True, description='Enables SuiteSparse support') - # TODO : dependency on SuiteSparse, googlehash, superlu, adolc missing + # TODO : dependency on googlehash, superlu, adolc missing depends_on('metis', when='+metis') depends_on('scotch', when='+scotch') depends_on('fftw', when='+fftw') - + depends_on('SuiteSparse', when='+suitesparse') depends_on('mpfr@2.3.0:') # Eigen 3.2.7 requires at least 2.3.0 depends_on('gmp') -- cgit v1.2.3-70-g09d2 From 71a25a109a8c9f23ce9aab0743ebf4516020519d Mon Sep 17 00:00:00 2001 From: alalazo Date: Fri, 5 Feb 2016 11:00:37 +0100 Subject: arpack-ng : added package --- .../repos/builtin/packages/arpack-ng/package.py | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 var/spack/repos/builtin/packages/arpack-ng/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py new file mode 100644 index 0000000000..0b49d14202 --- /dev/null +++ b/var/spack/repos/builtin/packages/arpack-ng/package.py @@ -0,0 +1,57 @@ +from spack import * + + +class ArpackNg(Package): + """ + ARPACK-NG is a collection of Fortran77 subroutines designed to solve large scale eigenvalue problems. + + Important Features: + + * Reverse Communication Interface. + * Single and Double Precision Real Arithmetic Versions for Symmetric, + Non-symmetric, Standard or Generalized Problems. + * Single and Double Precision Complex Arithmetic Versions for Standard or + Generalized Problems. + * Routines for Banded Matrices - Standard or Generalized Problems. + * Routines for The Singular Value Decomposition. + * Example driver routines that may be used as templates to implement numerous + Shift-Invert strategies for all problem types, data types and precision. + + This project is a joint project between Debian, Octave and Scilab in order to + provide a common and maintained version of arpack. + + Indeed, no single release has been published by Rice university for the last + few years and since many software (Octave, Scilab, R, Matlab...) forked it and + implemented their own modifications, arpack-ng aims to tackle this by providing + a common repository and maintained versions. + + arpack-ng is replacing arpack almost everywhere. + """ + homepage = 'https://github.com/opencollab/arpack-ng' + url = 'https://github.com/opencollab/arpack-ng/archive/3.3.0.tar.gz' + + version('3.3.0', 'ed3648a23f0a868a43ef44c97a21bad5') + + variant('shared', default=True, description='Enables the build of shared libraries') + variant('mpi', default=False, description='Activates MPI support') + + depends_on('blas') + depends_on('lapack') + depends_on('mpi', when='+mpi') + + def install(self, spec, prefix): + # Apparently autotools are not bootstrapped + bootstrap = Executable('./bootstrap') + + options = ['--prefix=%s' % prefix] + + if '+mpi' in spec: + options.append('--enable-mpi') + + if '~shared' in spec: + options.append('--enable-shared=no') + + bootstrap() + configure(*options) + make() + make('install') -- cgit v1.2.3-70-g09d2 From f729cf621ad463c953a81f4963b87535508583da Mon Sep 17 00:00:00 2001 From: Luigi Calori Date: Wed, 10 Feb 2016 13:29:36 +0100 Subject: fixing qhull: seems that dependency on cmake is essential when it is used --- var/spack/repos/builtin/packages/qhull/package.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/qhull/package.py b/var/spack/repos/builtin/packages/qhull/package.py index bdca6db15d..8f7c2f31b1 100644 --- a/var/spack/repos/builtin/packages/qhull/package.py +++ b/var/spack/repos/builtin/packages/qhull/package.py @@ -20,6 +20,8 @@ class Qhull(Package): # https://github.com/qhull/qhull/pull/5 patch('qhull-iterator.patch', when='@1.0') + + depends_on('cmake') def install(self, spec, prefix): with working_dir('spack-build', create=True): -- cgit v1.2.3-70-g09d2 From fe8aca630c65e1f0324bfebeca11ca1cb3d4183c Mon Sep 17 00:00:00 2001 From: Luigi Calori Date: Wed, 10 Feb 2016 14:58:00 +0100 Subject: add a variant to Qt for make dependency on mesa swlwctable --- var/spack/repos/builtin/packages/qt/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index e8d843519d..91afa420c1 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -23,6 +23,7 @@ class Qt(Package): version('3.3.8b', '9f05b4125cfe477cc52c9742c3c09009', url="http://download.qt.io/archive/qt/3/qt-x11-free-3.3.8b.tar.gz") + variant('mesa', default=False, description='depend on mesa') # Add patch for compile issues with qt3 found with use in the OpenSpeedShop project variant('krellpatch', default=False, description="build with openspeedshop based patch.") patch('qt3krell.patch', when='@3.3.8b+krellpatch') @@ -48,7 +49,7 @@ class Qt(Package): # depends_on("icu4c") # OpenGL hardware acceleration - depends_on("mesa", when='@4:') + depends_on("mesa", when='@4:+mesa') depends_on("libxcb") -- cgit v1.2.3-70-g09d2 From a1bd65550e343c25ffcaf22aadf7a1875b08d853 Mon Sep 17 00:00:00 2001 From: Luigi Calori Date: Wed, 10 Feb 2016 15:17:54 +0100 Subject: fix a reported hash mismatch on netcdf-4.4.0 tar download --- var/spack/repos/builtin/packages/netcdf/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 89b40f4a90..41a0d2b6f9 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -9,7 +9,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.0', 'f01cb26a0126dd9a6224e76472d25f6c') + version('4.4.0', 'cffda0cbd97fdb3a06e9274f7aef438e') version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') variant('mpi', default=True, description='Enables MPI parallelism') -- cgit v1.2.3-70-g09d2 From d7b3ed08ab15caa3aac95700d84bfb52d8e1ac2f Mon Sep 17 00:00:00 2001 From: Luigi Calori Date: Wed, 10 Feb 2016 15:40:05 +0100 Subject: add variant to select OpenGL2 Paraview backend --- var/spack/repos/builtin/packages/paraview/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index aaab352e66..e43bdd4493 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -14,6 +14,7 @@ class Paraview(Package): variant('osmesa', default=False, description='Enable OSMesa support') variant('qt', default=False, description='Enable Qt support') + variant('opengl2', default=False, description='Enable OPengl2 backend') depends_on('python', when='+python') depends_on('py-numpy', when='+python') -- cgit v1.2.3-70-g09d2 From 157ec210a74c2897abc093c14824975c49944f16 Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 11 Feb 2016 13:05:31 +0100 Subject: espresso : synchronized with current develop --- var/spack/packages/espresso/package.py | 61 ---------------------- .../repos/builtin/packages/espresso/package.py | 61 ++++++++++++++++++++++ 2 files changed, 61 insertions(+), 61 deletions(-) delete mode 100644 var/spack/packages/espresso/package.py create mode 100644 var/spack/repos/builtin/packages/espresso/package.py (limited to 'var') diff --git a/var/spack/packages/espresso/package.py b/var/spack/packages/espresso/package.py deleted file mode 100644 index ce5dcc2acc..0000000000 --- a/var/spack/packages/espresso/package.py +++ /dev/null @@ -1,61 +0,0 @@ -# FIXME: -# This is a template package file for Spack. We've conveniently -# put "FIXME" labels next to all the things you'll want to change. -# -# Once you've edited all the FIXME's, delete this whole message, -# save this file, and test out your package like this: -# -# spack install espresso -# -# You can always get back here to change things with: -# -# spack edit espresso -# -# See the spack documentation for more information on building -# packages. -# -from spack import * - -class Espresso(Package): - """FIXME: put a proper description of your package here.""" - # FIXME: add a proper url for your package's homepage here. - homepage = "http://quantum-espresso.org" - url = "http://www.qe-forge.org/gf/download/frsrelease/204/912/espresso-5.3.0.tar.gz" - - version('5.3.0', '6848fcfaeb118587d6be36bd10b7f2c3') - variant('mpi', default=True, description='Build Quantum-ESPRESSO with mpi support') - variant('openmp', default=False, description='Build Quantum-ESPRESSO with mpi openmp') - variant('scalapack', default=False, description='Build Quantum-ESPRESSO with mpi openmp') - - - # FIXME: Add dependencies if this package requires them. - # depends_on("foo") - depends_on('mpi', when='+mpi') - - -# def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. -# configure('--prefix=%s' % prefix) - - # FIXME: Add logic to build and install here -# make() -# make("install") - - def install(self, spec, prefix): - # TAU isn't happy with directories that have '@' in the path. Sigh. - - # TAU configure, despite the name , seems to be a manually written script (nothing related to autotools). - # As such it has a few #peculiarities# that make this build quite hackish. - options = ["-prefix=%s" % prefix, - "--enable-parallel"] - - if '+openmp' in spec: - options.append('--enable-openmp') - - if '+scalapack' in spec: - options.append('--with-scalapack=yes') - - configure(*options) - make("all") - make("install") - diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py new file mode 100644 index 0000000000..ce5dcc2acc --- /dev/null +++ b/var/spack/repos/builtin/packages/espresso/package.py @@ -0,0 +1,61 @@ +# FIXME: +# This is a template package file for Spack. We've conveniently +# put "FIXME" labels next to all the things you'll want to change. +# +# Once you've edited all the FIXME's, delete this whole message, +# save this file, and test out your package like this: +# +# spack install espresso +# +# You can always get back here to change things with: +# +# spack edit espresso +# +# See the spack documentation for more information on building +# packages. +# +from spack import * + +class Espresso(Package): + """FIXME: put a proper description of your package here.""" + # FIXME: add a proper url for your package's homepage here. + homepage = "http://quantum-espresso.org" + url = "http://www.qe-forge.org/gf/download/frsrelease/204/912/espresso-5.3.0.tar.gz" + + version('5.3.0', '6848fcfaeb118587d6be36bd10b7f2c3') + variant('mpi', default=True, description='Build Quantum-ESPRESSO with mpi support') + variant('openmp', default=False, description='Build Quantum-ESPRESSO with mpi openmp') + variant('scalapack', default=False, description='Build Quantum-ESPRESSO with mpi openmp') + + + # FIXME: Add dependencies if this package requires them. + # depends_on("foo") + depends_on('mpi', when='+mpi') + + +# def install(self, spec, prefix): + # FIXME: Modify the configure line to suit your build system here. +# configure('--prefix=%s' % prefix) + + # FIXME: Add logic to build and install here +# make() +# make("install") + + def install(self, spec, prefix): + # TAU isn't happy with directories that have '@' in the path. Sigh. + + # TAU configure, despite the name , seems to be a manually written script (nothing related to autotools). + # As such it has a few #peculiarities# that make this build quite hackish. + options = ["-prefix=%s" % prefix, + "--enable-parallel"] + + if '+openmp' in spec: + options.append('--enable-openmp') + + if '+scalapack' in spec: + options.append('--with-scalapack=yes') + + configure(*options) + make("all") + make("install") + -- cgit v1.2.3-70-g09d2 From ca3cdb445825126776c5269481540d3afac02c9f Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 11 Feb 2016 17:45:09 +0100 Subject: espresso : current working tree --- .../repos/builtin/packages/espresso/package.py | 73 ++++++++++------------ 1 file changed, 33 insertions(+), 40 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py index ce5dcc2acc..56b8c056b8 100644 --- a/var/spack/repos/builtin/packages/espresso/package.py +++ b/var/spack/repos/builtin/packages/espresso/package.py @@ -1,53 +1,44 @@ -# FIXME: -# This is a template package file for Spack. We've conveniently -# put "FIXME" labels next to all the things you'll want to change. -# -# Once you've edited all the FIXME's, delete this whole message, -# save this file, and test out your package like this: -# -# spack install espresso -# -# You can always get back here to change things with: -# -# spack edit espresso -# -# See the spack documentation for more information on building -# packages. -# +import llnl.util.tty as tty + from spack import * + class Espresso(Package): - """FIXME: put a proper description of your package here.""" - # FIXME: add a proper url for your package's homepage here. - homepage = "http://quantum-espresso.org" - url = "http://www.qe-forge.org/gf/download/frsrelease/204/912/espresso-5.3.0.tar.gz" + """ + QE is an integrated suite of Open-Source computer codes for electronic-structure calculations and materials + modeling at the nanoscale. It is based on density-functional theory, plane waves, and pseudopotentials. + """ + homepage = 'http://quantum-espresso.org' + url = 'http://www.qe-forge.org/gf/download/frsrelease/204/912/espresso-5.3.0.tar.gz' version('5.3.0', '6848fcfaeb118587d6be36bd10b7f2c3') + variant('mpi', default=True, description='Build Quantum-ESPRESSO with mpi support') - variant('openmp', default=False, description='Build Quantum-ESPRESSO with mpi openmp') - variant('scalapack', default=False, description='Build Quantum-ESPRESSO with mpi openmp') + variant('openmp', default=False, description='Enables openMP support') + variant('scalapack', default=False, description='Enables scalapack support') + variant('elpa', default=True, description='Use elpa as an eigenvalue solver') + depends_on('blas') + depends_on('lapack') - # FIXME: Add dependencies if this package requires them. - # depends_on("foo") depends_on('mpi', when='+mpi') + depends_on('elpa', when='+elpa') + depends_on('scalapack', when='+scalapack') - -# def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. -# configure('--prefix=%s' % prefix) - - # FIXME: Add logic to build and install here -# make() -# make("install") + def check_variants(self, spec): + error = 'you cannot ask for \'+{variant}\' when \'+mpi\' is not active' + if '+scalapack' in spec and '~mpi' in spec: + raise RuntimeError(error.format(variant='scalapack')) + if '+elpa' in spec and '~mpi' in spec: + raise RuntimeError(error.format(variant='elpa')) def install(self, spec, prefix): - # TAU isn't happy with directories that have '@' in the path. Sigh. + self.check_variants(spec) + + options = ['-prefix=%s' % prefix] - # TAU configure, despite the name , seems to be a manually written script (nothing related to autotools). - # As such it has a few #peculiarities# that make this build quite hackish. - options = ["-prefix=%s" % prefix, - "--enable-parallel"] + if '+mpi' in spec: + options.append('--enable-parallel') if '+openmp' in spec: options.append('--enable-openmp') @@ -55,7 +46,9 @@ class Espresso(Package): if '+scalapack' in spec: options.append('--with-scalapack=yes') - configure(*options) - make("all") - make("install") + if '+elpa' in spec: + options.append('--with-elpa=%s' % spec['elpa'].prefix) + configure(*options) + make('all') + make('install') -- cgit v1.2.3-70-g09d2 From b272a8881becf205c09ac11228dd035b99fa0fcd Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 11 Feb 2016 18:18:05 +0100 Subject: espresso : fixed dependency handling --- var/spack/repos/builtin/packages/espresso/package.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py index 56b8c056b8..df37bb0d71 100644 --- a/var/spack/repos/builtin/packages/espresso/package.py +++ b/var/spack/repos/builtin/packages/espresso/package.py @@ -1,5 +1,3 @@ -import llnl.util.tty as tty - from spack import * @@ -15,21 +13,21 @@ class Espresso(Package): variant('mpi', default=True, description='Build Quantum-ESPRESSO with mpi support') variant('openmp', default=False, description='Enables openMP support') - variant('scalapack', default=False, description='Enables scalapack support') + variant('scalapack', default=True, description='Enables scalapack support') variant('elpa', default=True, description='Use elpa as an eigenvalue solver') depends_on('blas') depends_on('lapack') depends_on('mpi', when='+mpi') - depends_on('elpa', when='+elpa') - depends_on('scalapack', when='+scalapack') + depends_on('elpa', when='+elpa+scalapack+mpi') # TODO : + mpi needed to avoid false dependencies installation + depends_on('scalapack', when='+scalapack+mpi') # TODO : + mpi needed to avoid false dependencies installation def check_variants(self, spec): error = 'you cannot ask for \'+{variant}\' when \'+mpi\' is not active' if '+scalapack' in spec and '~mpi' in spec: raise RuntimeError(error.format(variant='scalapack')) - if '+elpa' in spec and '~mpi' in spec: + if '+elpa' in spec and ('~mpi' in spec or '~scalapack' in spec): raise RuntimeError(error.format(variant='elpa')) def install(self, spec, prefix): -- cgit v1.2.3-70-g09d2 From e8704433debe35d7893c0c20672d06973226c4e8 Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 11 Feb 2016 18:57:40 +0100 Subject: espresso : added directories to search path --- var/spack/repos/builtin/packages/espresso/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py index df37bb0d71..f85257b3cc 100644 --- a/var/spack/repos/builtin/packages/espresso/package.py +++ b/var/spack/repos/builtin/packages/espresso/package.py @@ -47,6 +47,14 @@ class Espresso(Package): if '+elpa' in spec: options.append('--with-elpa=%s' % spec['elpa'].prefix) + # Add a list of directories to search + search_list = [] + for name, dependency_spec in spec.dependencies.iteritems(): + print name + search_list.extend([dependency_spec.prefix.lib, + dependency_spec.prefix.lib64]) + search_list = " ".join(search_list) + options.append('LIBDIRS=%s' % search_list) configure(*options) make('all') make('install') -- cgit v1.2.3-70-g09d2 From d7f674ce9678ddb3b964ad457b29ed058e2cb3c7 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 14 Jan 2016 17:41:44 -0500 Subject: libedit depends on ncurses --- var/spack/repos/builtin/packages/libedit/package.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/libedit/package.py b/var/spack/repos/builtin/packages/libedit/package.py index bcd5212b9e..faed8bad37 100644 --- a/var/spack/repos/builtin/packages/libedit/package.py +++ b/var/spack/repos/builtin/packages/libedit/package.py @@ -7,6 +7,8 @@ class Libedit(Package): version('3.1', '43cdb5df3061d78b5e9d59109871b4f6', url="http://thrysoee.dk/editline/libedit-20150325-3.1.tar.gz") + depends_on('ncurses') + def install(self, spec, prefix): configure('--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 70985170e5f248d0d6a1b6245bd5581185ecaa64 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 12 Feb 2016 12:08:31 +0100 Subject: qe : compiled on rhle6 --- var/spack/repos/builtin/packages/espresso/package.py | 15 ++++++++++----- var/spack/repos/builtin/packages/mpich/package.py | 8 ++++---- var/spack/repos/builtin/packages/openblas/package.py | 2 ++ 3 files changed, 16 insertions(+), 9 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py index f85257b3cc..a2bf58f585 100644 --- a/var/spack/repos/builtin/packages/espresso/package.py +++ b/var/spack/repos/builtin/packages/espresso/package.py @@ -1,5 +1,6 @@ from spack import * +import os class Espresso(Package): """ @@ -20,9 +21,10 @@ class Espresso(Package): depends_on('lapack') depends_on('mpi', when='+mpi') - depends_on('elpa', when='+elpa+scalapack+mpi') # TODO : + mpi needed to avoid false dependencies installation + depends_on('fftw~mpi', when='~mpi') + depends_on('fftw+mpi', when='+mpi') depends_on('scalapack', when='+scalapack+mpi') # TODO : + mpi needed to avoid false dependencies installation - + def check_variants(self, spec): error = 'you cannot ask for \'+{variant}\' when \'+mpi\' is not active' if '+scalapack' in spec and '~mpi' in spec: @@ -45,16 +47,19 @@ class Espresso(Package): options.append('--with-scalapack=yes') if '+elpa' in spec: - options.append('--with-elpa=%s' % spec['elpa'].prefix) + options.append('--with-elpa=yes') # Add a list of directories to search search_list = [] for name, dependency_spec in spec.dependencies.iteritems(): - print name search_list.extend([dependency_spec.prefix.lib, dependency_spec.prefix.lib64]) + search_list = " ".join(search_list) options.append('LIBDIRS=%s' % search_list) + options.append('F90=%s' % os.environ['FC']) + configure(*options) make('all') - make('install') + make('install') + diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index c856cfe277..26d3bc0c94 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -48,10 +48,10 @@ class Mpich(Package): def setup_dependent_environment(self, module, spec, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" - os.environ['MPICH_CC'] = 'cc' - os.environ['MPICH_CXX'] = 'c++' - os.environ['MPICH_F77'] = 'f77' - os.environ['MPICH_F90'] = 'f90' + os.environ['MPICH_CC'] = os.environ['CC'] + os.environ['MPICH_CXX'] = os.environ['CXX'] + os.environ['MPICH_F77'] = os.environ['F77'] + os.environ['MPICH_FC'] = os.environ['FC'] def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 9c8fa1c694..3c909360a4 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -19,7 +19,9 @@ class Openblas(Package): with working_dir(prefix.lib): symlink('libopenblas.a', 'blas.a') symlink('libopenblas.a', 'libblas.a') + symlink('libopenblas.so', 'libblas.so') # Lapack virtual package should provide liblapack.a with working_dir(prefix.lib): symlink('libopenblas.a', 'liblapack.a') + symlink('libopenblas.so', 'liblapack.so') -- cgit v1.2.3-70-g09d2 From 247a4bc75108aa2106c1b191345a0c3387a8afac Mon Sep 17 00:00:00 2001 From: alalazo Date: Fri, 12 Feb 2016 12:15:09 +0100 Subject: mpich : added back MPI_F90 --- var/spack/repos/builtin/packages/mpich/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 26d3bc0c94..c517defa83 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -51,6 +51,7 @@ class Mpich(Package): os.environ['MPICH_CC'] = os.environ['CC'] os.environ['MPICH_CXX'] = os.environ['CXX'] os.environ['MPICH_F77'] = os.environ['F77'] + os.environ['MPICH_F90'] = os.environ['FC'] os.environ['MPICH_FC'] = os.environ['FC'] -- cgit v1.2.3-70-g09d2 From d8c0edcc818b8f0fb2220993d469381ae072ebe4 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 14 Feb 2016 14:40:25 -0800 Subject: Minor code cleanup for gcc. --- var/spack/repos/builtin/packages/gcc/package.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 3e5895cfb8..f8958ee290 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -36,8 +36,6 @@ class Gcc(Package): list_url = 'http://open-source-box.org/gcc/' list_depth = 2 - DEPENDS_ON_ISL_PREDICATE = '@5.0:' - version('5.3.0', 'c9616fd448f980259c31de613e575719') version('5.2.0', 'a51bcfeb3da7dd4c623e27207ed43467') version('4.9.3', '6f831b4d251872736e8e9cc09746f327') @@ -53,12 +51,11 @@ class Gcc(Package): depends_on("mpfr") depends_on("gmp") - depends_on("mpc") # when @4.5: + depends_on("mpc", when='@4.5:') + depends_on("isl", when='@5.0:') depends_on("binutils~libiberty", when='~gold') depends_on("binutils~libiberty+gold", when='+gold') - # Save these until we can do optional deps. - depends_on("isl", when=DEPENDS_ON_ISL_PREDICATE) #depends_on("ppl") #depends_on("cloog") @@ -91,7 +88,7 @@ class Gcc(Package): "--with-as=%s/bin/as" % spec['binutils'].prefix] options.extend(binutils_options) # Isl - if spec.satisfies(Gcc.DEPENDS_ON_ISL_PREDICATE): + if 'isl' in spec: isl_options = ["--with-isl=%s" % spec['isl'].prefix] options.extend(isl_options) -- cgit v1.2.3-70-g09d2 From bf162e60f17f8aebcd62184d72a194eb91e4ef4f Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 15 Feb 2016 10:53:50 -0600 Subject: Add latest version --- var/spack/repos/builtin/packages/py-mpi4py/package.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/py-mpi4py/package.py b/var/spack/repos/builtin/packages/py-mpi4py/package.py index 8001689a18..f599205644 100644 --- a/var/spack/repos/builtin/packages/py-mpi4py/package.py +++ b/var/spack/repos/builtin/packages/py-mpi4py/package.py @@ -5,7 +5,9 @@ class PyMpi4py(Package): homepage = "https://pypi.python.org/pypi/mpi4py" url = "https://pypi.python.org/packages/source/m/mpi4py/mpi4py-1.3.1.tar.gz" + version('2.0.0', '4f7d8126d7367c239fd67615680990e3') version('1.3.1', 'dbe9d22bdc8ed965c23a7ceb6f32fc3c') + extends('python') depends_on('py-setuptools') depends_on('mpi') -- cgit v1.2.3-70-g09d2 From db50f52bbc47ef6dbe2e26c54ce828c0e6076e96 Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Tue, 16 Feb 2016 11:40:00 -0800 Subject: Adding the "Crypto++" package installation files. --- .../repos/builtin/packages/cryptopp/package.py | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 var/spack/repos/builtin/packages/cryptopp/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cryptopp/package.py b/var/spack/repos/builtin/packages/cryptopp/package.py new file mode 100644 index 0000000000..1693c4b160 --- /dev/null +++ b/var/spack/repos/builtin/packages/cryptopp/package.py @@ -0,0 +1,31 @@ +import glob +from spack import * + +class Cryptopp(Package): + """Crypto++ is an open-source C++ library of cryptographic schemes. The + library supports a number of different cryptography algorithms, including + authenticated encryption schemes (GCM, CCM), hash functions (SHA-1, SHA2), + public-key encryption (RSA, DSA), and a few obsolete/historical encryption + algorithms (MD5, Panama).""" + + homepage = "http://www.cryptopp.com/" + url = "http://www.cryptopp.com/cryptopp563.zip" + + version('5.6.3', '3c5b70e2ec98b7a24988734446242d07') + version('5.6.2', '7ed022585698df48e65ce9218f6c6a67') + + def install(self, spec, prefix): + make() + + mkdirp(prefix.include) + for hfile in glob.glob('*.h*'): + install(hfile, prefix.include) + + mkdirp(prefix.lib) + install('libcryptopp.a', prefix.lib) + + def url_for_version(self, version): + version_tuple = tuple(v for v in iter(version)) + version_string = reduce(lambda vs, nv: vs + str(nv), version_tuple, "") + + return "%scryptopp%s.zip" % (Cryptopp.homepage, version_string) -- cgit v1.2.3-70-g09d2 From 9a6221ea40e8cda3bdfa495b7c4a93284e8f4895 Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Tue, 16 Feb 2016 12:47:14 -0800 Subject: Added the installation files for the "ndiff" package. --- var/spack/repos/builtin/packages/ndiff/package.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 var/spack/repos/builtin/packages/ndiff/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/ndiff/package.py b/var/spack/repos/builtin/packages/ndiff/package.py new file mode 100644 index 0000000000..10e445c81e --- /dev/null +++ b/var/spack/repos/builtin/packages/ndiff/package.py @@ -0,0 +1,21 @@ +from spack import * + +class Ndiff(Package): + """The ndiff tool is a binary utility that compares putatively similar files + while ignoring small numeric differernces. This utility is most often used + to compare files containing a lot of floating-point numeric data that + may be slightly different due to numeric error.""" + + homepage = "http://ftp.math.utah.edu/pub/ndiff/" + url = "http://ftp.math.utah.edu/pub/ndiff/ndiff-2.00.tar.gz" + + version('2.00', '885548b4dc26e72c5455bebb5ba6c16d') + version('1.00', 'f41ffe5d12f36cd36b6311acf46eccdc') + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix) + + mkdirp(prefix.bin) + mkdirp('%s/lib' % prefix.share) + + make('install-exe', 'install-shrlib') -- cgit v1.2.3-70-g09d2 From 3c8bbeafc78c00cd93fa4526a0e55bf16d36b454 Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Tue, 16 Feb 2016 13:01:18 -0800 Subject: Added the installation files for the "Triangle" package. --- var/spack/repos/builtin/packages/Triangle/package.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 var/spack/repos/builtin/packages/Triangle/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/Triangle/package.py b/var/spack/repos/builtin/packages/Triangle/package.py new file mode 100644 index 0000000000..f65d93776d --- /dev/null +++ b/var/spack/repos/builtin/packages/Triangle/package.py @@ -0,0 +1,20 @@ +from spack import * + +class Triangle(Package): + """Triangle is a two-dimensional mesh generator and Delaunay + triangulator. Triangle generates exact Delaunay triangulations, + constrained Delaunay triangulations, conforming Delaunay + triangulations, Voronoi diagrams, and high-quality triangular + meshes.""" + + homepage = "http://www.cs.cmu.edu/~quake/triangle.html" + url = "http://www.netlib.org/voronoi/triangle.zip" + + version('1.6', '10aff8d7950f5e0e2fb6dd2e340be2c9') + + def install(self, spec, prefix): + make() + mkdirp(prefix.bin) + + install('triangle', prefix.bin) + install('showme', prefix.bin) -- cgit v1.2.3-70-g09d2 From 09254014b182ccf4cbc4ce291141b7ab39b9171d Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Tue, 16 Feb 2016 13:24:01 -0800 Subject: Added the installation files for the "TetGen" package. --- var/spack/repos/builtin/packages/tetgen/package.py | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 var/spack/repos/builtin/packages/tetgen/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/tetgen/package.py b/var/spack/repos/builtin/packages/tetgen/package.py new file mode 100644 index 0000000000..30c2b76655 --- /dev/null +++ b/var/spack/repos/builtin/packages/tetgen/package.py @@ -0,0 +1,28 @@ +from spack import * + +class Tetgen(Package): + """TetGen is a program and library that can be used to generate tetrahedral + meshes for given 3D polyhedral domains. TetGen generates exact constrained + Delaunay tetrahedralizations, boundary conforming Delaunay meshes, and + Voronoi paritions.""" + + homepage = "http://www.tetgen.org" + url = "http://www.tetgen.org/files/tetgen1.4.3.tar.gz" + + version('1.4.3', 'd6a4bcdde2ac804f7ec66c29dcb63c18') + + # TODO: Make this a build dependency once build dependencies are supported + # (see: https://github.com/LLNL/spack/pull/378). + depends_on('cmake@2.8.7:', when='@1.5.0:') + + def install(self, spec, prefix): + make('tetgen', 'tetlib') + + mkdirp(prefix.bin) + install('tetgen', prefix.bin) + + mkdirp(prefix.include) + install('tetgen.h', prefix.include) + + mkdirp(prefix.lib) + install('libtet.a', prefix.lib) -- cgit v1.2.3-70-g09d2 From 8cab10214e63344b77ffc34df3609dbc9f1690a5 Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Tue, 16 Feb 2016 16:43:24 -0800 Subject: Added the installation files for the "ExodusII" package. Added the "+static" variant to "hdf5" to enable "ExodusII" support. --- .../builtin/packages/exodusii/exodus-cmake.patch | 12 ++++++ .../repos/builtin/packages/exodusii/package.py | 49 ++++++++++++++++++++++ var/spack/repos/builtin/packages/hdf5/package.py | 4 ++ 3 files changed, 65 insertions(+) create mode 100644 var/spack/repos/builtin/packages/exodusii/exodus-cmake.patch create mode 100644 var/spack/repos/builtin/packages/exodusii/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/exodusii/exodus-cmake.patch b/var/spack/repos/builtin/packages/exodusii/exodus-cmake.patch new file mode 100644 index 0000000000..25355269ca --- /dev/null +++ b/var/spack/repos/builtin/packages/exodusii/exodus-cmake.patch @@ -0,0 +1,12 @@ +diff --git a/cmake-exodus b/cmake-exodus +index 787fd9d..ed073a2 100755 +--- a/cmake-exodus ++++ b/cmake-exodus +@@ -1,4 +1,6 @@ +-EXTRA_ARGS=$@ ++#!/bin/bash ++ ++EXTRA_ARGS=-DSEACASProj_ENABLE_CXX11=OFF + + ### Change this to point to the compilers you want to use + CC=gcc diff --git a/var/spack/repos/builtin/packages/exodusii/package.py b/var/spack/repos/builtin/packages/exodusii/package.py new file mode 100644 index 0000000000..89c04bf79c --- /dev/null +++ b/var/spack/repos/builtin/packages/exodusii/package.py @@ -0,0 +1,49 @@ +from spack import * + +# TODO: Add support for a C++11 enabled installation that filters out the +# TODO: "C++11-Disabled" flag (but only if the spec compiler supports C++11). + +# TODO: Add support for parallel installation that uses MPI. + +# TODO: Create installation options for NetCDF that support larger page size +# TODO: suggested by Exodus (see the repository "README" file). + +class Exodusii(Package): + """Exodus II is a C++/Fortran library developed to store and retrieve data for + finite element analyses. It's used for preprocessing (problem definition), + postprocessing (results visualization), and data transfer between codes. + An Exodus II data file is a random access, machine independent, binary + file that is written and read via C, C++, or Fortran API routines.""" + + homepage = "https://github.com/gsjaardema/seacas" + url = "https://github.com/gsjaardema/seacas/archive/master.zip" + + version('2016-02-08', git='https://github.com/gsjaardema/seacas.git', commit='dcf3529') + + # TODO: Make this a build dependency once build dependencies are supported + # (see: https://github.com/LLNL/spack/pull/378). + depends_on('cmake@2.8.7:') + depends_on('hdf5+static~mpi') + depends_on('netcdf~mpi') + + patch('exodus-cmake.patch') + + def patch(self): + ff = FileFilter('cmake-exodus') + + ff.filter('CMAKE_INSTALL_PREFIX:PATH=${ACCESS}', + 'CMAKE_INSTALL_PREFIX:PATH=%s' % self.spec.prefix, string=True) + ff.filter('NetCDF_DIR:PATH=${TPL}', + 'NetCDF_DIR:PATH=%s' % self.spec['netcdf'].prefix, string=True) + ff.filter('HDF5_ROOT:PATH=${TPL}', + 'HDF5_ROOT:PATH=%s' % self.spec['hdf5'].prefix, string=True) + + def install(self, spec, prefix): + mkdirp('build') + cd('build') + + cmake_exodus = Executable('../cmake-exodus') + cmake_exodus() + + make() + make('install') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 80f79539c0..7db4aff631 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -42,6 +42,7 @@ class Hdf5(Package): version('1.8.13', 'c03426e9e77d7766944654280b467289') variant('debug', default=False, description='Builds a debug version of the library') + variant('static', default=False, description='Builds a static executable version of the library') variant('cxx', default=True, description='Enable C++ support') variant('fortran', default=True, description='Enable Fortran support') @@ -78,6 +79,9 @@ class Hdf5(Package): else: extra_args.append('--enable-production') + if '+static' in spec: + extra_args.append('--enable-static-exec') + if '+unsupported' in spec: extra_args.append("--enable-unsupported") -- cgit v1.2.3-70-g09d2 From fca7ef2f7b3d8091e935073ec24570ebb163fe6d Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Tue, 16 Feb 2016 17:23:37 -0800 Subject: Moved "Triangle" to "triangle" to be more in line with Spack package naming conventions. --- var/spack/repos/builtin/packages/Triangle/package.py | 20 -------------------- var/spack/repos/builtin/packages/triangle/package.py | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/Triangle/package.py create mode 100644 var/spack/repos/builtin/packages/triangle/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/Triangle/package.py b/var/spack/repos/builtin/packages/Triangle/package.py deleted file mode 100644 index f65d93776d..0000000000 --- a/var/spack/repos/builtin/packages/Triangle/package.py +++ /dev/null @@ -1,20 +0,0 @@ -from spack import * - -class Triangle(Package): - """Triangle is a two-dimensional mesh generator and Delaunay - triangulator. Triangle generates exact Delaunay triangulations, - constrained Delaunay triangulations, conforming Delaunay - triangulations, Voronoi diagrams, and high-quality triangular - meshes.""" - - homepage = "http://www.cs.cmu.edu/~quake/triangle.html" - url = "http://www.netlib.org/voronoi/triangle.zip" - - version('1.6', '10aff8d7950f5e0e2fb6dd2e340be2c9') - - def install(self, spec, prefix): - make() - mkdirp(prefix.bin) - - install('triangle', prefix.bin) - install('showme', prefix.bin) diff --git a/var/spack/repos/builtin/packages/triangle/package.py b/var/spack/repos/builtin/packages/triangle/package.py new file mode 100644 index 0000000000..f65d93776d --- /dev/null +++ b/var/spack/repos/builtin/packages/triangle/package.py @@ -0,0 +1,20 @@ +from spack import * + +class Triangle(Package): + """Triangle is a two-dimensional mesh generator and Delaunay + triangulator. Triangle generates exact Delaunay triangulations, + constrained Delaunay triangulations, conforming Delaunay + triangulations, Voronoi diagrams, and high-quality triangular + meshes.""" + + homepage = "http://www.cs.cmu.edu/~quake/triangle.html" + url = "http://www.netlib.org/voronoi/triangle.zip" + + version('1.6', '10aff8d7950f5e0e2fb6dd2e340be2c9') + + def install(self, spec, prefix): + make() + mkdirp(prefix.bin) + + install('triangle', prefix.bin) + install('showme', prefix.bin) -- cgit v1.2.3-70-g09d2 From 0388093f7aed92bd1d3282fe4f53c27e66030fd4 Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Tue, 16 Feb 2016 17:33:19 -0800 Subject: Changed the hdf5 "+static" variant to become the "+shared" variant. --- var/spack/repos/builtin/packages/exodusii/package.py | 2 +- var/spack/repos/builtin/packages/hdf5/package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/exodusii/package.py b/var/spack/repos/builtin/packages/exodusii/package.py index 89c04bf79c..d68baaa6d9 100644 --- a/var/spack/repos/builtin/packages/exodusii/package.py +++ b/var/spack/repos/builtin/packages/exodusii/package.py @@ -23,7 +23,7 @@ class Exodusii(Package): # TODO: Make this a build dependency once build dependencies are supported # (see: https://github.com/LLNL/spack/pull/378). depends_on('cmake@2.8.7:') - depends_on('hdf5+static~mpi') + depends_on('hdf5+shared~mpi') depends_on('netcdf~mpi') patch('exodus-cmake.patch') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 7db4aff631..f4de92aa83 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -42,7 +42,7 @@ class Hdf5(Package): version('1.8.13', 'c03426e9e77d7766944654280b467289') variant('debug', default=False, description='Builds a debug version of the library') - variant('static', default=False, description='Builds a static executable version of the library') + variant('shared', default=False, description='Builds a static executable version of the library') variant('cxx', default=True, description='Enable C++ support') variant('fortran', default=True, description='Enable Fortran support') -- cgit v1.2.3-70-g09d2 From 6cd76d69c3fa4b9eb2d30660de28206697af722d Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Wed, 17 Feb 2016 11:51:24 -0800 Subject: Fixed the "+shared" variant in the "hdf5" package. --- var/spack/repos/builtin/packages/exodusii/package.py | 2 +- var/spack/repos/builtin/packages/hdf5/package.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/exodusii/package.py b/var/spack/repos/builtin/packages/exodusii/package.py index d68baaa6d9..af258b7e6e 100644 --- a/var/spack/repos/builtin/packages/exodusii/package.py +++ b/var/spack/repos/builtin/packages/exodusii/package.py @@ -23,7 +23,7 @@ class Exodusii(Package): # TODO: Make this a build dependency once build dependencies are supported # (see: https://github.com/LLNL/spack/pull/378). depends_on('cmake@2.8.7:') - depends_on('hdf5+shared~mpi') + depends_on('hdf5~shared~mpi') depends_on('netcdf~mpi') patch('exodus-cmake.patch') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index f4de92aa83..ed4e7c35c9 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -42,7 +42,7 @@ class Hdf5(Package): version('1.8.13', 'c03426e9e77d7766944654280b467289') variant('debug', default=False, description='Builds a debug version of the library') - variant('shared', default=False, description='Builds a static executable version of the library') + variant('shared', default=True, description='Builds a shared version of the library') variant('cxx', default=True, description='Enable C++ support') variant('fortran', default=True, description='Enable Fortran support') @@ -79,7 +79,9 @@ class Hdf5(Package): else: extra_args.append('--enable-production') - if '+static' in spec: + if '+shared' in spec: + extra_args.append('--enable-shared') + else: extra_args.append('--enable-static-exec') if '+unsupported' in spec: @@ -123,7 +125,6 @@ class Hdf5(Package): configure( "--prefix=%s" % prefix, "--with-zlib=%s" % spec['zlib'].prefix, - "--enable-shared", # TODO : this should be enabled by default, remove it? *extra_args) make() make("install") -- cgit v1.2.3-70-g09d2 From 19d10291bfeae45315fcef852baddec63b69247a Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Thu, 18 Feb 2016 15:45:29 -0800 Subject: modify compiler commands in python config files, fix for #431 --- var/spack/repos/builtin/packages/python/package.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index a1ce06feb0..58d401244e 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -55,6 +55,20 @@ class Python(Package): make() make("install") + # Modify compiler paths in configuration files. This is necessary for + # building site packages outside of spack + filter_file(r'([/s]=?)([\S=]*)/lib/spack/env(/[^\s/]*)?/(\S*)(\s)', + (r'\4\5'), + join_path(prefix.lib, 'python%d.%d' % self.version[:2], '_sysconfigdata.py')) + + python3_version = '' + if spec.satisfies('@3:'): + python3_version = '-%d.%dm' % self.version[:2] + makefile_filepath = join_path(prefix.lib, 'python%d.%d' % self.version[:2], 'config%s' % python3_version, 'Makefile') + filter_file(r'([/s]=?)([\S=]*)/lib/spack/env(/[^\s/]*)?/(\S*)(\s)', + (r'\4\5'), + makefile_filepath) + # ======================================================================== # Set up environment to make install easy for python extensions. -- cgit v1.2.3-70-g09d2 From 30c304748213bee3669c75d4384bad146f68dbd7 Mon Sep 17 00:00:00 2001 From: alalazo Date: Fri, 19 Feb 2016 12:39:38 +0100 Subject: gromacs : added package --- var/spack/repos/builtin/packages/fftw/package.py | 2 + .../repos/builtin/packages/gromacs/package.py | 56 ++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 var/spack/repos/builtin/packages/gromacs/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/fftw/package.py b/var/spack/repos/builtin/packages/fftw/package.py index 4d2b964242..bc129aaf1a 100644 --- a/var/spack/repos/builtin/packages/fftw/package.py +++ b/var/spack/repos/builtin/packages/fftw/package.py @@ -47,6 +47,8 @@ class Fftw(Package): depends_on('mpi', when='+mpi') + # TODO : add support for architecture specific optimizations as soon as targets are supported + def install(self, spec, prefix): options = ['--prefix=%s' % prefix, '--enable-shared', diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py new file mode 100644 index 0000000000..5fe8399308 --- /dev/null +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -0,0 +1,56 @@ +from spack import * + + +class Gromacs(Package): + """ + GROMACS (GROningen MAchine for Chemical Simulations) is a molecular dynamics package primarily designed for + simulations of proteins, lipids and nucleic acids. It was originally developed in the Biophysical Chemistry + department of University of Groningen, and is now maintained by contributors in universities and research centers + across the world. + + GROMACS is one of the fastest and most popular software packages available and can run on CPUs as well as GPUs. + It is free, open source released under the GNU General Public License. Starting from version 4.6, GROMACS is + released under the GNU Lesser General Public License. + """ + + homepage = 'http://www.gromacs.org' + url = 'ftp://ftp.gromacs.org/pub/gromacs/gromacs-5.1.2.tar.gz' + + version('5.1.2', '614d0be372f1a6f1f36382b7a6fcab98') + + variant('mpi', default=True, description='Activate MPI support') + variant('shared', default=True, description='Enables the build of shared libraries') + variant('debug', default=False, description='Enables debug mode') + variant('double', default=False, description='Produces a double precision version of the executables') + + depends_on('mpi', when='+mpi') + + depends_on('fftw') + + # TODO : add GPU support + + def install(self, spec, prefix): + + options = [] + + if '+mpi' in spec: + options.append('-DGMX_MPI:BOOL=ON') + + if '+double' in spec: + options.append('-DGMX_DOUBLE:BOOL=ON') + + if '~shared' in spec: + options.append('-DBUILD_SHARED_LIBS:BOOL=OFF') + + if '+debug' in spec: + options.append('-DCMAKE_BUILD_TYPE:STRING=Debug') + else: + options.append('-DCMAKE_BUILD_TYPE:STRING=Release') + + options.extend(std_cmake_args) + + with working_dir('spack-build', create=True): + + cmake('..', *options) + make() + make('install') -- cgit v1.2.3-70-g09d2 From 5c8dd6c3c86400ac82b061ce45f58b543526bfff Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Sat, 20 Feb 2016 17:18:49 -0800 Subject: llvm trunk version Adding a trunk version to the llvm package. This has all the features and requirements of the others, with the additional caveat that the llvm project makes no guarantee that trunk on all repositories together will necessarily make a working compiler. It has been tested, and worked with a version today, but not yesterday, so if you test keep that in mind. --- var/spack/repos/builtin/packages/llvm/package.py | 43 +++++++++++++++++++----- 1 file changed, 34 insertions(+), 9 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 1805d3ded8..a8f19f9071 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -117,6 +117,21 @@ class Llvm(Package): }, } releases = [ + { + 'version' : 'trunk', + 'repo' : 'http://llvm.org/svn/llvm-project/llvm/trunk', + 'resources' : { + 'compiler-rt' : 'http://llvm.org/svn/llvm-project/compiler-rt/trunk', + 'openmp' : 'http://llvm.org/svn/llvm-project/openmp/trunk', + 'polly' : 'http://llvm.org/svn/llvm-project/polly/trunk', + 'libcxx' : 'http://llvm.org/svn/llvm-project/libcxx/trunk', + 'libcxxabi' : 'http://llvm.org/svn/llvm-project/libcxxabi/trunk', + 'clang' : 'http://llvm.org/svn/llvm-project/cfe/trunk', + 'clang-tools-extra' : 'http://llvm.org/svn/llvm-project/clang-tools-extra/trunk', + 'lldb' : 'http://llvm.org/svn/llvm-project/lldb/trunk', + 'llvm-libunwind' : 'http://llvm.org/svn/llvm-project/libunwind/trunk', + } + }, { 'version' : '3.7.0', 'md5':'b98b9495e5655a672d6cb83e1a180f8e', @@ -161,15 +176,25 @@ class Llvm(Package): ] for release in releases: - version(release['version'], release['md5'], url=llvm_url % release) - - for name, md5 in release['resources'].items(): - resource(name=name, - url=resources[name]['url'] % release, - md5=md5, - destination=resources[name]['destination'], - when='@%(version)s' % release, - placement=resources[name].get('placement', None)) + if release['version'] == 'trunk' : + version(release['version'], svn=release['repo']) + + for name, repo in release['resources'].items(): + resource(name=name, + svn=repo, + destination=resources[name]['destination'], + when='@%(version)s' % release, + placement=resources[name].get('placement', None)) + else: + version(release['version'], release['md5'], url=llvm_url % release) + + for name, md5 in release['resources'].items(): + resource(name=name, + url=resources[name]['url'] % release, + md5=md5, + destination=resources[name]['destination'], + when='@%(version)s' % release, + placement=resources[name].get('placement', None)) # SVN - current develop version('develop', svn='http://llvm.org/svn/llvm-project/llvm/trunk') -- cgit v1.2.3-70-g09d2 From 976ae91dccd36d1feb6d0d20cd1ef5b3470c4c39 Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 24 Feb 2016 14:11:57 +0100 Subject: llvm : removed duplicate version --- var/spack/repos/builtin/packages/llvm/package.py | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index a8f19f9071..934d994bd3 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -196,25 +196,6 @@ class Llvm(Package): when='@%(version)s' % release, placement=resources[name].get('placement', None)) - # SVN - current develop - version('develop', svn='http://llvm.org/svn/llvm-project/llvm/trunk') - resource(name='clang', svn='http://llvm.org/svn/llvm-project/cfe/trunk', - destination='tools', when='@develop', placement='clang') - resource(name='compiler-rt', svn='http://llvm.org/svn/llvm-project/compiler-rt/trunk', - destination='projects', when='@develop', placement='compiler-rt') - resource(name='openmp', svn='http://llvm.org/svn/llvm-project/openmp/trunk', - destination='projects', when='@develop', placement='openmp') - resource(name='libcxx', svn='http://llvm.org/svn/llvm-project/libcxx/trunk', - destination='projects', when='@develop', placement='libcxx') - resource(name='libcxxabi', svn='http://llvm.org/svn/llvm-project/libcxxabi/trunk', - destination='projects', when='@develop', placement='libcxxabi') - resource(name='polly', svn='http://llvm.org/svn/llvm-project/polly/trunk', - destination='tools', when='@develop', placement='polly') - resource(name='lldb', svn='http://llvm.org/svn/llvm-project/lldb/trunk', - destination='tools', when='@develop', placement='lldb') - - - def install(self, spec, prefix): env['CXXFLAGS'] = self.compiler.cxx11_flag cmake_args = [ arg for arg in std_cmake_args if 'BUILD_TYPE' not in arg ] -- cgit v1.2.3-70-g09d2 From 20845a739f15190cf9610da4375d3e3c9fc61b6b Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 24 Feb 2016 22:18:51 -0500 Subject: Libevent depends on OpenSSL --- var/spack/repos/builtin/packages/libevent/package.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/libevent/package.py b/var/spack/repos/builtin/packages/libevent/package.py index 11b1083d67..2a44c49325 100644 --- a/var/spack/repos/builtin/packages/libevent/package.py +++ b/var/spack/repos/builtin/packages/libevent/package.py @@ -23,6 +23,9 @@ class Libevent(Package): version('2.0.12', '42986228baf95e325778ed328a93e070') + depends_on('openssl') + + def install(self, spec, prefix): configure("--prefix=%s" % prefix) -- cgit v1.2.3-70-g09d2 From 30d9ca2bde033da28b6f6105f93ee05f4fd0acfa Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Fri, 26 Feb 2016 16:06:17 -0800 Subject: Updated the silo package and added the '+fortran' variant. --- var/spack/repos/builtin/packages/silo/package.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/silo/package.py b/var/spack/repos/builtin/packages/silo/package.py index 9eda11df15..d1aed78e0e 100644 --- a/var/spack/repos/builtin/packages/silo/package.py +++ b/var/spack/repos/builtin/packages/silo/package.py @@ -1,19 +1,28 @@ from spack import * class Silo(Package): - """Silo is a library for reading and writing a wide variety of scientific data to binary, disk files.""" + """Silo is a library for reading and writing a wide variety of scientific + data to binary, disk files.""" homepage = "http://wci.llnl.gov/simulation/computer-codes/silo" url = "https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.8/silo-4.8.tar.gz" - #version('4.9', 'a83eda4f06761a86726e918fc55e782a') version('4.8', 'b1cbc0e7ec435eb656dc4b53a23663c9') - depends_on("hdf5@:1.8.12") + variant('fortran', default=True, description='Enable Fortran support') + + depends_on("hdf5") def install(self, spec, prefix): - configure("--prefix=%s" % prefix, - "--with-hdf5=%s" %spec['hdf5'].prefix) + config_args = [ + '--enable-fortran' if '+fortran' in spec else '--disable-fortran', + ] + + configure( + "--prefix=%s" % prefix, + "--with-hdf5=%s,%s" % (spec['hdf5'].prefix.include, spec['hdf5'].prefix.lib), + "--with-zlib=%s,%s" % (spec['zlib'].prefix.include, spec['zlib'].prefix.lib), + *config_args) make() make("install") -- cgit v1.2.3-70-g09d2 From 8f3ac9ac8b7b1d16672e7a52f691966de1f8483f Mon Sep 17 00:00:00 2001 From: Luigi Calori Date: Sat, 27 Feb 2016 01:40:32 +0100 Subject: adding new version to praview, compiled with spack -d install -j 8 --keep-stage paraview@5.0.0+qt+python+tcl+opengl2%gcc@4.8.2 ^netcdf -mpi --- var/spack/repos/builtin/packages/paraview/package.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index e43bdd4493..ccf2d14c06 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -2,9 +2,11 @@ from spack import * class Paraview(Package): homepage = 'http://www.paraview.org' - url = 'http://www.paraview.org/files/v4.4/ParaView-v4.4.0-source.tar.gz' + url = 'http://www.paraview.org/files/v5.0/ParaView-v' + _url_str = 'http://www.paraview.org/files/v%s/ParaView-v%s-source.tar.gz' - version('4.4.0', 'fa1569857dd680ebb4d7ff89c2227378', url='http://www.paraview.org/files/v4.4/ParaView-v4.4.0-source.tar.gz') + version('4.4.0', 'fa1569857dd680ebb4d7ff89c2227378') + version('5.0.0', '4598f0b421460c8bbc635c9a1c3bdbee') variant('python', default=False, description='Enable Python support') @@ -25,8 +27,8 @@ class Paraview(Package): depends_on('bzip2') depends_on('freetype') - depends_on('hdf5') depends_on('hdf5+mpi', when='+mpi') + depends_on('hdf5~mpi', when='~mpi') depends_on('jpeg') depends_on('libpng') depends_on('libtiff') @@ -35,6 +37,11 @@ class Paraview(Package): #depends_on('protobuf') # version mismatches? #depends_on('sqlite') # external version not supported depends_on('zlib') + + def url_for_version(self, version): + """Handle ParaView version-based custom URLs.""" + return self._url_str % (version.up_to(2), version) + def install(self, spec, prefix): with working_dir('spack-build', create=True): -- cgit v1.2.3-70-g09d2 From 67f327f805868d369eec0392631392281b68c39d Mon Sep 17 00:00:00 2001 From: Ian Lee Date: Sun, 28 Feb 2016 19:47:19 -0800 Subject: Updated links to use new llnl.gov address --- README.md | 4 ++-- lib/spack/docs/getting_started.rst | 2 +- lib/spack/spack/cmd/repo.py | 2 +- lib/spack/spack/repository.py | 2 +- lib/spack/spack/resource.py | 2 +- lib/spack/spack/test/namespace_trie.py | 2 +- lib/spack/spack/test/tally_plugin.py | 8 ++++---- var/spack/repos/builtin/packages/gdb/package.py | 2 +- var/spack/repos/builtin/packages/texinfo/package.py | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) (limited to 'var') diff --git a/README.md b/README.md index bdce345764..8664953c0c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ written in pure Python, and specs allow package authors to write a single build script for many different builds of the same package. See the -[Feature Overview](http://llnl.github.io/spack/features.html) +[Feature Overview](http://software.llnl.gov/spack/features.html) for examples and highlights. To install spack and install your first package: @@ -31,7 +31,7 @@ To install spack and install your first package: Documentation ---------------- -[**Full documentation**](http://llnl.github.io/spack) for Spack is +[**Full documentation**](http://software.llnl.gov/spack) for Spack is the first place to look. See also: diff --git a/lib/spack/docs/getting_started.rst b/lib/spack/docs/getting_started.rst index 67ca18e71a..2c5b68ea65 100644 --- a/lib/spack/docs/getting_started.rst +++ b/lib/spack/docs/getting_started.rst @@ -22,7 +22,7 @@ go: $ spack install libelf For a richer experience, use Spack's `shell support -`_: +`_: .. code-block:: sh diff --git a/lib/spack/spack/cmd/repo.py b/lib/spack/spack/cmd/repo.py index 34c755fb67..908f5400ab 100644 --- a/lib/spack/spack/cmd/repo.py +++ b/lib/spack/spack/cmd/repo.py @@ -6,7 +6,7 @@ # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # -# For details, see https://llnl.github.io/spack +# For details, see https://software.llnl.gov/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 diff --git a/lib/spack/spack/repository.py b/lib/spack/spack/repository.py index f58cd52125..e8d0cc09ec 100644 --- a/lib/spack/spack/repository.py +++ b/lib/spack/spack/repository.py @@ -6,7 +6,7 @@ # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # -# For details, see https://llnl.github.io/spack +# For details, see https://software.llnl.gov/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 diff --git a/lib/spack/spack/resource.py b/lib/spack/spack/resource.py index 2bf92947fd..ddfaaf4cb0 100644 --- a/lib/spack/spack/resource.py +++ b/lib/spack/spack/resource.py @@ -6,7 +6,7 @@ # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # -# For details, see https://llnl.github.io/spack +# For details, see https://software.llnl.gov/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 diff --git a/lib/spack/spack/test/namespace_trie.py b/lib/spack/spack/test/namespace_trie.py index d0d809004d..647976df21 100644 --- a/lib/spack/spack/test/namespace_trie.py +++ b/lib/spack/spack/test/namespace_trie.py @@ -6,7 +6,7 @@ # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # -# For details, see https://llnl.github.io/spack +# For details, see https://software.llnl.gov/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 diff --git a/lib/spack/spack/test/tally_plugin.py b/lib/spack/spack/test/tally_plugin.py index 9ca898c47c..e0b9618e0c 100644 --- a/lib/spack/spack/test/tally_plugin.py +++ b/lib/spack/spack/test/tally_plugin.py @@ -6,7 +6,7 @@ # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # -# For details, see https://scalability-llnl.github.io/spack +# For details, see https://scalability-software.llnl.gov/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 @@ -34,7 +34,7 @@ class Tally(Plugin): self.successCount = 0 self.failCount = 0 self.errorCount = 0 - + @property def numberOfTestsRun(self): """Excludes skipped tests""" @@ -48,10 +48,10 @@ class Tally(Plugin): def addSuccess(self, test): self.successCount += 1 - + def addError(self, test, err): self.errorCount += 1 - + def addFailure(self, test, err): self.failCount += 1 diff --git a/var/spack/repos/builtin/packages/gdb/package.py b/var/spack/repos/builtin/packages/gdb/package.py index dd02b426b9..b346fe80c2 100644 --- a/var/spack/repos/builtin/packages/gdb/package.py +++ b/var/spack/repos/builtin/packages/gdb/package.py @@ -6,7 +6,7 @@ # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # -# For details, see https://llnl.github.io/spack +# For details, see https://software.llnl.gov/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 diff --git a/var/spack/repos/builtin/packages/texinfo/package.py b/var/spack/repos/builtin/packages/texinfo/package.py index a83c10c0c1..6cf8d79072 100644 --- a/var/spack/repos/builtin/packages/texinfo/package.py +++ b/var/spack/repos/builtin/packages/texinfo/package.py @@ -6,7 +6,7 @@ # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # -# For details, see https://llnl.github.io/spack +# For details, see https://software.llnl.gov/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 -- cgit v1.2.3-70-g09d2 From e414c5fdfbc91e5934ee59233475f8f862e2e0ce Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Mon, 29 Feb 2016 22:31:18 -0500 Subject: Added missing cmake dependencies --- var/spack/repos/builtin/packages/cgal/package.py | 1 + var/spack/repos/builtin/packages/curl/package.py | 6 +++--- var/spack/repos/builtin/packages/expat/package.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cgal/package.py b/var/spack/repos/builtin/packages/cgal/package.py index 97356433be..ef4a2736db 100644 --- a/var/spack/repos/builtin/packages/cgal/package.py +++ b/var/spack/repos/builtin/packages/cgal/package.py @@ -46,6 +46,7 @@ class Cgal(Package): depends_on('mpfr') depends_on('gmp') depends_on('zlib') + depends_on('cmake') # FIXME : Qt5 dependency missing (needs Qt5 and OpenGL) # FIXME : Optional third party libraries missing diff --git a/var/spack/repos/builtin/packages/curl/package.py b/var/spack/repos/builtin/packages/curl/package.py index 9e684445c7..6c302281a7 100644 --- a/var/spack/repos/builtin/packages/curl/package.py +++ b/var/spack/repos/builtin/packages/curl/package.py @@ -13,13 +13,13 @@ class Curl(Package): version('7.43.0', '11bddbb452a8b766b932f859aaeeed39') version('7.42.1', '296945012ce647b94083ed427c1877a8') - depends_on("openssl") +# depends_on("openssl") depends_on("zlib") def install(self, spec, prefix): configure('--prefix=%s' % prefix, - '--with-zlib=%s' % spec['zlib'].prefix, - '--with-ssl=%s' % spec['openssl'].prefix) + '--with-zlib=%s' % spec['zlib'].prefix) +# '--with-ssl=%s' % spec['openssl'].prefix) make() make("install") diff --git a/var/spack/repos/builtin/packages/expat/package.py b/var/spack/repos/builtin/packages/expat/package.py index 082da5bf0b..3f925c6546 100644 --- a/var/spack/repos/builtin/packages/expat/package.py +++ b/var/spack/repos/builtin/packages/expat/package.py @@ -7,6 +7,7 @@ class Expat(Package): version('2.1.0', 'dd7dab7a5fea97d2a6a43f511449b7cd') + depends_on('cmake') def install(self, spec, prefix): -- cgit v1.2.3-70-g09d2 From 15ae92aae9c8ac521bb5d7ee5f210d265494d87a Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Mon, 29 Feb 2016 22:59:28 -0500 Subject: New packages added: blitz, netcdf-cxx4, netcdf-fortran, proj, udunits2 --- var/spack/repos/builtin/packages/blitz/package.py | 40 +++++++++++++++++++++ .../repos/builtin/packages/netcdf-cxx4/package.py | 41 ++++++++++++++++++++++ .../builtin/packages/netcdf-fortran/package.py | 21 +++++++++++ var/spack/repos/builtin/packages/proj/package.py | 37 +++++++++++++++++++ .../repos/builtin/packages/udunits2/package.py | 16 +++++++++ 5 files changed, 155 insertions(+) create mode 100644 var/spack/repos/builtin/packages/blitz/package.py create mode 100644 var/spack/repos/builtin/packages/netcdf-cxx4/package.py create mode 100644 var/spack/repos/builtin/packages/netcdf-fortran/package.py create mode 100644 var/spack/repos/builtin/packages/proj/package.py create mode 100644 var/spack/repos/builtin/packages/udunits2/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/blitz/package.py b/var/spack/repos/builtin/packages/blitz/package.py new file mode 100644 index 0000000000..82ff634925 --- /dev/null +++ b/var/spack/repos/builtin/packages/blitz/package.py @@ -0,0 +1,40 @@ +# FIXME: +# This is a template package file for Spack. We've conveniently +# put "FIXME" labels next to all the things you'll want to change. +# +# Once you've edited all the FIXME's, delete this whole message, +# save this file, and test out your package like this: +# +# spack install blitz +# +# You can always get back here to change things with: +# +# spack edit blitz +# +# See the spack documentation for more information on building +# packages. +# +from spack import * + +class Blitz(Package): + """N-dimensional arrays for C++""" + homepage = "http://github.com/blitzpp/blitz" + +# This version doesn't have the configure script generated yet. + url = "https://github.com/blitzpp/blitz/tarball/1.0.0" +#http://prdownloads.sourceforge.net/%(namelower)s + + version('1.0.0', '9f040b9827fe22228a892603671a77af') + + # FIXME: Add dependencies if this package requires them. + # depends_on("foo") + + def install(self, spec, prefix): + # FIXME: Modify the configure line to suit your build system here. + # FIXME: Spack couldn't guess one, so here are some options: + configure('--prefix=%s' % prefix) + # cmake('.', *std_cmake_args) + + # FIXME: Add logic to build and install here + make() + make("install") diff --git a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py new file mode 100644 index 0000000000..9d70eab05f --- /dev/null +++ b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py @@ -0,0 +1,41 @@ +# FIXME: +# This is a template package file for Spack. We've conveniently +# put "FIXME" labels next to all the things you'll want to change. +# +# Once you've edited all the FIXME's, delete this whole message, +# save this file, and test out your package like this: +# +# spack install netcdf-cxx4 +# +# You can always get back here to change things with: +# +# spack edit netcdf-cxx4 +# +# See the spack documentation for more information on building +# packages. +# +from spack import * + +class NetcdfCxx4(Package): + """C++ interface for NetCDF4""" + homepage = "http://www.unidata.ucar.edu/downloads/netcdf/netcdf-cxx/index.jsp" + url = "http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.2.tar.gz" + + version('4.2', 'd019853802092cf686254aaba165fc81') + + + variant('mpi', default=True, description='Enables MPI parallelism') +# variant('hdf4', default=False, description="Enable HDF4 support") + + # NetCDF-CXX4 doesn't really depend (directly) on MPI. However... this + # depndency ensures taht the right version of MPI is selected (eg: ^openmpi) + depends_on('mpi', when='+mpi') + depends_on('netcdf') + + def install(self, spec, prefix): + # FIXME: Modify the configure line to suit your build system here. + configure('--prefix=%s' % prefix) + + # FIXME: Add logic to build and install here + 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 new file mode 100644 index 0000000000..8e5c8ecc3a --- /dev/null +++ b/var/spack/repos/builtin/packages/netcdf-fortran/package.py @@ -0,0 +1,21 @@ +from spack import * + +class NetcdfFortran(Package): + """Fortran interface for NetCDF4""" + + homepage = "http://www.unidata.ucar.edu/downloads/netcdf/netcdf-cxx/index.jsp" + url = "http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.4.3.tar.gz" + + version('4.4.3', 'bfd4ae23a34635b273d3eb0d91cbde9e') + + variant('mpi', default=True, description='Enables MPI parallelism') + + # NetCDF-CXX4 doesn't really depend (directly) on MPI. However... this + # depndency ensures taht the right version of MPI is selected (eg: ^openmpi) + depends_on('mpi', when='+mpi') + depends_on('netcdf') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/repos/builtin/packages/proj/package.py b/var/spack/repos/builtin/packages/proj/package.py new file mode 100644 index 0000000000..4a0d3feac7 --- /dev/null +++ b/var/spack/repos/builtin/packages/proj/package.py @@ -0,0 +1,37 @@ +# FIXME: +# This is a template package file for Spack. We've conveniently +# put "FIXME" labels next to all the things you'll want to change. +# +# Once you've edited all the FIXME's, delete this whole message, +# save this file, and test out your package like this: +# +# spack install proj +# +# You can always get back here to change things with: +# +# spack edit proj +# +# See the spack documentation for more information on building +# packages. +# +from spack import * + +class Proj(Package): + """Cartographic Projections""" + homepage = "https://github.com/OSGeo/proj.4/wiki" + url = "http://download.osgeo.org/proj/proj-4.9.2.tar.gz" + + version('4.9.2', '9843131676e31bbd903d60ae7dc76cf9') + version('4.9.1', '3cbb2a964fd19a496f5f4265a717d31c') + version('4.8.0', 'd815838c92a29179298c126effbb1537') + version('4.7.0', '927d34623b52e0209ba2bfcca18fe8cd') + version('4.6.1', '7dbaab8431ad50c25669fd3fb28dc493') + + # FIXME: Add dependencies if this package requires them. + # depends_on("foo") + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix) + + make() + make("install") diff --git a/var/spack/repos/builtin/packages/udunits2/package.py b/var/spack/repos/builtin/packages/udunits2/package.py new file mode 100644 index 0000000000..9954a733bb --- /dev/null +++ b/var/spack/repos/builtin/packages/udunits2/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Udunits2(Package): + """Automated units conversion""" + + homepage = "http://www.unidata.ucar.edu/software/udunits" + url = "ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.2.20.tar.gz" + + version('2.2.20', '1586b70a49dfe05da5fcc29ef239dce0') + + depends_on('expat') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From eb1d90a8cfadeb556754b57e5d21e5605b9a0e9d Mon Sep 17 00:00:00 2001 From: citibeth Date: Mon, 29 Feb 2016 23:31:54 -0500 Subject: Undid accidental change on this branch. --- var/spack/repos/builtin/packages/curl/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/curl/package.py b/var/spack/repos/builtin/packages/curl/package.py index 6c302281a7..9e684445c7 100644 --- a/var/spack/repos/builtin/packages/curl/package.py +++ b/var/spack/repos/builtin/packages/curl/package.py @@ -13,13 +13,13 @@ class Curl(Package): version('7.43.0', '11bddbb452a8b766b932f859aaeeed39') version('7.42.1', '296945012ce647b94083ed427c1877a8') -# depends_on("openssl") + depends_on("openssl") depends_on("zlib") def install(self, spec, prefix): configure('--prefix=%s' % prefix, - '--with-zlib=%s' % spec['zlib'].prefix) -# '--with-ssl=%s' % spec['openssl'].prefix) + '--with-zlib=%s' % spec['zlib'].prefix, + '--with-ssl=%s' % spec['openssl'].prefix) make() make("install") -- cgit v1.2.3-70-g09d2 From 8174489787c56cee1726ca36799c236e4869f471 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Tue, 1 Mar 2016 15:25:57 -0700 Subject: + Provide two new variants for cmake: 1) +qt - build the cmake-gui Qt application. - adds a dependency on Qt. 2) +sphinxbuild - build the html CMake documentation. - adds a dependency on python and py-sphinx --- var/spack/repos/builtin/packages/cmake/package.py | 26 +++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index e20c1e4aeb..f39a681284 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -37,16 +37,34 @@ class Cmake(Package): version('2.8.10.2', '097278785da7182ec0aea8769d06860c') variant('ncurses', default=True, description='Enables the build of the ncurses gui') + variant('qt', default=False, description='Enables the build of cmake-gui') + variant('sphinxbuild', default=False, description='Enables the generation of html and man page documentation') + depends_on('ncurses', when='+ncurses') + depends_on('qt', when='+qt') + depends_on('python@2.7.11:', when='+sphinxbuild') + depends_on('py-sphinx', when='+sphinxbuild') def url_for_version(self, version): """Handle CMake's version-based custom URLs.""" return 'https://cmake.org/files/v%s/cmake-%s.tar.gz' % (version.up_to(2), version) - def install(self, spec, prefix): - configure('--prefix=' + prefix, - '--parallel=' + str(make_jobs), - '--', '-DCMAKE_USE_OPENSSL=ON') + + options = ['--prefix=%s' % prefix] + options.append('--parallel=%s' % str(make_jobs)) + + if '+qt' in spec: + options.append('--qt-gui') + + if '+sphinxbuild' in spec: + options.append('--sphinx-html') + options.append('--sphinx-man') + + options.append('--') + options.append('-DCMAKE_USE_OPENSSL=ON') + + configure(*options) + make() make('install') -- cgit v1.2.3-70-g09d2 From 976d0240c467b9ff74333fafcd2ac1e896819a80 Mon Sep 17 00:00:00 2001 From: citibeth Date: Wed, 2 Mar 2016 18:58:47 -0500 Subject: Removed FIXMEs. --- var/spack/repos/builtin/packages/blitz/package.py | 27 +--------------------- .../repos/builtin/packages/netcdf-cxx4/package.py | 21 +---------------- .../builtin/packages/netcdf-fortran/package.py | 2 +- var/spack/repos/builtin/packages/proj/package.py | 19 +-------------- 4 files changed, 4 insertions(+), 65 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/blitz/package.py b/var/spack/repos/builtin/packages/blitz/package.py index 82ff634925..9413b276fe 100644 --- a/var/spack/repos/builtin/packages/blitz/package.py +++ b/var/spack/repos/builtin/packages/blitz/package.py @@ -1,40 +1,15 @@ -# FIXME: -# This is a template package file for Spack. We've conveniently -# put "FIXME" labels next to all the things you'll want to change. -# -# Once you've edited all the FIXME's, delete this whole message, -# save this file, and test out your package like this: -# -# spack install blitz -# -# You can always get back here to change things with: -# -# spack edit blitz -# -# See the spack documentation for more information on building -# packages. -# from spack import * class Blitz(Package): """N-dimensional arrays for C++""" homepage = "http://github.com/blitzpp/blitz" - -# This version doesn't have the configure script generated yet. url = "https://github.com/blitzpp/blitz/tarball/1.0.0" -#http://prdownloads.sourceforge.net/%(namelower)s version('1.0.0', '9f040b9827fe22228a892603671a77af') - # FIXME: Add dependencies if this package requires them. - # depends_on("foo") + # No dependencies def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. - # FIXME: Spack couldn't guess one, so here are some options: configure('--prefix=%s' % prefix) - # cmake('.', *std_cmake_args) - - # FIXME: Add logic to build and install here make() make("install") diff --git a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py index 9d70eab05f..8d51a10679 100644 --- a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py +++ b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py @@ -1,19 +1,3 @@ -# FIXME: -# This is a template package file for Spack. We've conveniently -# put "FIXME" labels next to all the things you'll want to change. -# -# Once you've edited all the FIXME's, delete this whole message, -# save this file, and test out your package like this: -# -# spack install netcdf-cxx4 -# -# You can always get back here to change things with: -# -# spack edit netcdf-cxx4 -# -# See the spack documentation for more information on building -# packages. -# from spack import * class NetcdfCxx4(Package): @@ -25,17 +9,14 @@ class NetcdfCxx4(Package): variant('mpi', default=True, description='Enables MPI parallelism') -# variant('hdf4', default=False, description="Enable HDF4 support") - # NetCDF-CXX4 doesn't really depend (directly) on MPI. However... this + # netcdf-cxx4 doesn't really depend (directly) on MPI. However... this # depndency ensures taht the right version of MPI is selected (eg: ^openmpi) depends_on('mpi', when='+mpi') depends_on('netcdf') def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. configure('--prefix=%s' % prefix) - # FIXME: Add logic to build and install here 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 8e5c8ecc3a..9e4aee95fb 100644 --- a/var/spack/repos/builtin/packages/netcdf-fortran/package.py +++ b/var/spack/repos/builtin/packages/netcdf-fortran/package.py @@ -10,7 +10,7 @@ class NetcdfFortran(Package): variant('mpi', default=True, description='Enables MPI parallelism') - # NetCDF-CXX4 doesn't really depend (directly) on MPI. However... this + # netcdf-fortran doesn't really depend (directly) on MPI. However... this # depndency ensures taht the right version of MPI is selected (eg: ^openmpi) depends_on('mpi', when='+mpi') depends_on('netcdf') diff --git a/var/spack/repos/builtin/packages/proj/package.py b/var/spack/repos/builtin/packages/proj/package.py index 4a0d3feac7..797772f4f6 100644 --- a/var/spack/repos/builtin/packages/proj/package.py +++ b/var/spack/repos/builtin/packages/proj/package.py @@ -1,19 +1,3 @@ -# FIXME: -# This is a template package file for Spack. We've conveniently -# put "FIXME" labels next to all the things you'll want to change. -# -# Once you've edited all the FIXME's, delete this whole message, -# save this file, and test out your package like this: -# -# spack install proj -# -# You can always get back here to change things with: -# -# spack edit proj -# -# See the spack documentation for more information on building -# packages. -# from spack import * class Proj(Package): @@ -27,8 +11,7 @@ class Proj(Package): version('4.7.0', '927d34623b52e0209ba2bfcca18fe8cd') version('4.6.1', '7dbaab8431ad50c25669fd3fb28dc493') - # FIXME: Add dependencies if this package requires them. - # depends_on("foo") + # No dependencies def install(self, spec, prefix): configure('--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 7183db1b7df3bce7e5f174ce38a50476c2e3b218 Mon Sep 17 00:00:00 2001 From: Scott Pakin Date: Thu, 3 Mar 2016 11:30:57 -0700 Subject: Added LLVM 3.7.1 support --- var/spack/repos/builtin/packages/llvm/package.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 934d994bd3..280e400f69 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Copyright (c) 2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. @@ -34,7 +34,7 @@ class Llvm(Package): it is the full name of the project. """ homepage = 'http://llvm.org/' - url = 'http://llvm.org/releases/3.7.0/llvm-3.7.0.src.tar.xz' + url = 'http://llvm.org/releases/3.7.1/llvm-3.7.1.src.tar.xz' version('3.0', 'a8e5f5f1c1adebae7b4a654c376a6005', url='http://llvm.org/releases/3.0/llvm-3.0.tar.gz') # currently required by mesa package @@ -132,6 +132,21 @@ class Llvm(Package): 'llvm-libunwind' : 'http://llvm.org/svn/llvm-project/libunwind/trunk', } }, + { + 'version' : '3.7.1', + 'md5':'bf8b3a2c79e61212c5409041dfdbd319', + 'resources' : { + 'compiler-rt' : '1c6975daf30bb3b0473b53c3a1a6ff01', + 'openmp' : 'b4ad08cda4e5c22e42b66062b140438e', + 'polly' : '3a2a7367002740881637f4d47bca4dc3', + 'libcxx' : 'f9c43fa552a10e14ff53b94d04bea140', + 'libcxxabi' : '52d925afac9f97e9dcac90745255c169', + 'clang' : '0acd026b5529164197563d135a8fd83e', + 'clang-tools-extra' : '5d49ff745037f061a7c86aeb6a24c3d2', + 'lldb' : 'a106d8a0d21fc84d76953822fbaf3398', + 'llvm-libunwind' : '814bd52c9247c5d04629658fbcb3ab8c', + } + }, { 'version' : '3.7.0', 'md5':'b98b9495e5655a672d6cb83e1a180f8e', -- cgit v1.2.3-70-g09d2 From 0eb6ef2cd031d1668e1891425bdc6234df0594df Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Fri, 4 Mar 2016 11:09:40 -0500 Subject: 1. Removed fake MPI dependency from netcdf-cxx4 and netcdf-fortran. 2. Removed Fortran bootstrap variant from netcdf. Users who need NetCDF Fortran interface should install netcdf-fortran. 3. Added result of ./configure --help on the netcdf-fortran. Verified the package has no additional options that should be exposed through Spack. --- .../repos/builtin/packages/netcdf-cxx4/package.py | 6 - .../builtin/packages/netcdf-fortran/package.py | 156 ++++++++++++++++++++- var/spack/repos/builtin/packages/netcdf/package.py | 12 +- 3 files changed, 154 insertions(+), 20 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py index 8d51a10679..fb4c2886cd 100644 --- a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py +++ b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py @@ -7,12 +7,6 @@ class NetcdfCxx4(Package): version('4.2', 'd019853802092cf686254aaba165fc81') - - variant('mpi', default=True, description='Enables MPI parallelism') - - # netcdf-cxx4 doesn't really depend (directly) on MPI. However... this - # depndency ensures taht the right version of MPI is selected (eg: ^openmpi) - depends_on('mpi', when='+mpi') depends_on('netcdf') def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/netcdf-fortran/package.py b/var/spack/repos/builtin/packages/netcdf-fortran/package.py index 9e4aee95fb..4e0b14d012 100644 --- a/var/spack/repos/builtin/packages/netcdf-fortran/package.py +++ b/var/spack/repos/builtin/packages/netcdf-fortran/package.py @@ -10,12 +10,162 @@ class NetcdfFortran(Package): variant('mpi', default=True, description='Enables MPI parallelism') - # netcdf-fortran doesn't really depend (directly) on MPI. However... this - # depndency ensures taht the right version of MPI is selected (eg: ^openmpi) - depends_on('mpi', when='+mpi') depends_on('netcdf') def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install") + + + + +# netcdf-fortran configure parameters are below +# --------------------------------------------- +# +# `configure' configures netCDF-Fortran 4.4.3 to adapt to many kinds of systems. +# +# Usage: ./configure [OPTION]... [VAR=VALUE]... +# +# To assign environment variables (e.g., CC, CFLAGS...), specify them as +# VAR=VALUE. See below for descriptions of some of the useful variables. +# +# Defaults for the options are specified in brackets. +# +# Configuration: +# -h, --help display this help and exit +# --help=short display options specific to this package +# --help=recursive display the short help of all the included packages +# -V, --version display version information and exit +# -q, --quiet, --silent do not print `checking ...' messages +# --cache-file=FILE cache test results in FILE [disabled] +# -C, --config-cache alias for `--cache-file=config.cache' +# -n, --no-create do not create output files +# --srcdir=DIR find the sources in DIR [configure dir or `..'] +# +# Installation directories: +# --prefix=PREFIX install architecture-independent files in PREFIX +# [/usr/local] +# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +# [PREFIX] +# +# By default, `make install' will install all the files in +# `/usr/local/bin', `/usr/local/lib' etc. You can specify +# an installation prefix other than `/usr/local' using `--prefix', +# for instance `--prefix=$HOME'. +# +# For better control, use the options below. +# +# Fine tuning of the installation directories: +# --bindir=DIR user executables [EPREFIX/bin] +# --sbindir=DIR system admin executables [EPREFIX/sbin] +# --libexecdir=DIR program executables [EPREFIX/libexec] +# --sysconfdir=DIR read-only single-machine data [PREFIX/etc] +# --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] +# --localstatedir=DIR modifiable single-machine data [PREFIX/var] +# --libdir=DIR object code libraries [EPREFIX/lib] +# --includedir=DIR C header files [PREFIX/include] +# --oldincludedir=DIR C header files for non-gcc [/usr/include] +# --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] +# --datadir=DIR read-only architecture-independent data [DATAROOTDIR] +# --infodir=DIR info documentation [DATAROOTDIR/info] +# --localedir=DIR locale-dependent data [DATAROOTDIR/locale] +# --mandir=DIR man documentation [DATAROOTDIR/man] +# --docdir=DIR documentation root [DATAROOTDIR/doc/netcdf-fortran] +# --htmldir=DIR html documentation [DOCDIR] +# --dvidir=DIR dvi documentation [DOCDIR] +# --pdfdir=DIR pdf documentation [DOCDIR] +# --psdir=DIR ps documentation [DOCDIR] +# +# Program names: +# --program-prefix=PREFIX prepend PREFIX to installed program names +# --program-suffix=SUFFIX append SUFFIX to installed program names +# --program-transform-name=PROGRAM run sed PROGRAM on installed program names +# +# System types: +# --build=BUILD configure for building on BUILD [guessed] +# --host=HOST cross-compile to build programs to run on HOST [BUILD] +# --target=TARGET configure for building compilers for TARGET [HOST] +# +# Optional Features: +# --disable-option-checking ignore unrecognized --enable/--with options +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --enable-silent-rules less verbose build output (undo: "make V=1") +# --disable-silent-rules verbose build output (undo: "make V=0") +# --enable-maintainer-mode +# enable make rules and dependencies not useful (and +# sometimes confusing) to the casual installer +# --enable-valgrind-tests build with valgrind-tests (valgrind is required, +# static builds only) +# --enable-parallel-tests Run extra parallel IO tests. Ignored if netCDF-4 is +# not enabled, or built on a system without parallel +# I/O support. +# --enable-extra-tests run some extra tests that may not pass because of +# known issues +# --enable-doxygen Enable generation of documentation with doxygen. +# --enable-dot Use dot (provided by graphviz) to generate charts +# and graphs in the doxygen-based documentation. +# --enable-internal-docs Include documentation of library internals. This is +# of interest only to those developing the netCDF +# library. +# --enable-dependency-tracking +# do not reject slow dependency extractors +# --disable-dependency-tracking +# speeds up one-time build +# --disable-f03-compiler-check +# disable check of ISO_C_BINDING support in Fortran +# compiler +# --disable-f03 suppress netCDF Fortran 2003 native code +# --disable-fortran-type-check +# cause the Fortran type sizes checks to be skipped +# --enable-large-file-tests +# Run tests which create very large data files (~13 GB +# disk space required, but it will be recovered when +# tests are complete). See option --with-temp-large to +# specify temporary directory +# --enable-benchmarks Run benchmarks. This is an experimental feature. +# --enable-shared[=PKGS] build shared libraries [default=yes] +# --enable-static[=PKGS] build static libraries [default=yes] +# --enable-fast-install[=PKGS] +# optimize for fast installation [default=yes] +# --disable-libtool-lock avoid locking (might break parallel builds) +# --disable-largefile omit support for large files +# --enable-extra-example-tests +# Run extra example tests; requires GNU sed. Ignored +# if netCDF-4 is not enabled. +# --enable-dll build a win32 DLL (only works on mingw) +# +# Optional Packages: +# --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +# --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +# --with-temp-large= +# specify directory where large files (i.e. >2 GB) +# will be written, if large files tests are run with +# --enable-large-file-tests +# --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use +# both] +# --with-gnu-ld assume the C compiler uses GNU ld [default=no] +# --with-sysroot=DIR Search for dependent libraries within DIR +# (or the compiler's sysroot if not specified). +# +# Some influential environment variables: +# CC C compiler command +# CFLAGS C compiler flags +# LDFLAGS linker flags, e.g. -L if you have libraries in a +# nonstandard directory +# LIBS libraries to pass to the linker, e.g. -l +# CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if +# you have headers in a nonstandard directory +# FC Fortran compiler command +# FCFLAGS Fortran compiler flags +# F77 Fortran 77 compiler command +# FFLAGS Fortran 77 compiler flags +# CPP C preprocessor +# +# Use these variables to override the choices made by `configure' or to help +# it to find libraries and programs with nonstandard names/locations. +# +# Report bugs to . +# +# from spack import * diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 41a0d2b6f9..0b112a59ce 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -13,7 +13,6 @@ class Netcdf(Package): version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') variant('mpi', default=True, description='Enables MPI parallelism') - variant('fortran', default=False, description="Download and install NetCDF-Fortran") variant('hdf4', default=False, description="Enable HDF4 support") # Dependencies: @@ -66,11 +65,7 @@ class Netcdf(Package): # Fortran support # In version 4.2+, NetCDF-C and NetCDF-Fortran have split. - # They can be installed separately, but this bootstrap procedure - # should be able to install both at the same time. - # Note: this is a new experimental feature. - if '+fortran' in spec: - config_args.append("--enable-remote-fortran-bootstrap") + # Use the netcdf-fortran package to install Fortran support. config_args.append('CPPFLAGS=%s' % ' '.join(CPPFLAGS)) config_args.append('LDFLAGS=%s' % ' '.join(LDFLAGS)) @@ -79,8 +74,3 @@ class Netcdf(Package): configure(*config_args) make() make("install") - - # After installing NetCDF-C, install NetCDF-Fortran - if '+fortran' in spec: - make("build-netcdf-fortran") - make("install-netcdf-fortran") -- cgit v1.2.3-70-g09d2 From b043c4a5b83f36ad4837fc7302f0919a3d759940 Mon Sep 17 00:00:00 2001 From: Elizabeth Fischer Date: Fri, 4 Mar 2016 12:04:41 -0500 Subject: Update package.py Removed comments on configure options. --- .../builtin/packages/netcdf-fortran/package.py | 153 --------------------- 1 file changed, 153 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netcdf-fortran/package.py b/var/spack/repos/builtin/packages/netcdf-fortran/package.py index 4e0b14d012..954e7dc3e8 100644 --- a/var/spack/repos/builtin/packages/netcdf-fortran/package.py +++ b/var/spack/repos/builtin/packages/netcdf-fortran/package.py @@ -16,156 +16,3 @@ class NetcdfFortran(Package): configure("--prefix=%s" % prefix) make() make("install") - - - - -# netcdf-fortran configure parameters are below -# --------------------------------------------- -# -# `configure' configures netCDF-Fortran 4.4.3 to adapt to many kinds of systems. -# -# Usage: ./configure [OPTION]... [VAR=VALUE]... -# -# To assign environment variables (e.g., CC, CFLAGS...), specify them as -# VAR=VALUE. See below for descriptions of some of the useful variables. -# -# Defaults for the options are specified in brackets. -# -# Configuration: -# -h, --help display this help and exit -# --help=short display options specific to this package -# --help=recursive display the short help of all the included packages -# -V, --version display version information and exit -# -q, --quiet, --silent do not print `checking ...' messages -# --cache-file=FILE cache test results in FILE [disabled] -# -C, --config-cache alias for `--cache-file=config.cache' -# -n, --no-create do not create output files -# --srcdir=DIR find the sources in DIR [configure dir or `..'] -# -# Installation directories: -# --prefix=PREFIX install architecture-independent files in PREFIX -# [/usr/local] -# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX -# [PREFIX] -# -# By default, `make install' will install all the files in -# `/usr/local/bin', `/usr/local/lib' etc. You can specify -# an installation prefix other than `/usr/local' using `--prefix', -# for instance `--prefix=$HOME'. -# -# For better control, use the options below. -# -# Fine tuning of the installation directories: -# --bindir=DIR user executables [EPREFIX/bin] -# --sbindir=DIR system admin executables [EPREFIX/sbin] -# --libexecdir=DIR program executables [EPREFIX/libexec] -# --sysconfdir=DIR read-only single-machine data [PREFIX/etc] -# --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] -# --localstatedir=DIR modifiable single-machine data [PREFIX/var] -# --libdir=DIR object code libraries [EPREFIX/lib] -# --includedir=DIR C header files [PREFIX/include] -# --oldincludedir=DIR C header files for non-gcc [/usr/include] -# --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] -# --datadir=DIR read-only architecture-independent data [DATAROOTDIR] -# --infodir=DIR info documentation [DATAROOTDIR/info] -# --localedir=DIR locale-dependent data [DATAROOTDIR/locale] -# --mandir=DIR man documentation [DATAROOTDIR/man] -# --docdir=DIR documentation root [DATAROOTDIR/doc/netcdf-fortran] -# --htmldir=DIR html documentation [DOCDIR] -# --dvidir=DIR dvi documentation [DOCDIR] -# --pdfdir=DIR pdf documentation [DOCDIR] -# --psdir=DIR ps documentation [DOCDIR] -# -# Program names: -# --program-prefix=PREFIX prepend PREFIX to installed program names -# --program-suffix=SUFFIX append SUFFIX to installed program names -# --program-transform-name=PROGRAM run sed PROGRAM on installed program names -# -# System types: -# --build=BUILD configure for building on BUILD [guessed] -# --host=HOST cross-compile to build programs to run on HOST [BUILD] -# --target=TARGET configure for building compilers for TARGET [HOST] -# -# Optional Features: -# --disable-option-checking ignore unrecognized --enable/--with options -# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) -# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] -# --enable-silent-rules less verbose build output (undo: "make V=1") -# --disable-silent-rules verbose build output (undo: "make V=0") -# --enable-maintainer-mode -# enable make rules and dependencies not useful (and -# sometimes confusing) to the casual installer -# --enable-valgrind-tests build with valgrind-tests (valgrind is required, -# static builds only) -# --enable-parallel-tests Run extra parallel IO tests. Ignored if netCDF-4 is -# not enabled, or built on a system without parallel -# I/O support. -# --enable-extra-tests run some extra tests that may not pass because of -# known issues -# --enable-doxygen Enable generation of documentation with doxygen. -# --enable-dot Use dot (provided by graphviz) to generate charts -# and graphs in the doxygen-based documentation. -# --enable-internal-docs Include documentation of library internals. This is -# of interest only to those developing the netCDF -# library. -# --enable-dependency-tracking -# do not reject slow dependency extractors -# --disable-dependency-tracking -# speeds up one-time build -# --disable-f03-compiler-check -# disable check of ISO_C_BINDING support in Fortran -# compiler -# --disable-f03 suppress netCDF Fortran 2003 native code -# --disable-fortran-type-check -# cause the Fortran type sizes checks to be skipped -# --enable-large-file-tests -# Run tests which create very large data files (~13 GB -# disk space required, but it will be recovered when -# tests are complete). See option --with-temp-large to -# specify temporary directory -# --enable-benchmarks Run benchmarks. This is an experimental feature. -# --enable-shared[=PKGS] build shared libraries [default=yes] -# --enable-static[=PKGS] build static libraries [default=yes] -# --enable-fast-install[=PKGS] -# optimize for fast installation [default=yes] -# --disable-libtool-lock avoid locking (might break parallel builds) -# --disable-largefile omit support for large files -# --enable-extra-example-tests -# Run extra example tests; requires GNU sed. Ignored -# if netCDF-4 is not enabled. -# --enable-dll build a win32 DLL (only works on mingw) -# -# Optional Packages: -# --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] -# --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) -# --with-temp-large= -# specify directory where large files (i.e. >2 GB) -# will be written, if large files tests are run with -# --enable-large-file-tests -# --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use -# both] -# --with-gnu-ld assume the C compiler uses GNU ld [default=no] -# --with-sysroot=DIR Search for dependent libraries within DIR -# (or the compiler's sysroot if not specified). -# -# Some influential environment variables: -# CC C compiler command -# CFLAGS C compiler flags -# LDFLAGS linker flags, e.g. -L if you have libraries in a -# nonstandard directory -# LIBS libraries to pass to the linker, e.g. -l -# CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if -# you have headers in a nonstandard directory -# FC Fortran compiler command -# FCFLAGS Fortran compiler flags -# F77 Fortran 77 compiler command -# FFLAGS Fortran 77 compiler flags -# CPP C preprocessor -# -# Use these variables to override the choices made by `configure' or to help -# it to find libraries and programs with nonstandard names/locations. -# -# Report bugs to . -# -# from spack import * -- cgit v1.2.3-70-g09d2 From 648d08eb305e04d95ee702b819923f31fd829955 Mon Sep 17 00:00:00 2001 From: Elizabeth Fischer Date: Fri, 4 Mar 2016 12:05:43 -0500 Subject: Update package.py Updated homepage URL to general NetCDF homepage. --- var/spack/repos/builtin/packages/netcdf-cxx4/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py index fb4c2886cd..ab717ac6ff 100644 --- a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py +++ b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py @@ -2,7 +2,7 @@ from spack import * class NetcdfCxx4(Package): """C++ interface for NetCDF4""" - homepage = "http://www.unidata.ucar.edu/downloads/netcdf/netcdf-cxx/index.jsp" + homepage = "http://www.unidata.ucar.edu/software/netcdf" url = "http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.2.tar.gz" version('4.2', 'd019853802092cf686254aaba165fc81') -- cgit v1.2.3-70-g09d2 From a7b918837eab02ebff5af783d06e56ec7f868d9e Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 4 Mar 2016 15:22:28 -0600 Subject: GNU m4 depends on libsigsegv --- var/spack/repos/builtin/packages/libsigsegv/package.py | 15 +++++++++++++++ var/spack/repos/builtin/packages/m4/package.py | 2 ++ 2 files changed, 17 insertions(+) create mode 100644 var/spack/repos/builtin/packages/libsigsegv/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/libsigsegv/package.py b/var/spack/repos/builtin/packages/libsigsegv/package.py new file mode 100644 index 0000000000..4b486198ec --- /dev/null +++ b/var/spack/repos/builtin/packages/libsigsegv/package.py @@ -0,0 +1,15 @@ +from spack import * + +class Libsigsegv(Package): + """GNU libsigsegv is a library for handling page faults in user mode.""" + homepage = "https://www.gnu.org/software/libsigsegv/" + url = "ftp://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.10.tar.gz" + + version('2.10', '7f96fb1f65b3b8cbc1582fb7be774f0f') + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix, + '--enable-shared') + + make() + make("install") diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index 5d76d8866b..3890663ad1 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -7,6 +7,8 @@ class M4(Package): version('1.4.17', 'a5e9954b1dae036762f7b13673a2cf76') + depends_on('libsigsegv') + def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() -- cgit v1.2.3-70-g09d2 From f90eaa5f46bfd64b9b0adb4ab5a58d169efe3c69 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Fri, 4 Mar 2016 14:53:08 -0800 Subject: Fixed unmatched function signature for do_fetch in jdk package --- var/spack/repos/builtin/packages/jdk/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/jdk/package.py b/var/spack/repos/builtin/packages/jdk/package.py index f8f5fc21bd..cbcc53ac0a 100644 --- a/var/spack/repos/builtin/packages/jdk/package.py +++ b/var/spack/repos/builtin/packages/jdk/package.py @@ -28,7 +28,7 @@ class Jdk(Package): '-H', # specify required License Agreement cookie 'Cookie: oraclelicense=accept-securebackup-cookie'] - def do_fetch(self): + def do_fetch(self, mirror_only=False): # Add our custom curl commandline options tty.msg( "[Jdk] Adding required commandline options to curl " + @@ -39,7 +39,7 @@ class Jdk(Package): spack.curl.add_default_arg(option) # Now perform the actual fetch - super(Jdk, self).do_fetch() + super(Jdk, self).do_fetch(mirror_only) def install(self, spec, prefix): -- cgit v1.2.3-70-g09d2 From f663d37da75e4ef0f266c63707e77d29a651e07d Mon Sep 17 00:00:00 2001 From: Mark Miller Date: Fri, 4 Mar 2016 17:08:11 -0800 Subject: Adding zfp package. --- var/spack/repos/builtin/packages/zfp/package.py | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 var/spack/repos/builtin/packages/zfp/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/zfp/package.py b/var/spack/repos/builtin/packages/zfp/package.py new file mode 100644 index 0000000000..620fe9d456 --- /dev/null +++ b/var/spack/repos/builtin/packages/zfp/package.py @@ -0,0 +1,26 @@ +from spack import * + +class Zfp(Package): + """zfp is an open source C library for compressed floating-point arrays that supports + very high throughput read and write random acces, target error bounds or bit rates. + Although bit-for-bit lossless compression is not always possible, zfp is usually + accurate to within machine epsilon in near-lossless mode, and is often orders of + magnitude more accurate than other lossy compressors. + """ + + homepage = "http://computation.llnl.gov/projects/floating-point-compression" + url = "http://computation.llnl.gov/projects/floating-point-compression/download/zfp-0.5.0.tar.gz" + + version('0.5.0', '2ab29a852e65ad85aae38925c5003654') + + def install(self, spec, prefix): + make("shared") + + # No install provided + mkdirp(prefix.lib) + mkdirp(prefix.include) + install('lib/libzfp.so', prefix.lib) + install('inc/zfp.h', prefix.include) + install('inc/types.h', prefix.include) + install('inc/bitstream.h', prefix.include) + install('inc/system.h', prefix.include) -- cgit v1.2.3-70-g09d2 From 3dd630d0a567964acd11bee23ebbc52c7d1c61c5 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 5 Mar 2016 14:33:23 -0800 Subject: Make openssl a variant in libevent. --- var/spack/repos/builtin/packages/libevent/package.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/libevent/package.py b/var/spack/repos/builtin/packages/libevent/package.py index 2a44c49325..714a155dc0 100644 --- a/var/spack/repos/builtin/packages/libevent/package.py +++ b/var/spack/repos/builtin/packages/libevent/package.py @@ -22,12 +22,16 @@ class Libevent(Package): version('2.0.13', 'af786b4b3f790c9d3279792edf7867fc') version('2.0.12', '42986228baf95e325778ed328a93e070') - - depends_on('openssl') - + variant('openssl', default=True, description="Build with encryption enabled at the libevent level.") + depends_on('openssl', when='+openssl') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure_args = [] + if '+openssl' in spec: + configure_args.append('--enable-openssl') + else: + configure_args.append('--enable-openssl') + configure("--prefix=%s" % prefix, *configure_args) make() make("install") -- cgit v1.2.3-70-g09d2 From 220b6a9fee0f307d4de1e48b29093812f7dd10ec Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 5 Mar 2016 16:46:32 -0600 Subject: Make libsigsegv an optional dependency --- var/spack/repos/builtin/packages/m4/package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index 3890663ad1..9d522dfccf 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -7,7 +7,9 @@ class M4(Package): version('1.4.17', 'a5e9954b1dae036762f7b13673a2cf76') - depends_on('libsigsegv') + variant('sigsegv', default=True, description="Build the libsigsegv dependency") + + depends_on('libsigsegv', when='+sigsegv') def install(self, spec, prefix): configure("--prefix=%s" % prefix) -- cgit v1.2.3-70-g09d2 From 7d847f4dc4f8895d57e492c11cfd7c3fbb794945 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 5 Mar 2016 15:14:21 -0800 Subject: Minor tweaks to m4 -- be sure to add sigsegv args explicitly. --- var/spack/repos/builtin/packages/m4/package.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index 9d522dfccf..d6829dbcd4 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -12,6 +12,12 @@ class M4(Package): depends_on('libsigsegv', when='+sigsegv') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure_args = [] + if 'libsigsegv' in spec: + configure_args.append('--with-libsigsegv-prefix=%s' % spec['libsigsegv'].prefix) + else: + configure_args.append('--without-libsigsegv-prefix') + + configure("--prefix=%s" % prefix, *configure_args) make() make("install") -- cgit v1.2.3-70-g09d2 From ae87948a232c17982a7987e5423ac77acdc59194 Mon Sep 17 00:00:00 2001 From: citibeth Date: Sat, 5 Mar 2016 23:05:45 -0500 Subject: Fixed URLs Removed vestigal mpi variant in netcdf-fortran --- var/spack/repos/builtin/packages/netcdf-cxx4/package.py | 1 - var/spack/repos/builtin/packages/netcdf-fortran/package.py | 4 +--- var/spack/repos/builtin/packages/netcdf/package.py | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py index ab717ac6ff..b83e964b00 100644 --- a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py +++ b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py @@ -11,6 +11,5 @@ class NetcdfCxx4(Package): def install(self, spec, prefix): configure('--prefix=%s' % prefix) - 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 954e7dc3e8..e4e33445e5 100644 --- a/var/spack/repos/builtin/packages/netcdf-fortran/package.py +++ b/var/spack/repos/builtin/packages/netcdf-fortran/package.py @@ -3,13 +3,11 @@ from spack import * class NetcdfFortran(Package): """Fortran interface for NetCDF4""" - homepage = "http://www.unidata.ucar.edu/downloads/netcdf/netcdf-cxx/index.jsp" + 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.3', 'bfd4ae23a34635b273d3eb0d91cbde9e') - variant('mpi', default=True, description='Enables MPI parallelism') - depends_on('netcdf') def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 0b112a59ce..227362399a 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -6,7 +6,7 @@ class Netcdf(Package): data formats that support the creation, access, and sharing of array-oriented scientific data.""" - homepage = "http://www.unidata.ucar.edu/software/netcdf/" + 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.0', 'cffda0cbd97fdb3a06e9274f7aef438e') -- cgit v1.2.3-70-g09d2 From a399451e1e32c9a294f5b735237cef93ddbd4131 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 6 Mar 2016 23:34:48 -0500 Subject: Update OpenSSL to 1.0.2g --- var/spack/repos/builtin/packages/openssl/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index c73102f05d..70afaf4038 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -17,6 +17,7 @@ class Openssl(Package): version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') version('1.0.2f', 'b3bf73f507172be9292ea2a8c28b659d') + version('1.0.2g', 'f3c710c045cdee5fd114feb69feba7aa') depends_on("zlib") parallel = False -- cgit v1.2.3-70-g09d2 From 1e7d946d9116dee4900b95def1614bd3f788f6f0 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 7 Mar 2016 12:37:51 -0600 Subject: Add patch to allow PGI to build M4 --- var/spack/repos/builtin/packages/m4/inline-pgi.patch | 10 ++++++++++ var/spack/repos/builtin/packages/m4/package.py | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 var/spack/repos/builtin/packages/m4/inline-pgi.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/m4/inline-pgi.patch b/var/spack/repos/builtin/packages/m4/inline-pgi.patch new file mode 100644 index 0000000000..da5eb57a93 --- /dev/null +++ b/var/spack/repos/builtin/packages/m4/inline-pgi.patch @@ -0,0 +1,10 @@ +--- a/m4/extern-inline.m4 ++++ b/m4/extern-inline.m4 +@@ -34,6 +34,7 @@ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : (199901L <= __STDC_VERSION__ \ + && !defined __HP_cc \ ++ && !defined __PGI \ + && !(defined __SUNPRO_C && __STDC__))) \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) + # define _GL_INLINE inline diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index d6829dbcd4..ef70add18a 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -7,6 +7,8 @@ class M4(Package): version('1.4.17', 'a5e9954b1dae036762f7b13673a2cf76') + patch('inline-pgi.patch', when='@1.4.17') + variant('sigsegv', default=True, description="Build the libsigsegv dependency") depends_on('libsigsegv', when='+sigsegv') -- cgit v1.2.3-70-g09d2 From b7750cf61c51704d87d679efeba9ca8cb8c2b768 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 7 Mar 2016 15:52:22 -0600 Subject: Autoreconf is necessary after patch --- var/spack/repos/builtin/packages/m4/inline-pgi.patch | 12 ++++++++++++ var/spack/repos/builtin/packages/m4/package.py | 4 ++++ 2 files changed, 16 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/m4/inline-pgi.patch b/var/spack/repos/builtin/packages/m4/inline-pgi.patch index da5eb57a93..bc31ad918e 100644 --- a/var/spack/repos/builtin/packages/m4/inline-pgi.patch +++ b/var/spack/repos/builtin/packages/m4/inline-pgi.patch @@ -8,3 +8,15 @@ && !(defined __SUNPRO_C && __STDC__))) \ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # define _GL_INLINE inline +--- a/configure.ac ++++ b/configure.ac +@@ -22,7 +22,7 @@ + [bug-m4@gnu.org]) + AC_CONFIG_AUX_DIR([build-aux]) + +-AM_INIT_AUTOMAKE([1.11.6 dist-bzip2 dist-xz color-tests parallel-tests ++AM_INIT_AUTOMAKE([dist-bzip2 dist-xz color-tests parallel-tests + silent-rules subdir-objects gnu]) + + m4_pattern_forbid([^M4_[A-Z]]) + diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index ef70add18a..aa0c775f08 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -14,6 +14,10 @@ class M4(Package): depends_on('libsigsegv', when='+sigsegv') def install(self, spec, prefix): + # After patch, update generated configuration files that depend on extern-inline.m4 + autoreconf = which('autoreconf') + autoreconf() + configure_args = [] if 'libsigsegv' in spec: configure_args.append('--with-libsigsegv-prefix=%s' % spec['libsigsegv'].prefix) -- cgit v1.2.3-70-g09d2 From 18ce5ccf8fb31dae71848f541f3e139bd582953c Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 8 Mar 2016 02:49:11 -0800 Subject: Avoid race in pango's `make install`, set parallel=False --- var/spack/repos/builtin/packages/pango/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/pango/package.py b/var/spack/repos/builtin/packages/pango/package.py index df43625bf5..79dad3a3d2 100644 --- a/var/spack/repos/builtin/packages/pango/package.py +++ b/var/spack/repos/builtin/packages/pango/package.py @@ -16,4 +16,4 @@ class Pango(Package): def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() - make("install") + make("install", parallel=False) -- cgit v1.2.3-70-g09d2 From e0e545774aaddb5386367bd900a31b85692abc51 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 8 Mar 2016 12:15:40 -0600 Subject: Add more versions to Autotools --- var/spack/repos/builtin/packages/autoconf/package.py | 1 + var/spack/repos/builtin/packages/automake/package.py | 2 ++ 2 files changed, 3 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py index 5189faf054..6412e810a6 100644 --- a/var/spack/repos/builtin/packages/autoconf/package.py +++ b/var/spack/repos/builtin/packages/autoconf/package.py @@ -6,6 +6,7 @@ class Autoconf(Package): url = "http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz" version('2.69', '82d05e03b93e45f5a39b828dc9c6c29b') + version('2.62', '6c1f3b3734999035d77da5024aab4fbd') def install(self, spec, prefix): configure("--prefix=%s" % prefix) diff --git a/var/spack/repos/builtin/packages/automake/package.py b/var/spack/repos/builtin/packages/automake/package.py index 9115822730..2172a42030 100644 --- a/var/spack/repos/builtin/packages/automake/package.py +++ b/var/spack/repos/builtin/packages/automake/package.py @@ -5,7 +5,9 @@ class Automake(Package): 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') + version('1.11.6', '0286dc30295b62985ca51919202ecfcc') depends_on('autoconf') -- cgit v1.2.3-70-g09d2 From 0c7d0c0b6c650cd0fd6f4814a255613e3efa1814 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Tue, 8 Mar 2016 12:26:40 -0800 Subject: Variants and fixes to thrift package --- var/spack/repos/builtin/packages/thrift/package.py | 64 +++++++++++++--------- 1 file changed, 38 insertions(+), 26 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/thrift/package.py b/var/spack/repos/builtin/packages/thrift/package.py index 0e15052f64..ec3b13e563 100644 --- a/var/spack/repos/builtin/packages/thrift/package.py +++ b/var/spack/repos/builtin/packages/thrift/package.py @@ -12,33 +12,45 @@ class Thrift(Package): version('0.9.2', '89f63cc4d0100912f4a1f8a9dee63678') - extends("python") - - depends_on("autoconf") - depends_on("automake") - depends_on("bison") - depends_on("boost") - depends_on("flex") - depends_on("jdk") - depends_on("libtool") - depends_on("openssl") - depends_on("python") - - # Compilation fails for most languages, fortunately cpp installs fine - # All other languages (yes, including C) are omitted until someone needs them + # Currently only support for c-family and python + variant('c', default=True, description="Build support for C-family languages") + variant('python', default=True, description="Build support for python") + + depends_on('jdk') + depends_on('autoconf') + depends_on('automake') + depends_on('libtool') + depends_on('boost@1.53:') + depends_on('bison') + depends_on('flex') + depends_on('openssl') + + # Variant dependencies + extends('python', when='+python') + depends_on('python', when='+python') + + depends_on('zlib', when='+c') + depends_on('libevent', when='+c') + def install(self, spec, prefix): - env["PY_PREFIX"] = prefix - env["JAVA_PREFIX"] = prefix - - configure("--prefix=%s" % prefix, - "--with-boost=%s" % spec['boost'].prefix, - "--with-c=no", - "--with-go=no", - "--with-python=yes", - "--with-lua=no", - "--with-php=no", - "--with-qt4=no", - "--enable-tests=no") + env['PY_PREFIX'] = prefix + env['JAVA_HOME'] = spec['jdk'].prefix + + # configure options + options = ['--prefix=%s' % prefix] + + options.append('--with-boost=%s' % spec['boost'].prefix) + options.append('--enable-tests=no') + + options.append('--with-c=%s' % ('yes' if '+c' in spec else 'no')) + options.append('--with-python=%s' % ('yes' if '+python' in spec else 'no')) + options.append('--with-java=%s' % ('yes' if '+java' in spec else 'no')) + options.append('--with-go=%s' % ('yes' if '+go' in spec else 'no')) + options.append('--with-lua=%s' % ('yes' if '+lua' in spec else 'no')) + options.append('--with-php=%s' % ('yes' if '+php' in spec else 'no')) + options.append('--with-qt4=%s' % ('yes' if '+qt4' in spec else 'no')) + + configure(*options) make() make("install") -- cgit v1.2.3-70-g09d2 From 5b22873b3dce37c0d7bad418bf6e0b73d381d19e Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Wed, 9 Mar 2016 00:18:20 -0500 Subject: Fixed issues with hypre: 1. --with-lapack-lib was wrong. 2. --with-MPI was wrong; set env vars for MPI wrappers instead. 3. Added version 2.10.1 4. Added shared library variant (True by default). Hypre can build shared or static libraries, but not both in the same build. --- var/spack/repos/builtin/packages/hypre/package.py | 28 +++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index 0f7f14dd89..242ee100d7 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -1,4 +1,5 @@ from spack import * +import os class Hypre(Package): """Hypre is a library of high performance preconditioners that @@ -8,8 +9,11 @@ class Hypre(Package): homepage = "http://computation.llnl.gov/project/linear_solvers/software.php" url = "http://computation.llnl.gov/project/linear_solvers/download/hypre-2.10.0b.tar.gz" + version('2.10.1', 'dc048c4cabb3cd549af72591474ad674') version('2.10.0b', '768be38793a35bb5d055905b271f5b8e') + variant('shared', default=True, description="Build shared library version (disables static library)") + depends_on("mpi") depends_on("blas") depends_on("lapack") @@ -17,16 +21,26 @@ class Hypre(Package): def install(self, spec, prefix): blas_dir = spec['blas'].prefix lapack_dir = spec['lapack'].prefix + mpi_dir = spec['mpi'].prefix + + os.environ['CC'] = os.path.join(mpi_dir, 'bin', 'mpicc') + os.environ['CXX'] = os.path.join(mpi_dir, 'bin', 'mpicxx') + os.environ['F77'] = os.path.join(mpi_dir, 'bin', 'mpif77') + + + configure_args = [ + "--prefix=%s" % prefix, + "--with-lapack-libs=lapack", + "--with-lapack-lib-dirs=%s/lib" % lapack_dir, + "--with-blas-libs=blas", + "--with-blas-lib-dirs=%s/lib" % blas_dir] + if '+shared' in self.spec: + configure_args.append("--enable-shared") # Hypre's source is staged under ./src so we'll have to manually # cd into it. with working_dir("src"): - configure( - "--prefix=%s" % prefix, - "--with-blas-libs=blas", - "--with-blas-lib-dirs=%s/lib" % blas_dir, - "--with-lapack-libs=\"lapack blas\"", - "--with-lapack-lib-dirs=%s/lib" % lapack_dir, - "--with-MPI") + configure(*configure_args) + make() make("install") -- cgit v1.2.3-70-g09d2 From c67b922185ebf5b7686d5b4958e2b31b8f0f1469 Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Wed, 9 Mar 2016 00:34:08 -0500 Subject: Added shared library capability. --- var/spack/repos/builtin/packages/petsc/package.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 87f700629d..e42425bcef 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -11,8 +11,11 @@ class Petsc(Package): version('3.5.3', 'd4fd2734661e89f18ac6014b5dd1ef2f') version('3.5.2', 'ad170802b3b058b5deb9cd1f968e7e13') version('3.5.1', 'a557e029711ebf425544e117ffa44d8f') + version('3.4.4', '7edbc68aa6d8d6a3295dd5f6c2f6979d') - depends_on("python @2.6:2.9") # requires Python for building + variant('shared', default=True, description="Build shared library version") + + depends_on("python @2.6:2.7") # requires Python for building depends_on("boost") depends_on("blas") @@ -33,7 +36,7 @@ class Petsc(Package): "--with-metis-dir=%s" % spec['metis'].prefix, "--with-hdf5-dir=%s" % spec['hdf5'].prefix, "--with-mpi-dir=%s" % spec['mpi'].prefix, - "--with-shared-libraries=0") + "--with-shared-libraries=%d" % (1 if '+shared' in self.spec else 0)) # PETSc has its own way of doing parallel make. make('MAKE_NP=%s' % make_jobs, parallel=False) -- cgit v1.2.3-70-g09d2 From f01d1c4385f05dd7bda7efb3a9e7f2c8008e177a Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 9 Mar 2016 14:36:37 +0100 Subject: petsc : added variants and logic to build various flavors --- var/spack/repos/builtin/packages/petsc/package.py | 92 +++++++++++++++++------ 1 file changed, 69 insertions(+), 23 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 87f700629d..5be187f348 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -1,40 +1,86 @@ +import os from spack import * + class Petsc(Package): - """PETSc is a suite of data structures and routines for the - scalable (parallel) solution of scientific applications modeled by - partial differential equations.""" + """ + PETSc is a suite of data structures and routines for the scalable (parallel) solution of scientific applications + modeled by partial differential equations. + """ homepage = "http://www.mcs.anl.gov/petsc/index.html" - url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.5.3.tar.gz" + url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.5.3.tar.gz" + version('3.6.3', '91dd3522de5a5ef039ff8f50800db606') version('3.5.3', 'd4fd2734661e89f18ac6014b5dd1ef2f') version('3.5.2', 'ad170802b3b058b5deb9cd1f968e7e13') version('3.5.1', 'a557e029711ebf425544e117ffa44d8f') - depends_on("python @2.6:2.9") # requires Python for building + variant('shared', default=True, description='Enables the build of shared libraries') + variant('mpi', default=True, description='Activates MPI support') + variant('double', default=True, description='Switches between single and double precision') + + variant('metis', default=True, description='Activates support for metis and parmetis') + variant('hdf5', default=True, description='Activates support for HDF5 (only parallel)') + variant('boost', default=True, description='Activates support for Boost') + variant('hypre', default=True, description='Activates support for Hypre') + + # Build dependencies + depends_on('python @2.6:2.9') # requires Python for building + + # Virtual dependencies + depends_on('blas') + depends_on('lapack') + depends_on('mpi', when='+mpi') - depends_on("boost") - depends_on("blas") - depends_on("lapack") - depends_on("hypre") - depends_on("parmetis") - depends_on("metis") - depends_on("hdf5+mpi") - depends_on("mpi") + # Other dependencies + depends_on('boost', when='+boost') + depends_on('metis', when='+metis') + + depends_on('hdf5~cxx~unsupported+mpi', when='+hdf5+mpi') + depends_on('parmetis', when='+metis+mpi') + depends_on('hypre', when='+hypre+mpi') + + def mpi_dependent_options(self): + if '~mpi' in self.spec: + compiler_opts = [ + '--with-cc=%s' % os.environ['CC'], + '--with-cxx=%s' % (os.environ['CXX'] if self.compiler.cxx is not None else '0'), + '--with-fc=%s' % (os.environ['FC'] if self.compiler.fc is not None else '0'), + '--with-mpi=0' + ] + error_message_fmt = '\t{library} support requires "+mpi" to be activated' + errors = [error_message_fmt.format(library=x) for x in ('hdf5', 'hypre') if ('+'+x) in self.spec] + if errors: + errors = ['incompatible variants given'] + errors + raise RuntimeError('\n'.join(errors)) + else: + compiler_opts = [ + '--with-mpi=1', + '--with-mpi-dir=%s' % self.spec['mpi'].prefix, + ] + return compiler_opts def install(self, spec, prefix): - configure("--prefix=%s" % prefix, - "--with-blas-lib=%s/libblas.a" % spec['blas'].prefix.lib, - "--with-lapack-lib=%s/liblapack.a" % spec['lapack'].prefix.lib, - "--with-boost-dir=%s" % spec['boost'].prefix, - "--with-hypre-dir=%s" % spec['hypre'].prefix, - "--with-parmetis-dir=%s" % spec['parmetis'].prefix, - "--with-metis-dir=%s" % spec['metis'].prefix, - "--with-hdf5-dir=%s" % spec['hdf5'].prefix, - "--with-mpi-dir=%s" % spec['mpi'].prefix, - "--with-shared-libraries=0") + options = [] + options.extend(self.mpi_dependent_options()) + options.extend([ + '--with-precision=%s' % ('double' if '+double' in spec else 'single'), + '--with-shared-libraries=%s' % ('1' if '+shared' in spec else '0'), + '--with-blas-lapack-dir=%s' % spec['lapack'].prefix + ]) + # Activates library support if needed + for library in ('metis', 'boost', 'hfd5', 'hypre', 'parmetis'): + options.append( + '--with-{library}={value}'.format(library=library, value=('1' if library in spec else '0')) + ) + if library in spec: + options.append( + '--with-{library}-dir={path}'.format(library=library, path=spec[library].prefix) + ) + + configure('--prefix=%s' % prefix, *options) # PETSc has its own way of doing parallel make. make('MAKE_NP=%s' % make_jobs, parallel=False) make("install") -- cgit v1.2.3-70-g09d2 From 8e76cda200bb3da159cdc27726c7812f66c5a5ed Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 9 Mar 2016 10:41:31 -0600 Subject: Patch config.hin, not extern-inline.m4 --- .../repos/builtin/packages/m4/inline-pgi.patch | 22 ---------------------- var/spack/repos/builtin/packages/m4/package.py | 6 +----- var/spack/repos/builtin/packages/m4/pgi.patch | 10 ++++++++++ 3 files changed, 11 insertions(+), 27 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/m4/inline-pgi.patch create mode 100644 var/spack/repos/builtin/packages/m4/pgi.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/m4/inline-pgi.patch b/var/spack/repos/builtin/packages/m4/inline-pgi.patch deleted file mode 100644 index bc31ad918e..0000000000 --- a/var/spack/repos/builtin/packages/m4/inline-pgi.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/m4/extern-inline.m4 -+++ b/m4/extern-inline.m4 -@@ -34,6 +34,7 @@ - ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ - : (199901L <= __STDC_VERSION__ \ - && !defined __HP_cc \ -+ && !defined __PGI \ - && !(defined __SUNPRO_C && __STDC__))) \ - && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) - # define _GL_INLINE inline ---- a/configure.ac -+++ b/configure.ac -@@ -22,7 +22,7 @@ - [bug-m4@gnu.org]) - AC_CONFIG_AUX_DIR([build-aux]) - --AM_INIT_AUTOMAKE([1.11.6 dist-bzip2 dist-xz color-tests parallel-tests -+AM_INIT_AUTOMAKE([dist-bzip2 dist-xz color-tests parallel-tests - silent-rules subdir-objects gnu]) - - m4_pattern_forbid([^M4_[A-Z]]) - diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index aa0c775f08..a4b9dcb623 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -7,17 +7,13 @@ class M4(Package): version('1.4.17', 'a5e9954b1dae036762f7b13673a2cf76') - patch('inline-pgi.patch', when='@1.4.17') + patch('pgi.patch', when='@1.4.17') variant('sigsegv', default=True, description="Build the libsigsegv dependency") depends_on('libsigsegv', when='+sigsegv') def install(self, spec, prefix): - # After patch, update generated configuration files that depend on extern-inline.m4 - autoreconf = which('autoreconf') - autoreconf() - configure_args = [] if 'libsigsegv' in spec: configure_args.append('--with-libsigsegv-prefix=%s' % spec['libsigsegv'].prefix) diff --git a/var/spack/repos/builtin/packages/m4/pgi.patch b/var/spack/repos/builtin/packages/m4/pgi.patch new file mode 100644 index 0000000000..1ad63e2cf1 --- /dev/null +++ b/var/spack/repos/builtin/packages/m4/pgi.patch @@ -0,0 +1,10 @@ +--- a/lib/config.hin ++++ b/lib/config.hin +@@ -1510,6 +1510,7 @@ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : (199901L <= __STDC_VERSION__ \ + && !defined __HP_cc \ ++ && !defined __PGI \ + && !(defined __SUNPRO_C && __STDC__))) \ + && !defined _GL_EXTERN_INLINE_APPLE_BUG) + # define _GL_INLINE inline -- cgit v1.2.3-70-g09d2 From b43c277dc617020d7aaa1e292e01e79d0840999e Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 9 Mar 2016 10:55:50 -0800 Subject: Merge @citibeth and @alalazo's petsc fixes from #515 and #517 --- var/spack/repos/builtin/packages/petsc/package.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 5be187f348..41fd859945 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -15,6 +15,7 @@ class Petsc(Package): version('3.5.3', 'd4fd2734661e89f18ac6014b5dd1ef2f') version('3.5.2', 'ad170802b3b058b5deb9cd1f968e7e13') version('3.5.1', 'a557e029711ebf425544e117ffa44d8f') + version('3.4.4', '7edbc68aa6d8d6a3295dd5f6c2f6979d') variant('shared', default=True, description='Enables the build of shared libraries') variant('mpi', default=True, description='Activates MPI support') @@ -25,21 +26,21 @@ class Petsc(Package): variant('boost', default=True, description='Activates support for Boost') variant('hypre', default=True, description='Activates support for Hypre') - # Build dependencies - depends_on('python @2.6:2.9') # requires Python for building - # Virtual dependencies depends_on('blas') depends_on('lapack') depends_on('mpi', when='+mpi') + # Build dependencies + depends_on('python @2.6:2.7') + # Other dependencies depends_on('boost', when='+boost') depends_on('metis', when='+metis') - depends_on('hdf5~cxx~unsupported+mpi', when='+hdf5+mpi') + depends_on('hdf5+mpi', when='+hdf5+mpi') depends_on('parmetis', when='+metis+mpi') - depends_on('hypre', when='+hypre+mpi') + depends_on('hypre', when='+hypre+mpi') def mpi_dependent_options(self): if '~mpi' in self.spec: @@ -50,7 +51,9 @@ class Petsc(Package): '--with-mpi=0' ] error_message_fmt = '\t{library} support requires "+mpi" to be activated' - errors = [error_message_fmt.format(library=x) for x in ('hdf5', 'hypre') if ('+'+x) in self.spec] + errors = [error_message_fmt.format(library=x) + for x in ('hdf5', 'hypre', 'parmetis') + if ('+'+x) in self.spec] if errors: errors = ['incompatible variants given'] + errors raise RuntimeError('\n'.join(errors)) @@ -70,7 +73,7 @@ class Petsc(Package): '--with-blas-lapack-dir=%s' % spec['lapack'].prefix ]) # Activates library support if needed - for library in ('metis', 'boost', 'hfd5', 'hypre', 'parmetis'): + for library in ('metis', 'boost', 'hdf5', 'hypre', 'parmetis'): options.append( '--with-{library}={value}'.format(library=library, value=('1' if library in spec else '0')) ) @@ -79,8 +82,8 @@ class Petsc(Package): '--with-{library}-dir={path}'.format(library=library, path=spec[library].prefix) ) - configure('--prefix=%s' % prefix, *options) + # PETSc has its own way of doing parallel make. make('MAKE_NP=%s' % make_jobs, parallel=False) make("install") -- cgit v1.2.3-70-g09d2 From d06ebf23d4ffe3499edca3f34f60be9b561f5f8c Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 9 Mar 2016 11:16:35 -0800 Subject: Removing `unsupported` variant from HDF5. - `unsupported` shouldn't be a variant. --- var/spack/repos/builtin/packages/hdf5/package.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index ed4e7c35c9..513a38ee8a 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -46,7 +46,6 @@ class Hdf5(Package): variant('cxx', default=True, description='Enable C++ support') variant('fortran', default=True, description='Enable Fortran support') - variant('unsupported', default=True, description='Enables unsupported configuration options') variant('mpi', default=False, description='Enable MPI support') variant('szip', default=False, description='Enable szip support') @@ -74,6 +73,13 @@ class Hdf5(Package): self.validate(spec) # Handle compilation after spec validation extra_args = [] + + # Always enable this option. This does not actually enable any + # features: it only *allows* the user to specify certain + # combinations of other arguments. Enabling it just skips a + # sanity check in configure, so this doesn't merit a variant. + extra_args.append("--enable-unsupported") + if '+debug' in spec: extra_args.append('--enable-debug=all') else: @@ -84,9 +90,6 @@ class Hdf5(Package): else: extra_args.append('--enable-static-exec') - if '+unsupported' in spec: - extra_args.append("--enable-unsupported") - if '+cxx' in spec: extra_args.append('--enable-cxx') -- cgit v1.2.3-70-g09d2 From 383e73a5f53e0ab3d1f448789bc5a1b4a7c85292 Mon Sep 17 00:00:00 2001 From: Alfredo Adolfo Gimenez Date: Wed, 9 Mar 2016 11:25:51 -0800 Subject: Remove unneccessary depends_on --- var/spack/repos/builtin/packages/thrift/package.py | 1 - 1 file changed, 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/thrift/package.py b/var/spack/repos/builtin/packages/thrift/package.py index ec3b13e563..6430f40e80 100644 --- a/var/spack/repos/builtin/packages/thrift/package.py +++ b/var/spack/repos/builtin/packages/thrift/package.py @@ -27,7 +27,6 @@ class Thrift(Package): # Variant dependencies extends('python', when='+python') - depends_on('python', when='+python') depends_on('zlib', when='+c') depends_on('libevent', when='+c') -- cgit v1.2.3-70-g09d2 From 45ef496dd553e023903b8b4d5bcace59c56eb486 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 9 Mar 2016 11:26:37 -0800 Subject: Add some descriptive language to a list comprehension. --- var/spack/repos/builtin/packages/petsc/package.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 41fd859945..efe172fc08 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -51,6 +51,9 @@ class Petsc(Package): '--with-mpi=0' ] error_message_fmt = '\t{library} support requires "+mpi" to be activated' + + # If mpi is disabled (~mpi), it's an error to have any of these enabled. + # This generates a list of any such errors. errors = [error_message_fmt.format(library=x) for x in ('hdf5', 'hypre', 'parmetis') if ('+'+x) in self.spec] -- cgit v1.2.3-70-g09d2 From 6e82ab1f1501c8b64383f1d9a26d743284f4054f Mon Sep 17 00:00:00 2001 From: Nicolas Richart Date: Wed, 9 Mar 2016 21:18:44 +0100 Subject: change of url for mpfr --- var/spack/repos/builtin/packages/mpfr/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/mpfr/package.py b/var/spack/repos/builtin/packages/mpfr/package.py index a1bd7529cf..7e6e7d5bb6 100644 --- a/var/spack/repos/builtin/packages/mpfr/package.py +++ b/var/spack/repos/builtin/packages/mpfr/package.py @@ -28,8 +28,9 @@ class Mpfr(Package): """The MPFR library is a C library for multiple-precision floating-point computations with correct rounding.""" homepage = "http://www.mpfr.org" - url = "http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.bz2" + url = "https://gforge.inria.fr/frs/download.php/latestfile/159/mpfr-3.1.2.tar.bz2" + version('3.1.4', 'b8a2f6b0e68bef46e53da2ac439e1cf4') version('3.1.3', '5fdfa3cfa5c86514ee4a241a1affa138') version('3.1.2', 'ee2c3ac63bf0c2359bf08fc3ee094c19') -- cgit v1.2.3-70-g09d2 From 23cbc2b1d9dc5816c63f330640105c5435ccdc22 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Tue, 8 Mar 2016 09:44:21 -0700 Subject: + Provide download/build instructions for qt/5.4.2. - This version provides updates to provided cmake scripts that are required for building cmake-gui. + Provide download/build instructions for version 3.5.0. - When building the +qt variant, add a validate function to ensure that qt-5.4.0 is not used (this version of qt has errors related to cmake). --- var/spack/repos/builtin/packages/cmake/package.py | 19 ++++++++++++++++++- var/spack/repos/builtin/packages/qt/package.py | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index f39a681284..806c37a68c 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -30,6 +30,7 @@ class Cmake(Package): homepage = 'https://www.cmake.org' url = 'https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz' + version('3.5.0', '33c5d09d4c33d4ffcc63578a6ba8777e') version('3.4.3', '4cb3ff35b2472aae70f542116d616e63') version('3.4.0', 'cd3034e0a44256a0917e254167217fc8') version('3.3.1', '52638576f4e1e621fed6c3410d3a1b12') @@ -49,8 +50,25 @@ class Cmake(Package): """Handle CMake's version-based custom URLs.""" return 'https://cmake.org/files/v%s/cmake-%s.tar.gz' % (version.up_to(2), version) + def validate(self, spec): + """ + Checks if incompatible versions of qt were specified + + :param spec: spec of the package + :raises RuntimeError: in case of inconsistencies + """ + + print spec + + if '+qt' in spec and spec.satisfies('^qt@5.4.0'): + msg = 'qt-5.4.0 has broken CMake modules.' + raise RuntimeError(msg) + def install(self, spec, prefix): + # Consistency check + self.validate(spec) + # configure, build, install: options = ['--prefix=%s' % prefix] options.append('--parallel=%s' % str(make_jobs)) @@ -65,6 +83,5 @@ class Cmake(Package): options.append('-DCMAKE_USE_OPENSSL=ON') configure(*options) - make() make('install') diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 91afa420c1..ef5f05601f 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -8,6 +8,9 @@ class Qt(Package): list_url = 'http://download.qt-project.org/official_releases/qt/' list_depth = 2 + version('5.4.2', 'fa1c4d819b401b267eb246a543a63ea5', + url='http://download.qt-project.org/official_releases/qt/5.4/5.4.2/single/qt-everywhere-opensource-src-5.4.2.tar.gz') + version('5.4.0', 'e8654e4b37dd98039ba20da7a53877e6', url='http://download.qt-project.org/official_releases/qt/5.4/5.4.0/single/qt-everywhere-opensource-src-5.4.0.tar.gz') -- cgit v1.2.3-70-g09d2 From 267e83d8a70324d9b8a70a86085853dd762c7f93 Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Wed, 9 Mar 2016 21:12:11 -0500 Subject: Added emacs package. --- var/spack/repos/builtin/packages/emacs/package.py | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 var/spack/repos/builtin/packages/emacs/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py new file mode 100644 index 0000000000..e496ffc3d1 --- /dev/null +++ b/var/spack/repos/builtin/packages/emacs/package.py @@ -0,0 +1,36 @@ +# FIXME: +# This is a template package file for Spack. We've conveniently +# put "FIXME" labels next to all the things you'll want to change. +# +# Once you've edited all the FIXME's, delete this whole message, +# save this file, and test out your package like this: +# +# spack install emacs +# +# You can always get back here to change things with: +# +# spack edit emacs +# +# See the spack documentation for more information on building +# packages. +# +from spack import * + +class Emacs(Package): + """FIXME: put a proper description of your package here.""" + # FIXME: add a proper url for your package's homepage here. + homepage = "http://www.example.com" + url = "http://ftp.gnu.org/gnu/emacs/emacs-24.5.tar.gz" + + version('24.5', 'd74b597503a68105e61b5b9f6d065b44') + + # FIXME: Add dependencies if this package requires them. + depends_on('ncurses') + + def install(self, spec, prefix): + # FIXME: Modify the configure line to suit your build system here. + configure('--prefix=%s' % prefix) + + # FIXME: Add logic to build and install here + make() + make("install") -- cgit v1.2.3-70-g09d2 From b701aa10d4b40eda3d5ea3f0c96b5aed7493c7a7 Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Wed, 9 Mar 2016 21:21:25 -0500 Subject: Fixed up --- var/spack/repos/builtin/packages/emacs/package.py | 29 +++++------------------ 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py index e496ffc3d1..09eb05d5a7 100644 --- a/var/spack/repos/builtin/packages/emacs/package.py +++ b/var/spack/repos/builtin/packages/emacs/package.py @@ -1,36 +1,19 @@ -# FIXME: -# This is a template package file for Spack. We've conveniently -# put "FIXME" labels next to all the things you'll want to change. -# -# Once you've edited all the FIXME's, delete this whole message, -# save this file, and test out your package like this: -# -# spack install emacs -# -# You can always get back here to change things with: -# -# spack edit emacs -# -# See the spack documentation for more information on building -# packages. -# from spack import * class Emacs(Package): - """FIXME: put a proper description of your package here.""" - # FIXME: add a proper url for your package's homepage here. - homepage = "http://www.example.com" + """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') - # FIXME: Add dependencies if this package requires them. 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. def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. configure('--prefix=%s' % prefix) - - # FIXME: Add logic to build and install here make() make("install") -- cgit v1.2.3-70-g09d2 From 1fe196f95cc26cac73abe64752ff67b150f4d50a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 2 Mar 2016 22:38:21 -0800 Subject: whitespace and formatting --- lib/spack/spack/preferred_packages.py | 38 +++++++++++----------- lib/spack/spack/spec.py | 8 ++--- var/spack/repos/builtin/packages/python/package.py | 5 +-- 3 files changed, 26 insertions(+), 25 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/preferred_packages.py b/lib/spack/spack/preferred_packages.py index eaea016a85..4ff0f18b31 100644 --- a/lib/spack/spack/preferred_packages.py +++ b/lib/spack/spack/preferred_packages.py @@ -33,8 +33,8 @@ class PreferredPackages(object): self.preferred = spack.config.get_config('packages') self._spec_for_pkgname_cache = {} - #Given a package name, sort component (e.g, version, compiler, ...), and - # a second_key (used by providers), return the list + # Given a package name, sort component (e.g, version, compiler, ...), and + # a second_key (used by providers), return the list def _order_for_package(self, pkgname, component, second_key, test_all=True): pkglist = [pkgname] if test_all: @@ -47,10 +47,10 @@ class PreferredPackages(object): continue return [str(s).strip() for s in order] return [] - - # A generic sorting function. Given a package name and sort - # component, return less-than-0, 0, or greater-than-0 if + + # A generic sorting function. Given a package name and sort + # component, return less-than-0, 0, or greater-than-0 if # a is respectively less-than, equal to, or greater than b. def _component_compare(self, pkgname, component, a, b, reverse_natural_compare, second_key): if a is None: @@ -76,7 +76,7 @@ class PreferredPackages(object): cmp_a = orderlist.index(str(a)) cmp_b = orderlist.index(str(b)) reverse = 1 - + if cmp_a < cmp_b: return -1 * reverse elif cmp_a > cmp_b: @@ -87,7 +87,7 @@ class PreferredPackages(object): # A sorting function for specs. Similar to component_compare, but # a and b are considered to match entries in the sorting list if they - # satisfy the list component. + # satisfy the list component. def _spec_compare(self, pkgname, component, a, b, reverse_natural_compare, second_key): if not a or not a.concrete: return -1 @@ -121,7 +121,7 @@ class PreferredPackages(object): key = (pkgname, component, second_key) if not key in self._spec_for_pkgname_cache: pkglist = self._order_for_package(pkgname, component, second_key) - if not pkglist: + if not pkglist: if component in self._default_order: pkglist = self._default_order[component] if component == 'compiler': @@ -132,9 +132,9 @@ class PreferredPackages(object): self._spec_for_pkgname_cache[key] = [spack.spec.Spec(s) for s in pkglist] return self._spec_for_pkgname_cache[key] - + def provider_compare(self, pkgname, provider_str, a, b): - """Return less-than-0, 0, or greater than 0 if a is respecively less-than, equal-to, or + """Return less-than-0, 0, or greater than 0 if a is respecively less-than, equal-to, or greater-than b. A and b are possible implementations of provider_str. One provider is less-than another if it is preferred over the other. For example, provider_compare('scorep', 'mpi', 'mvapich', 'openmpi') would return -1 if @@ -148,28 +148,28 @@ class PreferredPackages(object): def version_compare(self, pkgname, a, b): - """Return less-than-0, 0, or greater than 0 if version a of pkgname is - respecively less-than, equal-to, or greater-than version b of pkgname. + """Return less-than-0, 0, or greater than 0 if version a of pkgname is + respecively less-than, equal-to, or greater-than version b of pkgname. One version is less-than another if it is preferred over the other.""" return self._spec_compare(pkgname, 'version', a, b, True, None) - + def variant_compare(self, pkgname, a, b): - """Return less-than-0, 0, or greater than 0 if variant a of pkgname is - respecively less-than, equal-to, or greater-than variant b of pkgname. + """Return less-than-0, 0, or greater than 0 if variant a of pkgname is + respecively less-than, equal-to, or greater-than variant b of pkgname. One variant is less-than another if it is preferred over the other.""" return self._component_compare(pkgname, 'variant', a, b, False, None) def architecture_compare(self, pkgname, a, b): - """Return less-than-0, 0, or greater than 0 if architecture a of pkgname is - respecively less-than, equal-to, or greater-than architecture b of pkgname. + """Return less-than-0, 0, or greater than 0 if architecture a of pkgname is + respecively less-than, equal-to, or greater-than architecture b of pkgname. One architecture is less-than another if it is preferred over the other.""" return self._component_compare(pkgname, 'architecture', a, b, False, None) def compiler_compare(self, pkgname, a, b): - """Return less-than-0, 0, or greater than 0 if compiler a of pkgname is - respecively less-than, equal-to, or greater-than compiler b of pkgname. + """Return less-than-0, 0, or greater than 0 if compiler a of pkgname is + respecively less-than, equal-to, or greater-than compiler b of pkgname. One compiler is less-than another if it is preferred over the other.""" return self._spec_compare(pkgname, 'compiler', a, b, False, None) diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 6f55065f01..b8c0d0ef9c 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -428,7 +428,7 @@ class Spec(object): for dep in dep_like: spec = dep if isinstance(dep, Spec) else Spec(dep) self._add_dependency(spec) - + # # Private routines here are called by the parser when building a spec. @@ -1410,7 +1410,7 @@ class Spec(object): self.architecture != other.architecture and self.compiler != other.compiler and \ self.variants != other.variants and self._normal != other._normal and \ self.concrete != other.concrete and self.external != other.external) - + # Local node attributes get copied first. self.name = other.name self.versions = other.versions.copy() @@ -1585,7 +1585,7 @@ class Spec(object): $@ Version with '@' prefix $% Compiler with '%' prefix $%@ Compiler with '%' prefix & compiler version with '@' prefix - $+ Options + $+ Options $= Architecture with '=' prefix $# 7-char prefix of DAG hash with '-' prefix $$ $ @@ -1738,7 +1738,7 @@ class Spec(object): #Package name sort order is not configurable, always goes alphabetical if self.name != other.name: return cmp(self.name, other.name) - + #Package version is second in compare order pkgname = self.name if self.versions != other.versions: diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 58d401244e..dd240d1ea0 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -34,8 +34,9 @@ class Python(Package): env['PYTHONHOME'] = prefix env['MACOSX_DEPLOYMENT_TARGET'] = '10.6' - # Rest of install is pretty standard except setup.py needs to be able to read the CPPFLAGS - # and LDFLAGS as it scans for the library and headers to build + # Rest of install is pretty standard except setup.py needs to + # be able to read the CPPFLAGS and LDFLAGS as it scans for the + # library and headers to build configure_args= [ "--prefix=%s" % prefix, "--with-threads", -- cgit v1.2.3-70-g09d2 From f5e8857c5e44719778e531bcc149c9fe228240b3 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Fri, 11 Mar 2016 09:51:12 -0700 Subject: + Rename variant 'sphinxbuild' to 'doc' as recommended in the discussion of PR#526. Also, remove a debug print statement that was accidentally committed. --- var/spack/repos/builtin/packages/cmake/package.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index 806c37a68c..cc93c7067c 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -39,12 +39,12 @@ class Cmake(Package): variant('ncurses', default=True, description='Enables the build of the ncurses gui') variant('qt', default=False, description='Enables the build of cmake-gui') - variant('sphinxbuild', default=False, description='Enables the generation of html and man page documentation') + variant('doc', default=False, description='Enables the generation of html and man page documentation') depends_on('ncurses', when='+ncurses') depends_on('qt', when='+qt') - depends_on('python@2.7.11:', when='+sphinxbuild') - depends_on('py-sphinx', when='+sphinxbuild') + depends_on('python@2.7.11:', when='+doc') + depends_on('py-sphinx', when='+doc') def url_for_version(self, version): """Handle CMake's version-based custom URLs.""" @@ -58,8 +58,6 @@ class Cmake(Package): :raises RuntimeError: in case of inconsistencies """ - print spec - if '+qt' in spec and spec.satisfies('^qt@5.4.0'): msg = 'qt-5.4.0 has broken CMake modules.' raise RuntimeError(msg) @@ -75,7 +73,7 @@ class Cmake(Package): if '+qt' in spec: options.append('--qt-gui') - if '+sphinxbuild' in spec: + if '+doc' in spec: options.append('--sphinx-html') options.append('--sphinx-man') -- cgit v1.2.3-70-g09d2 From 6ec65cd4ca1e6c2d346c949e21902680f27364c5 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 11 Mar 2016 15:03:37 -0600 Subject: Add GNU Octave package --- var/spack/repos/builtin/packages/octave/package.py | 182 +++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 var/spack/repos/builtin/packages/octave/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/octave/package.py b/var/spack/repos/builtin/packages/octave/package.py new file mode 100644 index 0000000000..6810da6d98 --- /dev/null +++ b/var/spack/repos/builtin/packages/octave/package.py @@ -0,0 +1,182 @@ +from spack import * + +class Octave(Package): + """GNU Octave is a high-level language, primarily intended for numerical + computations. It provides a convenient command line interface for solving + linear and nonlinear problems numerically, and for performing other + numerical experiments using a language that is mostly compatible with + Matlab. It may also be used as a batch-oriented language.""" + + homepage = "https://www.gnu.org/software/octave/" + url = "ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz" + + version('4.0.0' , 'a69f8320a4f20a8480c1b278b1adb799') + + variant('readline', default=True) + variant('arpack', default=False) + variant('curl', default=False) + variant('fftw', default=False) + variant('fltk', default=False) + variant('fontconfig', default=False) + variant('freetype', default=False) + variant('glpk', default=False) + variant('gl2ps', default=False) + variant('gnuplot', default=False) + variant('magick', default=False) + variant('hdf5', default=False) + variant('jdk', default=False) + variant('llvm', default=False) + variant('opengl', default=False) + variant('qhull', default=False) + variant('qrupdate', default=False) + variant('qscintilla', default=False) + variant('qt', default=False) + variant('suiteparse', default=False) + variant('zlib', default=False) + + # Required dependencies + depends_on('blas') + depends_on('lapack') + depends_on('pcre') + + # Strongly recommended dependencies + depends_on('readline', when='+readline') + + # Optional dependencies + depends_on('arpack', when='+arpack') + depends_on('curl', when='+curl') + depends_on('fftw@3', when='+fftw') + depends_on('fltk', when='+fltk') + depends_on('fontconfig', when='+fontconfig') + depends_on('freetype', when='+freetype') + depends_on('glpk', when='+glpk') + #depends_on('gl2ps', when='+gl2ps') + depends_on('gnuplot', when='+gnuplot') + depends_on('ImageMagick', when='+magick') + depends_on('hdf5', when='+hdf5') + depends_on('jdk', when='+jdk') + depends_on('llvm', when='+llvm') + #depends_on('opengl', when='+opengl') + depends_on('qhull', when='+qhull') + #depends_on('qrupdate', when='+qrupdate') + #depends_on('qscintilla', when='+qscintilla) + depends_on('qt', when='+qt') + depends_on('SuiteSparse', when='suitesparse') + depends_on('zlib', when='+zlib') + + + def install(self, spec, prefix): + config_args = [ + "--prefix=%s" % prefix + ] + + # Required dependencies + config_args.extend([ + "--with-blas=%s" % spec['blas'].prefix.lib, + "--with-lapack=%s" % spec['lapack'].prefix.lib + ]) + + # Strongly recommended dependencies + if '+readline' in spec: + config_args.append('--enable-readline') + else: + config_args.append('--disable-readline') + + # Optional dependencies + if '+arpack' in spec: + config_args.extend([ + "--with-arpack-includedir=%s" % spec['arpack'].prefix.include, + "--with-arpack-libdir=%s" % spec['arpack'].prefix.lib + ]) + else: + config_args.append("--without-arpack") + + if '+curl' in spec: + config_args.extend([ + "--with-curl-includedir=%s" % spec['curl'].prefix.include, + "--with-curl-libdir=%s" % spec['curl'].prefix.lib + ]) + else: + config_args.append("--without-curl") + + if '+fftw' in spec: + config_args.extend([ + "--with-fftw3-includedir=%s" % spec['fftw'].prefix.include, + "--with-fftw3-libdir=%s" % spec['fftw'].prefix.lib, + "--with-fftw3f-includedir=%s" % spec['fftw'].prefix.include, + "--with-fftw3f-libdir=%s" % spec['fftw'].prefix.lib + ]) + else: + config_args.extend([ + "--without-fftw3", + "--without-fftw3f" + ]) + + if '+fltk' in spec: + config_args.extend([ + "--with-fltk-prefix=%s" % spec['fltk'].prefix, + "--with-fltk-exec-prefix=%s" % spec['fltk'].prefix + ]) + else: + config_args.append("--without-fltk") + + if '+glpk' in spec: + config_args.extend([ + "--with-glpk-includedir=%s" % spec['glpk'].prefix.include + "--with-glpk-libdir=%s" % spec['glpk'].prefix.lib + ]) + else: + config_args.append("--without-glpk") + + if '+magick' in spec: + config_args.append("--with-magick=%s" % spec['ImageMagick'].prefix.lib) + + if '+hdf5' in spec: + config_args.extend([ + "--with-hdf5-includedir=%s" % spec['hdf5'].prefix.include, + "--with-hdf5-libdir=%s" % spec['hdf5'].prefix.lib + ]) + else: + config_args.append("--without-hdf5") + + if '+jdk' in spec: + config_args.extend([ + "--with-java-homedir=%s" % spec['jdk'].prefix, + "--with-java-includedir=%s" % spec['jdk'].prefix.include, + "--with-java-libdir=%s" % spec['jdk'].prefix.lib + ]) + + #if '~opengl' in spec: + # config_args.extend([ + # "--without-opengl", + # "--without-framework-opengl" + # ]) + + if '+qhull' in spec: + config_args.extend([ + "--with-qhull-includedir=%s" % spec['qhull'].prefix.include, + "--with-qhull-libdir=%s" % spec['qhull'].prefix.lib + ]) + else: + config_args.append("--without-qhull") + + #if '+qrupdate' in spec: + # config_args.extend([ + # "--with-qrupdate-includedir=%s" % spec['qrupdate'].prefix.include, + # "--with-qrupdate-libdir=%s" % spec['qrupdate'].prefix.lib + # ]) + #else: + # config_args.append("--without-qrupdate") + + if '+zlib' in spec: + config_args.extend([ + "--with-z-includedir=%s" % spec['zlib'].prefix.include, + "--with-z-libdir=%s" % spec['zlib'].prefix.lib + ]) + else: + config_args.append("--without-z") + + configure(*config_args) + + make() + make("install") -- cgit v1.2.3-70-g09d2 From 145390c7f3a9de6e679f56dc9b275973a459de91 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 11 Mar 2016 16:57:37 -0600 Subject: Add gl2ps and qrupdate packages --- var/spack/repos/builtin/packages/gl2ps/package.py | 18 ++++++++++++++++ var/spack/repos/builtin/packages/octave/package.py | 24 +++++++++++----------- .../repos/builtin/packages/qrupdate/package.py | 18 ++++++++++++++++ 3 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 var/spack/repos/builtin/packages/gl2ps/package.py create mode 100644 var/spack/repos/builtin/packages/qrupdate/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/gl2ps/package.py b/var/spack/repos/builtin/packages/gl2ps/package.py new file mode 100644 index 0000000000..cb376b3f03 --- /dev/null +++ b/var/spack/repos/builtin/packages/gl2ps/package.py @@ -0,0 +1,18 @@ +from spack import * + +class Gl2ps(Package): + """GL2PS is a C library providing high quality vector output for any + OpenGL application.""" + + homepage = "http://www.geuz.org/gl2ps/" + url = "http://geuz.org/gl2ps/src/gl2ps-1.3.9.tgz" + + version('1.3.9', '377b2bcad62d528e7096e76358f41140') + + depends_on("libpng") + + def install(self, spec, prefix): + cmake('.', *std_cmake_args) + + make() + make("install") diff --git a/var/spack/repos/builtin/packages/octave/package.py b/var/spack/repos/builtin/packages/octave/package.py index 6810da6d98..99847e1dbe 100644 --- a/var/spack/repos/builtin/packages/octave/package.py +++ b/var/spack/repos/builtin/packages/octave/package.py @@ -50,7 +50,7 @@ class Octave(Package): depends_on('fontconfig', when='+fontconfig') depends_on('freetype', when='+freetype') depends_on('glpk', when='+glpk') - #depends_on('gl2ps', when='+gl2ps') + depends_on('gl2ps', when='+gl2ps') depends_on('gnuplot', when='+gnuplot') depends_on('ImageMagick', when='+magick') depends_on('hdf5', when='+hdf5') @@ -58,10 +58,10 @@ class Octave(Package): depends_on('llvm', when='+llvm') #depends_on('opengl', when='+opengl') depends_on('qhull', when='+qhull') - #depends_on('qrupdate', when='+qrupdate') + depends_on('qrupdate', when='+qrupdate') #depends_on('qscintilla', when='+qscintilla) depends_on('qt', when='+qt') - depends_on('SuiteSparse', when='suitesparse') + depends_on('SuiteSparse', when='+suitesparse') depends_on('zlib', when='+zlib') @@ -72,7 +72,7 @@ class Octave(Package): # Required dependencies config_args.extend([ - "--with-blas=%s" % spec['blas'].prefix.lib, + "--with-blas=%s" % spec['blas'].prefix.lib, "--with-lapack=%s" % spec['lapack'].prefix.lib ]) @@ -122,7 +122,7 @@ class Octave(Package): if '+glpk' in spec: config_args.extend([ - "--with-glpk-includedir=%s" % spec['glpk'].prefix.include + "--with-glpk-includedir=%s" % spec['glpk'].prefix.include, "--with-glpk-libdir=%s" % spec['glpk'].prefix.lib ]) else: @@ -160,13 +160,13 @@ class Octave(Package): else: config_args.append("--without-qhull") - #if '+qrupdate' in spec: - # config_args.extend([ - # "--with-qrupdate-includedir=%s" % spec['qrupdate'].prefix.include, - # "--with-qrupdate-libdir=%s" % spec['qrupdate'].prefix.lib - # ]) - #else: - # config_args.append("--without-qrupdate") + if '+qrupdate' in spec: + config_args.extend([ + "--with-qrupdate-includedir=%s" % spec['qrupdate'].prefix.include, + "--with-qrupdate-libdir=%s" % spec['qrupdate'].prefix.lib + ]) + else: + config_args.append("--without-qrupdate") if '+zlib' in spec: config_args.extend([ diff --git a/var/spack/repos/builtin/packages/qrupdate/package.py b/var/spack/repos/builtin/packages/qrupdate/package.py new file mode 100644 index 0000000000..aff44bb2d8 --- /dev/null +++ b/var/spack/repos/builtin/packages/qrupdate/package.py @@ -0,0 +1,18 @@ +from spack import * + +class Qrupdate(Package): + """qrupdate is a Fortran library for fast updates of QR and + Cholesky decompositions.""" + + homepage = "http://sourceforge.net/projects/qrupdate/" + url = "https://downloads.sourceforge.net/qrupdate/qrupdate-1.1.2.tar.gz" + + version('1.1.2', '6d073887c6e858c24aeda5b54c57a8c4') + + depends_on("openblas") + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix) + + make() + make("install") -- cgit v1.2.3-70-g09d2 From 90f2e40ff92077da1f1b9b4d9aa317b89aa07960 Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Fri, 11 Mar 2016 23:28:16 -0500 Subject: Added comment to Emacs. --- var/spack/repos/builtin/packages/emacs/package.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py index 09eb05d5a7..caa264857e 100644 --- a/var/spack/repos/builtin/packages/emacs/package.py +++ b/var/spack/repos/builtin/packages/emacs/package.py @@ -12,6 +12,8 @@ class Emacs(Package): # 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 def install(self, spec, prefix): configure('--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 7cd478418d5b8a204a8e6b9a5307ecf71ea83939 Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Fri, 11 Mar 2016 23:28:36 -0500 Subject: New version of LAPACK --- var/spack/repos/builtin/packages/netlib-lapack/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netlib-lapack/package.py b/var/spack/repos/builtin/packages/netlib-lapack/package.py index fb6b99e27c..741f4af421 100644 --- a/var/spack/repos/builtin/packages/netlib-lapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-lapack/package.py @@ -12,6 +12,7 @@ class NetlibLapack(Package): homepage = "http://www.netlib.org/lapack/" url = "http://www.netlib.org/lapack/lapack-3.5.0.tgz" + version('3.6.0', 'f2f6c67134e851fe189bb3ca1fbb5101') version('3.5.0', 'b1d3e3e425b2e44a06760ff173104bdf') version('3.4.2', '61bf1a8a4469d4bdb7604f5897179478') version('3.4.1', '44c3869c38c8335c2b9c2a8bb276eb55') -- cgit v1.2.3-70-g09d2 From 8b715d9c3fabdf4658ff4c0c500d01f74e7ed64e Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 13 Mar 2016 21:14:41 -0400 Subject: Update tmux --- var/spack/repos/builtin/packages/tmux/package.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/tmux/package.py b/var/spack/repos/builtin/packages/tmux/package.py index 23d36db427..f2067d1366 100644 --- a/var/spack/repos/builtin/packages/tmux/package.py +++ b/var/spack/repos/builtin/packages/tmux/package.py @@ -7,10 +7,11 @@ class Tmux(Package): do a lot more. """ - homepage = "http://tmux.sourceforge.net" - url = "http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.9/tmux-1.9a.tar.gz" + homepage = "http://tmux.github.io" + url = "https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz" version('1.9a', 'b07601711f96f1d260b390513b509a2d') + version('2.1', '74a2855695bccb51b6e301383ad4818c') depends_on('libevent') depends_on('ncurses') -- cgit v1.2.3-70-g09d2 From f45b8b1083e5f628dd31fa4b7b873b6df7119d0e Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 14 Mar 2016 05:02:50 -0700 Subject: Add some tests for packages with multiple virtual dependencies. - Added mock `hypre` package, depends on `lapack` and `blas`. - test cases where some packages provide both `lapack` and `blas`, but others do not. --- lib/spack/spack/test/concretize.py | 29 +++++++++++++++- .../repos/builtin.mock/packages/hypre/package.py | 39 ++++++++++++++++++++++ .../packages/openblas-with-lapack/package.py | 38 +++++++++++++++++++++ 3 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin.mock/packages/hypre/package.py create mode 100644 var/spack/repos/builtin.mock/packages/openblas-with-lapack/package.py (limited to 'var') diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index 07828d8ea6..f264faf17a 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -142,6 +142,34 @@ class ConcretizeTest(MockPackagesTest): for spec in spack.repo.providers_for('mpi@3'))) + def test_concretize_two_virtuals(self): + """Test a package with multiple virtual dependencies.""" + s = Spec('hypre').concretize() + + + def test_concretize_two_virtuals_with_one_bound(self): + """Test a package with multiple virtual dependencies and one preset.""" + s = Spec('hypre ^openblas').concretize() + + + def test_concretize_two_virtuals_with_two_bound(self): + """Test a package with multiple virtual dependencies and two of them preset.""" + s = Spec('hypre ^openblas ^netlib-lapack').concretize() + + + def test_concretize_two_virtuals_with_dual_provider(self): + """Test a package with multiple virtual dependencies and force a provider + that provides both.""" + s = Spec('hypre ^openblas-with-lapack').concretize() + + + def test_concretize_two_virtuals_with_dual_provider_and_a_conflict(self): + """Test a package with multiple virtual dependencies and force a provider + that provides both, and another conflicting package that provides one.""" + s = Spec('hypre ^openblas-with-lapack ^netlib-lapack') + self.assertRaises(spack.spec.MultipleProviderError, s.concretize) + + def test_virtual_is_fully_expanded_for_callpath(self): # force dependence on fake "zmpi" by asking for MPI 10.0 spec = Spec('callpath ^mpi@10.0') @@ -281,4 +309,3 @@ class ConcretizeTest(MockPackagesTest): Spec('d')), Spec('e')) self.assertEqual(None, find_spec(s['b'], lambda s: '+foo' in s)) - diff --git a/var/spack/repos/builtin.mock/packages/hypre/package.py b/var/spack/repos/builtin.mock/packages/hypre/package.py new file mode 100644 index 0000000000..f69f16d2cc --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/hypre/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013-2015, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written 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 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 +############################################################################## +from spack import * + +class Hypre(Package): + """Hypre is included here as an example of a package that depends on + both LAPACK and BLAS.""" + homepage = "http://www.openblas.net" + url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz" + + version('0.2.15', 'b1190f3d3471685f17cfd1ec1d252ac9') + + depends_on('lapack') + depends_on('blas') + + def install(self, spec, prefix): + pass diff --git a/var/spack/repos/builtin.mock/packages/openblas-with-lapack/package.py b/var/spack/repos/builtin.mock/packages/openblas-with-lapack/package.py new file mode 100644 index 0000000000..509bfb71e5 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/openblas-with-lapack/package.py @@ -0,0 +1,38 @@ +############################################################################## +# Copyright (c) 2013-2015, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written 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 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 +############################################################################## +from spack import * + +class OpenblasWithLapack(Package): + """Dummy version of OpenBLAS that also provides LAPACK, for testing.""" + homepage = "http://www.openblas.net" + url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz" + + version('0.2.15', 'b1190f3d3471685f17cfd1ec1d252ac9') + + provides('lapack') + provides('blas') + + def install(self, spec, prefix): + pass -- cgit v1.2.3-70-g09d2 From 0d9a6d3c25de2b8490622c49362b09f706459bc0 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 14 Mar 2016 14:19:30 -0500 Subject: Updates to qrupdate --- var/spack/repos/builtin/packages/octave/package.py | 17 +++++++++-------- var/spack/repos/builtin/packages/qrupdate/package.py | 10 +++++----- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/octave/package.py b/var/spack/repos/builtin/packages/octave/package.py index 99847e1dbe..38b355159d 100644 --- a/var/spack/repos/builtin/packages/octave/package.py +++ b/var/spack/repos/builtin/packages/octave/package.py @@ -12,6 +12,7 @@ class Octave(Package): version('4.0.0' , 'a69f8320a4f20a8480c1b278b1adb799') + # Variants variant('readline', default=True) variant('arpack', default=False) variant('curl', default=False) @@ -45,7 +46,7 @@ class Octave(Package): # Optional dependencies depends_on('arpack', when='+arpack') depends_on('curl', when='+curl') - depends_on('fftw@3', when='+fftw') + depends_on('fftw', when='+fftw') depends_on('fltk', when='+fltk') depends_on('fontconfig', when='+fontconfig') depends_on('freetype', when='+freetype') @@ -56,10 +57,10 @@ class Octave(Package): depends_on('hdf5', when='+hdf5') depends_on('jdk', when='+jdk') depends_on('llvm', when='+llvm') - #depends_on('opengl', when='+opengl') + #depends_on('opengl', when='+opengl') # TODO: add package depends_on('qhull', when='+qhull') depends_on('qrupdate', when='+qrupdate') - #depends_on('qscintilla', when='+qscintilla) + #depends_on('qscintilla', when='+qscintilla) # TODO: add package depends_on('qt', when='+qt') depends_on('SuiteSparse', when='+suitesparse') depends_on('zlib', when='+zlib') @@ -146,11 +147,11 @@ class Octave(Package): "--with-java-libdir=%s" % spec['jdk'].prefix.lib ]) - #if '~opengl' in spec: - # config_args.extend([ - # "--without-opengl", - # "--without-framework-opengl" - # ]) + if '~opengl' in spec: + config_args.extend([ + "--without-opengl", + "--without-framework-opengl" + ]) if '+qhull' in spec: config_args.extend([ diff --git a/var/spack/repos/builtin/packages/qrupdate/package.py b/var/spack/repos/builtin/packages/qrupdate/package.py index aff44bb2d8..5374d02c97 100644 --- a/var/spack/repos/builtin/packages/qrupdate/package.py +++ b/var/spack/repos/builtin/packages/qrupdate/package.py @@ -9,10 +9,10 @@ class Qrupdate(Package): version('1.1.2', '6d073887c6e858c24aeda5b54c57a8c4') - depends_on("openblas") + depends_on("blas") + depends_on("lapack") def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") + # Build static and dynamic libraries + make("lib", "solib") + make("install", "PREFIX=%s" % prefix) -- cgit v1.2.3-70-g09d2 From bcea1df01ce145aea5e49eaaceb7a063b44ddf80 Mon Sep 17 00:00:00 2001 From: alalazo Date: Tue, 15 Mar 2016 10:49:33 +0100 Subject: environment : refactoreded set_build_environment_variables --- lib/spack/spack/build_environment.py | 56 +++++++++++----------- lib/spack/spack/environment.py | 3 ++ .../repos/builtin/packages/mvapich2/package.py | 2 +- 3 files changed, 33 insertions(+), 28 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index e91a8a1997..770e191ac9 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -35,7 +35,7 @@ import sys import spack from llnl.util.filesystem import * -from spack.environment import EnvironmentModifications, apply_environment_modifications +from spack.environment import EnvironmentModifications, apply_environment_modifications, concatenate_paths from spack.util.environment import * from spack.util.executable import Executable, which @@ -127,44 +127,45 @@ def set_build_environment_variables(pkg): # handled by putting one in the /case-insensitive # directory. Add that to the path too. env_paths = [] - def add_env_path(path): - env_paths.append(path) - ci = join_path(path, 'case-insensitive') - if os.path.isdir(ci): env_paths.append(ci) - add_env_path(spack.build_env_path) - add_env_path(join_path(spack.build_env_path, pkg.compiler.name)) - - path_put_first("PATH", env_paths) - path_set(SPACK_ENV_PATH, env_paths) - - # Prefixes of all of the package's dependencies go in - # SPACK_DEPENDENCIES + for item in [spack.build_env_path, join_path(spack.build_env_path, pkg.compiler.name)]: + env_paths.append(item) + ci = join_path(item, 'case-insensitive') + if os.path.isdir(ci): + env_paths.append(ci) + + env = EnvironmentModifications() + for item in reversed(env_paths): + env.prepend_path('PATH', item) + env.set_env(SPACK_ENV_PATH, concatenate_paths(env_paths)) + + # Prefixes of all of the package's dependencies go in SPACK_DEPENDENCIES dep_prefixes = [d.prefix for d in pkg.spec.traverse(root=False)] - path_set(SPACK_DEPENDENCIES, dep_prefixes) + env.set_env(SPACK_DEPENDENCIES, concatenate_paths(dep_prefixes)) + env.set_env('CMAKE_PREFIX_PATH', concatenate_paths(dep_prefixes)) # Add dependencies to CMAKE_PREFIX_PATH # Install prefix - os.environ[SPACK_PREFIX] = pkg.prefix + env.set_env(SPACK_PREFIX, pkg.prefix) # Install root prefix - os.environ[SPACK_INSTALL] = spack.install_path + env.set_env(SPACK_INSTALL, spack.install_path) # Remove these vars from the environment during build because they # can affect how some packages find libraries. We want to make # sure that builds never pull in unintended external dependencies. - pop_keys(os.environ, "LD_LIBRARY_PATH", "LD_RUN_PATH", "DYLD_LIBRARY_PATH") + env.unset_env('LD_LIBRARY_PATH') + env.unset_env('LD_RUN_PATH') + env.unset_env('DYLD_LIBRARY_PATH') # Add bin directories from dependencies to the PATH for the build. - bin_dirs = ['%s/bin' % prefix for prefix in dep_prefixes] - path_put_first('PATH', [bin for bin in bin_dirs if os.path.isdir(bin)]) + bin_dirs = reversed(filter(os.path.isdir, ['%s/bin' % prefix for prefix in dep_prefixes])) + for item in bin_dirs: + env.prepend_path('PATH', item) # Working directory for the spack command itself, for debug logs. if spack.debug: - os.environ[SPACK_DEBUG] = "TRUE" - os.environ[SPACK_SHORT_SPEC] = pkg.spec.short_spec - os.environ[SPACK_DEBUG_LOG_DIR] = spack.spack_working_dir - - # Add dependencies to CMAKE_PREFIX_PATH - path_set("CMAKE_PREFIX_PATH", dep_prefixes) + env.set_env(SPACK_DEBUG, 'TRUE') + env.set_env(SPACK_SHORT_SPEC, pkg.spec.short_spec) + env.set_env(SPACK_DEBUG_LOG_DIR, spack.spack_working_dir) # Add any pkgconfig directories to PKG_CONFIG_PATH pkg_config_dirs = [] @@ -173,8 +174,9 @@ def set_build_environment_variables(pkg): pcdir = join_path(p, libdir, 'pkgconfig') if os.path.isdir(pcdir): pkg_config_dirs.append(pcdir) - path_set("PKG_CONFIG_PATH", pkg_config_dirs) + env.set_env('PKG_CONFIG_PATH', concatenate_paths(pkg_config_dirs)) + return env def set_module_variables_for_package(pkg, m): """Populate the module scope of install() with some useful functions. @@ -269,8 +271,8 @@ def setup_package(pkg): """Execute all environment setup routines.""" env = EnvironmentModifications() env.extend(set_compiler_environment_variables(pkg)) + env.extend(set_build_environment_variables(pkg)) apply_environment_modifications(env) - set_build_environment_variables(pkg) # If a user makes their own package repo, e.g. # spack.repos.mystuff.libelf.Libelf, and they inherit from # an existing class like spack.repos.original.libelf.Libelf, diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index 3b73f1c7a2..18fef1ef12 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -146,6 +146,9 @@ class EnvironmentModifications(object): self.env_modifications.append(item) +def concatenate_paths(paths): + return ':'.join(str(item) for item in paths) + def validate_environment_modifications(env): modifications = collections.defaultdict(list) for item in env: diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py index af5ed1b088..e4e95f92af 100644 --- a/var/spack/repos/builtin/packages/mvapich2/package.py +++ b/var/spack/repos/builtin/packages/mvapich2/package.py @@ -123,7 +123,7 @@ class Mvapich2(Package): count += 1 if count > 1: raise RuntimeError('network variants are mutually exclusive (only one can be selected at a time)') - + network_options = [] # From here on I can suppose that only one variant has been selected if self.enabled(Mvapich2.PSM) in spec: network_options = ["--with-device=ch3:psm"] -- cgit v1.2.3-70-g09d2 From c85888eb5763d453af7b7255b6d8c3461082362f Mon Sep 17 00:00:00 2001 From: alalazo Date: Tue, 15 Mar 2016 13:36:41 +0100 Subject: package : added `environment_modifications` --- lib/spack/spack/build_environment.py | 7 ++++--- lib/spack/spack/package.py | 4 ++++ var/spack/repos/builtin/packages/mpich/package.py | 16 ++++++++++------ .../builtin/packages/netlib-scalapack/package.py | 3 +-- .../repos/builtin/packages/openmpi/package.py | 14 ++++++++------ var/spack/repos/builtin/packages/python/package.py | 20 +++++++++++--------- var/spack/repos/builtin/packages/qt/package.py | 12 +++++++----- var/spack/repos/builtin/packages/ruby/package.py | 22 +++++++++++++--------- 8 files changed, 58 insertions(+), 40 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 770e191ac9..d321a0e495 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -178,6 +178,7 @@ def set_build_environment_variables(pkg): return env + def set_module_variables_for_package(pkg, m): """Populate the module scope of install() with some useful functions. This makes things easier for package writers. @@ -272,7 +273,6 @@ def setup_package(pkg): env = EnvironmentModifications() env.extend(set_compiler_environment_variables(pkg)) env.extend(set_build_environment_variables(pkg)) - apply_environment_modifications(env) # If a user makes their own package repo, e.g. # spack.repos.mystuff.libelf.Libelf, and they inherit from # an existing class like spack.repos.original.libelf.Libelf, @@ -284,8 +284,9 @@ def setup_package(pkg): # Allow dependencies to set up environment as well. for dep_spec in pkg.spec.traverse(root=False): - dep_spec.package.setup_dependent_environment( - pkg.module, dep_spec, pkg.spec) + env.extend(dep_spec.package.environment_modifications(pkg.module, dep_spec, pkg.spec)) + dep_spec.package.setup_dependent_environment(pkg.module, dep_spec, pkg.spec) + apply_environment_modifications(env) def fork(pkg, function): diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 696adaf896..224d7f8f4b 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -63,6 +63,7 @@ import spack.build_environment import spack.url import spack.util.web import spack.fetch_strategy as fs +from spack.environment import EnvironmentModifications from spack.version import * from spack.stage import Stage, ResourceStage, StageComposite from spack.util.compression import allowed_archive, extension @@ -983,6 +984,9 @@ class Package(object): fromlist=[self.__class__.__name__]) + def environment_modifications(self, module, spec, dependent_spec): + return EnvironmentModifications() + def setup_dependent_environment(self, module, spec, dependent_spec): """Called before the install() method of dependents. diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index e2b3654c19..c85e8febf3 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -46,14 +46,18 @@ class Mpich(Package): provides('mpi@:3.0', when='@3:') provides('mpi@:1.3', when='@1:') + def environment_modifications(self, module, spec, dependent_spec): + env = super(Mpich, self).environment_modifications(module, spec, dependent_spec) + env.set_env('MPICH_CC', os.environ['CC']) + env.set_env('MPICH_CXX', os.environ['CXX']) + env.set_env('MPICH_F77', os.environ['F77']) + env.set_env('MPICH_F90', os.environ['FC']) + env.set_env('MPICH_FC', os.environ['FC']) + return env + def setup_dependent_environment(self, module, spec, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" - os.environ['MPICH_CC'] = os.environ['CC'] - os.environ['MPICH_CXX'] = os.environ['CXX'] - os.environ['MPICH_F77'] = os.environ['F77'] - os.environ['MPICH_F90'] = os.environ['FC'] - os.environ['MPICH_FC'] = os.environ['FC'] - + # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers? module.mpicc = join_path(self.prefix.bin, 'mpicc') def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 22d538560e..6dbf367475 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -46,5 +46,4 @@ class NetlibScalapack(Package): spec['scalapack'].fc_link = '-L%s -lscalapack' % spec['scalapack'].prefix.lib spec['scalapack'].cc_link = spec['scalapack'].fc_link - spec['scalapack'].libraries = [join_path(spec['scalapack'].prefix.lib, - 'libscalapack%s' % lib_suffix)] + spec['scalapack'].libraries = [join_path(spec['scalapack'].prefix.lib, 'libscalapack%s' % lib_suffix)] diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index e4484af8c5..83a3fe7a4f 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -41,12 +41,14 @@ class Openmpi(Package): def url_for_version(self, version): return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version) - def setup_dependent_environment(self, module, spec, dep_spec): - """For dependencies, make mpicc's use spack wrapper.""" - os.environ['OMPI_CC'] = 'cc' - os.environ['OMPI_CXX'] = 'c++' - os.environ['OMPI_FC'] = 'f90' - os.environ['OMPI_F77'] = 'f77' + def environment_modifications(self, module, spec, dependent_spec): + env = super(Openmpi, self).environment_modifications(module, spec, dependent_spec) + # FIXME : the compilers should point to the current wrappers, not to generic cc etc. + env.set_env('OMPI_CC', 'cc') + env.set_env('OMPI_CXX', 'c++') + env.set_env('OMPI_FC', 'f90') + env.set_env('OMPI_F77', 'f77') + return env def install(self, spec, prefix): config_args = ["--prefix=%s" % prefix, diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index dd240d1ea0..39ced0a120 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -90,6 +90,17 @@ class Python(Package): return os.path.join(self.python_lib_dir, 'site-packages') + def environment_modifications(self, module, spec, dependent_spec): + env = super(Python, self).environment_modifications(module, spec, dependent_spec) + # Set PYTHONPATH to include site-packages dir for the + # extension and any other python extensions it depends on. + python_paths = [] + for d in ext_spec.traverse(): + if d.package.extends(self.spec): + python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) + env.set_env['PYTHONPATH'] = ':'.join(python_paths) + + def setup_dependent_environment(self, module, spec, ext_spec): """Called before python modules' install() methods. @@ -111,15 +122,6 @@ class Python(Package): # Make the site packages directory if it does not exist already. mkdirp(module.site_packages_dir) - # Set PYTHONPATH to include site-packages dir for the - # extension and any other python extensions it depends on. - python_paths = [] - for d in ext_spec.traverse(): - if d.package.extends(self.spec): - python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) - os.environ['PYTHONPATH'] = ':'.join(python_paths) - - # ======================================================================== # Handle specifics of activating and deactivating python modules. # ======================================================================== diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 91afa420c1..373623cd95 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -52,11 +52,13 @@ class Qt(Package): depends_on("mesa", when='@4:+mesa') depends_on("libxcb") - - def setup_dependent_environment(self, module, spec, dep_spec): - """Dependencies of Qt find it using the QTDIR environment variable.""" - os.environ['QTDIR'] = self.prefix - + def environment_modifications(self, module, spec, dep_spec): + """ + Dependencies of Qt find it using the QTDIR environment variable + """ + env = super(Qt, self).environment_modifications(module, spec, dep_spec) + env.set_env['QTDIR'] = self.prefix + return env def patch(self): if self.spec.satisfies('@4'): diff --git a/var/spack/repos/builtin/packages/ruby/package.py b/var/spack/repos/builtin/packages/ruby/package.py index 6b6242362c..9ec0afa268 100644 --- a/var/spack/repos/builtin/packages/ruby/package.py +++ b/var/spack/repos/builtin/packages/ruby/package.py @@ -15,10 +15,21 @@ class Ruby(Package): def install(self, spec, prefix): configure("--prefix=%s" % prefix) - make() make("install") + def environment_modifications(self, module, spec, ext_spec): + env = super(Ruby, self).environment_modifications(module, spec, ext_spec) + # Set GEM_PATH to include dependent gem directories + ruby_paths = [] + for d in ext_spec.traverse(): + if d.package.extends(self.spec): + ruby_paths.append(d.prefix) + env.set_env('GEM_PATH', concatenate_paths(ruby_paths)) + # The actual installation path for this gem + env.set_env('GEM_HOME', ext_spec.prefix) + return env + def setup_dependent_environment(self, module, spec, ext_spec): """Called before ruby modules' install() methods. Sets GEM_HOME and GEM_PATH to values appropriate for the package being built. @@ -31,11 +42,4 @@ class Ruby(Package): module.ruby = Executable(join_path(spec.prefix.bin, 'ruby')) module.gem = Executable(join_path(spec.prefix.bin, 'gem')) - # Set GEM_PATH to include dependent gem directories - ruby_paths = [] - for d in ext_spec.traverse(): - if d.package.extends(self.spec): - ruby_paths.append(d.prefix) - os.environ['GEM_PATH'] = ':'.join(ruby_paths) - # The actual installation path for this gem - os.environ['GEM_HOME'] = ext_spec.prefix + -- cgit v1.2.3-70-g09d2 From 572cb93bf8131d222d2d08bca13fd9de6fded1f4 Mon Sep 17 00:00:00 2001 From: alalazo Date: Tue, 15 Mar 2016 14:05:30 +0100 Subject: package : renamed `setup_dependent_environment` to `module_modifications` --- lib/spack/spack/build_environment.py | 4 ++-- lib/spack/spack/package.py | 4 ++-- var/spack/repos/builtin/packages/mpich/package.py | 6 +++--- .../repos/builtin/packages/netlib-scalapack/package.py | 2 +- var/spack/repos/builtin/packages/openmpi/package.py | 4 ++-- var/spack/repos/builtin/packages/python/package.py | 10 ++++------ var/spack/repos/builtin/packages/qt/package.py | 7 ++----- var/spack/repos/builtin/packages/ruby/package.py | 13 ++++++------- 8 files changed, 22 insertions(+), 28 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index d321a0e495..e86a7c413a 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -284,8 +284,8 @@ def setup_package(pkg): # Allow dependencies to set up environment as well. for dep_spec in pkg.spec.traverse(root=False): - env.extend(dep_spec.package.environment_modifications(pkg.module, dep_spec, pkg.spec)) - dep_spec.package.setup_dependent_environment(pkg.module, dep_spec, pkg.spec) + dep_spec.package.module_modifications(pkg.module, dep_spec, pkg.spec) + env.extend(dep_spec.package.environment_modifications(pkg.spec)) apply_environment_modifications(env) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 224d7f8f4b..c1a5c912be 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -984,10 +984,10 @@ class Package(object): fromlist=[self.__class__.__name__]) - def environment_modifications(self, module, spec, dependent_spec): + def environment_modifications(self, dependent_spec): return EnvironmentModifications() - def setup_dependent_environment(self, module, spec, dependent_spec): + def module_modifications(self, module, spec, dependent_spec): """Called before the install() method of dependents. Default implementation does nothing, but this can be diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index c85e8febf3..d298981c92 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -46,8 +46,8 @@ class Mpich(Package): provides('mpi@:3.0', when='@3:') provides('mpi@:1.3', when='@1:') - def environment_modifications(self, module, spec, dependent_spec): - env = super(Mpich, self).environment_modifications(module, spec, dependent_spec) + def environment_modifications(self, dependent_spec): + env = super(Mpich, self).environment_modifications(dependent_spec) env.set_env('MPICH_CC', os.environ['CC']) env.set_env('MPICH_CXX', os.environ['CXX']) env.set_env('MPICH_F77', os.environ['F77']) @@ -55,7 +55,7 @@ class Mpich(Package): env.set_env('MPICH_FC', os.environ['FC']) return env - def setup_dependent_environment(self, module, spec, dep_spec): + def module_modifications(self, module, spec, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers? module.mpicc = join_path(self.prefix.bin, 'mpicc') diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 6dbf367475..ecdea46442 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -40,7 +40,7 @@ class NetlibScalapack(Package): make() make("install") - def setup_dependent_environment(self, module, spec, dependent_spec): + def module_modifications(self, module, spec, dependent_spec): # TODO treat OS that are not Linux... lib_suffix = '.so' if '+shared' in spec['scalapack'] else '.a' diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 83a3fe7a4f..3a14170457 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -41,8 +41,8 @@ class Openmpi(Package): def url_for_version(self, version): return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version) - def environment_modifications(self, module, spec, dependent_spec): - env = super(Openmpi, self).environment_modifications(module, spec, dependent_spec) + def environment_modifications(self, dependent_spec): + env = super(Openmpi, self).environment_modifications(dependent_spec) # FIXME : the compilers should point to the current wrappers, not to generic cc etc. env.set_env('OMPI_CC', 'cc') env.set_env('OMPI_CXX', 'c++') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 39ced0a120..307cec726b 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -89,19 +89,17 @@ class Python(Package): def site_packages_dir(self): return os.path.join(self.python_lib_dir, 'site-packages') - - def environment_modifications(self, module, spec, dependent_spec): - env = super(Python, self).environment_modifications(module, spec, dependent_spec) + def environment_modifications(self, extension_spec): + env = super(Python, self).environment_modifications(extension_spec) # Set PYTHONPATH to include site-packages dir for the # extension and any other python extensions it depends on. python_paths = [] - for d in ext_spec.traverse(): + for d in extension_spec.traverse(): if d.package.extends(self.spec): python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) env.set_env['PYTHONPATH'] = ':'.join(python_paths) - - def setup_dependent_environment(self, module, spec, ext_spec): + def module_modifications(self, module, spec, ext_spec): """Called before python modules' install() methods. In most cases, extensions will only need to have one line:: diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 373623cd95..8391ded3e0 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -52,11 +52,8 @@ class Qt(Package): depends_on("mesa", when='@4:+mesa') depends_on("libxcb") - def environment_modifications(self, module, spec, dep_spec): - """ - Dependencies of Qt find it using the QTDIR environment variable - """ - env = super(Qt, self).environment_modifications(module, spec, dep_spec) + def environment_modifications(self, dependent_spec): + env = super(Qt, self).environment_modifications(dependent_spec) env.set_env['QTDIR'] = self.prefix return env diff --git a/var/spack/repos/builtin/packages/ruby/package.py b/var/spack/repos/builtin/packages/ruby/package.py index 9ec0afa268..9caea30ef4 100644 --- a/var/spack/repos/builtin/packages/ruby/package.py +++ b/var/spack/repos/builtin/packages/ruby/package.py @@ -1,6 +1,5 @@ from spack import * -import spack -import os + class Ruby(Package): """A dynamic, open source programming language with a focus on @@ -18,19 +17,19 @@ class Ruby(Package): make() make("install") - def environment_modifications(self, module, spec, ext_spec): - env = super(Ruby, self).environment_modifications(module, spec, ext_spec) + def environment_modifications(self, extension_spec): + env = super(Ruby, self).environment_modifications(extension_spec) # Set GEM_PATH to include dependent gem directories ruby_paths = [] - for d in ext_spec.traverse(): + for d in extension_spec.traverse(): if d.package.extends(self.spec): ruby_paths.append(d.prefix) env.set_env('GEM_PATH', concatenate_paths(ruby_paths)) # The actual installation path for this gem - env.set_env('GEM_HOME', ext_spec.prefix) + env.set_env('GEM_HOME', extension_spec.prefix) return env - def setup_dependent_environment(self, module, spec, ext_spec): + def module_modifications(self, module, spec, ext_spec): """Called before ruby modules' install() methods. Sets GEM_HOME and GEM_PATH to values appropriate for the package being built. -- cgit v1.2.3-70-g09d2 From 68d22253eca40bc4223234d6c26204f292be6a0c Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 15 Mar 2016 17:22:48 -0700 Subject: Add sanity checks to the libelf build. --- var/spack/repos/builtin/packages/libelf/package.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/libelf/package.py b/var/spack/repos/builtin/packages/libelf/package.py index 29bc21b65c..0fcb56c164 100644 --- a/var/spack/repos/builtin/packages/libelf/package.py +++ b/var/spack/repos/builtin/packages/libelf/package.py @@ -38,6 +38,9 @@ class Libelf(Package): provides('elf') + sanity_check_files = ['include/libelf.h'] + sanity_check_dirs = ['lib'] + def install(self, spec, prefix): configure("--prefix=" + prefix, "--enable-shared", -- cgit v1.2.3-70-g09d2 From b45ec3f04e3627dbe3633239560873ae01bf3beb Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 16 Mar 2016 10:55:28 +0100 Subject: environment : simplified modification of the environment --- lib/spack/spack/build_environment.py | 12 +++-- lib/spack/spack/cmd/module.py | 2 +- lib/spack/spack/environment.py | 58 +++++++++++----------- lib/spack/spack/test/environment.py | 12 +++-- lib/spack/spack/util/environment.py | 2 +- var/spack/repos/builtin/packages/python/package.py | 1 + 6 files changed, 47 insertions(+), 40 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index e86a7c413a..e5d256a2e0 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -35,7 +35,7 @@ import sys import spack from llnl.util.filesystem import * -from spack.environment import EnvironmentModifications, apply_environment_modifications, concatenate_paths +from spack.environment import EnvironmentModifications, concatenate_paths from spack.util.environment import * from spack.util.executable import Executable, which @@ -283,10 +283,12 @@ def setup_package(pkg): set_module_variables_for_package(pkg, mod) # Allow dependencies to set up environment as well. - for dep_spec in pkg.spec.traverse(root=False): - dep_spec.package.module_modifications(pkg.module, dep_spec, pkg.spec) - env.extend(dep_spec.package.environment_modifications(pkg.spec)) - apply_environment_modifications(env) + for dependency_spec in pkg.spec.traverse(root=False): + dependency_spec.package.module_modifications(pkg.module, dependency_spec, pkg.spec) + env.extend(dependency_spec.package.environment_modifications(pkg.spec)) + # TODO : implement validation + #validate(env) + env.apply_modifications() def fork(pkg, function): diff --git a/lib/spack/spack/cmd/module.py b/lib/spack/spack/cmd/module.py index 1d6867c1d9..315d9fc926 100644 --- a/lib/spack/spack/cmd/module.py +++ b/lib/spack/spack/cmd/module.py @@ -80,7 +80,7 @@ def module_find(mtype, spec_array): if not os.path.isfile(mod.file_name): tty.die("No %s module is installed for %s" % (mtype, spec)) - print mod.use_name + print(mod.use_name) def module_refresh(): diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index 5a68e10c99..b557bf0bbc 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -158,41 +158,43 @@ class EnvironmentModifications(object): item = RemovePath(name, path, **kwargs) self.env_modifications.append(item) + def group_by_name(self): + """ + Returns a dict of the modifications grouped by variable name + + Returns: + dict mapping the environment variable name to the modifications to be done on it + """ + modifications = collections.defaultdict(list) + for item in self: + modifications[item.name].append(item) + return modifications + + def clear(self): + """ + Clears the current list of modifications + """ + self.env_modifications.clear() + + def apply_modifications(self): + """ + Applies the modifications and clears the list + """ + modifications = self.group_by_name() + # Apply the modifications to the environment variables one variable at a time + for name, actions in sorted(modifications.items()): + for x in actions: + x.execute() + def concatenate_paths(paths): """ - Concatenates an iterable of paths into a column separated string + Concatenates an iterable of paths into a string of column separated paths Args: paths: iterable of paths Returns: - column separated string + string """ return ':'.join(str(item) for item in paths) - - -def validate_environment_modifications(env): - modifications = collections.defaultdict(list) - for item in env: - modifications[item.name].append(item) - # TODO : once we organized the modifications into a dictionary that maps an environment variable - # TODO : to a list of action to be done on it, we may easily spot inconsistencies and warn the user if - # TODO : something suspicious is happening - return modifications - - -def apply_environment_modifications(env): - """ - Modifies the current environment according to the request in env - - Args: - env: object storing modifications to the environment - """ - modifications = validate_environment_modifications(env) - - # Cycle over the environment variables that will be modified - for variable, actions in modifications.items(): - # Execute all the actions in the order they were issued - for x in actions: - x.execute() diff --git a/lib/spack/spack/test/environment.py b/lib/spack/spack/test/environment.py index f44282d6f3..d0b093b054 100644 --- a/lib/spack/spack/test/environment.py +++ b/lib/spack/spack/test/environment.py @@ -1,6 +1,6 @@ import unittest import os -from spack.environment import EnvironmentModifications, apply_environment_modifications +from spack.environment import EnvironmentModifications class EnvironmentTest(unittest.TestCase): @@ -15,7 +15,7 @@ class EnvironmentTest(unittest.TestCase): env = EnvironmentModifications() env.set_env('A', 'dummy value') env.set_env('B', 3) - apply_environment_modifications(env) + env.apply_modifications() self.assertEqual('dummy value', os.environ['A']) self.assertEqual(str(3), os.environ['B']) @@ -23,7 +23,7 @@ class EnvironmentTest(unittest.TestCase): env = EnvironmentModifications() self.assertEqual('foo', os.environ['UNSET_ME']) env.unset_env('UNSET_ME') - apply_environment_modifications(env) + env.apply_modifications() self.assertRaises(KeyError, os.environ.__getitem__, 'UNSET_ME') def test_path_manipulation(self): @@ -43,7 +43,7 @@ class EnvironmentTest(unittest.TestCase): env.remove_path('REMOVE_PATH_LIST', '/remove/this') env.remove_path('REMOVE_PATH_LIST', '/duplicate/') - apply_environment_modifications(env) + env.apply_modifications() self.assertEqual('/path/first:/path/second:/path/third:/path/last', os.environ['PATH_LIST']) self.assertEqual('/path/first:/path/middle:/path/last', os.environ['EMPTY_PATH_LIST']) self.assertEqual('/path/first:/path/middle:/path/last', os.environ['NEWLY_CREATED_PATH_LIST']) @@ -52,7 +52,9 @@ class EnvironmentTest(unittest.TestCase): def test_extra_arguments(self): env = EnvironmentModifications() env.set_env('A', 'dummy value', who='Pkg1') - apply_environment_modifications(env) + for x in env: + assert hasattr(x, 'who') + env.apply_modifications() self.assertEqual('dummy value', os.environ['A']) def test_extend(self): diff --git a/lib/spack/spack/util/environment.py b/lib/spack/spack/util/environment.py index 00cda8d508..1485992b0f 100644 --- a/lib/spack/spack/util/environment.py +++ b/lib/spack/spack/util/environment.py @@ -64,5 +64,5 @@ def path_put_first(var_name, directories): def dump_environment(path): """Dump the current environment out to a file.""" with open(path, 'w') as env_file: - for key,val in sorted(os.environ.items()): + for key, val in sorted(os.environ.items()): env_file.write("%s=%s\n" % (key, val)) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 307cec726b..2f9948d451 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -98,6 +98,7 @@ class Python(Package): if d.package.extends(self.spec): python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) env.set_env['PYTHONPATH'] = ':'.join(python_paths) + return env def module_modifications(self, module, spec, ext_spec): """Called before python modules' install() methods. -- cgit v1.2.3-70-g09d2 From 9c2996667433e4f69eb25cce2d74a94caeb1646c Mon Sep 17 00:00:00 2001 From: Nicolas Richart Date: Wed, 16 Mar 2016 12:57:17 +0100 Subject: Change urls in binutils to help 'spack checksum/versions' + adding latest version --- var/spack/repos/builtin/packages/binutils/package.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py index de04221e33..897539a439 100644 --- a/var/spack/repos/builtin/packages/binutils/package.py +++ b/var/spack/repos/builtin/packages/binutils/package.py @@ -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.") -- cgit v1.2.3-70-g09d2 From 597727f8bedc894330dfd26eab1a82859980f2f1 Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 16 Mar 2016 15:19:13 +0100 Subject: tclmodules : added hooks to process EnvironmentModifications objects --- lib/spack/spack/modules.py | 151 +++++++++++++++------ var/spack/repos/builtin/packages/mpich/package.py | 25 +++- var/spack/repos/builtin/packages/python/package.py | 15 +- 3 files changed, 137 insertions(+), 54 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index c27043db8c..1a0a0fd4d6 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -47,18 +47,18 @@ of module file. __all__ = ['EnvModule', 'Dotkit', 'TclModule'] import os +import os.path import re -import textwrap import shutil +import textwrap from glob import glob import llnl.util.tty as tty -from llnl.util.filesystem import join_path, mkdirp - import spack +from spack.environment import * +from llnl.util.filesystem import join_path, mkdirp -"""Registry of all types of modules. Entries created by EnvModule's - metaclass.""" +# Registry of all types of modules. Entries created by EnvModule's metaclass module_types = {} @@ -79,6 +79,32 @@ def print_help(): "") +class PathInspector(object): + dirname2varname = { + 'bin': ('PATH',), + 'man': ('MANPATH',), + 'lib': ('LIBRARY_PATH', 'LD_LIBRARY_PATH'), + 'lib64': ('LIBRARY_PATH', 'LD_LIBRARY_PATH'), + 'include': ('CPATH',), + 'pkgconfig': ('PKG_CONFIG_PATH',) + } + + def __call__(self, env, directory, names): + for name in names: + variables = PathInspector.dirname2varname.get(name, None) + if variables is None: + continue + absolute_path = join_path(os.path.abspath(directory), name) + for variable in variables: + env.prepend_path(variable, absolute_path) + + +def inspect_path(path): + env, inspector = EnvironmentModifications(), PathInspector() + os.path.walk(path, inspector, env) + return env + + class EnvModule(object): name = 'env_module' @@ -88,21 +114,27 @@ class EnvModule(object): if cls.name != 'env_module': module_types[cls.name] = cls - def __init__(self, spec=None): # category in the modules system # TODO: come up with smarter category names. self.category = "spack" - # Descriptions for the module system's UI - self.short_description = "" - self.long_description = "" - # dict pathname -> list of directories to be prepended to in # the module file. self._paths = None self.spec = spec + self.pkg = spec.package # Just stored for convenience + + # short description default is just the package + version + # packages can provide this optional attribute + self.short_description = spec.format("$_ $@") + if hasattr(self.pkg, 'short_description'): + self.short_description = self.pkg.short_description + # long description is the docstring with reduced whitespace. + self.long_description = None + if self.spec.package.__doc__: + self.long_description = re.sub(r'\s+', ' ', self.spec.package.__doc__) @property def paths(self): @@ -130,26 +162,19 @@ class EnvModule(object): add_path(var, directory) # Add python path unless it's an actual python installation - # TODO: is there a better way to do this? + # TODO : is there a better way to do this? + # FIXME : add PYTHONPATH to every python package if self.spec.name != 'python': site_packages = glob(join_path(self.spec.prefix.lib, "python*/site-packages")) if site_packages: add_path('PYTHONPATH', site_packages[0]) + # FIXME : Same for GEM_PATH if self.spec.package.extends(spack.spec.Spec('ruby')): - add_path('GEM_PATH', self.spec.prefix) - - # short description is just the package + version - # TODO: maybe packages can optionally provide it. - self.short_description = self.spec.format("$_ $@") - - # long description is the docstring with reduced whitespace. - if self.spec.package.__doc__: - self.long_description = re.sub(r'\s+', ' ', self.spec.package.__doc__) + add_path('GEM_PATH', self.spec.prefix) return self._paths - def write(self): """Write out a module file for this object.""" module_dir = os.path.dirname(self.file_name) @@ -160,9 +185,18 @@ class EnvModule(object): if not self.paths: return - with open(self.file_name, 'w') as f: - self._write(f) + # Construct the changes that needs to be done on the environment for + env = inspect_path(self.spec.prefix) + # FIXME : move the logic to inspection + env.prepend_path('CMAKE_PREFIX_PATH', self.spec.prefix) + # FIXME : decide how to distinguish between calls done in the installation and elsewhere + env.extend(self.spec.package.environment_modifications(None)) + # site_specific = ...` + if not env: + return + with open(self.file_name, 'w') as f: + self._write(f, env) def _write(self, stream): """To be implemented by subclasses.""" @@ -175,14 +209,12 @@ class EnvModule(object): where this module lives.""" raise NotImplementedError() - @property def use_name(self): """Subclasses should implement this to return the name the module command uses to refer to the package.""" raise NotImplementedError() - def remove(self): mod_file = self.file_name if os.path.exists(mod_file): @@ -205,7 +237,7 @@ class Dotkit(EnvModule): self.spec.compiler.version, self.spec.dag_hash()) - def _write(self, dk_file): + def _write(self, dk_file, env): # Category if self.category: dk_file.write('#c %s\n' % self.category) @@ -231,6 +263,10 @@ class Dotkit(EnvModule): class TclModule(EnvModule): name = 'tcl' path = join_path(spack.share_path, "modules") + formats = { + PrependPath: 'prepend-path {0.name} \"{0.path}\"\n', + SetEnv: 'setenv {0.name} \"{0.value}\"\n' + } @property def file_name(self): @@ -244,25 +280,56 @@ class TclModule(EnvModule): self.spec.compiler.version, self.spec.dag_hash()) - - def _write(self, m_file): - # TODO: cateogry? - m_file.write('#%Module1.0\n') - + def process_environment_command(self, env): + for command in env: + # FIXME : how should we handle errors here? + yield self.formats[type(command)].format(command) + + def _write(self, module_file, env): + """ + Writes a TCL module file for this package + + Args: + module_file: module file stream + env: list of environment modifications to be written in the module file + """ + # TCL Modulefile header + module_file.write('#%Module1.0\n') + # TODO : category ? # Short description if self.short_description: - m_file.write('module-whatis \"%s\"\n\n' % self.short_description) + module_file.write('module-whatis \"%s\"\n\n' % self.short_description) # Long description if self.long_description: - m_file.write('proc ModulesHelp { } {\n') + module_file.write('proc ModulesHelp { } {\n') doc = re.sub(r'"', '\"', self.long_description) - m_file.write("puts stderr \"%s\"\n" % doc) - m_file.write('}\n\n') - - # Path alterations - for var, dirs in self.paths.items(): - for directory in dirs: - m_file.write("prepend-path %s \"%s\"\n" % (var, directory)) - - m_file.write("prepend-path CMAKE_PREFIX_PATH \"%s\"\n" % self.spec.prefix) + module_file.write("puts stderr \"%s\"\n" % doc) + module_file.write('}\n\n') + + # Environment modifications + for line in self.process_environment_command(env): + module_file.write(line) + + # FIXME : REMOVE + # def _write(self, m_file): + # # TODO: cateogry? + # m_file.write('#%Module1.0\n') + # + # # Short description + # if self.short_description: + # m_file.write('module-whatis \"%s\"\n\n' % self.short_description) + # + # # Long description + # if self.long_description: + # m_file.write('proc ModulesHelp { } {\n') + # doc = re.sub(r'"', '\"', self.long_description) + # m_file.write("puts stderr \"%s\"\n" % doc) + # m_file.write('}\n\n') + # + # # Path alterations + # for var, dirs in self.paths.items(): + # for directory in dirs: + # m_file.write("prepend-path %s \"%s\"\n" % (var, directory)) + # + # m_file.write("prepend-path CMAKE_PREFIX_PATH \"%s\"\n" % self.spec.prefix) diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index d298981c92..4c34d0308f 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -25,6 +25,7 @@ from spack import * import os + class Mpich(Package): """MPICH is a high performance and widely portable implementation of the Message Passing Interface (MPI) standard.""" @@ -48,11 +49,25 @@ class Mpich(Package): def environment_modifications(self, dependent_spec): env = super(Mpich, self).environment_modifications(dependent_spec) - env.set_env('MPICH_CC', os.environ['CC']) - env.set_env('MPICH_CXX', os.environ['CXX']) - env.set_env('MPICH_F77', os.environ['F77']) - env.set_env('MPICH_F90', os.environ['FC']) - env.set_env('MPICH_FC', os.environ['FC']) + + if dependent_spec is None: + # We are not using compiler wrappers + cc = self.compiler.cc + cxx = self.compiler.cxx + f77 = self.compiler.f77 + f90 = fc = self.compiler.fc + else: + # Spack compiler wrappers + cc = os.environ['CC'] + cxx = os.environ['CXX'] + f77 = os.environ['F77'] + f90 = fc = os.environ['FC'] + + env.set_env('MPICH_CC', cc) + env.set_env('MPICH_CXX', cxx) + env.set_env('MPICH_F77', f77) + env.set_env('MPICH_F90', f90) + env.set_env('MPICH_FC', fc) return env def module_modifications(self, module, spec, dep_spec): diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 2f9948d451..acb3651726 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -91,13 +91,14 @@ class Python(Package): def environment_modifications(self, extension_spec): env = super(Python, self).environment_modifications(extension_spec) - # Set PYTHONPATH to include site-packages dir for the - # extension and any other python extensions it depends on. - python_paths = [] - for d in extension_spec.traverse(): - if d.package.extends(self.spec): - python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) - env.set_env['PYTHONPATH'] = ':'.join(python_paths) + if extension_spec is not None: + # Set PYTHONPATH to include site-packages dir for the + # extension and any other python extensions it depends on. + python_paths = [] + for d in extension_spec.traverse(): + if d.package.extends(self.spec): + python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) + env.set_env['PYTHONPATH'] = ':'.join(python_paths) return env def module_modifications(self, module, spec, ext_spec): -- cgit v1.2.3-70-g09d2 From fa2a66db6721ef5d7b54b9cede69aa2f1b5b7531 Mon Sep 17 00:00:00 2001 From: citibeth Date: Wed, 16 Mar 2016 15:46:59 -0400 Subject: 1. Disabled git versions known to have vulnerabilities. 2. Added autoconf command to allow building directly from GitHub source. --- var/spack/repos/builtin/packages/git/package.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/git/package.py b/var/spack/repos/builtin/packages/git/package.py index ddc5078c4d..586b6ce3c3 100644 --- a/var/spack/repos/builtin/packages/git/package.py +++ b/var/spack/repos/builtin/packages/git/package.py @@ -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 @@ class Git(Package): if '+expat' in spec: configure_args.append("--with-expat=%s" % spec['expat'].prefix) + which('autoreconf')('-i') configure(*configure_args) make() make("install") -- cgit v1.2.3-70-g09d2 From f0f0663d1b9ece1e2b0b0a8f720b1325eec443bb Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 17 Mar 2016 15:11:39 +0100 Subject: package : split `environment_modifications` into `setup_environment` and `setup_dependent_environment`. package : renamed `module_modifications` to `modify_module` for consistency --- lib/spack/spack/build_environment.py | 4 +-- lib/spack/spack/modules.py | 5 ++- lib/spack/spack/package.py | 9 +++-- var/spack/repos/builtin/packages/mpich/package.py | 39 +++++++++------------- .../builtin/packages/netlib-scalapack/package.py | 2 +- .../repos/builtin/packages/openmpi/package.py | 19 ++++++----- var/spack/repos/builtin/packages/python/package.py | 27 +++++++-------- var/spack/repos/builtin/packages/qt/package.py | 4 +-- var/spack/repos/builtin/packages/ruby/package.py | 6 ++-- 9 files changed, 52 insertions(+), 63 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index e5d256a2e0..68477145fe 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -284,8 +284,8 @@ def setup_package(pkg): # Allow dependencies to set up environment as well. for dependency_spec in pkg.spec.traverse(root=False): - dependency_spec.package.module_modifications(pkg.module, dependency_spec, pkg.spec) - env.extend(dependency_spec.package.environment_modifications(pkg.spec)) + dependency_spec.package.modify_module(pkg.module, dependency_spec, pkg.spec) + dependency_spec.package.setup_dependent_environment(env, pkg.spec) # TODO : implement validation #validate(env) env.apply_modifications() diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index 7e395736e4..09895d8c44 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -162,9 +162,8 @@ class EnvModule(object): # Environment modifications guessed by inspecting the installation prefix env = inspect_path(self.spec.prefix) # Package-specific environment modifications - # FIXME : decide how to distinguish between calls done in the installation and elsewhere - env.extend(self.spec.package.environment_modifications(None)) - # site_specific = ...` + self.spec.package.setup_environment(env) + # TODO : implement site-specific modifications and filters if not env: return diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 042833964a..8e56dd1f97 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -977,7 +977,7 @@ class Package(object): fromlist=[self.__class__.__name__]) - def environment_modifications(self, dependent_spec): + def setup_environment(self, env): """ Called before the install() method of dependents. @@ -998,9 +998,12 @@ class Package(object): Returns: instance of environment modifications """ - return EnvironmentModifications() + pass + + def setup_dependent_environment(self, env, dependent_spec): + self.setup_environment(env) - def module_modifications(self, module, spec, dependent_spec): + def modify_module(self, module, spec, dependent_spec): """ Called before the install() method of dependents. diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 4c34d0308f..5af9b585ea 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -47,30 +47,21 @@ class Mpich(Package): provides('mpi@:3.0', when='@3:') provides('mpi@:1.3', when='@1:') - def environment_modifications(self, dependent_spec): - env = super(Mpich, self).environment_modifications(dependent_spec) - - if dependent_spec is None: - # We are not using compiler wrappers - cc = self.compiler.cc - cxx = self.compiler.cxx - f77 = self.compiler.f77 - f90 = fc = self.compiler.fc - else: - # Spack compiler wrappers - cc = os.environ['CC'] - cxx = os.environ['CXX'] - f77 = os.environ['F77'] - f90 = fc = os.environ['FC'] - - env.set_env('MPICH_CC', cc) - env.set_env('MPICH_CXX', cxx) - env.set_env('MPICH_F77', f77) - env.set_env('MPICH_F90', f90) - env.set_env('MPICH_FC', fc) - return env - - def module_modifications(self, module, spec, dep_spec): + def setup_environment(self, env): + env.set_env('MPICH_CC', self.compiler.cc) + env.set_env('MPICH_CXX', self.compiler.cxx) + env.set_env('MPICH_F77', self.compiler.f77) + env.set_env('MPICH_F90', self.compiler.fc) + env.set_env('MPICH_FC', self.compiler.fc) + + def setup_dependent_environment(self, env, dependent_spec): + env.set_env('MPICH_CC', spack_cc) + env.set_env('MPICH_CXX', spack_cxx) + env.set_env('MPICH_F77', spack_f77) + env.set_env('MPICH_F90', spack_f90) + env.set_env('MPICH_FC', spack_fc) + + def modify_module(self, module, spec, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers? module.mpicc = join_path(self.prefix.bin, 'mpicc') diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index ecdea46442..7e7e5b2e2e 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -40,7 +40,7 @@ class NetlibScalapack(Package): make() make("install") - def module_modifications(self, module, spec, dependent_spec): + def modify_module(self, module, spec, dependent_spec): # TODO treat OS that are not Linux... lib_suffix = '.so' if '+shared' in spec['scalapack'] else '.a' diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 3a14170457..7783ca8766 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -41,14 +41,17 @@ class Openmpi(Package): def url_for_version(self, version): return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version) - def environment_modifications(self, dependent_spec): - env = super(Openmpi, self).environment_modifications(dependent_spec) - # FIXME : the compilers should point to the current wrappers, not to generic cc etc. - env.set_env('OMPI_CC', 'cc') - env.set_env('OMPI_CXX', 'c++') - env.set_env('OMPI_FC', 'f90') - env.set_env('OMPI_F77', 'f77') - return env + def setup_environment(self, env): + env.set_env('OMPI_CC', self.compiler.cc) + env.set_env('OMPI_CXX', self.compiler.cxx) + env.set_env('OMPI_FC', self.compiler.fc) + env.set_env('OMPI_F77', self.compiler.f77) + + def setup_dependent_environment(self, env, dependent_spec): + env.set_env('OMPI_CC', spack_cc) + env.set_env('OMPI_CXX', spack_cxx) + env.set_env('OMPI_FC', spack_fc) + env.set_env('OMPI_F77', spack_f77) def install(self, spec, prefix): config_args = ["--prefix=%s" % prefix, diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index acb3651726..d47c1d1b2f 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -89,24 +89,21 @@ class Python(Package): def site_packages_dir(self): return os.path.join(self.python_lib_dir, 'site-packages') - def environment_modifications(self, extension_spec): - env = super(Python, self).environment_modifications(extension_spec) - if extension_spec is not None: - # Set PYTHONPATH to include site-packages dir for the - # extension and any other python extensions it depends on. - python_paths = [] - for d in extension_spec.traverse(): - if d.package.extends(self.spec): - python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) - env.set_env['PYTHONPATH'] = ':'.join(python_paths) - return env - - def module_modifications(self, module, spec, ext_spec): - """Called before python modules' install() methods. + def setup_dependent_environment(self, env, extension_spec): + # Set PYTHONPATH to include site-packages dir for the extension and any other python extensions it depends on. + python_paths = [] + for d in extension_spec.traverse(): + if d.package.extends(self.spec): + python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) + env.set_env['PYTHONPATH'] = ':'.join(python_paths) + + def modify_module(self, module, spec, ext_spec): + """ + Called before python modules' install() methods. In most cases, extensions will only need to have one line:: - python('setup.py', 'install', '--prefix=%s' % prefix) + python('setup.py', 'install', '--prefix=%s' % prefix) """ # Python extension builds can have a global python executable function if self.version >= Version("3.0.0") and self.version < Version("4.0.0"): diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 0adf352be2..35b9d68462 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -55,10 +55,8 @@ class Qt(Package): depends_on("mesa", when='@4:+mesa') depends_on("libxcb") - def environment_modifications(self, dependent_spec): - env = super(Qt, self).environment_modifications(dependent_spec) + def setup_environment(self, env): env.set_env['QTDIR'] = self.prefix - return env def patch(self): if self.spec.satisfies('@4'): diff --git a/var/spack/repos/builtin/packages/ruby/package.py b/var/spack/repos/builtin/packages/ruby/package.py index 9caea30ef4..2d1da8c9af 100644 --- a/var/spack/repos/builtin/packages/ruby/package.py +++ b/var/spack/repos/builtin/packages/ruby/package.py @@ -17,8 +17,7 @@ class Ruby(Package): make() make("install") - def environment_modifications(self, extension_spec): - env = super(Ruby, self).environment_modifications(extension_spec) + def setup_dependent_environment(self, env, extension_spec): # Set GEM_PATH to include dependent gem directories ruby_paths = [] for d in extension_spec.traverse(): @@ -27,9 +26,8 @@ class Ruby(Package): env.set_env('GEM_PATH', concatenate_paths(ruby_paths)) # The actual installation path for this gem env.set_env('GEM_HOME', extension_spec.prefix) - return env - def module_modifications(self, module, spec, ext_spec): + def modify_module(self, module, spec, ext_spec): """Called before ruby modules' install() methods. Sets GEM_HOME and GEM_PATH to values appropriate for the package being built. -- cgit v1.2.3-70-g09d2 From ac394718ec0aa67c468a8529b930eaade0bcbed1 Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 17 Mar 2016 18:22:07 +0100 Subject: python : implemented possible solution --- lib/spack/spack/package.py | 11 ++++++++++- var/spack/repos/builtin/packages/py-nose/package.py | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index d0b94dbbeb..a7ab20137e 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -37,6 +37,7 @@ import os import re import textwrap import time +import glob import llnl.util.tty as tty import spack @@ -55,7 +56,6 @@ from llnl.util.filesystem import * from llnl.util.lang import * from llnl.util.link_tree import LinkTree from llnl.util.tty.log import log_output -from spack.environment import EnvironmentModifications from spack.stage import Stage, ResourceStage, StageComposite from spack.util.compression import allowed_archive from spack.util.environment import dump_environment @@ -1236,6 +1236,15 @@ class Package(object): return " ".join("-Wl,-rpath,%s" % p for p in self.rpath) +class PythonExtension(Package): + def setup_dependent_environment(self, env, dependent_spec): + pass + + def setup_environment(self, env): + site_packages = glob.glob(join_path(self.spec.prefix.lib, "python*/site-packages")) + if site_packages: + env.prepend_path('PYTHONPATH', site_packages[0]) + def validate_package_url(url_string): """Determine whether spack can handle a particular URL or not.""" url = urlparse(url_string) diff --git a/var/spack/repos/builtin/packages/py-nose/package.py b/var/spack/repos/builtin/packages/py-nose/package.py index e7c6cf0264..e817b8eb51 100644 --- a/var/spack/repos/builtin/packages/py-nose/package.py +++ b/var/spack/repos/builtin/packages/py-nose/package.py @@ -1,6 +1,7 @@ from spack import * +from spack.package import PythonExtension -class PyNose(Package): +class PyNose(PythonExtension): """nose extends the test loading and running features of unittest, making it easier to write, find and run tests.""" -- cgit v1.2.3-70-g09d2 From e55880904376847ce767770344059eef1ba7707c Mon Sep 17 00:00:00 2001 From: alalazo Date: Thu, 17 Mar 2016 19:32:31 +0100 Subject: python : fixed typo --- var/spack/repos/builtin/packages/python/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index d47c1d1b2f..d46e1068b6 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -95,7 +95,7 @@ class Python(Package): for d in extension_spec.traverse(): if d.package.extends(self.spec): python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) - env.set_env['PYTHONPATH'] = ':'.join(python_paths) + env.set_env('PYTHONPATH', ':'.join(python_paths)) def modify_module(self, module, spec, ext_spec): """ -- cgit v1.2.3-70-g09d2 From 9e4c757f50ec98e55a74ad13fda70f12ce788891 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 17 Mar 2016 13:45:57 -0400 Subject: Update curl to 7.47.1 --- var/spack/repos/builtin/packages/curl/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/curl/package.py b/var/spack/repos/builtin/packages/curl/package.py index 9e684445c7..ab6305fc08 100644 --- a/var/spack/repos/builtin/packages/curl/package.py +++ b/var/spack/repos/builtin/packages/curl/package.py @@ -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') -- cgit v1.2.3-70-g09d2 From 90268876f7d740e5b7dcfd079168f248a337791a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 17 Mar 2016 18:49:58 -0700 Subject: Change sanity_check_[file|dir] to sanity_check_is_[file|dir], per #554 - Add documentation as well. --- lib/spack/docs/packaging_guide.rst | 84 ++++++++++++++++++---- lib/spack/spack/package.py | 22 +++--- var/spack/repos/builtin/packages/libelf/package.py | 3 +- 3 files changed, 84 insertions(+), 25 deletions(-) (limited to 'var') diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index 169899212d..c1077e4497 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -1559,11 +1559,11 @@ you ask for a particular spec. A user may have certain preferences for how packages should be concretized on their system. For example, one user may prefer packages built with OpenMPI and the Intel compiler. Another user may prefer -packages be built with MVAPICH and GCC. +packages be built with MVAPICH and GCC. Spack can be configured to prefer certain compilers, package versions, depends_on, and variants during concretization. -The preferred configuration can be controlled via the +The preferred configuration can be controlled via the ``~/.spack/packages.yaml`` file for user configuations, or the ``etc/spack/packages.yaml`` site configuration. @@ -1582,32 +1582,32 @@ Here's an example packages.yaml file that sets preferred packages: compiler: [gcc@4.4.7, gcc@4.6:, intel, clang, pgi] providers: mpi: [mvapich, mpich, openmpi] - + At a high level, this example is specifying how packages should be -concretized. The dyninst package should prefer using gcc 4.9 and +concretized. The dyninst package should prefer using gcc 4.9 and be built with debug options. 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 +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 on the command line if explicitly requested. -Each packages.yaml file begins with the string ``packages:`` and +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``, -or ``providers``. Each component has an ordered list of spec +applies settings to each package. Underneath each package name is +one or more components: ``compiler``, ``variants``, ``version``, +or ``providers``. Each component has an ordered list of spec ``constraints``, with earlier entries in the list being preferred over later entries. -Sometimes a package installation may have constraints that forbid +Sometimes a package installation may have constraints that forbid the first concretization rule, in which case Spack will use the first legal concretization rule. Going back to the example, if a user -requests gperftools 2.3 or later, then Spack will install version 2.4 +requests gperftools 2.3 or later, then Spack will install version 2.4 as the 2.4 version of gperftools is preferred over 2.3. -An explicit concretization rule in the preferred section will always -take preference over unlisted concretizations. In the above example, +An explicit concretization rule in the preferred section will always +take preference over unlisted concretizations. In the above example, xlc isn't listed in the compiler list. Every listed compiler from gcc to pgi will thus be preferred over the xlc compiler. @@ -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 diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 02fb3e5834..291056a7b9 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -318,16 +318,17 @@ class Package(object): """Most packages are NOT extendable. Set to True if you want extensions.""" extendable = False - """List of prefix-relative file paths. If these do not exist after - install, or if they exist but are not files, sanity checks fail. + """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_files = [] + sanity_check_is_file = [] - """List of prefix-relative directory paths. If these do not exist - after install, or if they exist but are not directories, sanity - checks will fail. + """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_dirs = [] + sanity_check_is_dir = [] def __init__(self, spec): @@ -966,14 +967,17 @@ class Package(object): 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_files, 'file', os.path.isfile) - check_paths(self.sanity_check_dirs, 'directory', os.path.isdir) + 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) diff --git a/var/spack/repos/builtin/packages/libelf/package.py b/var/spack/repos/builtin/packages/libelf/package.py index 0fcb56c164..9f16708af5 100644 --- a/var/spack/repos/builtin/packages/libelf/package.py +++ b/var/spack/repos/builtin/packages/libelf/package.py @@ -38,8 +38,7 @@ class Libelf(Package): provides('elf') - sanity_check_files = ['include/libelf.h'] - sanity_check_dirs = ['lib'] + sanity_check_is_file = 'include/libelf.h' def install(self, spec, prefix): configure("--prefix=" + prefix, -- cgit v1.2.3-70-g09d2 From 802acb4d166a7ca3ff2db3c0a0c95a3ad8a6a81a Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 17 Mar 2016 13:43:40 -0400 Subject: Update PAPI to 5.4.3 --- var/spack/repos/builtin/packages/papi/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py index 910e0aa9f9..53d69e28d9 100644 --- a/var/spack/repos/builtin/packages/papi/package.py +++ b/var/spack/repos/builtin/packages/papi/package.py @@ -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') -- cgit v1.2.3-70-g09d2 From 1b279cd7ff29e09ef9afa1a328b964487b5b2030 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 17 Mar 2016 13:55:45 -0400 Subject: Update OpenBLAS to 0.2.16 --- var/spack/repos/builtin/packages/openblas/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 3c909360a4..e16d3fe89c 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -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 -- cgit v1.2.3-70-g09d2 From 4cf4bf3a0343fc93d6f0c14dd89956fa03b8f738 Mon Sep 17 00:00:00 2001 From: alalazo Date: Fri, 18 Mar 2016 11:05:59 +0100 Subject: openssl : solved glitch to prevent spack to freeze when the network is unreachable --- .../repos/builtin/packages/openssl/package.py | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 70afaf4038..22d538531a 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -1,4 +1,4 @@ -import urllib +import urllib2 import llnl.util.tty as tty from spack import * @@ -37,17 +37,22 @@ class Openssl(Package): version_number = '.'.join([str(x) for x in version[:-1]]) older_url = older.format(version_number=version_number, version_full=version) latest_url = latest.format(version=version) - response = urllib.urlopen(latest.format(version=version)) - if response.getcode() == 404: - openssl_url = older_url - # 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)) - warnings_given_to_user[version] = True - else: + try: + response = urllib2.urlopen(latest.format(version=version), timeout=5) + if response.getcode() == 404: + openssl_url = older_url + # 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)) + warnings_given_to_user[version] = True + else: + openssl_url = latest_url + except urllib2.URLError: + tty.warn('Cannot connect to network to retrieve OpenSSL version. Using default url.') + warnings_given_to_user[version] = True openssl_url = latest_url # Store the computed URL openssl_urls[version] = openssl_url -- cgit v1.2.3-70-g09d2 From 3b24db92b5ea64814b1294fc6c9c982bbaa9b3c6 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 17 Mar 2016 13:43:40 -0400 Subject: Update PAPI to 5.4.3 --- var/spack/repos/builtin/packages/papi/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py index 910e0aa9f9..53d69e28d9 100644 --- a/var/spack/repos/builtin/packages/papi/package.py +++ b/var/spack/repos/builtin/packages/papi/package.py @@ -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') -- cgit v1.2.3-70-g09d2 From ec8cc2b52839007f0825815c8cfdee8f9a8629a6 Mon Sep 17 00:00:00 2001 From: alalazo Date: Fri, 18 Mar 2016 14:40:53 +0100 Subject: PYTHONPATH : python patches methods for its extensions --- lib/spack/spack/build_environment.py | 4 ++- lib/spack/spack/cmd/uninstall.py | 12 ++++---- lib/spack/spack/directory_layout.py | 2 +- lib/spack/spack/modules.py | 12 ++++++-- lib/spack/spack/package.py | 10 ------- .../repos/builtin/packages/py-nose/package.py | 6 ++-- var/spack/repos/builtin/packages/python/package.py | 34 ++++++++++++++++++++-- 7 files changed, 53 insertions(+), 27 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 68477145fe..c51fa58477 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -282,9 +282,11 @@ def setup_package(pkg): for mod in modules: set_module_variables_for_package(pkg, mod) - # Allow dependencies to set up environment as well. + # Allow dependencies to modify the module for dependency_spec in pkg.spec.traverse(root=False): dependency_spec.package.modify_module(pkg.module, dependency_spec, pkg.spec) + # Allow dependencies to set up environment as well + for dependency_spec in pkg.spec.traverse(root=False): dependency_spec.package.setup_dependent_environment(env, pkg.spec) # TODO : implement validation #validate(env) diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index d01aa2136b..2fab8f6f2a 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -79,7 +79,7 @@ def uninstall(parser, args): try: # should work if package is known to spack pkgs.append(s.package) - except spack.repository.UnknownPackageError, e: + except spack.repository.UnknownPackageError as e: # The package.py file has gone away -- but still # want to uninstall. spack.Package(s).do_uninstall(force=True) @@ -94,11 +94,11 @@ def uninstall(parser, args): for pkg in pkgs: try: pkg.do_uninstall(force=args.force) - except PackageStillNeededError, e: + except PackageStillNeededError as e: tty.error("Will not uninstall %s" % e.spec.format("$_$@$%@$#", color=True)) - print - print "The following packages depend on it:" + print() + print("The following packages depend on it:") display_specs(e.dependents, long=True) - print - print "You can use spack uninstall -f to force this action." + print() + print("You can use spack uninstall -f to force this action.") sys.exit(1) diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index 39ee4e203d..da8f1aa1bc 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -150,7 +150,7 @@ class DirectoryLayout(object): if os.path.exists(path): try: shutil.rmtree(path) - except exceptions.OSError, e: + except exceptions.OSError as e: raise RemoveFailedError(spec, path, e) path = os.path.dirname(path) diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index d192bbe004..7303844229 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -119,13 +119,13 @@ class EnvModule(object): module_types[cls.name] = cls def __init__(self, spec=None): + self.spec = spec + self.pkg = spec.package # Just stored for convenience + # category in the modules system # TODO: come up with smarter category names. self.category = "spack" - self.spec = spec - self.pkg = spec.package # Just stored for convenience - # short description default is just the package + version # packages can provide this optional attribute self.short_description = spec.format("$_ $@") @@ -161,6 +161,12 @@ class EnvModule(object): # Environment modifications guessed by inspecting the installation prefix env = inspect_path(self.spec.prefix) + + # Let the extendee modify their extensions before asking for package-specific modifications + for extendee in self.pkg.extendees: + extendee_spec = self.spec[extendee] + extendee_spec.package.modify_module(self.pkg, extendee_spec, self.spec) + # Package-specific environment modifications self.spec.package.setup_environment(env) # TODO : implement site-specific modifications and filters diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 185e3ad2ee..72c84ec624 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1261,16 +1261,6 @@ class Package(object): """Get the rpath args as a string, with -Wl,-rpath, for each element.""" return " ".join("-Wl,-rpath,%s" % p for p in self.rpath) - -class PythonExtension(Package): - def setup_dependent_environment(self, env, dependent_spec): - pass - - def setup_environment(self, env): - site_packages = glob.glob(join_path(self.spec.prefix.lib, "python*/site-packages")) - if site_packages: - env.prepend_path('PYTHONPATH', site_packages[0]) - def validate_package_url(url_string): """Determine whether spack can handle a particular URL or not.""" url = urlparse(url_string) diff --git a/var/spack/repos/builtin/packages/py-nose/package.py b/var/spack/repos/builtin/packages/py-nose/package.py index e817b8eb51..4fee99098e 100644 --- a/var/spack/repos/builtin/packages/py-nose/package.py +++ b/var/spack/repos/builtin/packages/py-nose/package.py @@ -1,12 +1,12 @@ from spack import * -from spack.package import PythonExtension -class PyNose(PythonExtension): + +class PyNose(Package): """nose extends the test loading and running features of unittest, making it easier to write, find and run tests.""" homepage = "https://pypi.python.org/pypi/nose" - url = "https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz" + url = "https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz" version('1.3.4', '6ed7169887580ddc9a8e16048d38274d') version('1.3.6', '0ca546d81ca8309080fc80cb389e7a16') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index d46e1068b6..c445d26369 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -1,11 +1,14 @@ +import functools +import glob +import inspect import os import re from contextlib import closing -from llnl.util.lang import match_predicate -from spack.util.environment import * -from spack import * import spack +from llnl.util.lang import match_predicate +from spack import * +from spack.util.environment import * class Python(Package): @@ -111,6 +114,31 @@ class Python(Package): else: module.python = Executable(join_path(spec.prefix.bin, 'python')) + # The code below patches the any python extension to have good defaults for `setup_dependent_environment` and + # `setup_environment` only if the extension didn't override any of these functions explicitly. + def _setup_env(self, env): + site_packages = glob.glob(join_path(self.spec.prefix.lib, "python*/site-packages")) + if site_packages: + env.prepend_path('PYTHONPATH', site_packages[0]) + + def _setup_denv(self, env, extension_spec): + pass + + pkg_cls = type(ext_spec.package) # Retrieve the type we may want to patch + if 'python' in pkg_cls.extendees: + # List of overrides we are interested in + interesting_overrides = ['setup_environment', 'setup_dependent_environment'] + overrides_found = [ + (name, defining_cls) for name, _, defining_cls, _, in inspect.classify_class_attrs(pkg_cls) + if + name in interesting_overrides and # The attribute has the right name + issubclass(defining_cls, Package) and defining_cls is not Package # and is an actual override + ] + if not overrides_found: + # If no override were found go on patching + pkg_cls.setup_environment = functools.wraps(Package.setup_environment)(_setup_env) + pkg_cls.setup_dependent_environment = functools.wraps(Package.setup_dependent_environment)(_setup_denv) + # Add variables for lib/pythonX.Y and lib/pythonX.Y/site-packages dirs. module.python_lib_dir = os.path.join(ext_spec.prefix, self.python_lib_dir) module.python_include_dir = os.path.join(ext_spec.prefix, self.python_include_dir) -- cgit v1.2.3-70-g09d2 From 5f6f2d5f51fc3700dce13c6aa035943bbc42f6f7 Mon Sep 17 00:00:00 2001 From: alalazo Date: Fri, 18 Mar 2016 14:42:24 +0100 Subject: Revert "openssl : solved glitch to prevent spack to freeze when the network is unreachable" This reverts commit 4cf4bf3a0343fc93d6f0c14dd89956fa03b8f738. --- .../repos/builtin/packages/openssl/package.py | 29 +++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 22d538531a..70afaf4038 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -1,4 +1,4 @@ -import urllib2 +import urllib import llnl.util.tty as tty from spack import * @@ -37,22 +37,17 @@ class Openssl(Package): version_number = '.'.join([str(x) for x in version[:-1]]) older_url = older.format(version_number=version_number, version_full=version) latest_url = latest.format(version=version) - try: - response = urllib2.urlopen(latest.format(version=version), timeout=5) - if response.getcode() == 404: - openssl_url = older_url - # 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)) - warnings_given_to_user[version] = True - else: - openssl_url = latest_url - except urllib2.URLError: - tty.warn('Cannot connect to network to retrieve OpenSSL version. Using default url.') - warnings_given_to_user[version] = True + response = urllib.urlopen(latest.format(version=version)) + if response.getcode() == 404: + openssl_url = older_url + # 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)) + warnings_given_to_user[version] = True + else: openssl_url = latest_url # Store the computed URL openssl_urls[version] = openssl_url -- cgit v1.2.3-70-g09d2 From ed0b5e649dd6bc480e3faa6ffcca121eb9e264b8 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Fri, 18 Mar 2016 15:54:26 -0600 Subject: + Provide fpic variant for netlib-lapack. --- var/spack/repos/builtin/packages/netlib-lapack/package.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netlib-lapack/package.py b/var/spack/repos/builtin/packages/netlib-lapack/package.py index 741f4af421..78c5a053fe 100644 --- a/var/spack/repos/builtin/packages/netlib-lapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-lapack/package.py @@ -20,13 +20,13 @@ class NetlibLapack(Package): version('3.3.1', 'd0d533ec9a5b74933c2a1e84eedc58b4') variant('shared', default=False, description="Build shared library version") + variant('fpic', default=False, description="Build with -fpic compiler option") # virtual dependency provides('lapack') # blas is a virtual dependency. depends_on('blas') - depends_on('cmake') # Doesn't always build correctly in parallel @@ -37,24 +37,23 @@ class NetlibLapack(Package): blas = self.spec['netlib-blas'] return [join_path(blas.prefix.lib, 'blas.a')] - @when('^atlas') def get_blas_libs(self): blas = self.spec['atlas'] return [join_path(blas.prefix.lib, l) for l in ('libf77blas.a', 'libatlas.a')] - def install(self, spec, prefix): blas_libs = ";".join(self.get_blas_libs()) cmake_args = [".", '-DBLAS_LIBRARIES=' + blas_libs] if '+shared' in spec: cmake_args.append('-DBUILD_SHARED_LIBS=ON') + if '+fpic' in spec: + cmake_args.append('-DCMAKE_POSITION_INDEPENDENT_CODE=ON') cmake_args += std_cmake_args cmake(*cmake_args) make() make("install") - -- cgit v1.2.3-70-g09d2 From 620c120503c8c23d10feb14e14d37dfc36f4befb Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sat, 19 Mar 2016 19:32:44 +0100 Subject: fix openblas suffix for OS-X --- var/spack/repos/builtin/packages/openblas/package.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index e16d3fe89c..781a1e2ec8 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -1,4 +1,5 @@ from spack import * +import sys class Openblas(Package): """OpenBLAS: An optimized BLAS library""" @@ -16,13 +17,14 @@ class Openblas(Package): make('libs', 'netlib', 'shared', 'CC=cc', 'FC=f77') make('install', "PREFIX='%s'" % prefix) + lib_dsuffix = 'dylib' if sys.platform == 'darwin' else 'so' # Blas virtual package should provide blas.a and libblas.a with working_dir(prefix.lib): symlink('libopenblas.a', 'blas.a') symlink('libopenblas.a', 'libblas.a') - symlink('libopenblas.so', 'libblas.so') + symlink('libopenblas.%s' % lib_dsuffix, 'libblas.%s' % lib_dsuffix) # Lapack virtual package should provide liblapack.a with working_dir(prefix.lib): symlink('libopenblas.a', 'liblapack.a') - symlink('libopenblas.so', 'liblapack.so') + symlink('libopenblas.%s' % lib_dsuffix, 'liblapack.%s' % lib_dsuffix) -- cgit v1.2.3-70-g09d2 From 95ad2875b6bb4dc15eb43b44c1dbdd521c843119 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sun, 20 Mar 2016 09:25:02 +0100 Subject: fix scalapack suffix for osx --- var/spack/repos/builtin/packages/netlib-scalapack/package.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 22d538560e..a5b6eedafb 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -1,8 +1,9 @@ from spack import * +import sys class NetlibScalapack(Package): """ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines""" - + homepage = "http://www.netlib.org/scalapack/" url = "http://www.netlib.org/scalapack/scalapack-2.0.2.tgz" @@ -32,17 +33,17 @@ class NetlibScalapack(Package): "-DCMAKE_C_FLAGS=-fPIC", "-DCMAKE_Fortran_FLAGS=-fPIC" ]) - + options.extend(std_cmake_args) - + with working_dir('spack-build', create=True): cmake('..', *options) make() make("install") def setup_dependent_environment(self, module, spec, dependent_spec): - # TODO treat OS that are not Linux... - lib_suffix = '.so' if '+shared' in spec['scalapack'] else '.a' + lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so' + lib_suffix = lib_dsuffix if '+shared' in spec['scalapack'] else '.a' spec['scalapack'].fc_link = '-L%s -lscalapack' % spec['scalapack'].prefix.lib spec['scalapack'].cc_link = spec['scalapack'].fc_link -- cgit v1.2.3-70-g09d2 From db61a09cf14cc791d7692aac0329e8958b228fb6 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 18 Mar 2016 16:28:36 +0100 Subject: fix mumps: when installed with parmetis has to be linked with metis --- var/spack/repos/builtin/packages/mumps/package.py | 28 +++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py index 44a37903cc..5c120c37df 100644 --- a/var/spack/repos/builtin/packages/mumps/package.py +++ b/var/spack/repos/builtin/packages/mumps/package.py @@ -20,10 +20,10 @@ class Mumps(Package): variant('complex', default=True, description='Activate the compilation of cmumps and/or zmumps') variant('idx64', default=False, description='Use int64_t/integer*8 as default index type') - + depends_on('scotch + esmumps', when='~ptscotch+scotch') depends_on('scotch + esmumps + mpi', when='+ptscotch') - depends_on('metis', when='~parmetis+metis') + depends_on('metis', when='+metis') depends_on('parmetis', when="+parmetis") depends_on('blas') depends_on('lapack') @@ -38,11 +38,11 @@ class Mumps(Package): 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') - + 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( @@ -54,15 +54,19 @@ class Mumps(Package): if '+ptscotch' in self.spec: orderings.append('-Dptscotch') - if '+parmetis' in self.spec or '+metis' in self.spec: + if '+parmetis' in self.spec and '+metis' in self.spec: libname = 'parmetis' if '+parmetis' in self.spec else 'metis' makefile_conf.extend( - ["IMETIS = -I%s" % self.spec[libname].prefix.include, - "LMETIS = -L%s -l%s" % (self.spec[libname].prefix.lib, libname)]) + ["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')]) orderings.append('-Dmetis') - if '+parmetis' in self.spec: - orderings.append('-Dparmetis') makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings))) @@ -101,12 +105,12 @@ class Mumps(Package): # compiler possible values are -DAdd_, -DAdd__ and/or -DUPPER makefile_conf.append("CDEFS = -DAdd_") - + 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')) - + with working_dir('.'): with open("Makefile.inc", "w") as fh: makefile_inc = '\n'.join(makefile_conf) @@ -130,7 +134,7 @@ class Mumps(Package): make_libs.append('zexamples') self.write_makefile_inc() - + make(*make_libs) install_tree('lib', prefix.lib) -- cgit v1.2.3-70-g09d2 From 7b283bfaffa5509915d91392878203bba8a8d2cb Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 21 Mar 2016 07:48:17 +0100 Subject: fix petsc on osx --- var/spack/repos/builtin/packages/petsc/package.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index efe172fc08..7239baaf7f 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -61,14 +61,24 @@ class Petsc(Package): errors = ['incompatible variants given'] + errors raise RuntimeError('\n'.join(errors)) else: - compiler_opts = [ - '--with-mpi=1', - '--with-mpi-dir=%s' % self.spec['mpi'].prefix, - ] + if self.compiler.name == "clang": + compiler_opts = [ + '--with-mpi=1', + '--with-cc=%s -Qunused-arguments' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # Avoid confusing PETSc config by clang: warning: argument unused during compilation + '--with-cxx=%s -Qunused-arguments' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'), + '--with-fc=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'), + '--with-f77=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif77'), + ] + else: + compiler_opts = [ + '--with-mpi=1', + '--with-mpi-dir=%s' % self.spec['mpi'].prefix, + ] return compiler_opts def install(self, spec, prefix): - options = [] + options = ['--with-debugging=0', + '--with-ssl=0'] options.extend(self.mpi_dependent_options()) options.extend([ '--with-precision=%s' % ('double' if '+double' in spec else 'single'), -- cgit v1.2.3-70-g09d2 From b926d8a0cdcf47de029e372cf15e281266930378 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 21 Mar 2016 14:33:00 +0100 Subject: build parmetis against external metis --- .../packages/parmetis/enable_external_metis.patch | 13 ++++++++++++ .../repos/builtin/packages/parmetis/package.py | 24 ++++------------------ 2 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 var/spack/repos/builtin/packages/parmetis/enable_external_metis.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/parmetis/enable_external_metis.patch b/var/spack/repos/builtin/packages/parmetis/enable_external_metis.patch new file mode 100644 index 0000000000..514781b8b8 --- /dev/null +++ b/var/spack/repos/builtin/packages/parmetis/enable_external_metis.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ca945dd..1bf94e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,7 +33,7 @@ include_directories(${GKLIB_PATH}) + include_directories(${METIS_PATH}/include) + + # List of directories that cmake will look for CMakeLists.txt +-add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis) ++#add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis) + add_subdirectory(include) + add_subdirectory(libparmetis) + add_subdirectory(programs) diff --git a/var/spack/repos/builtin/packages/parmetis/package.py b/var/spack/repos/builtin/packages/parmetis/package.py index c897dec7e4..3f18dd76b8 100644 --- a/var/spack/repos/builtin/packages/parmetis/package.py +++ b/var/spack/repos/builtin/packages/parmetis/package.py @@ -25,9 +25,6 @@ from spack import * -# FIXME : lot of code is duplicated from packages/metis/package.py . Inheriting from there may reduce -# FIXME : the installation rules to just a few lines - class Parmetis(Package): """ @@ -43,13 +40,11 @@ class Parmetis(Package): variant('debug', default=False, description='Builds the library in debug mode') variant('gdb', default=False, description='Enables gdb support') - variant('idx64', default=False, description='Use int64_t as default index type') - variant('double', default=False, description='Use double precision floating point types') - depends_on('cmake @2.8:') # build dependency depends_on('mpi') - # FIXME : this should conflict with metis as it builds its own version internally + patch('enable_external_metis.patch') + depends_on('metis') depends_on('gdb', when='+gdb') @@ -63,8 +58,8 @@ class Parmetis(Package): # FIXME : Once a contract is defined, MPI compilers should be retrieved indirectly via spec['mpi'] in case # FIXME : they use a non-standard name - options.extend(['-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=metis_source), - '-DMETIS_PATH:PATH={metis_source}'.format(metis_source=metis_source), + options.extend(['-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=metis_source), # still need headers from METIS source, and they are not installed with METIS. shame... + '-DMETIS_PATH:PATH={metis_source}'.format(metis_source=spec['metis'].prefix), '-DCMAKE_C_COMPILER:STRING=mpicc', '-DCMAKE_CXX_COMPILER:STRING=mpicxx']) @@ -78,18 +73,7 @@ class Parmetis(Package): if '+gdb' in spec: options.append('-DGDB:BOOL=ON') - metis_header = join_path(metis_source, 'include', 'metis.h') - - if '+idx64' in spec: - filter_file('IDXTYPEWIDTH 32', 'IDXTYPEWIDTH 64', metis_header) - - if '+double' in spec: - filter_file('REALTYPEWIDTH 32', 'REALTYPEWIDTH 64', metis_header) - with working_dir(build_directory, create=True): cmake(source_directory, *options) make() make("install") - # Parmetis build system doesn't allow for an external metis to be used, but doesn't copy the required - # metis header either - install(metis_header, self.prefix.include) -- cgit v1.2.3-70-g09d2 From 3fcaf5b9031c3d55b152844b97cd432078340f4b Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 21 Mar 2016 14:47:05 +0100 Subject: llvm : update to 3.8.0 --- var/spack/repos/builtin/packages/llvm/package.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 280e400f69..5c38b5b88c 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -132,6 +132,21 @@ class Llvm(Package): 'llvm-libunwind' : 'http://llvm.org/svn/llvm-project/libunwind/trunk', } }, + { + 'version' : '3.8.0', + 'md5':'07a7a74f3c6bd65de4702bf941b511a0', + 'resources' : { + 'compiler-rt' : 'd6fcbe14352ffb708e4d1ac2e48bb025', + 'openmp' : '8fd7cc35d48051613cf1e750e9f22e40', + 'polly' : '1b3b20f52d34a4024e21a4ea7112caa7', + 'libcxx' : 'd6e0bdbbee39f7907ad74fd56d03b88a', + 'libcxxabi' : 'bbe6b4d72c7c5978550d370af529bcf7', + 'clang' : 'cc99e7019bb74e6459e80863606250c5', + 'clang-tools-extra' : 'c2344f50e0eea0b402f0092a80ddc036', + 'lldb' : 'a5da35ed9cc8c8817ee854e3dbfba00e', + 'llvm-libunwind' : '162ade468607f153cca12be90b5194fa', + } + }, { 'version' : '3.7.1', 'md5':'bf8b3a2c79e61212c5409041dfdbd319', -- cgit v1.2.3-70-g09d2 From 3a3443dff63167fc0331672871af4c0cc1fe5903 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 21 Mar 2016 15:14:48 +0100 Subject: parmetis patches by PETSc developers --- .../repos/builtin/packages/parmetis/package.py | 6 ++ ...-1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b.patch | 77 ++++++++++++++++++++++ ...-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch | 35 ++++++++++ 3 files changed, 118 insertions(+) create mode 100644 var/spack/repos/builtin/packages/parmetis/pkg-parmetis-1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b.patch create mode 100644 var/spack/repos/builtin/packages/parmetis/pkg-parmetis-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/parmetis/package.py b/var/spack/repos/builtin/packages/parmetis/package.py index 3f18dd76b8..c691cf4191 100644 --- a/var/spack/repos/builtin/packages/parmetis/package.py +++ b/var/spack/repos/builtin/packages/parmetis/package.py @@ -46,6 +46,12 @@ class Parmetis(Package): patch('enable_external_metis.patch') depends_on('metis') + # bug fixes from PETSc developers + # https://bitbucket.org/petsc/pkg-parmetis/commits/1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b/raw/ + patch('pkg-parmetis-1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b.patch') + # https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/ + patch('pkg-parmetis-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch') + depends_on('gdb', when='+gdb') def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/parmetis/pkg-parmetis-1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b.patch b/var/spack/repos/builtin/packages/parmetis/pkg-parmetis-1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b.patch new file mode 100644 index 0000000000..e6b8056c21 --- /dev/null +++ b/var/spack/repos/builtin/packages/parmetis/pkg-parmetis-1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b.patch @@ -0,0 +1,77 @@ +From 1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b Mon Sep 17 00:00:00 2001 +From: Jed Brown +Date: Fri, 12 Oct 2012 15:45:10 -0500 +Subject: [PATCH] ParMetis bug fixes reported by John Fettig [petsc-maint + #133631] + +''' +I have also reported to to Karypis but have received zero +response and he hasn't released any updates to the original release +either. At least he approved my forum posting so that other people +can see the bug and the fix. +http://glaros.dtc.umn.edu/gkhome/node/837 +''' + +Hg-commit: 1c2b9fe39201d404b493885093b5992028b9b8d4 +--- + libparmetis/xyzpart.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/libparmetis/xyzpart.c b/libparmetis/xyzpart.c +index 3a2c289..63abfcb 100644 +--- a/libparmetis/xyzpart.c ++++ b/libparmetis/xyzpart.c +@@ -104,7 +104,7 @@ void IRBinCoordinates(ctrl_t *ctrl, graph_t *graph, idx_t ndims, real_t *xyz, + + for (i=0; i +Date: Tue, 20 Mar 2012 11:59:44 -0500 +Subject: [PATCH] parmetis: fix bug reported by jfettig; '<' to '<=' in xyzpart + +Hg-commit: 2dd2eae596acaabbc80e0ef875182616f868dbc2 +--- + libparmetis/xyzpart.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libparmetis/xyzpart.c b/libparmetis/xyzpart.c +index 307aed9..3a2c289 100644 +--- a/libparmetis/xyzpart.c ++++ b/libparmetis/xyzpart.c +@@ -111,7 +111,7 @@ void IRBinCoordinates(ctrl_t *ctrl, graph_t *graph, idx_t ndims, real_t *xyz, + /* determine bucket counts */ + iset(nbins, 0, lcounts); + for (j=0, i=0; i Date: Mon, 21 Mar 2016 16:18:02 +0100 Subject: llvm : does not support python 3 --- var/spack/repos/builtin/packages/llvm/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 5c38b5b88c..1d25d59e50 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -52,7 +52,7 @@ class Llvm(Package): depends_on('cmake @2.8.12.2:') # Universal dependency - depends_on('python@2.7:') + depends_on('python@2.7:2.8') # Seems not to support python 3.X.Y # lldb dependencies depends_on('ncurses', when='+lldb') -- cgit v1.2.3-70-g09d2 From c5c92d50eb78673c635a7ed26145bf10a15c20cb Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 21 Mar 2016 11:24:36 -0400 Subject: paraview: remove trailing whitespace --- var/spack/repos/builtin/packages/paraview/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index ccf2d14c06..b3312736f1 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -37,11 +37,11 @@ class Paraview(Package): #depends_on('protobuf') # version mismatches? #depends_on('sqlite') # external version not supported depends_on('zlib') - + def url_for_version(self, version): """Handle ParaView version-based custom URLs.""" return self._url_str % (version.up_to(2), version) - + def install(self, spec, prefix): with working_dir('spack-build', create=True): -- cgit v1.2.3-70-g09d2 From 8e77f1776020c2a6edf9eb284615d99c905821e9 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 21 Mar 2016 11:54:58 -0400 Subject: paraview: fix variant description typo --- var/spack/repos/builtin/packages/paraview/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index b3312736f1..0c3c7c1621 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -16,7 +16,7 @@ class Paraview(Package): variant('osmesa', default=False, description='Enable OSMesa support') variant('qt', default=False, description='Enable Qt support') - variant('opengl2', default=False, description='Enable OPengl2 backend') + variant('opengl2', default=False, description='Enable OpenGL2 backend') depends_on('python', when='+python') depends_on('py-numpy', when='+python') -- cgit v1.2.3-70-g09d2 From 553fff270a13d40fb9a41569bebf5075a740d8ac Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 21 Mar 2016 11:24:49 -0400 Subject: paraview: disallow python3 ParaView is not Python3-ready. --- var/spack/repos/builtin/packages/paraview/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index 0c3c7c1621..c16054816c 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -18,7 +18,7 @@ class Paraview(Package): variant('qt', default=False, description='Enable Qt support') variant('opengl2', default=False, description='Enable OpenGL2 backend') - depends_on('python', when='+python') + depends_on('python@2:2.7', when='+python') depends_on('py-numpy', when='+python') depends_on('py-matplotlib', when='+python') depends_on('tcl', when='+tcl') -- cgit v1.2.3-70-g09d2 From 953fb35f82c099936f833f31dcd292ffa1a3ec06 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 21 Mar 2016 18:00:32 +0100 Subject: add superlu_dist package --- .../repos/builtin/packages/superlu-dist/package.py | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 var/spack/repos/builtin/packages/superlu-dist/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/superlu-dist/package.py b/var/spack/repos/builtin/packages/superlu-dist/package.py new file mode 100644 index 0000000000..c4c76909b3 --- /dev/null +++ b/var/spack/repos/builtin/packages/superlu-dist/package.py @@ -0,0 +1,63 @@ +from spack import * + +class SuperluDist(Package): + """A general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear equations on high performance machines.""" + homepage = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" + url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_4.1.tar.gz" + + version('4.3', 'ee66c84e37b4f7cc557771ccc3dc43ae') + version('4.2', 'ae9fafae161f775fbac6eba11e530a65') + version('4.1', '4edee38cc29f687bd0c8eb361096a455') + version('4.0', 'c0b98b611df227ae050bc1635c6940e0') + + depends_on ('mpi') + depends_on ('blas') + depends_on ('lapack') + depends_on ('parmetis') + depends_on ('metis') + + def install(self, spec, prefix): + makefile_inc = [] + makefile_inc.extend([ + 'PLAT = _mac_x', + 'DSuperLUroot = %s' % self.stage.source_path, #self.stage.path, prefix + 'DSUPERLULIB = $(DSuperLUroot)/lib/libsuperlu_dist.a', + 'BLASDEF = -DUSE_VENDOR_BLAS', + 'BLASLIB = -L%s -llapack %s -lblas' % (spec['lapack'].prefix.lib, spec['blas'].prefix.lib), # FIXME: avoid hardcoding blas/lapack lib names + 'METISLIB = -L%s -lmetis' % spec['metis'].prefix.lib, + 'PARMETISLIB = -L%s -lparmetis' % spec['parmetis'].prefix.lib, + 'FLIBS =', + 'LIBS = $(DSUPERLULIB) $(BLASLIB) $(PARMETISLIB) $(METISLIB)', + 'ARCH = ar', + 'ARCHFLAGS = cr', + 'RANLIB = true', + 'CC = mpicc', # FIXME avoid hardcoding MPI compiler names + 'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s' %(spec['parmetis'].prefix.include, spec['metis'].prefix.include), + 'NOOPTS = -fPIC -std=c99', + 'FORTRAN = mpif77', + 'F90FLAGS = -O2', + 'LOADER = mpif77', + 'LOADOPTS =', + 'CDEFS = -DAdd_' + ]) + + #with working_dir('src'): + with open('make.inc', 'w') as fh: + fh.write('\n'.join(makefile_inc)) + + make("lib", parallel=False) + + # FIXME: + # cd "EXAMPLE" do + # system "make" + + # need to install by hand + headers_location = join_path(self.prefix.include,'superlu_dist') + mkdirp(headers_location) + # FIXME: fetch all headers in the folder automatically + for header in ['Cnames.h','cublas_utils.h','dcomplex.h','html_mainpage.h','machines.h','old_colamd.h','psymbfact.h','superlu_ddefs.h','superlu_defs.h','superlu_enum_consts.h','superlu_zdefs.h','supermatrix.h','util_dist.h']: + superludist_header = join_path(self.stage.source_path, 'SRC/',header) + install(superludist_header, headers_location) + + superludist_lib = join_path(self.stage.source_path, 'lib/libsuperlu_dist.a') + install(superludist_lib,self.prefix.lib) -- cgit v1.2.3-70-g09d2 From 439d47b4e45c674ab9aa4ebd0c2bfaf6911ade60 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 21 Mar 2016 01:48:18 -0700 Subject: Refactor environment setup. - Gave setup_environment and setup_dependent_environment more similar signatures. They now allows editing the Spack env and the runtime env for *this* package and dependents, respectively. - modify_module renamed to setup_dependent_python_module for symmetry with setup_dependent_environment and to avoid confusion with environment modules. - removed need for patching Package objects at runtime. - adjust packages to reflect these changes. --- lib/spack/spack/build_environment.py | 35 +++--- lib/spack/spack/modules.py | 3 +- lib/spack/spack/package.py | 120 ++++++++++++++++----- var/spack/repos/builtin/packages/mpich/package.py | 9 +- .../builtin/packages/netlib-scalapack/package.py | 2 +- .../repos/builtin/packages/openmpi/package.py | 18 ++-- var/spack/repos/builtin/packages/python/package.py | 39 ++----- var/spack/repos/builtin/packages/qt/package.py | 10 +- var/spack/repos/builtin/packages/ruby/package.py | 12 +-- 9 files changed, 151 insertions(+), 97 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 59b234624c..5688d47e2d 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -84,7 +84,7 @@ class MakeExecutable(Executable): return super(MakeExecutable, self).__call__(*args, **kwargs) -def set_compiler_environment_variables(pkg): +def set_compiler_environment_variables(pkg, env): assert pkg.spec.concrete # Set compiler variables used by CMake and autotools assert all(key in pkg.compiler.link_paths for key in ('cc', 'cxx', 'f77', 'fc')) @@ -92,7 +92,6 @@ def set_compiler_environment_variables(pkg): # Populate an object with the list of environment modifications # and return it # TODO : add additional kwargs for better diagnostics, like requestor, ttyout, ttyerr, etc. - env = EnvironmentModifications() link_dir = spack.build_env_path env.set_env('CC', join_path(link_dir, pkg.compiler.link_paths['cc'])) env.set_env('CXX', join_path(link_dir, pkg.compiler.link_paths['cxx'])) @@ -113,7 +112,7 @@ def set_compiler_environment_variables(pkg): return env -def set_build_environment_variables(pkg): +def set_build_environment_variables(pkg, env): """ This ensures a clean install environment when we build packages """ @@ -134,7 +133,6 @@ def set_build_environment_variables(pkg): if os.path.isdir(ci): env_paths.append(ci) - env = EnvironmentModifications() for item in reversed(env_paths): env.prepend_path('PATH', item) env.set_env(SPACK_ENV_PATH, concatenate_paths(env_paths)) @@ -180,7 +178,7 @@ def set_build_environment_variables(pkg): return env -def set_module_variables_for_package(pkg, m): +def set_module_variables_for_package(pkg, module): """Populate the module scope of install() with some useful functions. This makes things easier for package writers. """ @@ -190,6 +188,8 @@ def set_module_variables_for_package(pkg, m): jobs = 1 elif pkg.make_jobs: jobs = pkg.make_jobs + + m = module m.make_jobs = jobs # TODO: make these build deps that can be installed if not found. @@ -271,9 +271,12 @@ def parent_class_modules(cls): def setup_package(pkg): """Execute all environment setup routines.""" - env = EnvironmentModifications() - env.extend(set_compiler_environment_variables(pkg)) - env.extend(set_build_environment_variables(pkg)) + spack_env = EnvironmentModifications() + run_env = EnvironmentModifications() + + set_compiler_environment_variables(pkg, spack_env) + set_build_environment_variables(pkg, spack_env) + # If a user makes their own package repo, e.g. # spack.repos.mystuff.libelf.Libelf, and they inherit from # an existing class like spack.repos.original.libelf.Libelf, @@ -285,12 +288,20 @@ def setup_package(pkg): # Allow dependencies to modify the module for dependency_spec in pkg.spec.traverse(root=False): - dependency_spec.package.modify_module(pkg.module, dependency_spec, pkg.spec) + dpkg = dependency_spec.package + dpkg.setup_dependent_python_module(pkg.module, pkg.spec) + # Allow dependencies to set up environment as well for dependency_spec in pkg.spec.traverse(root=False): - dependency_spec.package.setup_dependent_environment(env, pkg.spec) - validate(env, tty.warn) - env.apply_modifications() + dpkg = dependency_spec.package + dpkg.setup_dependent_environment(spack_env, run_env, pkg.spec) + + # Allow the package to apply some settings. + pkg.setup_environment(spack_env, run_env) + + # Make sure nothing's strange about the Spack environment. + validate(spack_env, tty.warn) + spack_env.apply_modifications() def fork(pkg, function): diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index 4e98d50001..05c93cd3e6 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -164,7 +164,8 @@ class EnvModule(object): self.pkg.module, extendee_spec, self.spec) # Package-specific environment modifications - self.spec.package.setup_environment(env) + spack_env = EnvironmentModifications() + self.spec.package.setup_environment(spack_env, env) # TODO : implement site-specific modifications and filters if not env: diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index acad5a28f6..9d8ac87bd7 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1002,56 +1002,120 @@ class Package(object): return __import__(self.__class__.__module__, fromlist=[self.__class__.__name__]) - def setup_environment(self, env): - """ - Appends in `env` the list of environment modifications needed to use this package outside of spack. + def setup_environment(self, spack_env, run_env): + """Set up the compile and runtime environemnts for a package. - Default implementation does nothing, but this can be overridden if the package needs a particular environment. + `spack_env` and `run_env` are `EnvironmentModifications` + objects. Package authors can call methods on them to alter + the environment within Spack and at runtime. - Example : + Both `spack_env` and `run_env` are applied within the build + process, before this package's `install()` method is called. + + Modifications in `run_env` will *also* be added to the + generated environment modules for this package. + + Default implementation does nothing, but this can be + overridden if the package needs a particular environment. - 1. A lot of Qt extensions need `QTDIR` set. This can be used to do that. + Examples: + + 1. Qt extensions need `QTDIR` set. Args: - env: list of environment modifications to be updated + spack_env (EnvironmentModifications): list of + modifications to be applied when this package is built + within Spack. + + run_env (EnvironmentModifications): list of environment + changes to be applied when this package is run outside + of Spack. + """ pass - def setup_dependent_environment(self, env, dependent_spec): - """ - Called before the install() method of dependents. - Appends in `env` the list of environment modifications needed by dependents (or extensions) during the - installation of a package. The default implementation delegates to `setup_environment`, but can be overridden - if the modifications to the environment happen to be different from the one needed to use the package outside - of spack. + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + """Set up the environment of packages that depend on this one. + + This is similar to `setup_environment`, but it is used to + modify the compile and runtime environments of packages that + *depend* on this one. This gives packages like Python and + others that follow the extension model a way to implement + common environment or compile-time settings for dependencies. - This is useful if there are some common steps to installing all extensions for a certain package. + By default, this delegates to self.setup_environment() Example : - 1. Installing python modules generally requires `PYTHONPATH` to point to the lib/pythonX.Y/site-packages - directory in the module's install prefix. This could set that variable. + 1. Installing python modules generally requires + `PYTHONPATH` to point to the lib/pythonX.Y/site-packages + directory in the module's install prefix. This could + set that variable. Args: - env: list of environment modifications to be updated - dependent_spec: dependent (or extension) of this spec - """ - self.setup_environment(env) - def modify_module(self, module, spec, dependent_spec): + spack_env (EnvironmentModifications): list of + modifications to be applied when the dependent package + is bulit within Spack. + + run_env (EnvironmentModifications): list of environment + changes to be applied when the dependent package is + run outside of Spack. + + dependent_spec (Spec): The spec of the dependent package + about to be built. This allows the extendee (self) to + query the dependent's state. Note that *this* + package's spec is available as `self.spec`. + + This is useful if there are some common steps to installing + all extensions for a certain package. + """ + self.setup_environment(spack_env, run_env) + + + def setup_dependent_python_module(self, module, dependent_spec): + """Set up Python module-scope variables for dependent packages. + Called before the install() method of dependents. - Default implementation does nothing, but this can be overridden by an extendable package to set up the module of - its extensions. This is useful if there are some common steps to installing all extensions for a - certain package. + Default implementation does nothing, but this can be + overridden by an extendable package to set up the module of + its extensions. This is useful if there are some common steps + to installing all extensions for a certain package. Example : - 1. Extensions often need to invoke the 'python' interpreter from the Python installation being extended. - This routine can put a 'python' Executable object in the module scope for the extension package to simplify - extension installs. + 1. Extensions often need to invoke the `python` + interpreter from the Python installation being + extended. This routine can put a 'python' Executable + object in the module scope for the extension package to + simplify extension installs. + + 2. MPI compilers could set some variables in the + dependent's scope that point to `mpicc`, `mpicxx`, + etc., allowing them to be called by common names + regardless of which MPI is used. + + 3. BLAS/LAPACK implementations can set some variables + indicating the path to their libraries, since these + paths differ by BLAS/LAPACK implementation. + + Args: + + module (module): The Python `module` object of the + dependent package. Packages can use this to set + module-scope variables for the dependent to use. + + dependent_spec (Spec): The spec of the dependent package + about to be built. This allows the extendee (self) to + query the dependent's state. Note that *this* + package's spec is available as `self.spec`. + + This is useful if there are some common steps to installing + all extensions for a certain package. + """ pass diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 5af9b585ea..90b5d42eab 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -47,13 +47,6 @@ class Mpich(Package): provides('mpi@:3.0', when='@3:') provides('mpi@:1.3', when='@1:') - def setup_environment(self, env): - env.set_env('MPICH_CC', self.compiler.cc) - env.set_env('MPICH_CXX', self.compiler.cxx) - env.set_env('MPICH_F77', self.compiler.f77) - env.set_env('MPICH_F90', self.compiler.fc) - env.set_env('MPICH_FC', self.compiler.fc) - def setup_dependent_environment(self, env, dependent_spec): env.set_env('MPICH_CC', spack_cc) env.set_env('MPICH_CXX', spack_cxx) @@ -61,7 +54,7 @@ class Mpich(Package): env.set_env('MPICH_F90', spack_f90) env.set_env('MPICH_FC', spack_fc) - def modify_module(self, module, spec, dep_spec): + def setup_dependent_python_module(self, module, spec, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers? module.mpicc = join_path(self.prefix.bin, 'mpicc') diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 36f506f7cd..62abfcc48e 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -40,7 +40,7 @@ class NetlibScalapack(Package): make() make("install") - def modify_module(self, module, spec, dependent_spec): + def setup_dependent_python_module(self, module, spec, dependent_spec): lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so' lib_suffix = lib_dsuffix if '+shared' in spec['scalapack'] else '.a' diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 7783ca8766..c91a13e376 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -41,17 +41,13 @@ class Openmpi(Package): def url_for_version(self, version): return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version) - def setup_environment(self, env): - env.set_env('OMPI_CC', self.compiler.cc) - env.set_env('OMPI_CXX', self.compiler.cxx) - env.set_env('OMPI_FC', self.compiler.fc) - env.set_env('OMPI_F77', self.compiler.f77) - - def setup_dependent_environment(self, env, dependent_spec): - env.set_env('OMPI_CC', spack_cc) - env.set_env('OMPI_CXX', spack_cxx) - env.set_env('OMPI_FC', spack_fc) - env.set_env('OMPI_F77', spack_f77) + + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + spack_env.set_env('OMPI_CC', spack_cc) + spack_env.set_env('OMPI_CXX', spack_cxx) + spack_env.set_env('OMPI_FC', spack_fc) + spack_env.set_env('OMPI_F77', spack_f77) + def install(self, spec, prefix): config_args = ["--prefix=%s" % prefix, diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index c445d26369..593a27708c 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -92,13 +92,21 @@ class Python(Package): def site_packages_dir(self): return os.path.join(self.python_lib_dir, 'site-packages') - def setup_dependent_environment(self, env, extension_spec): - # Set PYTHONPATH to include site-packages dir for the extension and any other python extensions it depends on. + + def setup_dependent_environment(self, spack_env, run_env, extension_spec): + # TODO: do this only for actual extensions. + + # Set PYTHONPATH to include site-packages dir for the + # extension and any other python extensions it depends on. python_paths = [] for d in extension_spec.traverse(): if d.package.extends(self.spec): python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) - env.set_env('PYTHONPATH', ':'.join(python_paths)) + + pythonpath = ':'.join(python_paths) + spack_env.set_env('PYTHONPATH', pythonpath) + run_env.set_env('PYTHONPATH', pythonpath) + def modify_module(self, module, spec, ext_spec): """ @@ -114,31 +122,6 @@ class Python(Package): else: module.python = Executable(join_path(spec.prefix.bin, 'python')) - # The code below patches the any python extension to have good defaults for `setup_dependent_environment` and - # `setup_environment` only if the extension didn't override any of these functions explicitly. - def _setup_env(self, env): - site_packages = glob.glob(join_path(self.spec.prefix.lib, "python*/site-packages")) - if site_packages: - env.prepend_path('PYTHONPATH', site_packages[0]) - - def _setup_denv(self, env, extension_spec): - pass - - pkg_cls = type(ext_spec.package) # Retrieve the type we may want to patch - if 'python' in pkg_cls.extendees: - # List of overrides we are interested in - interesting_overrides = ['setup_environment', 'setup_dependent_environment'] - overrides_found = [ - (name, defining_cls) for name, _, defining_cls, _, in inspect.classify_class_attrs(pkg_cls) - if - name in interesting_overrides and # The attribute has the right name - issubclass(defining_cls, Package) and defining_cls is not Package # and is an actual override - ] - if not overrides_found: - # If no override were found go on patching - pkg_cls.setup_environment = functools.wraps(Package.setup_environment)(_setup_env) - pkg_cls.setup_dependent_environment = functools.wraps(Package.setup_dependent_environment)(_setup_denv) - # Add variables for lib/pythonX.Y and lib/pythonX.Y/site-packages dirs. module.python_lib_dir = os.path.join(ext_spec.prefix, self.python_lib_dir) module.python_include_dir = os.path.join(ext_spec.prefix, self.python_include_dir) diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 35b9d68462..039aeb3c31 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -55,8 +55,14 @@ class Qt(Package): depends_on("mesa", when='@4:+mesa') depends_on("libxcb") - def setup_environment(self, env): - env.set_env['QTDIR'] = self.prefix + + def setup_environment(self, spack_env, env): + env.set_env('QTDIR', self.prefix) + + + def setup_dependent_environment(self, spack_env, run_env, dspec): + spack_env.set_env('QTDIR', self.prefix) + def patch(self): if self.spec.satisfies('@4'): diff --git a/var/spack/repos/builtin/packages/ruby/package.py b/var/spack/repos/builtin/packages/ruby/package.py index 2d1da8c9af..39f65f51d2 100644 --- a/var/spack/repos/builtin/packages/ruby/package.py +++ b/var/spack/repos/builtin/packages/ruby/package.py @@ -2,7 +2,7 @@ from spack import * class Ruby(Package): - """A dynamic, open source programming language with a focus on + """A dynamic, open source programming language with a focus on simplicity and productivity.""" homepage = "https://www.ruby-lang.org/" @@ -17,15 +17,17 @@ class Ruby(Package): make() make("install") - def setup_dependent_environment(self, env, extension_spec): + def setup_dependent_environment(self, spack_env, run_env, extension_spec): + # TODO: do this only for actual extensions. # Set GEM_PATH to include dependent gem directories ruby_paths = [] for d in extension_spec.traverse(): if d.package.extends(self.spec): ruby_paths.append(d.prefix) - env.set_env('GEM_PATH', concatenate_paths(ruby_paths)) + + spack_env.set_env('GEM_PATH', concatenate_paths(ruby_paths)) # The actual installation path for this gem - env.set_env('GEM_HOME', extension_spec.prefix) + spack_env.set_env('GEM_HOME', extension_spec.prefix) def modify_module(self, module, spec, ext_spec): """Called before ruby modules' install() methods. Sets GEM_HOME @@ -38,5 +40,3 @@ class Ruby(Package): # Ruby extension builds have global ruby and gem functions module.ruby = Executable(join_path(spec.prefix.bin, 'ruby')) module.gem = Executable(join_path(spec.prefix.bin, 'gem')) - - -- cgit v1.2.3-70-g09d2 From b1516f64eb75c108eded1e9ee7e0480a4552236a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 21 Mar 2016 02:21:31 -0700 Subject: Rename some environment methods to be less repetitive, add set_path. --- lib/spack/spack/build_environment.py | 45 +++++++++++----------- lib/spack/spack/environment.py | 22 ++++++++++- lib/spack/spack/test/environment.py | 22 +++++++---- var/spack/repos/builtin/packages/mpich/package.py | 10 ++--- .../repos/builtin/packages/openmpi/package.py | 8 ++-- var/spack/repos/builtin/packages/python/package.py | 4 +- var/spack/repos/builtin/packages/qt/package.py | 4 +- var/spack/repos/builtin/packages/ruby/package.py | 5 ++- 8 files changed, 73 insertions(+), 47 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 5688d47e2d..fc5b7d6207 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -36,7 +36,7 @@ import sys import spack import llnl.util.tty as tty from llnl.util.filesystem import * -from spack.environment import EnvironmentModifications, concatenate_paths, validate +from spack.environment import EnvironmentModifications, validate from spack.util.environment import * from spack.util.executable import Executable, which @@ -93,22 +93,23 @@ def set_compiler_environment_variables(pkg, env): # and return it # TODO : add additional kwargs for better diagnostics, like requestor, ttyout, ttyerr, etc. link_dir = spack.build_env_path - env.set_env('CC', join_path(link_dir, pkg.compiler.link_paths['cc'])) - env.set_env('CXX', join_path(link_dir, pkg.compiler.link_paths['cxx'])) - env.set_env('F77', join_path(link_dir, pkg.compiler.link_paths['f77'])) - env.set_env('FC', join_path(link_dir, pkg.compiler.link_paths['fc'])) + env.set('CC', join_path(link_dir, pkg.compiler.link_paths['cc'])) + env.set('CXX', join_path(link_dir, pkg.compiler.link_paths['cxx'])) + env.set('F77', join_path(link_dir, pkg.compiler.link_paths['f77'])) + env.set('FC', join_path(link_dir, pkg.compiler.link_paths['fc'])) + # Set SPACK compiler variables so that our wrapper knows what to call compiler = pkg.compiler if compiler.cc: - env.set_env('SPACK_CC', compiler.cc) + env.set('SPACK_CC', compiler.cc) if compiler.cxx: - env.set_env('SPACK_CXX', compiler.cxx) + env.set('SPACK_CXX', compiler.cxx) if compiler.f77: - env.set_env('SPACK_F77', compiler.f77) + env.set('SPACK_F77', compiler.f77) if compiler.fc: - env.set_env('SPACK_FC', compiler.fc) + env.set('SPACK_FC', compiler.fc) - env.set_env('SPACK_COMPILER_SPEC', str(pkg.spec.compiler)) + env.set('SPACK_COMPILER_SPEC', str(pkg.spec.compiler)) return env @@ -135,25 +136,25 @@ def set_build_environment_variables(pkg, env): for item in reversed(env_paths): env.prepend_path('PATH', item) - env.set_env(SPACK_ENV_PATH, concatenate_paths(env_paths)) + env.set_path(SPACK_ENV_PATH, env_paths) # Prefixes of all of the package's dependencies go in SPACK_DEPENDENCIES dep_prefixes = [d.prefix for d in pkg.spec.traverse(root=False)] - env.set_env(SPACK_DEPENDENCIES, concatenate_paths(dep_prefixes)) - env.set_env('CMAKE_PREFIX_PATH', concatenate_paths(dep_prefixes)) # Add dependencies to CMAKE_PREFIX_PATH + env.set_path(SPACK_DEPENDENCIES, dep_prefixes) + env.set_path('CMAKE_PREFIX_PATH', dep_prefixes) # Add dependencies to CMAKE_PREFIX_PATH # Install prefix - env.set_env(SPACK_PREFIX, pkg.prefix) + env.set(SPACK_PREFIX, pkg.prefix) # Install root prefix - env.set_env(SPACK_INSTALL, spack.install_path) + env.set(SPACK_INSTALL, spack.install_path) # Remove these vars from the environment during build because they # can affect how some packages find libraries. We want to make # sure that builds never pull in unintended external dependencies. - env.unset_env('LD_LIBRARY_PATH') - env.unset_env('LD_RUN_PATH') - env.unset_env('DYLD_LIBRARY_PATH') + env.unset('LD_LIBRARY_PATH') + env.unset('LD_RUN_PATH') + env.unset('DYLD_LIBRARY_PATH') # Add bin directories from dependencies to the PATH for the build. bin_dirs = reversed(filter(os.path.isdir, ['%s/bin' % prefix for prefix in dep_prefixes])) @@ -162,9 +163,9 @@ def set_build_environment_variables(pkg, env): # Working directory for the spack command itself, for debug logs. if spack.debug: - env.set_env(SPACK_DEBUG, 'TRUE') - env.set_env(SPACK_SHORT_SPEC, pkg.spec.short_spec) - env.set_env(SPACK_DEBUG_LOG_DIR, spack.spack_working_dir) + env.set(SPACK_DEBUG, 'TRUE') + env.set(SPACK_SHORT_SPEC, pkg.spec.short_spec) + env.set(SPACK_DEBUG_LOG_DIR, spack.spack_working_dir) # Add any pkgconfig directories to PKG_CONFIG_PATH pkg_config_dirs = [] @@ -173,7 +174,7 @@ def set_build_environment_variables(pkg, env): pcdir = join_path(p, libdir, 'pkgconfig') if os.path.isdir(pcdir): pkg_config_dirs.append(pcdir) - env.set_env('PKG_CONFIG_PATH', concatenate_paths(pkg_config_dirs)) + env.set_path('PKG_CONFIG_PATH', pkg_config_dirs) return env diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index 74aef57fe8..72aafa4e2d 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -29,6 +29,12 @@ class UnsetEnv(NameModifier): os.environ.pop(self.name, None) # Avoid throwing if the variable was not set +class SetPath(NameValueModifier): + def execute(self): + string_path = concatenate_paths(self.value) + os.environ[self.name] = string_path + + class AppendPath(NameValueModifier): def execute(self): environment_value = os.environ.get(self.name, '') @@ -103,7 +109,7 @@ class EnvironmentModifications(object): } return args - def set_env(self, name, value, **kwargs): + def set(self, name, value, **kwargs): """ Stores in the current object a request to set an environment variable @@ -115,7 +121,7 @@ class EnvironmentModifications(object): item = SetEnv(name, value, **kwargs) self.env_modifications.append(item) - def unset_env(self, name, **kwargs): + def unset(self, name, **kwargs): """ Stores in the current object a request to unset an environment variable @@ -126,6 +132,18 @@ class EnvironmentModifications(object): item = UnsetEnv(name, **kwargs) self.env_modifications.append(item) + def set_path(self, name, elts, **kwargs): + """ + Stores a request to set a path generated from a list. + + Args: + name: name o the environment variable to be set. + elts: elements of the path to set. + """ + kwargs.update(self._get_outside_caller_attributes()) + item = SetPath(name, elts, **kwargs) + self.env_modifications.append(item) + def append_path(self, name, path, **kwargs): """ Stores in the current object a request to append a path to a path list diff --git a/lib/spack/spack/test/environment.py b/lib/spack/spack/test/environment.py index 3e03760c01..6c8f5ea43c 100644 --- a/lib/spack/spack/test/environment.py +++ b/lib/spack/spack/test/environment.py @@ -11,21 +11,27 @@ class EnvironmentTest(unittest.TestCase): os.environ['PATH_LIST'] = '/path/second:/path/third' os.environ['REMOVE_PATH_LIST'] = '/a/b:/duplicate:/a/c:/remove/this:/a/d:/duplicate/:/f/g' - def test_set_env(self): + def test_set(self): env = EnvironmentModifications() - env.set_env('A', 'dummy value') - env.set_env('B', 3) + env.set('A', 'dummy value') + env.set('B', 3) env.apply_modifications() self.assertEqual('dummy value', os.environ['A']) self.assertEqual(str(3), os.environ['B']) - def test_unset_env(self): + def test_unset(self): env = EnvironmentModifications() self.assertEqual('foo', os.environ['UNSET_ME']) - env.unset_env('UNSET_ME') + env.unset('UNSET_ME') env.apply_modifications() self.assertRaises(KeyError, os.environ.__getitem__, 'UNSET_ME') + def test_set_path(self): + env = EnvironmentModifications() + env.set_path('A', ['foo', 'bar', 'baz']) + env.apply_modifications() + self.assertEqual('foo:bar:baz', os.environ['A']) + def test_path_manipulation(self): env = EnvironmentModifications() @@ -51,7 +57,7 @@ class EnvironmentTest(unittest.TestCase): def test_extra_arguments(self): env = EnvironmentModifications() - env.set_env('A', 'dummy value', who='Pkg1') + env.set('A', 'dummy value', who='Pkg1') for x in env: assert 'who' in x.args env.apply_modifications() @@ -59,8 +65,8 @@ class EnvironmentTest(unittest.TestCase): def test_extend(self): env = EnvironmentModifications() - env.set_env('A', 'dummy value') - env.set_env('B', 3) + env.set('A', 'dummy value') + env.set('B', 3) copy_construct = EnvironmentModifications(env) self.assertEqual(len(copy_construct), 2) for x, y in zip(env, copy_construct): diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 90b5d42eab..c4d9940bb7 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -48,11 +48,11 @@ class Mpich(Package): provides('mpi@:1.3', when='@1:') def setup_dependent_environment(self, env, dependent_spec): - env.set_env('MPICH_CC', spack_cc) - env.set_env('MPICH_CXX', spack_cxx) - env.set_env('MPICH_F77', spack_f77) - env.set_env('MPICH_F90', spack_f90) - env.set_env('MPICH_FC', spack_fc) + env.set('MPICH_CC', spack_cc) + env.set('MPICH_CXX', spack_cxx) + env.set('MPICH_F77', spack_f77) + env.set('MPICH_F90', spack_f90) + env.set('MPICH_FC', spack_fc) def setup_dependent_python_module(self, module, spec, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index c91a13e376..9a127f1812 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -43,10 +43,10 @@ class Openmpi(Package): def setup_dependent_environment(self, spack_env, run_env, dependent_spec): - spack_env.set_env('OMPI_CC', spack_cc) - spack_env.set_env('OMPI_CXX', spack_cxx) - spack_env.set_env('OMPI_FC', spack_fc) - spack_env.set_env('OMPI_F77', spack_f77) + spack_env.set('OMPI_CC', spack_cc) + spack_env.set('OMPI_CXX', spack_cxx) + spack_env.set('OMPI_FC', spack_fc) + spack_env.set('OMPI_F77', spack_f77) def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 593a27708c..4f55bc803e 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -104,8 +104,8 @@ class Python(Package): python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) pythonpath = ':'.join(python_paths) - spack_env.set_env('PYTHONPATH', pythonpath) - run_env.set_env('PYTHONPATH', pythonpath) + spack_env.set('PYTHONPATH', pythonpath) + run_env.set('PYTHONPATH', pythonpath) def modify_module(self, module, spec, ext_spec): diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 039aeb3c31..d08e8e81e1 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -57,11 +57,11 @@ class Qt(Package): def setup_environment(self, spack_env, env): - env.set_env('QTDIR', self.prefix) + env.set('QTDIR', self.prefix) def setup_dependent_environment(self, spack_env, run_env, dspec): - spack_env.set_env('QTDIR', self.prefix) + spack_env.set('QTDIR', self.prefix) def patch(self): diff --git a/var/spack/repos/builtin/packages/ruby/package.py b/var/spack/repos/builtin/packages/ruby/package.py index 39f65f51d2..7ff1898ce9 100644 --- a/var/spack/repos/builtin/packages/ruby/package.py +++ b/var/spack/repos/builtin/packages/ruby/package.py @@ -25,9 +25,10 @@ class Ruby(Package): if d.package.extends(self.spec): ruby_paths.append(d.prefix) - spack_env.set_env('GEM_PATH', concatenate_paths(ruby_paths)) + spack_env.set_path('GEM_PATH', ruby_paths) + # The actual installation path for this gem - spack_env.set_env('GEM_HOME', extension_spec.prefix) + spack_env.set('GEM_HOME', extension_spec.prefix) def modify_module(self, module, spec, ext_spec): """Called before ruby modules' install() methods. Sets GEM_HOME -- cgit v1.2.3-70-g09d2 From 23bf70296e4a02f49c301b1b744055802b1e8dc1 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 22 Mar 2016 09:22:42 +0100 Subject: arpack: add a patch for 3.3 --- var/spack/repos/builtin/packages/arpack-ng/package.py | 4 ++++ .../repos/builtin/packages/arpack-ng/pdlamch10.patch | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 var/spack/repos/builtin/packages/arpack-ng/pdlamch10.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py index 0b49d14202..614071cf53 100644 --- a/var/spack/repos/builtin/packages/arpack-ng/package.py +++ b/var/spack/repos/builtin/packages/arpack-ng/package.py @@ -35,6 +35,10 @@ class ArpackNg(Package): variant('shared', default=True, description='Enables the build of shared libraries') variant('mpi', default=False, description='Activates MPI support') + # The function pdlamch10 does not set the return variable. This is fixed upstream + # see https://github.com/opencollab/arpack-ng/issues/34 + patch('pdlamch10.patch', when='@3.3:') + depends_on('blas') depends_on('lapack') depends_on('mpi', when='+mpi') diff --git a/var/spack/repos/builtin/packages/arpack-ng/pdlamch10.patch b/var/spack/repos/builtin/packages/arpack-ng/pdlamch10.patch new file mode 100644 index 0000000000..922828909f --- /dev/null +++ b/var/spack/repos/builtin/packages/arpack-ng/pdlamch10.patch @@ -0,0 +1,15 @@ +diff --git a/PARPACK/SRC/MPI/pdlamch10.f b/PARPACK/SRC/MPI/pdlamch10.f +index 6571da9..2882c2e 100644 +--- a/PARPACK/SRC/MPI/pdlamch10.f ++++ b/PARPACK/SRC/MPI/pdlamch10.f +@@ -86,8 +86,8 @@ + TEMP = TEMP1 + END IF + * +- PDLAMCH = TEMP ++ PDLAMCH10 = TEMP + * +-* End of PDLAMCH ++* End of PDLAMCH10 + * + END -- cgit v1.2.3-70-g09d2 From aca8b5c89de7058ab58f2eb3392e8b023b16fe8a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 22 Mar 2016 09:27:00 +0100 Subject: move suite sparse to a proper folder --- .../repos/builtin/packages/SuiteSparse/package.py | 27 ---------------------- .../repos/builtin/packages/suite-sparse/package.py | 27 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/SuiteSparse/package.py create mode 100644 var/spack/repos/builtin/packages/suite-sparse/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/SuiteSparse/package.py b/var/spack/repos/builtin/packages/SuiteSparse/package.py deleted file mode 100644 index 6e130d118f..0000000000 --- a/var/spack/repos/builtin/packages/SuiteSparse/package.py +++ /dev/null @@ -1,27 +0,0 @@ -from spack import * - - -class Suitesparse(Package): - """ - SuiteSparse is a suite of sparse matrix algorithms - """ - homepage = 'http://faculty.cse.tamu.edu/davis/suitesparse.html' - url = 'http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.1.tar.gz' - - version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319') - - depends_on('blas') - depends_on('lapack') - - depends_on('metis@5.1.0', when='@4.5.1') - - def install(self, spec, prefix): - # The build system of SuiteSparse is quite old-fashioned - # It's basically a plain Makefile which include an header (SuiteSparse_config/SuiteSparse_config.mk) - # with a lot of convoluted logic in it. - # Any kind of customization will need to go through filtering of that file - - # FIXME : this actually uses the current workaround - # FIXME : (blas / lapack always provide libblas and liblapack as aliases) - make('install', 'INSTALL=%s' % prefix, 'BLAS=-lblas', 'LAPACK=-llapack') - diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py new file mode 100644 index 0000000000..6e130d118f --- /dev/null +++ b/var/spack/repos/builtin/packages/suite-sparse/package.py @@ -0,0 +1,27 @@ +from spack import * + + +class Suitesparse(Package): + """ + SuiteSparse is a suite of sparse matrix algorithms + """ + homepage = 'http://faculty.cse.tamu.edu/davis/suitesparse.html' + url = 'http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.1.tar.gz' + + version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319') + + depends_on('blas') + depends_on('lapack') + + depends_on('metis@5.1.0', when='@4.5.1') + + def install(self, spec, prefix): + # The build system of SuiteSparse is quite old-fashioned + # It's basically a plain Makefile which include an header (SuiteSparse_config/SuiteSparse_config.mk) + # with a lot of convoluted logic in it. + # Any kind of customization will need to go through filtering of that file + + # FIXME : this actually uses the current workaround + # FIXME : (blas / lapack always provide libblas and liblapack as aliases) + make('install', 'INSTALL=%s' % prefix, 'BLAS=-lblas', 'LAPACK=-llapack') + -- cgit v1.2.3-70-g09d2 From 3c5a1605d5e3cba881b743bf561f0966b1a3ad8b Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 22 Mar 2016 09:27:39 +0100 Subject: adjust the class name for suite sparse --- var/spack/repos/builtin/packages/suite-sparse/package.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py index 6e130d118f..b57f9967c3 100644 --- a/var/spack/repos/builtin/packages/suite-sparse/package.py +++ b/var/spack/repos/builtin/packages/suite-sparse/package.py @@ -1,7 +1,7 @@ from spack import * -class Suitesparse(Package): +class SuiteSparse(Package): """ SuiteSparse is a suite of sparse matrix algorithms """ @@ -24,4 +24,3 @@ class Suitesparse(Package): # FIXME : this actually uses the current workaround # FIXME : (blas / lapack always provide libblas and liblapack as aliases) make('install', 'INSTALL=%s' % prefix, 'BLAS=-lblas', 'LAPACK=-llapack') - -- cgit v1.2.3-70-g09d2 From cb97e8dd9301e5bbc6752caed2f4861a2a06f494 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 22 Mar 2016 09:43:10 +0100 Subject: adjust eigen and octave to use new names of suite sparse --- var/spack/repos/builtin/packages/eigen/package.py | 2 +- var/spack/repos/builtin/packages/octave/package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py index e40046b452..8d6e672f86 100644 --- a/var/spack/repos/builtin/packages/eigen/package.py +++ b/var/spack/repos/builtin/packages/eigen/package.py @@ -48,7 +48,7 @@ class Eigen(Package): depends_on('metis', when='+metis') depends_on('scotch', when='+scotch') depends_on('fftw', when='+fftw') - depends_on('SuiteSparse', when='+suitesparse') + 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') diff --git a/var/spack/repos/builtin/packages/octave/package.py b/var/spack/repos/builtin/packages/octave/package.py index 38b355159d..6e99c23652 100644 --- a/var/spack/repos/builtin/packages/octave/package.py +++ b/var/spack/repos/builtin/packages/octave/package.py @@ -62,7 +62,7 @@ class Octave(Package): depends_on('qrupdate', when='+qrupdate') #depends_on('qscintilla', when='+qscintilla) # TODO: add package depends_on('qt', when='+qt') - depends_on('SuiteSparse', when='+suitesparse') + depends_on('suite-sparse',when='+suitesparse') depends_on('zlib', when='+zlib') -- cgit v1.2.3-70-g09d2 From a26992ef55fed958c15b45b989fc0a4d57f02251 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 22 Mar 2016 01:56:16 -0700 Subject: Change from PR #552: rename setup_dependent_python_module -> setup_dependent_package - Fixed in package.py - Fixed wrong prototypes in packages that use it. - Fixed build_environment to set module variables properly - added hacky fix to ensure spec/package consistency in build processes. - Need to think about defensive spec copy done by `Repo.get`. May be time to think about an immutable spec implementation. --- lib/spack/spack/build_environment.py | 52 ++++++++++++++++------ lib/spack/spack/package.py | 2 +- var/spack/repos/builtin/packages/mpich/package.py | 2 +- .../builtin/packages/netlib-scalapack/package.py | 22 ++++----- 4 files changed, 52 insertions(+), 26 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index fc5b7d6207..119a255a34 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -225,7 +225,7 @@ def set_module_variables_for_package(pkg, module): m.spack_cc = join_path(link_dir, pkg.compiler.link_paths['cc']) m.spack_cxx = join_path(link_dir, pkg.compiler.link_paths['cxx']) m.spack_f77 = join_path(link_dir, pkg.compiler.link_paths['f77']) - m.spack_f90 = join_path(link_dir, pkg.compiler.link_paths['fc']) + m.spack_fc = join_path(link_dir, pkg.compiler.link_paths['fc']) # Emulate some shell commands for convenience m.pwd = os.getcwd @@ -270,32 +270,56 @@ def parent_class_modules(cls): return result +def setup_module_variables_for_dag(pkg): + """Set module-scope variables for all packages in the DAG.""" + for spec in pkg.spec.traverse(order='post'): + # If a user makes their own package repo, e.g. + # spack.repos.mystuff.libelf.Libelf, and they inherit from + # an existing class like spack.repos.original.libelf.Libelf, + # then set the module variables for both classes so the + # parent class can still use them if it gets called. + spkg = spec.package + modules = parent_class_modules(spkg.__class__) + for mod in modules: + set_module_variables_for_package(spkg, mod) + set_module_variables_for_package(spkg, spkg.module) + + def setup_package(pkg): """Execute all environment setup routines.""" spack_env = EnvironmentModifications() run_env = EnvironmentModifications() + # Before proceeding, ensure that specs and packages are consistent + # + # This is a confusing behavior due to how packages are + # constructed. `setup_dependent_package` may set attributes on + # specs in the DAG for use by other packages' install + # method. However, spec.package will look up a package via + # spack.repo, which defensively copies specs into packages. This + # code ensures that all packages in the DAG have pieces of the + # same spec object at build time. + # + # This is safe for the build process, b/c the build process is a + # throwaway environment, but it is kind of dirty. + # + # TODO: Think about how to avoid this fix and do something cleaner. + for s in pkg.spec.traverse(): s.package.spec = s + set_compiler_environment_variables(pkg, spack_env) set_build_environment_variables(pkg, spack_env) - - # If a user makes their own package repo, e.g. - # spack.repos.mystuff.libelf.Libelf, and they inherit from - # an existing class like spack.repos.original.libelf.Libelf, - # then set the module variables for both classes so the - # parent class can still use them if it gets called. - modules = parent_class_modules(pkg.__class__) - for mod in modules: - set_module_variables_for_package(pkg, mod) + setup_module_variables_for_dag(pkg) # Allow dependencies to modify the module - for dependency_spec in pkg.spec.traverse(root=False): + spec = pkg.spec + for dependency_spec in spec.traverse(root=False): dpkg = dependency_spec.package - dpkg.setup_dependent_python_module(pkg.module, pkg.spec) + dpkg.setup_dependent_package(pkg.module, spec) # Allow dependencies to set up environment as well - for dependency_spec in pkg.spec.traverse(root=False): + for dependency_spec in spec.traverse(root=False): dpkg = dependency_spec.package - dpkg.setup_dependent_environment(spack_env, run_env, pkg.spec) + dpkg.setup_dependent_environment(spack_env, run_env, spec) # Allow the package to apply some settings. pkg.setup_environment(spack_env, run_env) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 9d8ac87bd7..9af3221837 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1075,7 +1075,7 @@ class Package(object): self.setup_environment(spack_env, run_env) - def setup_dependent_python_module(self, module, dependent_spec): + def setup_dependent_package(self, module, dependent_spec): """Set up Python module-scope variables for dependent packages. Called before the install() method of dependents. diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index c4d9940bb7..b20dc8dd60 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -54,7 +54,7 @@ class Mpich(Package): env.set('MPICH_F90', spack_f90) env.set('MPICH_FC', spack_fc) - def setup_dependent_python_module(self, module, spec, dep_spec): + def setup_dependent_package(self, module, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers? module.mpicc = join_path(self.prefix.bin, 'mpicc') diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 62abfcc48e..c3e6822cdf 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -1,4 +1,5 @@ from spack import * +import sys class NetlibScalapack(Package): """ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines""" @@ -11,16 +12,16 @@ class NetlibScalapack(Package): version('2.0.0', '9e76ae7b291be27faaad47cfc256cbfe') # versions before 2.0.0 are not using cmake and requires blacs as # a separated package - + variant('shared', default=True, description='Build the shared library version') variant('fpic', default=False, description="Build with -fpic compiler option") - + provides('scalapack') - + depends_on('mpi') depends_on('lapack') - - def install(self, spec, prefix): + + def install(self, spec, prefix): options = [ "-DBUILD_SHARED_LIBS:BOOL=%s" % ('ON' if '+shared' in spec else 'OFF'), "-DBUILD_STATIC_LIBS:BOOL=%s" % ('OFF' if '+shared' in spec else 'ON'), @@ -40,10 +41,11 @@ class NetlibScalapack(Package): make() make("install") - def setup_dependent_python_module(self, module, spec, dependent_spec): + def setup_dependent_package(self, module, dependent_spec): + spec = self.spec lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so' - lib_suffix = lib_dsuffix if '+shared' in spec['scalapack'] else '.a' + lib_suffix = lib_dsuffix if '+shared' in spec else '.a' - spec['scalapack'].fc_link = '-L%s -lscalapack' % spec['scalapack'].prefix.lib - spec['scalapack'].cc_link = spec['scalapack'].fc_link - spec['scalapack'].libraries = [join_path(spec['scalapack'].prefix.lib, 'libscalapack%s' % lib_suffix)] + spec.fc_link = '-L%s -lscalapack' % spec.prefix.lib + spec.cc_link = spec.fc_link + spec.libraries = [join_path(spec.prefix.lib, 'libscalapack%s' % lib_suffix)] -- cgit v1.2.3-70-g09d2