Merge remote-tracking branch 'upstream/develop' into pkg-graphviz

This commit is contained in:
Kelly (KT) Thompson
2016-03-28 19:53:22 -06:00
42 changed files with 771 additions and 217 deletions

View File

@@ -0,0 +1,43 @@
##############################################################################
# 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 Python(Package):
"""Dummy Python package to demonstrate preferred versions."""
homepage = "http://www.python.org"
url = "http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz"
extendable = True
version('3.5.1', 'be78e48cdfc1a7ad90efff146dce6cfe')
version('3.5.0', 'a56c0c0b45d75a0ec9c6dee933c41c36')
version('2.7.11', '6b6076ec9e93f05dd63e47eb9c15728b', preferred=True)
version('2.7.10', 'd7547558fd673bd9d38e2108c6b42521')
version('2.7.9', '5eebcaa0030dc4061156d3429657fb83')
version('2.7.8', 'd4bca0159acb0b44a781292b5231936f')
def install(self, spec, prefix):
pass

View File

@@ -50,7 +50,10 @@ def install(self, spec, prefix):
options = ['--prefix=%s' % prefix]
if '+mpi' in spec:
options.append('--enable-mpi')
options.extend([
'--enable-mpi',
'F77=mpif77' #FIXME: avoid hardcoding MPI wrapper names
])
if '~shared' in spec:
options.append('--enable-shared=no')

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

@@ -1,5 +1,6 @@
from spack import *
import spack
import sys
class Boost(Package):
"""Boost provides free peer-reviewed portable C++ source
@@ -45,34 +46,34 @@ class Boost(Package):
version('1.34.1', '2d938467e8a448a2c9763e0a9f8ca7e5')
version('1.34.0', 'ed5b9291ffad776f8757a916e1726ad0')
default_install_libs = set(['atomic',
'chrono',
'date_time',
'filesystem',
default_install_libs = set(['atomic',
'chrono',
'date_time',
'filesystem',
'graph',
'iostreams',
'locale',
'log',
'math',
'math',
'program_options',
'random',
'regex',
'serialization',
'signals',
'system',
'test',
'thread',
'random',
'regex',
'serialization',
'signals',
'system',
'test',
'thread',
'wave'])
# mpi/python are not installed by default because they pull in many
# dependencies and/or because there is a great deal of customization
# 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
for lib in all_libs:
variant(lib, default=(lib not in default_noinstall_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')
@@ -124,9 +125,9 @@ def determine_bootstrap_options(self, spec, withLibs, options):
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,
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'))
@@ -155,7 +156,7 @@ def determine_b2_options(self, spec, options):
linkTypes = ['static']
if '+shared' in spec:
linkTypes.append('shared')
threadingOpts = []
if '+multithreaded' in spec:
threadingOpts.append('multi')
@@ -163,12 +164,12 @@ def determine_b2_options(self, spec, options):
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),
'--layout=tagged'])
return threadingOpts
def install(self, spec, prefix):
@@ -177,14 +178,14 @@ def install(self, spec, prefix):
if "+{0}".format(lib) in spec:
withLibs.append(lib)
if not withLibs:
# if no libraries are specified for compilation, then you dont have
# 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'] = './'
@@ -207,4 +208,7 @@ def install(self, spec, prefix):
# Boost.MPI if the threading options are not separated.
for threadingOpt in threadingOpts:
b2('install', 'threading=%s' % threadingOpt, *b2_options)
# The shared libraries are not installed correctly on Darwin; correct this
if (sys.platform == 'darwin') and ('+shared' in spec):
fix_darwin_install_name(prefix.lib)

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

@@ -8,8 +8,8 @@ class Cryptopp(Package):
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"
homepage = "http://www.cryptopp.com"
base_url = "http://www.cryptopp.com"
version('5.6.3', '3c5b70e2ec98b7a24988734446242d07')
version('5.6.2', '7ed022585698df48e65ce9218f6c6a67')
@@ -25,7 +25,5 @@ def install(self, spec, prefix):
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)
version_string = str(version).replace('.', '')
return '%s/cryptopp%s.zip' % (Cryptopp.base_url, version_string)

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

@@ -0,0 +1,30 @@
from spack import *
class Gettext(Package):
"""GNU internationalization (i18n) and localization (l10n) library."""
homepage = "https://www.gnu.org/software/gettext/"
url = "http://ftpmirror.gnu.org/gettext/gettext-0.19.7.tar.xz"
version('0.19.7', 'f81e50556da41b44c1d59ac93474dca5')
def install(self, spec, prefix):
options = ['--disable-dependency-tracking',
'--disable-silent-rules',
'--disable-debug',
'--prefix=%s' % prefix,
'--with-included-gettext',
'--with-included-glib',
'--with-included-libcroco',
'--with-included-libunistring',
'--with-emacs',
'--with-lispdir=%s/emacs/site-lisp/gettext' % prefix.share,
'--disable-java',
'--disable-csharp',
'--without-git', # Don't use VCS systems to create these archives
'--without-cvs',
'--without-xz']
configure(*options)
make()
make("install")

View File

@@ -1,5 +1,5 @@
from spack import *
import os
import os, sys
class Hypre(Package):
"""Hypre is a library of high performance preconditioners that
@@ -12,7 +12,10 @@ class Hypre(Package):
version('2.10.1', 'dc048c4cabb3cd549af72591474ad674')
version('2.10.0b', '768be38793a35bb5d055905b271f5b8e')
variant('shared', default=True, description="Build shared library version (disables static library)")
# hypre does not know how to build shared libraries on Darwin
variant('shared', default=sys.platform!='darwin', description="Build shared library version (disables static library)")
# SuperluDist have conflicting headers with those in Hypre
variant('internal-superlu', default=True, description="Use internal Superlu routines")
depends_on("mpi")
depends_on("blas")
@@ -37,6 +40,9 @@ def install(self, spec, prefix):
if '+shared' in self.spec:
configure_args.append("--enable-shared")
if '~internal-superlu' in self.spec:
configure_args.append("--without-superlu")
# Hypre's source is staged under ./src so we'll have to manually
# cd into it.
with working_dir("src"):

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

