Merge branch 'develop' of https://github.com/LLNL/spack into packages/blas_lapack_providers

Conflicts:
	var/spack/repos/builtin/packages/py-numpy/package.py
This commit is contained in:
Massimiliano Culpo 2016-03-25 11:05:05 +01:00
commit f15249afe5
15 changed files with 145 additions and 57 deletions

8
etc/spack/modules.yaml Normal file
View File

@ -0,0 +1,8 @@
# -------------------------------------------------------------------------
# This is the default spack module files generation configuration.
#
# Changes to this file will affect all users of this spack install,
# although users can override these settings in their ~/.spack/modules.yaml.
# -------------------------------------------------------------------------
modules:
enable: ['tcl', 'dotkit']

View File

@ -237,7 +237,29 @@
'type' : 'object',
'default' : {},
}
},},},},},}
},},},},},},
'modules': {
'$schema': 'http://json-schema.org/schema#',
'title': 'Spack module file configuration file schema',
'type': 'object',
'additionalProperties': False,
'patternProperties': {
r'modules:?': {
'type': 'object',
'default': {},
'additionalProperties': False,
'properties': {
'enable': {
'type': 'array',
'default': [],
'items': {
'type': 'string'
}
}
}
},
},
},
}
"""OrderedDict of config scopes keyed by name.
@ -405,11 +427,11 @@ def _read_config_file(filename, schema):
validate_section(data, schema)
return data
except MarkedYAMLError, e:
except MarkedYAMLError as e:
raise ConfigFileError(
"Error parsing yaml%s: %s" % (str(e.context_mark), e.problem))
except IOError, e:
except IOError as e:
raise ConfigFileError(
"Error reading configuration file %s: %s" % (filename, str(e)))

View File

@ -48,6 +48,7 @@
import llnl.util.tty as tty
import spack
import spack.config
from llnl.util.filesystem import join_path, mkdirp
from spack.environment import *
@ -56,6 +57,8 @@
# Registry of all types of modules. Entries created by EnvModule's metaclass
module_types = {}
CONFIGURATION = spack.config.get_config('modules')
def print_help():
"""For use by commands to tell user how to activate shell support."""
@ -115,7 +118,7 @@ class EnvModule(object):
class __metaclass__(type):
def __init__(cls, name, bases, dict):
type.__init__(cls, name, bases, dict)
if cls.name != 'env_module':
if cls.name != 'env_module' and cls.name in CONFIGURATION['enable']:
module_types[cls.name] = cls
def __init__(self, spec=None):
@ -158,13 +161,13 @@ def write(self):
# 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.setup_dependent_package(
self.pkg.module, self.spec)
spack_env = EnvironmentModifications()
for item in self.pkg.extendees:
package = self.spec[item].package
package.setup_dependent_package(self.pkg.module, self.spec)
package.setup_dependent_environment(spack_env, env, self.spec)
# Package-specific environment modifications
spack_env = EnvironmentModifications()
self.spec.package.setup_environment(spack_env, env)
# TODO : implement site-specific modifications and filters

View File

@ -1,31 +1,36 @@
from spack import *
from spack.util.executable import Executable
import os
import os.path
class Atlas(Package):
"""
Automatically Tuned Linear Algebra Software, generic shared
ATLAS is an approach for the automatic generation and optimization of
numerical software. Currently ATLAS supplies optimized versions for the
complete set of linear algebra kernels known as the Basic Linear Algebra
Subroutines (BLAS), and a subset of the linear algebra routines in the
LAPACK library.
Automatically Tuned Linear Algebra Software, generic shared ATLAS is an approach for the automatic generation and
optimization of numerical software. Currently ATLAS supplies optimized versions for the complete set of linear
algebra kernels known as the Basic Linear Algebra Subroutines (BLAS), and a subset of the linear algebra routines
in the LAPACK library.
"""
homepage = "http://math-atlas.sourceforge.net/"
version('3.10.2', 'a4e21f343dec8f22e7415e339f09f6da',
url='http://downloads.sourceforge.net/project/math-atlas/Stable/3.10.2/atlas3.10.2.tar.bz2', preferred=True)
resource(name='lapack',
url='http://www.netlib.org/lapack/lapack-3.5.0.tgz',
md5='b1d3e3e425b2e44a06760ff173104bdf',
destination='spack-resource-lapack',
when='@3:')
version('3.11.34', '0b6c5389c095c4c8785fd0f724ec6825',
url='http://sourceforge.net/projects/math-atlas/files/Developer%20%28unstable%29/3.11.34/atlas3.11.34.tar.bz2/download')
version('3.10.2', 'a4e21f343dec8f22e7415e339f09f6da',
url='http://downloads.sourceforge.net/project/math-atlas/Stable/3.10.2/atlas3.10.2.tar.bz2')
# TODO: make this provide BLAS once it works better. Create a way
# TODO: to mark "beta" packages and require explicit invocation.
variant('shared', default=True, description='Builds shared library')
# provides('blas')
provides('blas')
provides('lapack')
parallel = False
def patch(self):
# Disable thraed check. LLNL's environment does not allow
# Disable thread check. LLNL's environment does not allow
# disabling of CPU throttling in a way that ATLAS actually
# understands.
filter_file(r'^\s+if \(thrchk\) exit\(1\);', 'if (0) exit(1);',
@ -33,26 +38,21 @@ def patch(self):
# TODO: investigate a better way to add the check back in
# TODO: using, say, MSRs. Or move this to a variant.
@when('@:3.10')
def install(self, spec, prefix):
with working_dir('ATLAS-Build', create=True):
options = []
if '+shared' in spec:
options.append('--shared')
# Lapack resource
lapack_stage = self.stage[1]
lapack_tarfile = os.path.basename(lapack_stage.fetcher.url)
lapack_tarfile_path = join_path(lapack_stage.path, lapack_tarfile)
options.append('--with-netlib-lapack-tarfile=%s' % lapack_tarfile_path)
with working_dir('spack-build', create=True):
configure = Executable('../configure')
configure('--prefix=%s' % prefix, '-C', 'ic', 'cc', '-C', 'if', 'f77', "--dylibs")
make()
make('check')
make('ptcheck')
make('time')
make("install")
def install(self, spec, prefix):
with working_dir('ATLAS-Build', create=True):
configure = Executable('../configure')
configure('--incdir=%s' % prefix.include,
'--libdir=%s' % prefix.lib,
'--cc=cc',
"--shared")
configure('--prefix=%s' % prefix, *options)
make()
make('check')
make('ptcheck')

View File

@ -38,10 +38,12 @@ class Cmake(Package):
version('2.8.10.2', '097278785da7182ec0aea8769d06860c')
variant('ncurses', default=True, description='Enables the build of the ncurses gui')
variant('openssl', default=True, description="Enables CMake's OpenSSL features")
variant('qt', default=False, description='Enables the build of cmake-gui')
variant('doc', default=False, description='Enables the generation of html and man page documentation')
depends_on('ncurses', when='+ncurses')
depends_on('openssl', when='+openssl')
depends_on('qt', when='+qt')
depends_on('python@2.7.11:', when='+doc')
depends_on('py-sphinx', when='+doc')
@ -77,8 +79,9 @@ def install(self, spec, prefix):
options.append('--sphinx-html')
options.append('--sphinx-man')
options.append('--')
options.append('-DCMAKE_USE_OPENSSL=ON')
if '+openssl' in spec:
options.append('--')
options.append('-DCMAKE_USE_OPENSSL=ON')
configure(*options)
make()

View File

@ -32,6 +32,10 @@ def check_variants(self, spec):
if '+elpa' in spec and ('~mpi' in spec or '~scalapack' in spec):
raise RuntimeError(error.format(variant='elpa'))
def setup_environment(self, spack_env, run_env):
# Espresso copies every executable in prefix without creating sub-folders
run_env.prepend_path('PATH', self.prefix)
def install(self, spec, prefix):
self.check_variants(spec)

View File

@ -38,8 +38,6 @@ class Libelf(Package):
provides('elf')
sanity_check_is_file = 'include/libelf.h'
def install(self, spec, prefix):
configure("--prefix=" + prefix,
"--enable-shared",

View File

@ -135,7 +135,8 @@ def install(self, spec, prefix):
self.write_makefile_inc()
make(*make_libs)
# Build fails in parallel, at least on OS-X
make(*make_libs, parallel=False)
install_tree('lib', prefix.lib)
install_tree('include', prefix.include)

View File

@ -6,6 +6,7 @@ class Openblas(Package):
homepage = "http://www.openblas.net"
url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz"
version('0.2.17', '664a12807f2a2a7cda4781e3ab2ae0e1')
version('0.2.16', 'fef46ab92463bdbb1479dcec594ef6dc')
version('0.2.15', 'b1190f3d3471685f17cfd1ec1d252ac9')
@ -14,7 +15,14 @@ class Openblas(Package):
provides('lapack')
def install(self, spec, prefix):
make('libs', 'netlib', 'shared', 'CC=cc', 'FC=f77')
extra=[]
if spec.satisfies('@0.2.16'):
extra.extend([
'BUILD_LAPACK_DEPRECATED=1' # fix missing _dggsvd_ and _sggsvd_
])
make('libs', 'netlib', 'shared', 'CC=cc', 'FC=f77',*extra)
make("tests")
make('install', "PREFIX='%s'" % prefix)
lib_dsuffix = 'dylib' if sys.platform == 'darwin' else 'so'

View File

@ -0,0 +1,14 @@
diff --git a/libparmetis/CMakeLists.txt b/libparmetis/CMakeLists.txt
index 9cfc8a7..dfc0125 100644
--- a/libparmetis/CMakeLists.txt
+++ b/libparmetis/CMakeLists.txt
@@ -5,7 +5,7 @@ file(GLOB parmetis_sources *.c)
# Create libparmetis
add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
# Link with metis and MPI libraries.
-target_link_libraries(parmetis metis ${MPI_LIBRARIES})
+target_link_libraries(parmetis metis ${MPI_LIBRARIES} "-lm")
set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
install(TARGETS parmetis

View File

@ -52,6 +52,8 @@ class Parmetis(Package):
# https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/
patch('pkg-parmetis-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch')
patch('link-to-lm.patch')
depends_on('gdb', when='+gdb')
def install(self, spec, prefix):

View File

@ -1,23 +1,43 @@
from spack import *
class PyNumpy(Package):
"""array processing for numbers, strings, records, and objects."""
homepage = "https://pypi.python.org/pypi/numpy"
"""NumPy is the fundamental package for scientific computing with Python.
It contains among other things: a powerful N-dimensional array object,
sophisticated (broadcasting) functions, tools for integrating C/C++ and
Fortran code, and useful linear algebra, Fourier transform, and random
number capabilities"""
homepage = "http://www.numpy.org/"
url = "https://pypi.python.org/packages/source/n/numpy/numpy-1.9.1.tar.gz"
version('1.9.1', '78842b73560ec378142665e712ae4ad9')
version('1.9.2', 'a1ed53432dbcd256398898d35bc8e645')
version('1.10.4', 'aed294de0aa1ac7bd3f9745f4f1968ad')
version('1.9.2', 'a1ed53432dbcd256398898d35bc8e645')
version('1.9.1', '78842b73560ec378142665e712ae4ad9')
variant('blas', default=True)
variant('blas', default=True)
variant('lapack', default=True)
extends('python')
depends_on('py-nose')
depends_on('lapack+shared', when='+blas')
depends_on('blas', when='+blas')
depends_on('lapack', when='+lapack')
def install(self, spec, prefix):
libraries = []
library_dirs = []
if '+blas' in spec:
libraries.append('blas')
library_dirs.append(spec['blas'].prefix.lib)
if '+lapack' in spec:
libraries.append('lapack')
library_dirs.append(spec['lapack'].prefix.lib)
if '+blas' in spec or '+lapack' in spec:
with open('site.cfg', 'w') as f:
f.write('[DEFAULT]\n')
f.write('libraries=lapack,blas\n')
f.write('library_dirs=%s/lib:%s/lib\n' % (spec['blas'].prefix, spec['lapack'].prefix))
f.write('libraries=%s\n' % ','.join(libraries))
f.write('library_dirs=%s\n' % ':'.join(library_dirs))
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@ -2,11 +2,12 @@
class PyScipy(Package):
"""Scientific Library for Python."""
homepage = "https://pypi.python.org/pypi/scipy"
homepage = "http://www.scipy.org/"
url = "https://pypi.python.org/packages/source/s/scipy/scipy-0.15.0.tar.gz"
version('0.15.0', '639112f077f0aeb6d80718dc5019dc7a')
version('0.17.0', '5ff2971e1ce90e762c59d2cd84837224')
version('0.15.1', 'be56cd8e60591d6332aac792a5880110')
version('0.15.0', '639112f077f0aeb6d80718dc5019dc7a')
extends('python')
depends_on('py-nose')

View File

@ -105,7 +105,10 @@ def setup_dependent_environment(self, spack_env, run_env, extension_spec):
pythonpath = ':'.join(python_paths)
spack_env.set('PYTHONPATH', pythonpath)
run_env.set('PYTHONPATH', pythonpath)
# For run time environment set only the path for extension_spec and prepend it to PYTHONPATH
if extension_spec.package.extends(self.spec):
run_env.prepend_path('PYTHONPATH', os.path.join(extension_spec.prefix, self.site_packages_dir))
def setup_dependent_package(self, module, ext_spec):

View File

@ -54,6 +54,7 @@ def install(self, spec, prefix):
# need to install by hand
headers_location = join_path(self.prefix.include,'superlu_dist')
mkdirp(headers_location)
mkdirp(prefix.lib)
# 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)