@@ -0,0 +1,22 @@
# HG changeset patch
# User Sean Farley <sean@mcs.anl.gov>
# Date 1332269671 18000
# Tue Mar 20 13:54:31 2012 -0500
# Node ID b95c0c2e1d8bf8e3273f7d45e856f0c0127d998e
# Parent 88049269953c67c3fdcc4309bf901508a875f0dc
cmake: add gklib headers to install into include
diff -r 88049269953c -r b95c0c2e1d8b libmetis/CMakeLists.txt
Index: libmetis/CMakeLists.txt
===================================================================
--- a/libmetis/CMakeLists.txt Tue Mar 20 13:54:29 2012 -0500
+++ b/libmetis/CMakeLists.txt Tue Mar 20 13:54:31 2012 -0500
@@ -12,6 +12,8 @@ endif()
if(METIS_INSTALL)
install(TARGETS metis
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
ARCHIVE DESTINATION lib)
+ install(FILES gklib_defs.h DESTINATION include)
+ install(FILES gklib_rename.h DESTINATION include)
endif()

View File

@@ -24,7 +24,7 @@
##############################################################################
from spack import *
import glob,sys
class Metis(Package):
"""
@@ -49,6 +49,8 @@ class Metis(Package):
depends_on('gdb', when='+gdb')
patch('install_gklib_defs_rename.patch')
def install(self, spec, prefix):
options = []
@@ -80,4 +82,15 @@ def install(self, spec, prefix):
with working_dir(build_directory, create=True):
cmake(source_directory, *options)
make()
make("install")
make("install")
# install GKlib headers, which will be needed for ParMETIS
GKlib_dist = join_path(prefix.include,'GKlib')
mkdirp(GKlib_dist)
fs = glob.glob(join_path(source_directory,'GKlib',"*.h"))
for f in fs:
install(f, GKlib_dist)
# The shared library is not installed correctly on Darwin; correct this
if (sys.platform == 'darwin') and ('+shared' in spec):
fix_darwin_install_name(prefix.lib)

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

@@ -0,0 +1,18 @@
from spack import *
class Muparser(Package):
"""C++ math expression parser library."""
homepage = "http://muparser.beltoforion.de/"
url = "https://github.com/beltoforion/muparser/archive/v2.2.5.tar.gz"
version('2.2.5', '02dae671aa5ad955fdcbcd3fee313fb7')
def install(self, spec, prefix):
options = ['--disable-debug',
'--disable-dependency-tracking',
'--prefix=%s' % prefix]
configure(*options)
make()
make("install")

View File

@@ -0,0 +1,15 @@
from spack import *
class NetcdfCxx(Package):
"""C++ compatibility bindings for NetCDF"""
homepage = "http://www.unidata.ucar.edu/software/netcdf"
url = "http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx-4.2.tar.gz"
version('4.2', 'd32b20c00f144ae6565d9e98d9f6204c')
depends_on('netcdf')
def install(self, spec, prefix):
configure('--prefix=%s' % prefix)
make()
make("install")

View File

@@ -43,6 +43,13 @@ def install(self, spec, prefix):
"--enable-dap"
]
# Make sure Netcdf links against Spack's curl
# Otherwise it may pick up system's curl, which could lead to link errors:
# /usr/lib/x86_64-linux-gnu/libcurl.so: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0'
LIBS.append("-lcurl")
CPPFLAGS.append("-I%s" % spec['curl'].prefix.include)
LDFLAGS.append ("-L%s" % spec['curl'].prefix.lib)
if '+mpi' in spec:
config_args.append('--enable-parallel4')

View File

@@ -1,46 +0,0 @@
from spack import *
import os
class NetlibBlas(Package):
"""Netlib reference BLAS"""
homepage = "http://www.netlib.org/lapack/"
url = "http://www.netlib.org/lapack/lapack-3.5.0.tgz"
version('3.5.0', 'b1d3e3e425b2e44a06760ff173104bdf')
variant('fpic', default=False, description="Build with -fpic compiler option")
# virtual dependency
provides('blas')
# Doesn't always build correctly in parallel
parallel = False
def patch(self):
os.symlink('make.inc.example', 'make.inc')
mf = FileFilter('make.inc')
mf.filter('^FORTRAN.*', 'FORTRAN = f90')
mf.filter('^LOADER.*', 'LOADER = f90')
mf.filter('^CC =.*', 'CC = cc')
if '+fpic' in self.spec:
mf.filter('^OPTS.*=.*', 'OPTS = -O2 -frecursive -fpic')
mf.filter('^CFLAGS =.*', 'CFLAGS = -O3 -fpic')
def install(self, spec, prefix):
make('blaslib')
# Tests that blas builds correctly
make('blas_testing')
# No install provided
mkdirp(prefix.lib)
install('librefblas.a', prefix.lib)
# Blas virtual package should provide blas.a and libblas.a
with working_dir(prefix.lib):
symlink('librefblas.a', 'blas.a')
symlink('librefblas.a', 'libblas.a')

View File

@@ -1,16 +1,15 @@
from spack import *
class NetlibLapack(Package):
"""
LAPACK version 3.X is a comprehensive FORTRAN library that does
linear algebra operations including matrix inversions, least
squared solutions to linear sets of equations, eigenvector
analysis, singular value decomposition, etc. It is a very
comprehensive and reputable package that has found extensive
use in the scientific community.
LAPACK version 3.X is a comprehensive FORTRAN library that does linear algebra operations including matrix
inversions, least squared solutions to linear sets of equations, eigenvector analysis, singular value
decomposition, etc. It is a very comprehensive and reputable package that has found extensive use in the
scientific community.
"""
homepage = "http://www.netlib.org/lapack/"
url = "http://www.netlib.org/lapack/lapack-3.5.0.tgz"
url = "http://www.netlib.org/lapack/lapack-3.5.0.tgz"
version('3.6.0', 'f2f6c67134e851fe189bb3ca1fbb5101')
version('3.5.0', 'b1d3e3e425b2e44a06760ff173104bdf')
@@ -19,41 +18,34 @@ class NetlibLapack(Package):
version('3.4.0', '02d5706ec03ba885fc246e5fa10d8c70')
version('3.3.1', 'd0d533ec9a5b74933c2a1e84eedc58b4')
variant('shared', default=False, description="Build shared library version")
variant('fpic', default=False, description="Build with -fpic compiler option")
variant('debug', default=False, description='Activates the Debug build type')
variant('shared', default=True, description="Build shared library version")
variant('external-blas', default=False, description='Build lapack with an external blas')
variant('lapacke', default=True, description='Activates the build of the LAPACKE C interface')
# virtual dependency
provides('blas', when='~external-blas')
provides('lapack')
# blas is a virtual dependency.
depends_on('blas')
depends_on('cmake')
# Doesn't always build correctly in parallel
parallel = False
@when('^netlib-blas')
def get_blas_libs(self):
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')]
depends_on('blas', when='+external-blas')
def install(self, spec, prefix):
blas_libs = ";".join(self.get_blas_libs())
cmake_args = [".", '-DBLAS_LIBRARIES=' + blas_libs]
cmake_args = ['-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'),
'-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'),
'-DLAPACKE:BOOL=%s' % ('ON' if '+lapacke' in spec else 'OFF')]
if '+external-blas' in spec:
# TODO : the mechanism to specify the library should be more general,
# TODO : but this allows to have an hook to an external blas
cmake_args.extend([
'-DUSE_OPTIMIZED_BLAS:BOOL=ON',
'-DBLAS_LIBRARIES:PATH=%s' % join_path(spec['blas'].prefix.lib, 'libblas.a')
])
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.extend(std_cmake_args)
cmake_args += std_cmake_args
cmake(*cmake_args)
make()
make("install")
with working_dir('spack-build', create=True):
cmake('..', *cmake_args)
make()
make("install")

View File

@@ -41,6 +41,11 @@ def install(self, spec, prefix):
make()
make("install")
# The shared libraries are not installed correctly on Darwin; correct this
if (sys.platform == 'darwin') and ('+shared' in spec):
fix_darwin_install_name(prefix.lib)
def setup_dependent_package(self, module, dependent_spec):
spec = self.spec
lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so'

View File

@@ -0,0 +1,51 @@
from spack import *
import platform, sys
class Oce(Package):
"""
Open CASCADE Community Edition:
patches/improvements/experiments contributed by users over the official Open CASCADE library.
"""
homepage = "https://github.com/tpaviot/oce"
url = "https://github.com/tpaviot/oce/archive/OCE-0.17.tar.gz"
version('0.17.1', '36c67b87093c675698b483454258af91')
version('0.17' , 'f1a89395c4b0d199bea3db62b85f818d')
version('0.16.1', '4d591b240c9293e879f50d86a0cb2bb3')
version('0.16' , '7a4b4df5a104d75a537e25e7dd387eca')
version('0.15' , '7ec541a1c350ca8a684f74980e48801c')
depends_on('cmake@2.8:')
def install(self, spec, prefix):
options = []
options.extend(std_cmake_args)
options.extend([
'-DOCE_INSTALL_PREFIX=%s' % prefix,
'-DOCE_BUILD_SHARED_LIB:BOOL=ON',
'-DOCE_BUILD_TYPE:STRING=Release',
'-DOCE_DATAEXCHANGE:BOOL=ON',
'-DOCE_DISABLE_X11:BOOL=ON',
'-DOCE_DRAW:BOOL=OFF',
'-DOCE_MODEL:BOOL=ON',
'-DOCE_MULTITHREAD_LIBRARY:STRING=NONE', # FIXME: add tbb
'-DOCE_OCAF:BOOL=ON',
'-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=OFF',
'-DOCE_VISUALISATION:BOOL=OFF',
'-DOCE_WITH_FREEIMAGE:BOOL=OFF',
'-DOCE_WITH_GL2PS:BOOL=OFF',
'-DOCE_WITH_OPENCL:BOOL=OFF'
])
if platform.system() == 'Darwin':
options.extend([
'-DOCE_OSX_USE_COCOA:BOOL=ON',
])
cmake('.', *options)
make("install/strip")
# The shared libraries are not installed correctly on Darwin; correct this
if (sys.platform == 'darwin'):
fix_darwin_install_name(prefix.lib)

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,34 @@
from spack import *
class P4est(Package):
"""Dynamic management of a collection (a forest) of adaptive octrees in parallel"""
homepage = "http://www.p4est.org"
url = "http://p4est.github.io/release/p4est-1.1.tar.gz"
version('1.1', '37ba7f4410958cfb38a2140339dbf64f')
# disable by default to make it work on frontend of clusters
variant('tests', default=False, description='Run small tests')
depends_on('mpi')
def install(self, spec, prefix):
options = ['--enable-mpi',
'--enable-shared',
'--disable-vtk-binary',
'--without-blas',
'CPPFLAGS=-DSC_LOG_PRIORITY=SC_LP_ESSENTIAL',
'CFLAGS=-O2',
'CC=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # TODO: use ENV variables or MPI class wrappers
'CXX=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'),
'FC=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'),
'F77=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif77'),
]
configure('--prefix=%s' % prefix, *options)
make()
if '+tests' in self.spec:
make("check")
make("install")

View File

@@ -1,13 +1,71 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca945dd..1bf94e9 100644
index ca945dd..aff8b5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ else()
set(ParMETIS_LIBRARY_TYPE STATIC)
endif()
-include(${GKLIB_PATH}/GKlibSystem.cmake)
+include_directories(${GKLIB_PATH})
# List of paths that the compiler will search for header files.
# i.e., the -I equivalent
@@ -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)
+find_library(METIS_LIBRARY metis PATHS ${METIS_PATH}/lib)
add_subdirectory(include)
add_subdirectory(libparmetis)
add_subdirectory(programs)
diff --git a/libparmetis/CMakeLists.txt b/libparmetis/CMakeLists.txt
index 9cfc8a7..e0c4de7 100644
--- a/libparmetis/CMakeLists.txt
+++ b/libparmetis/CMakeLists.txt
@@ -5,7 +5,10 @@ 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_LIBRARY} ${MPI_LIBRARIES})
+if(UNIX)
+ target_link_libraries(parmetis m)
+endif()
set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
install(TARGETS parmetis
diff --git a/libparmetis/parmetislib.h b/libparmetis/parmetislib.h
index c1daeeb..07511f6 100644
--- a/libparmetis/parmetislib.h
+++ b/libparmetis/parmetislib.h
@@ -20,13 +20,12 @@
#include <parmetis.h>
-#include "../metis/libmetis/gklib_defs.h"
+#include <gklib_defs.h>
-#include <mpi.h>
+#include <mpi.h>
#include <rename.h>
#include <defs.h>
#include <struct.h>
#include <macros.h>
#include <proto.h>
-
diff --git a/programs/parmetisbin.h b/programs/parmetisbin.h
index e26cd2d..d156480 100644
--- a/programs/parmetisbin.h
+++ b/programs/parmetisbin.h
@@ -19,7 +19,7 @@
#include <GKlib.h>
#include <parmetis.h>
-#include "../metis/libmetis/gklib_defs.h"
+#include <gklib_defs.h>
#include "../libparmetis/rename.h"
#include "../libparmetis/defs.h"
#include "../libparmetis/struct.h"

View File

@@ -24,7 +24,7 @@
##############################################################################
from spack import *
import sys
class Parmetis(Package):
"""
@@ -64,7 +64,7 @@ def install(self, spec, prefix):
# 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), # still need headers from METIS source, and they are not installed with METIS. shame...
options.extend(['-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=spec['metis'].prefix.include),
'-DMETIS_PATH:PATH={metis_source}'.format(metis_source=spec['metis'].prefix),
'-DCMAKE_C_COMPILER:STRING=mpicc',
'-DCMAKE_CXX_COMPILER:STRING=mpicxx'])
@@ -83,3 +83,7 @@ def install(self, spec, prefix):
cmake(source_directory, *options)
make()
make("install")
# The shared library is not installed correctly on Darwin; correct this
if (sys.platform == 'darwin') and ('+shared' in spec):
fix_darwin_install_name(prefix.lib)

View File

@@ -17,14 +17,18 @@ class Petsc(Package):
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')
variant('double', default=True, description='Switches between single and double precision')
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('complex', default=False, description='Build with complex numbers')
variant('debug', default=False, description='Compile in debug mode')
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')
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 (only parallel)')
variant('mumps', default=True, description='Activates support for MUMPS (only parallel)')
variant('superlu-dist', default=True, description='Activates support for SuperluDist (only parallel)')
# Virtual dependencies
depends_on('blas')
@@ -40,7 +44,13 @@ class Petsc(Package):
depends_on('hdf5+mpi', when='+hdf5+mpi')
depends_on('parmetis', when='+metis+mpi')
depends_on('hypre', when='+hypre+mpi')
# Hypre does not support complex numbers.
# Also PETSc prefer to build it without internal superlu, likely due to conflict in headers
# see https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py
depends_on('hypre~internal-superlu', when='+hypre+mpi~complex')
depends_on('superlu-dist', when='+superlu-dist+mpi')
depends_on('mumps+mpi', when='+mumps+mpi')
depends_on('scalapack', when='+mumps+mpi')
def mpi_dependent_options(self):
if '~mpi' in self.spec:
@@ -55,7 +65,7 @@ def mpi_dependent_options(self):
# 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')
for x in ('hdf5', 'hypre', 'parmetis','mumps','superlu-dist')
if ('+'+x) in self.spec]
if errors:
errors = ['incompatible variants given'] + errors
@@ -77,16 +87,17 @@ def mpi_dependent_options(self):
return compiler_opts
def install(self, spec, prefix):
options = ['--with-debugging=0',
'--with-ssl=0']
options = ['--with-ssl=0']
options.extend(self.mpi_dependent_options())
options.extend([
'--with-precision=%s' % ('double' if '+double' in spec else 'single'),
'--with-scalar-type=%s' % ('complex' if '+complex' in spec else 'real'),
'--with-shared-libraries=%s' % ('1' if '+shared' in spec else '0'),
'--with-debugging=%s' % ('1' if '+debug' in spec else '0'),
'--with-blas-lapack-dir=%s' % spec['lapack'].prefix
])
# Activates library support if needed
for library in ('metis', 'boost', 'hdf5', 'hypre', 'parmetis'):
for library in ('metis', 'boost', 'hdf5', 'hypre', 'parmetis','mumps','scalapack'):
options.append(
'--with-{library}={value}'.format(library=library, value=('1' if library in spec else '0'))
)
@@ -94,9 +105,24 @@ def install(self, spec, prefix):
options.append(
'--with-{library}-dir={path}'.format(library=library, path=spec[library].prefix)
)
# PETSc does not pick up SuperluDist from the dir as they look for superlu_dist_4.1.a
if 'superlu-dist' in spec:
options.extend([
'--with-superlu_dist-include=%s' % spec['superlu-dist'].prefix.include,
'--with-superlu_dist-lib=%s' % join_path(spec['superlu-dist'].prefix.lib, 'libsuperlu_dist.a'),
'--with-superlu_dist=1'
])
else:
options.append(
'--with-superlu_dist=0'
)
configure('--prefix=%s' % prefix, *options)
# PETSc has its own way of doing parallel make.
make('MAKE_NP=%s' % make_jobs, parallel=False)
make("install")
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# set up PETSC_DIR for everyone using PETSc package
spack_env.set('PETSC_DIR', self.prefix)

View File

@@ -0,0 +1,16 @@
from spack import *
class PyNetcdf(Package):
"""Python interface to the netCDF Library."""
homepage = "http://unidata.github.io/netcdf4-python"
url = "https://github.com/Unidata/netcdf4-python/tarball/v1.2.3.1rel"
version('1.2.3.1', '4fc4320d4f2a77b894ebf8da1c9895af')
extends('python')
depends_on('py-numpy')
depends_on('py-cython')
depends_on('netcdf')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -1,24 +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('netlib-blas+fpic', when='+blas')
depends_on('netlib-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,10 +105,13 @@ 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 modify_module(self, module, spec, ext_spec):
def setup_dependent_package(self, module, ext_spec):
"""
Called before python modules' install() methods.
@@ -118,17 +121,18 @@ def modify_module(self, module, spec, ext_spec):
"""
# Python extension builds can have a global python executable function
if self.version >= Version("3.0.0") and self.version < Version("4.0.0"):
module.python = Executable(join_path(spec.prefix.bin, 'python3'))
module.python = Executable(join_path(self.spec.prefix.bin, 'python3'))
else:
module.python = Executable(join_path(spec.prefix.bin, 'python'))
module.python = Executable(join_path(self.spec.prefix.bin, 'python'))
# 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)
module.site_packages_dir = os.path.join(ext_spec.prefix, self.site_packages_dir)
# Make the site packages directory if it does not exist already.
mkdirp(module.site_packages_dir)
# Make the site packages directory for extensions, if it does not exist already.
if ext_spec.package.is_extension:
mkdirp(module.site_packages_dir)
# ========================================================================
# Handle specifics of activating and deactivating python modules.

View File

@@ -30,7 +30,7 @@ def setup_dependent_environment(self, spack_env, run_env, extension_spec):
# The actual installation path for this gem
spack_env.set('GEM_HOME', extension_spec.prefix)
def modify_module(self, module, spec, ext_spec):
def setup_dependent_package(self, module, ext_spec):
"""Called before ruby modules' install() methods. Sets GEM_HOME
and GEM_PATH to values appropriate for the package being built.
@@ -39,5 +39,5 @@ def modify_module(self, module, spec, ext_spec):
gem('install', '<gem-name>.gem')
"""
# 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'))
module.ruby = Executable(join_path(self.spec.prefix.bin, 'ruby'))
module.gem = Executable(join_path(self.spec.prefix.bin, 'gem'))

View File

@@ -5,24 +5,35 @@ class Silo(Package):
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"
base_url = "https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo"
version('4.10.2', '9ceac777a2f2469ac8cef40f4fab49c8')
version('4.9', 'a83eda4f06761a86726e918fc55e782a')
version('4.8', 'b1cbc0e7ec435eb656dc4b53a23663c9')
variant('fortran', default=True, description='Enable Fortran support')
variant('silex', default=False, description='Builds Silex, a GUI for viewing Silo files')
depends_on("hdf5")
depends_on('hdf5')
depends_on('qt', when='+silex')
def install(self, spec, prefix):
config_args = [
'--enable-fortran' if '+fortran' in spec else '--disable-fortran',
'--enable-silex' if '+silex' in spec else '--disable-silex',
]
if '+silex' in spec:
config_args.append('--with-Qt-dir=%s' % spec['qt'].prefix)
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),
'--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")
make('install')
def url_for_version(self, version):
return '%s/silo-%s/silo-%s.tar.gz' % (Silo.base_url, version, version)

View File

@@ -0,0 +1,49 @@
import os
from spack import *
class Slepc(Package):
"""
Scalable Library for Eigenvalue Computations.
"""
homepage = "http://www.grycap.upv.es/slepc"
url = "http://slepc.upv.es/download/download.php?filename=slepc-3.6.2.tar.gz"
version('3.6.2', '2ab4311bed26ccf7771818665991b2ea3a9b15f97e29fd13911ab1293e8e65df')
variant('arpack', default=False, description='Enables Arpack wrappers')
depends_on('petsc')
depends_on('arpack-ng~mpi',when='+arpack^petsc~mpi')
depends_on('arpack-ng+mpi',when='+arpack^petsc+mpi')
def install(self, spec, prefix):
# set SLEPC_DIR for installation
os.environ['SLEPC_DIR'] = self.stage.source_path
options = []
if '+arpack' in spec:
options.extend([
'--with-arpack-dir=%s' % spec['arpack-ng'].prefix.lib,
])
if 'arpack-ng~mpi' in spec:
options.extend([
'--with-arpack-flags=-larpack'
])
else:
options.extend([
'--with-arpack-flags=-lparpack,-larpack'
])
configure('--prefix=%s' % prefix, *options)
make('MAKE_NP=%s' % make_jobs, parallel=False)
#FIXME:
# make('test')
make('install')
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# set up SLEPC_DIR for everyone using SLEPc package
spack_env.set('SLEPC_DIR', self.prefix)

View File

@@ -1,4 +1,5 @@
from spack import *
import glob
class SuperluDist(Package):
"""A general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear equations on high performance machines."""
@@ -52,12 +53,13 @@ def install(self, spec, prefix):
# system "make"
# need to install by hand
headers_location = join_path(self.prefix.include,'superlu_dist')
headers_location = self.prefix.include
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)
mkdirp(prefix.lib)
headers = glob.glob(join_path(self.stage.source_path, 'SRC','*.h'))
for h in headers:
install(h,headers_location)
superludist_lib = join_path(self.stage.source_path, 'lib/libsuperlu_dist.a')
install(superludist_lib,self.prefix.lib)

View File

@@ -0,0 +1,79 @@
from spack import *
import os
import glob
class Tbb(Package):
"""Widely used C++ template library for task parallelism.
Intel Threading Building Blocks (Intel TBB) lets you easily write parallel
C++ programs that take full advantage of multicore performance, that are
portable and composable, and that have future-proof scalability.
"""
homepage = "http://www.threadingbuildingblocks.org/"
# Only version-specific URL's work for TBB
version('4.4.3', '80707e277f69d9b20eeebdd7a5f5331137868ce1', url='https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160128oss_src_0.tgz')
def coerce_to_spack(self,tbb_build_subdir):
for compiler in ["icc","gcc","clang"]:
fs = glob.glob(join_path(tbb_build_subdir,"*.%s.inc" % compiler ))
for f in fs:
lines = open(f).readlines()
of = open(f,"w")
for l in lines:
if l.strip().startswith("CPLUS ="):
of.write("# coerced to spack\n")
of.write("CPLUS = $(CXX)\n")
elif l.strip().startswith("CPLUS ="):
of.write("# coerced to spack\n")
of.write("CONLY = $(CC)\n")
else:
of.write(l);
def install(self, spec, prefix):
#
# we need to follow TBB's compiler selection logic to get the proper build + link flags
# but we still need to use spack's compiler wrappers
# to accomplish this, we do two things:
#
# * Look at the spack spec to determine which compiler we should pass to tbb's Makefile
#
# * patch tbb's build system to use the compiler wrappers (CC, CXX) for
# icc, gcc, clang
# (see coerce_to_spack())
#
self.coerce_to_spack("build")
if spec.satisfies('%clang'):
tbb_compiler = "clang"
elif spec.satisfies('%intel'):
tbb_compiler = "icc"
else:
tbb_compiler = "gcc"
mkdirp(prefix)
mkdirp(prefix.lib)
#
# tbb does not have a configure script or make install target
# we simply call make, and try to put the pieces together
#
make("compiler=%s" %(tbb_compiler))
# install headers to {prefix}/include
install_tree('include',prefix.include)
# install libs to {prefix}/lib
tbb_lib_names = ["libtbb",
"libtbbmalloc",
"libtbbmalloc_proxy"]
for lib_name in tbb_lib_names:
# install release libs
fs = glob.glob(join_path("build","*release",lib_name + ".*"))
for f in fs:
install(f, prefix.lib)
# install debug libs if they exist
fs = glob.glob(join_path("build","*debug",lib_name + "_debug.*"))
for f in fs:
install(f, prefix.lib)