summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/multimethod/package.py8
-rw-r--r--var/spack/repos/builtin/packages/astyle/package.py2
-rw-r--r--var/spack/repos/builtin/packages/boost/package.py3
-rw-r--r--var/spack/repos/builtin/packages/dealii/package.py184
-rw-r--r--var/spack/repos/builtin/packages/fenics/package.py176
-rw-r--r--var/spack/repos/builtin/packages/flex/package.py5
-rw-r--r--var/spack/repos/builtin/packages/gcc/package.py91
-rw-r--r--var/spack/repos/builtin/packages/ghostscript/package.py4
-rw-r--r--var/spack/repos/builtin/packages/go-bootstrap/package.py51
-rw-r--r--var/spack/repos/builtin/packages/go/package.py80
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py1
-rw-r--r--var/spack/repos/builtin/packages/hub/package.py24
-rw-r--r--var/spack/repos/builtin/packages/launchmon/package.py18
-rw-r--r--var/spack/repos/builtin/packages/libdwarf/package.py8
-rw-r--r--var/spack/repos/builtin/packages/libpciaccess/package.py2
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py34
-rw-r--r--var/spack/repos/builtin/packages/lua-luaposix/package.py16
-rw-r--r--var/spack/repos/builtin/packages/lua/package.py107
-rw-r--r--var/spack/repos/builtin/packages/metis/package.py190
-rw-r--r--var/spack/repos/builtin/packages/mvapich2/package.py88
-rw-r--r--var/spack/repos/builtin/packages/netcdf-cxx4/package.py9
-rw-r--r--var/spack/repos/builtin/packages/octave/package.py57
-rw-r--r--var/spack/repos/builtin/packages/openmpi/package.py36
-rw-r--r--var/spack/repos/builtin/packages/openssl/package.py4
-rw-r--r--var/spack/repos/builtin/packages/parmetis/package.py44
-rw-r--r--var/spack/repos/builtin/packages/py-autopep8/package.py16
-rw-r--r--var/spack/repos/builtin/packages/py-pep8/package.py15
-rw-r--r--var/spack/repos/builtin/packages/py-ply/package.py38
-rw-r--r--var/spack/repos/builtin/packages/rust-bindgen/package.py18
-rw-r--r--var/spack/repos/builtin/packages/rust/package.py63
-rw-r--r--var/spack/repos/builtin/packages/scotch/Makefile.esmumps5
-rw-r--r--var/spack/repos/builtin/packages/scotch/package.py123
-rw-r--r--var/spack/repos/builtin/packages/sed/package.py39
-rw-r--r--var/spack/repos/builtin/packages/stream/package.py62
-rw-r--r--var/spack/repos/builtin/packages/tbb/package.py51
-rw-r--r--var/spack/repos/builtin/packages/tetgen/package.py11
-rw-r--r--var/spack/repos/builtin/packages/the_platinum_searcher/package.py21
37 files changed, 1276 insertions, 428 deletions
diff --git a/var/spack/repos/builtin.mock/packages/multimethod/package.py b/var/spack/repos/builtin.mock/packages/multimethod/package.py
index 2d15722470..def73ad82e 100644
--- a/var/spack/repos/builtin.mock/packages/multimethod/package.py
+++ b/var/spack/repos/builtin.mock/packages/multimethod/package.py
@@ -103,19 +103,19 @@ class Multimethod(Package):
#
# Make sure we can switch methods on different architectures
#
- @when('=x86_64')
+ @when('arch=x86_64')
def different_by_architecture(self):
return 'x86_64'
- @when('=ppc64')
+ @when('arch=ppc64')
def different_by_architecture(self):
return 'ppc64'
- @when('=ppc32')
+ @when('arch=ppc32')
def different_by_architecture(self):
return 'ppc32'
- @when('=arm64')
+ @when('arch=arm64')
def different_by_architecture(self):
return 'arm64'
diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py
index cd6f1d04f1..815c184577 100644
--- a/var/spack/repos/builtin/packages/astyle/package.py
+++ b/var/spack/repos/builtin/packages/astyle/package.py
@@ -41,7 +41,7 @@ class Astyle(Package):
# we need to edit the makefile in place to set compiler:
make_file = join_path(self.stage.source_path,
'build', 'gcc', 'Makefile')
- filter_file(r'^CXX\s*=.*', 'CXX=%s'.format(spack_cxx), make_file)
+ filter_file(r'^CXX\s*=.*', 'CXX=%s' % spack_cxx, make_file)
make('-f',
make_file,
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py
index b1b9c58b32..2f2965eb12 100644
--- a/var/spack/repos/builtin/packages/boost/package.py
+++ b/var/spack/repos/builtin/packages/boost/package.py
@@ -43,6 +43,7 @@ class Boost(Package):
list_url = "http://sourceforge.net/projects/boost/files/boost/"
list_depth = 2
+ version('1.61.0', '6095876341956f65f9d35939ccea1a9f')
version('1.60.0', '65a840e1a0b13a558ff19eeb2c4f0cbe')
version('1.59.0', '6aa9a5c6a4ca1016edd0ed1178e3cb87')
version('1.58.0', 'b8839650e61e9c1c0a89f371dd475546')
@@ -127,7 +128,7 @@ class Boost(Package):
dots, underscores)
def determine_toolset(self, spec):
- if spec.satisfies("=darwin-x86_64"):
+ if spec.satisfies("arch=darwin-x86_64"):
return 'darwin'
toolsets = {'g++': 'gcc',
diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py
index 49dc971d3a..54b6426d36 100644
--- a/var/spack/repos/builtin/packages/dealii/package.py
+++ b/var/spack/repos/builtin/packages/dealii/package.py
@@ -25,18 +25,24 @@
from spack import *
import sys
+
class Dealii(Package):
- """C++ software library providing well-documented tools to build finite element codes for a broad variety of PDEs."""
+ """C++ software library providing well-documented tools to build finite
+ element codes for a broad variety of PDEs."""
homepage = "https://www.dealii.org"
- url = "https://github.com/dealii/dealii/releases/download/v8.4.0/dealii-8.4.0.tar.gz"
+ url = "https://github.com/dealii/dealii/releases/download/v8.4.1/dealii-8.4.1.tar.gz"
+ version('8.4.1', 'efbaf16f9ad59cfccad62302f36c3c1d')
version('8.4.0', 'ac5dbf676096ff61e092ce98c80c2b00')
+ version('8.3.0', 'fc6cdcb16309ef4bea338a4f014de6fa')
+ version('8.2.1', '71c728dbec14f371297cd405776ccf08')
+ version('8.1.0', 'aa8fadc2ce5eb674f44f997461bf668d')
version('dev', git='https://github.com/dealii/dealii.git')
variant('mpi', default=True, description='Compile with MPI')
variant('arpack', default=True, description='Compile with Arpack and PArpack (only with MPI)')
variant('doc', default=False, description='Compile with documentation')
- variant('gsl' , default=True, description='Compile with GSL')
+ variant('gsl', default=True, description='Compile with GSL')
variant('hdf5', default=True, description='Compile with HDF5 (only with MPI)')
variant('metis', default=True, description='Compile with Metis')
variant('netcdf', default=True, description='Compile with Netcdf (only with MPI)')
@@ -47,38 +53,40 @@ class Dealii(Package):
variant('trilinos', default=True, description='Compile with Trilinos (only with MPI)')
# required dependencies, light version
- depends_on ("blas")
- # Boost 1.58 is blacklisted, see https://github.com/dealii/dealii/issues/1591
- # require at least 1.59
- depends_on ("boost@1.59.0:", when='~mpi')
- depends_on ("boost@1.59.0:+mpi", when='+mpi')
- depends_on ("bzip2")
- depends_on ("cmake")
- depends_on ("lapack")
- depends_on ("muparser")
- depends_on ("suite-sparse")
- depends_on ("tbb")
- depends_on ("zlib")
+ depends_on("blas")
+ # Boost 1.58 is blacklisted, see
+ # https://github.com/dealii/dealii/issues/1591
+ # Require at least 1.59
+ depends_on("boost@1.59.0:+thread+system+serialization+iostreams", when='~mpi') # NOQA: ignore=E501
+ depends_on("boost@1.59.0:+mpi+thread+system+serialization+iostreams", when='+mpi') # NOQA: ignore=E501
+ depends_on("bzip2")
+ depends_on("cmake")
+ depends_on("lapack")
+ depends_on("muparser")
+ depends_on("suite-sparse")
+ depends_on("tbb")
+ depends_on("zlib")
# optional dependencies
- depends_on ("mpi", when="+mpi")
- depends_on ("arpack-ng+mpi", when='+arpack+mpi')
- depends_on ("doxygen", when='+doc')
- depends_on ("gsl", when='@8.5.0:+gsl')
- depends_on ("gsl", when='@dev+gsl')
- depends_on ("hdf5+mpi~cxx", when='+hdf5+mpi') #FIXME NetCDF declares dependency with ~cxx, why?
- depends_on ("metis@5:", when='+metis')
- depends_on ("netcdf+mpi", when="+netcdf+mpi")
- depends_on ("netcdf-cxx", when='+netcdf+mpi')
- depends_on ("oce", when='+oce')
- depends_on ("p4est", when='+p4est+mpi')
- depends_on ("petsc+mpi", when='+petsc+mpi')
- depends_on ("slepc", when='+slepc+petsc+mpi')
- depends_on ("trilinos", when='+trilinos+mpi')
+ depends_on("mpi", when="+mpi")
+ depends_on("arpack-ng+mpi", when='+arpack+mpi')
+ depends_on("doxygen+graphviz", when='+doc')
+ depends_on("graphviz", when='+doc')
+ depends_on("gsl", when='@8.5.0:+gsl')
+ depends_on("gsl", when='@dev+gsl')
+ depends_on("hdf5+mpi", when='+hdf5+mpi')
+ depends_on("metis@5:", when='+metis')
+ depends_on("netcdf+mpi", when="+netcdf+mpi")
+ depends_on("netcdf-cxx", when='+netcdf+mpi')
+ depends_on("oce", when='+oce')
+ depends_on("p4est", when='+p4est+mpi')
+ depends_on("petsc+mpi", when='+petsc+mpi')
+ depends_on("slepc", when='+slepc+petsc+mpi')
+ depends_on("trilinos", when='+trilinos+mpi')
# developer dependnecies
- depends_on ("numdiff", when='@dev')
- depends_on ("astyle@2.04", when='@dev')
+ depends_on("numdiff", when='@dev')
+ depends_on("astyle@2.04", when='@dev')
def install(self, spec, prefix):
options = []
@@ -96,17 +104,17 @@ class Dealii(Package):
'-DDEAL_II_WITH_THREADS:BOOL=ON',
'-DBOOST_DIR=%s' % spec['boost'].prefix,
'-DBZIP2_DIR=%s' % spec['bzip2'].prefix,
- # CMake's FindBlas/Lapack may pickup system's blas/lapack instead of Spack's.
- # Be more specific to avoid this.
- # Note that both lapack and blas are provided in -DLAPACK_XYZ variables
+ # CMake's FindBlas/Lapack may pickup system's blas/lapack instead
+ # of Spack's. Be more specific to avoid this.
+ # Note that both lapack and blas are provided in -DLAPACK_XYZ.
'-DLAPACK_FOUND=true',
'-DLAPACK_INCLUDE_DIRS=%s;%s' %
(spec['lapack'].prefix.include,
spec['blas'].prefix.include),
'-DLAPACK_LIBRARIES=%s;%s' %
- (join_path(spec['lapack'].prefix.lib,'liblapack.%s' % dsuf), # FIXME don't hardcode names
- join_path(spec['blas'].prefix.lib,'libblas.%s' % dsuf)), # FIXME don't hardcode names
- '-DMUPARSER_DIR=%s ' % spec['muparser'].prefix,
+ (spec['lapack'].lapack_shared_lib,
+ spec['blas'].blas_shared_lib),
+ '-DMUPARSER_DIR=%s' % spec['muparser'].prefix,
'-DUMFPACK_DIR=%s' % spec['suite-sparse'].prefix,
'-DTBB_DIR=%s' % spec['tbb'].prefix,
'-DZLIB_DIR=%s' % spec['zlib'].prefix
@@ -116,33 +124,34 @@ class Dealii(Package):
if '+mpi' in spec:
options.extend([
'-DDEAL_II_WITH_MPI:BOOL=ON',
- '-DCMAKE_C_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # FIXME: avoid hardcoding mpi wrappers names
- '-DCMAKE_CXX_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'),
- '-DCMAKE_Fortran_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'),
+ '-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc,
+ '-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx,
+ '-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc,
])
else:
options.extend([
'-DDEAL_II_WITH_MPI:BOOL=OFF',
])
- # Optional dependencies for which librariy names are the same as CMake variables
- for library in ('gsl','hdf5','p4est','petsc','slepc','trilinos','metis'):
+ # Optional dependencies for which librariy names are the same as CMake
+ # variables:
+ for library in ('gsl', 'hdf5', 'p4est', 'petsc', 'slepc', 'trilinos', 'metis'): # NOQA: ignore=E501
if library in spec:
options.extend([
- '-D{library}_DIR={value}'.format(library=library.upper(), value=spec[library].prefix),
- '-DDEAL_II_WITH_{library}:BOOL=ON'.format(library=library.upper())
+ '-D%s_DIR=%s' % (library.upper(), spec[library].prefix),
+ '-DDEAL_II_WITH_%s:BOOL=ON' % library.upper()
])
else:
options.extend([
- '-DDEAL_II_WITH_{library}:BOOL=OFF'.format(library=library.upper())
+ '-DDEAL_II_WITH_%s:BOOL=OFF' % library.upper()
])
# doxygen
options.extend([
- '-DDEAL_II_COMPONENT_DOCUMENTATION=%s' % ('ON' if '+doc' in spec else 'OFF'),
+ '-DDEAL_II_COMPONENT_DOCUMENTATION=%s' %
+ ('ON' if '+doc' in spec else 'OFF'),
])
-
# arpack
if '+arpack' in spec:
options.extend([
@@ -160,11 +169,13 @@ class Dealii(Package):
options.extend([
'-DNETCDF_FOUND=true',
'-DNETCDF_LIBRARIES=%s;%s' %
- (join_path(spec['netcdf-cxx'].prefix.lib,'libnetcdf_c++.%s' % dsuf),
- join_path(spec['netcdf'].prefix.lib,'libnetcdf.%s' % dsuf)),
+ (join_path(spec['netcdf-cxx'].prefix.lib,
+ 'libnetcdf_c++.%s' % dsuf),
+ join_path(spec['netcdf'].prefix.lib,
+ 'libnetcdf.%s' % dsuf)),
'-DNETCDF_INCLUDE_DIRS=%s;%s' %
(spec['netcdf-cxx'].prefix.include,
- spec['netcdf'].prefix.include),
+ spec['netcdf'].prefix.include),
])
else:
options.extend([
@@ -200,7 +211,7 @@ class Dealii(Package):
with working_dir('examples/step-3'):
cmake('.')
make('release')
- make('run',parallel=False)
+ make('run', parallel=False)
# An example which uses Metis + PETSc
# FIXME: switch step-18 to MPI
@@ -213,7 +224,7 @@ class Dealii(Package):
if '^petsc' in spec and '^metis' in spec:
cmake('.')
make('release')
- make('run',parallel=False)
+ make('run', parallel=False)
# take step-40 which can use both PETSc and Trilinos
# FIXME: switch step-40 to MPI run
@@ -222,43 +233,58 @@ class Dealii(Package):
print('========== Step-40 PETSc ============')
print('=====================================')
# list the number of cycles to speed up
- filter_file(r'(const unsigned int n_cycles = 8;)', ('const unsigned int n_cycles = 2;'), 'step-40.cc')
+ filter_file(r'(const unsigned int n_cycles = 8;)',
+ ('const unsigned int n_cycles = 2;'), 'step-40.cc')
cmake('.')
if '^petsc' in spec:
make('release')
- make('run',parallel=False)
+ make('run', parallel=False)
print('=====================================')
print('========= Step-40 Trilinos ==========')
print('=====================================')
# change Linear Algebra to Trilinos
- filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc')
+ # The below filter_file should be different for versions
+ # before and after 8.4.0
+ if spec.satisfies('@8.4.0:'):
+ filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)',
+ ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc')
+ else:
+ filter_file(r'(#define USE_PETSC_LA.*)',
+ ('// #define USE_PETSC_LA'), 'step-40.cc')
if '^trilinos+hypre' in spec:
make('release')
- make('run',parallel=False)
+ make('run', parallel=False)
- print('=====================================')
- print('=== Step-40 Trilinos SuperluDist ====')
- print('=====================================')
- # change to direct solvers
- filter_file(r'(LA::SolverCG solver\(solver_control\);)', ('TrilinosWrappers::SolverDirect::AdditionalData data(false,"Amesos_Superludist"); TrilinosWrappers::SolverDirect solver(solver_control,data);'), 'step-40.cc')
- filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)', (''), 'step-40.cc')
- filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)', (''), 'step-40.cc')
- filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', (''), 'step-40.cc')
- filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc')
- filter_file(r'(preconditioner\);)', (''), 'step-40.cc')
- if '^trilinos+superlu-dist' in spec:
- make('release')
- make('run',paralle=False)
+ # the rest of the tests on step 40 only works for
+ # dealii version 8.4.0 and after
+ if spec.satisfies('@8.4.0:'):
+ print('=====================================')
+ print('=== Step-40 Trilinos SuperluDist ====')
+ print('=====================================')
+ # change to direct solvers
+ filter_file(r'(LA::SolverCG solver\(solver_control\);)', ('TrilinosWrappers::SolverDirect::AdditionalData data(false,"Amesos_Superludist"); TrilinosWrappers::SolverDirect solver(solver_control,data);'), 'step-40.cc') # NOQA: ignore=E501
+ filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)',
+ (''), 'step-40.cc')
+ filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)',
+ (''), 'step-40.cc')
+ filter_file(r'(preconditioner.initialize\(system_matrix, data\);)',
+ (''), 'step-40.cc')
+ filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc') # NOQA: ignore=E501
+ filter_file(r'(preconditioner\);)', (''), 'step-40.cc')
+ if '^trilinos+superlu-dist' in spec:
+ make('release')
+ make('run', paralle=False)
- print('=====================================')
- print('====== Step-40 Trilinos MUMPS =======')
- print('=====================================')
- # switch to Mumps
- filter_file(r'(Amesos_Superludist)', ('Amesos_Mumps'), 'step-40.cc')
- if '^trilinos+mumps' in spec:
- make('release')
- make('run',parallel=False)
+ print('=====================================')
+ print('====== Step-40 Trilinos MUMPS =======')
+ print('=====================================')
+ # switch to Mumps
+ filter_file(r'(Amesos_Superludist)',
+ ('Amesos_Mumps'), 'step-40.cc')
+ if '^trilinos+mumps' in spec:
+ make('release')
+ make('run', parallel=False)
print('=====================================')
print('============ Step-36 ================')
@@ -267,7 +293,7 @@ class Dealii(Package):
if 'slepc' in spec:
cmake('.')
make('release')
- make('run',parallel=False)
+ make('run', parallel=False)
print('=====================================')
print('============ Step-54 ================')
@@ -276,7 +302,7 @@ class Dealii(Package):
if 'oce' in spec:
cmake('.')
make('release')
- make('run',parallel=False)
+ make('run', parallel=False)
def setup_environment(self, spack_env, env):
env.set('DEAL_II_DIR', self.prefix)
diff --git a/var/spack/repos/builtin/packages/fenics/package.py b/var/spack/repos/builtin/packages/fenics/package.py
new file mode 100644
index 0000000000..0845237656
--- /dev/null
+++ b/var/spack/repos/builtin/packages/fenics/package.py
@@ -0,0 +1,176 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Fenics(Package):
+ """FEniCS is organized as a collection of interoperable components
+ that together form the FEniCS Project. These components include
+ the problem-solving environment DOLFIN, the form compiler FFC, the
+ finite element tabulator FIAT, the just-in-time compiler Instant,
+ the code generation interface UFC, the form language UFL and a
+ range of additional components."""
+
+ homepage = "http://fenicsproject.org/"
+ url = "https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-1.6.0.tar.gz"
+
+ base_url = "https://bitbucket.org/fenics-project/{pkg}/downloads/{pkg}-{version}.tar.gz" # NOQA: ignore E501
+
+ variant('hdf5', default=True, description='Compile with HDF5')
+ variant('parmetis', default=True, description='Compile with ParMETIS')
+ variant('scotch', default=True, description='Compile with Scotch')
+ variant('petsc', default=True, description='Compile with PETSc')
+ variant('slepc', default=True, description='Compile with SLEPc')
+ variant('trilinos', default=True, description='Compile with Trilinos')
+ variant('suite-sparse', default=True, description='Compile with SuiteSparse solvers')
+ variant('vtk', default=False, description='Compile with VTK')
+ variant('qt', default=False, description='Compile with QT')
+ variant('mpi', default=True, description='Enables the distributed memory support')
+ variant('openmp', default=True, description='Enables the shared memory support')
+ variant('shared', default=True, description='Enables the build of shared libraries')
+ variant('debug', default=False, description='Builds a debug version of the libraries')
+
+ # not part of spack list for now
+ # variant('petsc4py', default=True, description='Uses PETSc4py')
+ # variant('slepc4py', default=True, description='Uses SLEPc4py')
+ # variant('pastix', default=True, description='Compile with Pastix')
+
+ extends('python')
+
+ depends_on('py-numpy')
+ depends_on('py-ply')
+ depends_on('py-six')
+ depends_on('py-sphinx@1.0.1:', when='+doc')
+ depends_on('eigen@3.2.0:')
+ depends_on('boost')
+ depends_on('mpi', when='+mpi')
+ depends_on('hdf5', when='+hdf5')
+ depends_on('parmetis@4.0.2:^metis+real64', when='+parmetis')
+ depends_on('scotch~metis', when='+scotch~mpi')
+ depends_on('scotch+mpi~metis', when='+scotch+mpi')
+ depends_on('petsc@3.4:', when='+petsc')
+ depends_on('slepc@3.4:', when='+slepc')
+ depends_on('trilinos', when='+trilinos')
+ depends_on('vtk', when='+vtk')
+ depends_on('suite-sparse', when='+suite-sparse')
+ depends_on('qt', when='+qt')
+
+ # This are the build dependencies
+ depends_on('py-setuptools')
+ depends_on('cmake@2.8.12:')
+ depends_on('swig@3.0.3:')
+
+ releases = [
+ {
+ 'version': '1.6.0',
+ 'md5': '35cb4baf7ab4152a40fb7310b34d5800',
+ 'resources': {
+ 'ffc': '358faa3e9da62a1b1a717070217b793e',
+ 'fiat': 'f4509d05c911fd93cea8d288a78a6c6f',
+ 'instant': '5f2522eb032a5bebbad6597b6fe0732a',
+ 'ufl': 'c40c5f04eaa847377ab2323122284016',
+ }
+ },
+ {
+ 'version': '1.5.0',
+ 'md5': '9b589a3534299a5e6d22c13c5eb30bb8',
+ 'resources': {
+ 'ffc': '343f6d30e7e77d329a400fd8e73e0b63',
+ 'fiat': 'da3fa4dd8177bb251e7f68ec9c7cf6c5',
+ 'instant': 'b744023ded27ee9df4a8d8c6698c0d58',
+ 'ufl': '130d7829cf5a4bd5b52bf6d0955116fd',
+ }
+ },
+ ]
+
+ for release in releases:
+ version(release['version'], release['md5'], url=base_url.format(pkg='dolfin', version=release['version']))
+ for name, md5 in release['resources'].items():
+ resource(name=name,
+ url=base_url.format(pkg=name, **release),
+ md5=md5,
+ destination='depends',
+ when='@{version}'.format(**release),
+ placement=name)
+
+ def cmake_is_on(self, option):
+ return 'ON' if option in self.spec else 'OFF'
+
+ def install(self, spec, prefix):
+ for package in ['ufl', 'ffc', 'fiat', 'instant']:
+ with working_dir(join_path('depends', package)):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
+
+ cmake_args = [
+ '-DCMAKE_BUILD_TYPE:STRING={0}'.format(
+ 'Debug' if '+debug' in spec else 'RelWithDebInfo'),
+ '-DBUILD_SHARED_LIBS:BOOL={0}'.format(
+ self.cmake_is_on('+shared')),
+ '-DDOLFIN_SKIP_BUILD_TESTS:BOOL=ON',
+ '-DDOLFIN_ENABLE_OPENMP:BOOL={0}'.format(
+ self.cmake_is_on('+openmp')),
+ '-DDOLFIN_ENABLE_CHOLMOD:BOOL={0}'.format(
+ self.cmake_is_on('suite-sparse')),
+ '-DDOLFIN_ENABLE_HDF5:BOOL={0}'.format(
+ self.cmake_is_on('hdf5')),
+ '-DDOLFIN_ENABLE_MPI:BOOL={0}'.format(
+ self.cmake_is_on('mpi')),
+ '-DDOLFIN_ENABLE_PARMETIS:BOOL={0}'.format(
+ self.cmake_is_on('parmetis')),
+ '-DDOLFIN_ENABLE_PASTIX:BOOL={0}'.format(
+ self.cmake_is_on('pastix')),
+ '-DDOLFIN_ENABLE_PETSC:BOOL={0}'.format(
+ self.cmake_is_on('petsc')),
+ '-DDOLFIN_ENABLE_PETSC4PY:BOOL={0}'.format(
+ self.cmake_is_on('py-petsc4py')),
+ '-DDOLFIN_ENABLE_PYTHON:BOOL={0}'.format(
+ self.cmake_is_on('python')),
+ '-DDOLFIN_ENABLE_QT:BOOL={0}'.format(
+ self.cmake_is_on('qt')),
+ '-DDOLFIN_ENABLE_SCOTCH:BOOL={0}'.format(
+ self.cmake_is_on('scotch')),
+ '-DDOLFIN_ENABLE_SLEPC:BOOL={0}'.format(
+ self.cmake_is_on('slepc')),
+ '-DDOLFIN_ENABLE_SLEPC4PY:BOOL={0}'.format(
+ self.cmake_is_on('py-slepc4py')),
+ '-DDOLFIN_ENABLE_SPHINX:BOOL={0}'.format(
+ self.cmake_is_on('py-sphinx')),
+ '-DDOLFIN_ENABLE_TRILINOS:BOOL={0}'.format(
+ self.cmake_is_on('trilinos')),
+ '-DDOLFIN_ENABLE_UMFPACK:BOOL={0}'.format(
+ self.cmake_is_on('suite-sparse')),
+ '-DDOLFIN_ENABLE_VTK:BOOL={0}'.format(
+ self.cmake_is_on('vtk')),
+ '-DDOLFIN_ENABLE_ZLIB:BOOL={0}'.format(
+ self.cmake_is_on('zlib')),
+ ]
+
+ cmake_args.extend(std_cmake_args)
+
+ with working_dir('build', create=True):
+ cmake('..', *cmake_args)
+
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/flex/package.py b/var/spack/repos/builtin/packages/flex/package.py
index 926651010f..b778538606 100644
--- a/var/spack/repos/builtin/packages/flex/package.py
+++ b/var/spack/repos/builtin/packages/flex/package.py
@@ -24,15 +24,18 @@
##############################################################################
from spack import *
+
class Flex(Package):
"""Flex is a tool for generating scanners."""
homepage = "http://flex.sourceforge.net/"
- url = "http://download.sourceforge.net/flex/flex-2.5.39.tar.gz"
+ url = "http://download.sourceforge.net/flex/flex-2.5.39.tar.gz"
version('2.6.0', '5724bcffed4ebe39e9b55a9be80859ec')
version('2.5.39', 'e133e9ead8ec0a58d81166b461244fde')
+ depends_on("bison")
+
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py
index 47dbeb2a99..224105ea0f 100644
--- a/var/spack/repos/builtin/packages/gcc/package.py
+++ b/var/spack/repos/builtin/packages/gcc/package.py
@@ -1,33 +1,9 @@
-##############################################################################
-# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
-# Produced at the Lawrence Livermore National Laboratory.
-#
-# This file is part of Spack.
-# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
-# LLNL-CODE-647188
-#
-# For details, see https://github.com/llnl/spack
-# Please also see the LICENSE file for our notice and the LGPL.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License (as
-# published by the Free Software Foundation) version 2.1, February 1999.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
-# conditions of the GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##############################################################################
from spack import *
from contextlib import closing
from glob import glob
import sys
-import os
+
class Gcc(Package):
"""The GNU Compiler Collection includes front ends for C, C++,
@@ -50,10 +26,12 @@ class Gcc(Package):
version('4.6.4', 'b407a3d1480c11667f293bfb1f17d1a4')
version('4.5.4', '27e459c2566b8209ab064570e1b378f7')
- variant('binutils', default=sys.platform != 'darwin',
- description="Build via binutils")
- variant('gold', default=sys.platform != 'darwin',
- description="Build the gold linker plugin for ld-based LTO")
+ variant('binutils',
+ default=sys.platform != 'darwin',
+ description="Build via binutils")
+ variant('gold',
+ default=sys.platform != 'darwin',
+ description="Build the gold linker plugin for ld-based LTO")
depends_on("mpfr")
depends_on("gmp")
@@ -63,16 +41,18 @@ class Gcc(Package):
depends_on("binutils~libiberty+gold", when='+binutils +gold')
# TODO: integrate these libraries.
- #depends_on("ppl")
- #depends_on("cloog")
+ # depends_on("ppl")
+ # depends_on("cloog")
if sys.platform == 'darwin':
patch('darwin/gcc-4.9.patch1', when='@4.9.3')
patch('darwin/gcc-4.9.patch2', when='@4.9.3')
+ else:
+ provides('golang', when='@4.7.1:')
def install(self, spec, prefix):
# libjava/configure needs a minor fix to install into spack paths.
filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure',
- string=True)
+ string=True)
enabled_languages = set(('c', 'c++', 'fortran', 'java', 'objc'))
@@ -80,62 +60,59 @@ class Gcc(Package):
enabled_languages.add('go')
# Generic options to compile GCC
- options = ["--prefix=%s" % prefix,
- "--libdir=%s/lib64" % prefix,
+ options = ["--prefix=%s" % prefix, "--libdir=%s/lib64" % prefix,
"--disable-multilib",
"--enable-languages=" + ','.join(enabled_languages),
- "--with-mpc=%s" % spec['mpc'].prefix,
- "--with-mpfr=%s" % spec['mpfr'].prefix,
- "--with-gmp=%s" % spec['gmp'].prefix,
- "--enable-lto",
- "--with-quad"]
+ "--with-mpc=%s" % spec['mpc'].prefix, "--with-mpfr=%s" %
+ spec['mpfr'].prefix, "--with-gmp=%s" % spec['gmp'].prefix,
+ "--enable-lto", "--with-quad"]
# Binutils
if spec.satisfies('+binutils'):
static_bootstrap_flags = "-static-libstdc++ -static-libgcc"
- binutils_options = ["--with-sysroot=/",
- "--with-stage1-ldflags=%s %s" %
- (self.rpath_args, static_bootstrap_flags),
- "--with-boot-ldflags=%s %s" %
- (self.rpath_args, static_bootstrap_flags),
- "--with-gnu-ld",
- "--with-ld=%s/bin/ld" % spec['binutils'].prefix,
- "--with-gnu-as",
- "--with-as=%s/bin/as" % spec['binutils'].prefix]
+ binutils_options = [
+ "--with-sysroot=/", "--with-stage1-ldflags=%s %s" %
+ (self.rpath_args, static_bootstrap_flags),
+ "--with-boot-ldflags=%s %s" %
+ (self.rpath_args, static_bootstrap_flags), "--with-gnu-ld",
+ "--with-ld=%s/bin/ld" % spec['binutils'].prefix,
+ "--with-gnu-as",
+ "--with-as=%s/bin/as" % spec['binutils'].prefix
+ ]
options.extend(binutils_options)
# Isl
if 'isl' in spec:
isl_options = ["--with-isl=%s" % spec['isl'].prefix]
options.extend(isl_options)
- if sys.platform == 'darwin' :
- darwin_options = [ "--with-build-config=bootstrap-debug" ]
+ if sys.platform == 'darwin':
+ darwin_options = ["--with-build-config=bootstrap-debug"]
options.extend(darwin_options)
build_dir = join_path(self.stage.path, 'spack-build')
- configure = Executable( join_path(self.stage.source_path, 'configure') )
+ configure = Executable(join_path(self.stage.source_path, 'configure'))
with working_dir(build_dir, create=True):
# Rest of install is straightforward.
configure(*options)
- if sys.platform == 'darwin' : make("bootstrap")
- else: make()
+ if sys.platform == 'darwin':
+ make("bootstrap")
+ else:
+ make()
make("install")
self.write_rpath_specs()
-
@property
def spec_dir(self):
# e.g. lib64/gcc/x86_64-unknown-linux-gnu/4.9.2
spec_dir = glob("%s/lib64/gcc/*/*" % self.prefix)
return spec_dir[0] if spec_dir else None
-
def write_rpath_specs(self):
"""Generate a spec file so the linker adds a rpath to the libs
the compiler used to build the executable."""
if not self.spec_dir:
tty.warn("Could not install specs for %s." %
- self.spec.format('$_$@'))
+ self.spec.format('$_$@'))
return
gcc = Executable(join_path(self.prefix.bin, 'gcc'))
@@ -146,5 +123,5 @@ class Gcc(Package):
out.write(line + "\n")
if line.startswith("*link:"):
out.write("-rpath %s/lib:%s/lib64 \\\n" %
- (self.prefix, self.prefix))
+ (self.prefix, self.prefix))
set_install_permissions(specs_file)
diff --git a/var/spack/repos/builtin/packages/ghostscript/package.py b/var/spack/repos/builtin/packages/ghostscript/package.py
index 707f65c902..c22b90088e 100644
--- a/var/spack/repos/builtin/packages/ghostscript/package.py
+++ b/var/spack/repos/builtin/packages/ghostscript/package.py
@@ -28,9 +28,9 @@ from spack import *
class Ghostscript(Package):
"""an interpreter for the PostScript language and for PDF. """
homepage = "http://ghostscript.com/"
- url = "http://downloads.ghostscript.com/public/old-gs-releases/ghostscript-9.16.tar.gz"
+ url = "http://downloads.ghostscript.com/public/old-gs-releases/ghostscript-9.18.tar.gz"
- version('9.16', '829319325bbdb83f5c81379a8f86f38f')
+ version('9.18', '33a47567d7a591c00a253caddd12a88a')
parallel = False
diff --git a/var/spack/repos/builtin/packages/go-bootstrap/package.py b/var/spack/repos/builtin/packages/go-bootstrap/package.py
new file mode 100644
index 0000000000..b0e2109fd3
--- /dev/null
+++ b/var/spack/repos/builtin/packages/go-bootstrap/package.py
@@ -0,0 +1,51 @@
+import os
+import shutil
+import glob
+from spack import *
+
+# THIS PACKAGE SHOULD NOT EXIST
+# it exists to make up for the inability to:
+# * use an external go compiler
+# * have go depend on itself
+# * have a sensible way to find gccgo without a dep on gcc
+
+
+class GoBootstrap(Package):
+ """Old C-bootstrapped go to bootstrap real go"""
+ homepage = "https://golang.org"
+ url = "https://go.googlesource.com/go"
+
+ extendable = True
+
+ # temporary fix until tags are pulled correctly
+ version('1.4.2', git='https://go.googlesource.com/go', tag='go1.4.2')
+
+ variant('test',
+ default=True,
+ description="Run tests as part of build, a good idea but quite"
+ " time consuming")
+
+ provides('golang@:1.4.2')
+
+ depends_on('git')
+
+ def install(self, spec, prefix):
+ bash = which('bash')
+ with working_dir('src'):
+ if '+test' in spec:
+ bash('all.bash')
+ else:
+ bash('make.bash')
+
+ try:
+ os.makedirs(prefix)
+ except OSError:
+ pass
+ for f in glob.glob('*'):
+ if os.path.isdir(f):
+ shutil.copytree(f, os.path.join(prefix, f))
+ else:
+ shutil.copy2(f, os.path.join(prefix, f))
+
+ def setup_environment(self, spack_env, run_env):
+ spack_env.set('GOROOT_FINAL', self.spec.prefix)
diff --git a/var/spack/repos/builtin/packages/go/package.py b/var/spack/repos/builtin/packages/go/package.py
new file mode 100644
index 0000000000..13b83517d1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/go/package.py
@@ -0,0 +1,80 @@
+import os
+import shutil
+import glob
+import llnl.util.tty as tty
+from spack import *
+
+
+class Go(Package):
+ """The golang compiler and build environment"""
+ homepage = "https://golang.org"
+ url = "https://go.googlesource.com/go"
+
+ extendable = True
+
+ version('1.5.4', git='https://go.googlesource.com/go', tag='go1.5.4')
+ version('1.6.2', git='https://go.googlesource.com/go', tag='go1.6.2')
+
+ variant('test',
+ default=True,
+ description="Run tests as part of build, a good idea but quite"
+ " time consuming")
+
+ provides('golang')
+
+ # to-do, make non-c self-hosting compilers feasible without backflips
+ # should be a dep on external go compiler
+ depends_on('go-bootstrap')
+ depends_on('git')
+
+ def install(self, spec, prefix):
+ bash = which('bash')
+ with working_dir('src'):
+ if '+test' in spec:
+ bash('all.bash')
+ else:
+ bash('make.bash')
+
+ try:
+ os.makedirs(prefix)
+ except OSError:
+ pass
+ for f in glob.glob('*'):
+ if os.path.isdir(f):
+ shutil.copytree(f, os.path.join(prefix, f))
+ else:
+ shutil.copy2(f, os.path.join(prefix, f))
+
+ def setup_environment(self, spack_env, run_env):
+ spack_env.set('GOROOT_FINAL', self.spec.prefix)
+ spack_env.set('GOROOT_BOOTSTRAP', self.spec['go-bootstrap'].prefix)
+
+ def setup_dependent_package(self, module, ext_spec):
+ """Called before go modules' install() methods.
+
+ In most cases, extensions will only need to set GOPATH and use go::
+
+ env = os.environ
+ env['GOPATH'] = self.source_path + ':' + env['GOPATH']
+ go('get', '<package>', env=env)
+ shutil.copytree('bin', os.path.join(prefix, '/bin'))
+ """
+ # Add a go command/compiler for extensions
+ module.go = Executable(join_path(self.spec.prefix.bin, 'go'))
+
+ def setup_dependent_environment(self, spack_env, run_env, ext_spec):
+ if os.environ.get('GOROOT', False):
+ tty.warn('GOROOT is set, this is not recommended')
+
+ path_components = []
+ # Set GOPATH to include paths of dependencies
+ for d in ext_spec.traverse():
+ if d.package.extends(self.spec):
+ path_components.append(d.prefix)
+
+ # This *MUST* be first, this is where new code is installed
+ spack_env.set('GOPATH', ':'.join(path_components))
+
+ # Allow packages to find this when using module or dotkit
+ run_env.prepend_path('GOPATH', ':'.join(
+ [ext_spec.prefix] + path_components))
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
index 21137ef356..e46f432be5 100644
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -38,6 +38,7 @@ class Hdf5(Package):
list_url = "http://www.hdfgroup.org/ftp/HDF5/releases"
list_depth = 3
+ version('1.10.0-patch1', '9180ff0ef8dc2ef3f61bd37a7404f295')
version('1.10.0', 'bdc935337ee8282579cd6bc4270ad199')
version('1.8.16', 'b8ed9a36ae142317f88b0c7ef4b9c618', preferred=True)
version('1.8.15', '03cccb5b33dbe975fdcd8ae9dc021f24')
diff --git a/var/spack/repos/builtin/packages/hub/package.py b/var/spack/repos/builtin/packages/hub/package.py
new file mode 100644
index 0000000000..ed8b742e42
--- /dev/null
+++ b/var/spack/repos/builtin/packages/hub/package.py
@@ -0,0 +1,24 @@
+from spack import *
+import os
+
+
+class Hub(Package):
+ """The github git wrapper"""
+ homepage = "https://github.com/github/hub"
+ url = "https://github.com/github/hub/archive/v2.2.3.tar.gz"
+
+ version('head', git='https://github.com/github/hub')
+ version('2.2.3', '6675992ddd16d186eac7ba4484d57f5b')
+ version('2.2.2', '7edc8f5b5d3c7c392ee191dd999596fc')
+ version('2.2.1', '889a31ee9d10ae9cb333480d8dbe881f')
+ version('2.2.0', 'eddce830a079b8480f104aa7496f46fe')
+ version('1.12.4', '4f2ebb14834c9981b04e40b0d1754717')
+
+ extends("go")
+
+ def install(self, spec, prefix):
+ env = os.environ
+ env['GOPATH'] = self.stage.source_path + ':' + env['GOPATH']
+ bash = which('bash')
+ bash(os.path.join('script', 'build'), '-o', os.path.join(prefix, 'bin',
+ 'hub'))
diff --git a/var/spack/repos/builtin/packages/launchmon/package.py b/var/spack/repos/builtin/packages/launchmon/package.py
index f38bc38202..f256810005 100644
--- a/var/spack/repos/builtin/packages/launchmon/package.py
+++ b/var/spack/repos/builtin/packages/launchmon/package.py
@@ -24,29 +24,19 @@
##############################################################################
from spack import *
+
class Launchmon(Package):
"""Software infrastructure that enables HPC run-time tools to
co-locate tool daemons with a parallel job."""
- homepage = "http://sourceforge.net/projects/launchmon"
- url = "http://downloads.sourceforge.net/project/launchmon/launchmon/1.0.1%20release/launchmon-1.0.1.tar.gz"
+ homepage = "https://github.com/LLNL/LaunchMON"
+ url = "https://github.com/LLNL/LaunchMON/releases/download/v1.0.2/launchmon-v1.0.2.tar.gz" # NOQA: ignore=E501
- version('1.0.1', '2f12465803409fd07f91174a4389eb2b')
- version('1.0.1-2', git='https://github.com/llnl/launchmon.git', commit='ff7e22424b8f375318951eb1c9282fcbbfa8aadf')
+ version('1.0.2', '8d6ba77a0ec2eff2fde2c5cc8fa7ff7a')
depends_on('autoconf')
depends_on('automake')
depends_on('libtool')
-
- def patch(self):
- # This patch makes libgcrypt compile correctly with newer gcc versions.
- mf = FileFilter('tools/libgcrypt/tests/Makefile.in')
- mf.filter(r'(basic_LDADD\s*=\s*.*)', r'\1 -lgpg-error')
- mf.filter(r'(tsexp_LDADD\s*=\s*.*)', r'\1 -lgpg-error')
- mf.filter(r'(keygen_LDADD\s*=\s*.*)', r'\1 -lgpg-error')
- mf.filter(r'(benchmark_LDADD\s*=\s*.*)', r'\1 -lgpg-error')
-
-
def install(self, spec, prefix):
configure(
"--prefix=" + prefix,
diff --git a/var/spack/repos/builtin/packages/libdwarf/package.py b/var/spack/repos/builtin/packages/libdwarf/package.py
index 3f5a72116e..c9c6e9404f 100644
--- a/var/spack/repos/builtin/packages/libdwarf/package.py
+++ b/var/spack/repos/builtin/packages/libdwarf/package.py
@@ -41,12 +41,10 @@ class Libdwarf(Package):
MIPS/IRIX C compiler."""
homepage = "http://www.prevanders.net/dwarf.html"
- url = "http://www.prevanders.net/libdwarf-20130729.tar.gz"
+ url = "http://www.prevanders.net/libdwarf-20160507.tar.gz"
list_url = homepage
- version('20130729', '4cc5e48693f7b93b7aa0261e63c0e21d')
- version('20130207', '64b42692e947d5180e162e46c689dfbf')
- version('20130126', 'ded74a5e90edb5a12aac3c29d260c5db')
+ version('20160507', 'ae32d6f9ece5daf05e2d4b14822ea811')
depends_on("libelf")
@@ -69,7 +67,7 @@ class Libdwarf(Package):
install('libdwarf.h', prefix.include)
install('dwarf.h', prefix.include)
- with working_dir('dwarfdump2'):
+ with working_dir('dwarfdump'):
configure("--prefix=" + prefix)
# This makefile has strings of copy commands that
diff --git a/var/spack/repos/builtin/packages/libpciaccess/package.py b/var/spack/repos/builtin/packages/libpciaccess/package.py
index 5d1e93eab7..42e8711a7d 100644
--- a/var/spack/repos/builtin/packages/libpciaccess/package.py
+++ b/var/spack/repos/builtin/packages/libpciaccess/package.py
@@ -37,7 +37,7 @@ class Libpciaccess(Package):
def install(self, spec, prefix):
# libpciaccess does not support OS X
- if spec.satisfies('=darwin-x86_64'):
+ if spec.satisfies('arch=darwin-x86_64'):
# create a dummy directory
mkdir(prefix.lib)
return
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index c090c131c6..c32f66590a 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -23,7 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
-import os, shutil
+import os, glob
class Llvm(Package):
@@ -46,7 +46,9 @@ class Llvm(Package):
variant('libcxx', default=True, description="Build the LLVM C++ standard library")
variant('compiler-rt', default=True, description="Build the LLVM compiler runtime, including sanitizers")
variant('gold', default=True, description="Add support for LTO with the gold linker plugin")
-
+ variant('shared_libs', default=False, description="Build all components as shared libraries, faster, less memory to build, less stable")
+ variant('link_dylib', default=False, description="Build and link the libLLVM shared library rather than static")
+ variant('all_targets', default=True, description="Build all supported targets, default targets <current arch>,NVPTX,AMDGPU,CppBackend")
# Build dependency
depends_on('cmake @2.8.12.2:')
@@ -257,6 +259,28 @@ class Llvm(Package):
if '+compiler-rt' not in spec:
cmake_args.append('-DLLVM_EXTERNAL_COMPILER_RT_BUILD:Bool=OFF')
+ if '+shared_libs' in spec:
+ cmake_args.append('-DBUILD_SHARED_LIBS:Bool=ON')
+
+ if '+link_dylib' in spec:
+ cmake_args.append('-DLLVM_LINK_LLVM_DYLIB:Bool=ON')
+
+ if '+all_targets' not in spec: # all is default on cmake
+ targets = ['CppBackend', 'NVPTX', 'AMDGPU']
+ if 'x86' in spec.architecture.lower():
+ targets.append('X86')
+ elif 'arm' in spec.architecture.lower():
+ targets.append('ARM')
+ elif 'aarch64' in spec.architecture.lower():
+ targets.append('AArch64')
+ elif 'sparc' in spec.architecture.lower():
+ targets.append('sparc')
+ elif ('ppc' in spec.architecture.lower() or
+ 'power' in spec.architecture.lower()):
+ targets.append('PowerPC')
+
+ cmake_args.append('-DLLVM_TARGETS_TO_BUILD:Bool=' + ';'.join(targets))
+
if '+clang' not in spec:
if '+clang_extra' in spec:
raise SpackException('The clang_extra variant requires the clang variant to be selected')
@@ -267,7 +291,5 @@ class Llvm(Package):
cmake(*cmake_args)
make()
make("install")
- query_path = os.path.join('bin', 'clang-query')
- # Manually install clang-query, because llvm doesn't...
- if os.path.exists(query_path):
- shutil.copy(query_path, os.path.join(prefix, 'bin'))
+ cp = which('cp')
+ cp('-a', 'bin/', prefix)
diff --git a/var/spack/repos/builtin/packages/lua-luaposix/package.py b/var/spack/repos/builtin/packages/lua-luaposix/package.py
new file mode 100644
index 0000000000..9e96548f08
--- /dev/null
+++ b/var/spack/repos/builtin/packages/lua-luaposix/package.py
@@ -0,0 +1,16 @@
+from spack import *
+import glob
+
+
+class LuaLuaposix(Package):
+ """Lua posix bindings, including ncurses"""
+ homepage = "https://github.com/luaposix/luaposix/"
+ url = "https://github.com/luaposix/luaposix/archive/release-v33.4.0.tar.gz"
+
+ version('33.4.0', 'b36ff049095f28752caeb0b46144516c')
+
+ extends("lua")
+
+ def install(self, spec, prefix):
+ rockspec = glob.glob('luaposix-*.rockspec')
+ luarocks('--tree=' + prefix, 'install', rockspec[0])
diff --git a/var/spack/repos/builtin/packages/lua/package.py b/var/spack/repos/builtin/packages/lua/package.py
index 9a73a22645..170f90516a 100644
--- a/var/spack/repos/builtin/packages/lua/package.py
+++ b/var/spack/repos/builtin/packages/lua/package.py
@@ -25,10 +25,11 @@
from spack import *
import os
+
class Lua(Package):
""" The Lua programming language interpreter and library """
homepage = "http://www.lua.org"
- url = "http://www.lua.org/ftp/lua-5.1.5.tar.gz"
+ url = "http://www.lua.org/ftp/lua-5.1.5.tar.gz"
version('5.3.2', '33278c2ab5ee3c1a875be8d55c1ca2a1')
version('5.3.1', '797adacada8d85761c079390ff1d9961')
@@ -42,17 +43,115 @@ class Lua(Package):
version('5.1.4', 'd0870f2de55d59c1c8419f36e8fac150')
version('5.1.3', 'a70a8dfaa150e047866dc01a46272599')
+ extendable = True
+
depends_on('ncurses')
depends_on('readline')
+ resource(
+ name="luarocks",
+ url="https://keplerproject.github.io/luarocks/releases/"
+ "luarocks-2.3.0.tar.gz",
+ md5="a38126684cf42b7d0e7a3c7cf485defb",
+ destination="luarocks",
+ placement='luarocks')
+
def install(self, spec, prefix):
- if spec.satisfies("=darwin-i686") or spec.satisfies("=darwin-x86_64"):
+ if spec.satisfies("arch=darwin-i686") or spec.satisfies("arch=darwin-x86_64"):
target = 'macosx'
else:
target = 'linux'
make('INSTALL_TOP=%s' % prefix,
- 'MYLDFLAGS=-L%s -lncurses' % spec['ncurses'].prefix.lib,
+ 'MYLDFLAGS=-L%s -L%s ' % (
+ spec['readline'].prefix.lib,
+ spec['ncurses'].prefix.lib),
+ 'MYLIBS=-lncurses',
target)
make('INSTALL_TOP=%s' % prefix,
- 'MYLDFLAGS=-L%s -lncurses' % spec['ncurses'].prefix.lib,
+ 'MYLDFLAGS=-L%s -L%s ' % (
+ spec['readline'].prefix.lib,
+ spec['ncurses'].prefix.lib),
+ 'MYLIBS=-lncurses',
'install')
+
+ with working_dir(os.path.join('luarocks', 'luarocks')):
+ configure('--prefix=' + prefix, '--with-lua=' + prefix)
+ make('build')
+ make('install')
+
+ def append_paths(self, paths, cpaths, path):
+ paths.append(os.path.join(path, '?.lua'))
+ paths.append(os.path.join(path, '?', 'init.lua'))
+ cpaths.append(os.path.join(path, '?.so'))
+
+ def setup_dependent_environment(self, spack_env, run_env, extension_spec):
+ lua_paths = []
+ for d in extension_spec.traverse():
+ if d.package.extends(self.spec):
+ lua_paths.append(os.path.join(d.prefix, self.lua_lib_dir))
+ lua_paths.append(os.path.join(d.prefix, self.lua_share_dir))
+
+ lua_patterns = []
+ lua_cpatterns = []
+ for p in lua_paths:
+ if os.path.isdir(p):
+ self.append_paths(lua_patterns, lua_cpatterns, p)
+
+ # Always add this package's paths
+ for p in (os.path.join(self.spec.prefix, self.lua_lib_dir),
+ os.path.join(self.spec.prefix, self.lua_share_dir)):
+ self.append_paths(lua_patterns, lua_cpatterns, p)
+
+ spack_env.set('LUA_PATH', ';'.join(lua_patterns), separator=';')
+ spack_env.set('LUA_CPATH', ';'.join(lua_cpatterns), separator=';')
+
+ # For run time environment set only the path for extension_spec and
+ # prepend it to LUAPATH
+ if extension_spec.package.extends(self.spec):
+ run_env.prepend_path('LUA_PATH', ';'.join(lua_patterns),
+ separator=';')
+ run_env.prepend_path('LUA_CPATH', ';'.join(lua_cpatterns),
+ separator=';')
+
+ def setup_environment(self, spack_env, run_env):
+ run_env.prepend_path(
+ 'LUA_PATH',
+ os.path.join(self.spec.prefix, self.lua_share_dir, '?.lua'),
+ separator=';')
+ run_env.prepend_path(
+ 'LUA_PATH', os.path.join(self.spec.prefix, self.lua_share_dir, '?',
+ 'init.lua'),
+ separator=';')
+ run_env.prepend_path(
+ 'LUA_PATH',
+ os.path.join(self.spec.prefix, self.lua_lib_dir, '?.lua'),
+ separator=';')
+ run_env.prepend_path(
+ 'LUA_PATH',
+ os.path.join(self.spec.prefix, self.lua_lib_dir, '?', 'init.lua'),
+ separator=';')
+ run_env.prepend_path(
+ 'LUA_CPATH',
+ os.path.join(self.spec.prefix, self.lua_lib_dir, '?.so'),
+ separator=';')
+
+ @property
+ def lua_lib_dir(self):
+ return os.path.join('lib', 'lua', '%d.%d' % self.version[:2])
+
+ @property
+ def lua_share_dir(self):
+ return os.path.join('share', 'lua', '%d.%d' % self.version[:2])
+
+ def setup_dependent_package(self, module, ext_spec):
+ """
+ Called before lua modules's install() methods.
+
+ In most cases, extensions will only need to have two lines::
+
+ luarocks('--tree=' + prefix, 'install', rock_spec_path)
+ """
+ # Lua extension builds can have lua and luarocks executable functions
+ module.lua = Executable(join_path(self.spec.prefix.bin, 'lua'))
+ module.luarocks = Executable(join_path(self.spec.prefix.bin,
+ 'luarocks'))
diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py
index 061179b78e..c4f2afaff2 100644
--- a/var/spack/repos/builtin/packages/metis/package.py
+++ b/var/spack/repos/builtin/packages/metis/package.py
@@ -24,55 +24,61 @@
##############################################################################
from spack import *
-import glob, sys, os
+import glob
+import sys
+import os
+
class Metis(Package):
- """
- METIS is a set of serial programs for partitioning graphs, partitioning finite element meshes, and producing fill
- reducing orderings for sparse matrices. The algorithms implemented in METIS are based on the multilevel
- recursive-bisection, multilevel k-way, and multi-constraint partitioning schemes.
- """
+ """METIS is a set of serial programs for partitioning graphs, partitioning
+ finite element meshes, and producing fill reducing orderings for sparse
+ matrices. The algorithms implemented in METIS are based on the
+ multilevel recursive-bisection, multilevel k-way, and multi-constraint
+ partitioning schemes."""
- homepage = 'http://glaros.dtc.umn.edu/gkhome/metis/metis/overview'
- url = "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz"
+ homepage = "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview"
+ base_url = "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis"
- version('5.1.0', '5465e67079419a69e0116de24fce58fe',
- url='http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz')
- version('4.0.3', '5efa35de80703c1b2c4d0de080fafbcf4e0d363a21149a1ad2f96e0144841a55',
- url='http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/OLD/metis-4.0.3.tar.gz')
+ version('5.1.0', '5465e67079419a69e0116de24fce58fe')
+ version('5.0.2', 'acb521a4e8c2e6dd559a7f9abd0468c5')
+ version('4.0.3', 'd3848b454532ef18dc83e4fb160d1e10')
variant('shared', default=True, description='Enables the build of shared libraries')
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')
+ variant('real64', default=False, description='Use double precision floating point types')
- depends_on('cmake @2.8:', when='@5:') # build-time dependency
- depends_on('gdb', when='+gdb')
+ depends_on('cmake@2.8:', when='@5:') # build-time dependency
patch('install_gklib_defs_rename.patch', when='@5:')
+ def url_for_version(self, version):
+ verdir = 'OLD/' if version < Version('4.0.3') else ''
+ return '%s/%smetis-%s.tar.gz' % (Metis.base_url, verdir, version)
- @when('@4:4.0.3')
+ @when('@:4')
def install(self, spec, prefix):
-
- if '+gdb' in spec:
- raise InstallError('gdb support not implemented in METIS 4!')
- if '+idx64' in spec:
- raise InstallError('idx64 option not implemented in METIS 4!')
- if '+double' in spec:
- raise InstallError('double option not implemented for METIS 4!')
+ # Process library spec and options
+ unsupp_vars = [v for v in ('+gdb', '+idx64', '+real64') if v in spec]
+ if unsupp_vars:
+ msg = 'Given variants %s are unsupported by METIS 4!' % unsupp_vars
+ raise InstallError(msg)
options = ['COPTIONS=-fPIC']
if '+debug' in spec:
options.append('OPTFLAGS=-g -O0')
make(*options)
+ # Compile and install library files
+ ccompile = Executable(self.compiler.cc)
+
mkdir(prefix.bin)
- for x in ('pmetis', 'kmetis', 'oemetis', 'onmetis', 'partnmesh',
- 'partdmesh', 'mesh2nodal', 'mesh2dual', 'graphchk'):
- install(x, prefix.bin)
+ binfiles = ('pmetis', 'kmetis', 'oemetis', 'onmetis', 'partnmesh',
+ 'partdmesh', 'mesh2nodal', 'mesh2dual', 'graphchk')
+ for binfile in binfiles:
+ install(binfile, prefix.bin)
mkdir(prefix.lib)
install('libmetis.a', prefix.lib)
@@ -82,106 +88,120 @@ class Metis(Package):
install(h, prefix.include)
mkdir(prefix.share)
- for f in (join_path(*p)
- for p in (('Programs', 'io.c'),
- ('Test','mtest.c'),
- ('Graphs','4elt.graph'),
- ('Graphs', 'metis.mesh'),
- ('Graphs', 'test.mgraph'))):
- install(f, prefix.share)
+ sharefiles = (('Graphs', '4elt.graph'), ('Graphs', 'metis.mesh'),
+ ('Graphs', 'test.mgraph'))
+ for sharefile in tuple(join_path(*sf) for sf in sharefiles):
+ install(sharefile, prefix.share)
if '+shared' in spec:
+ shared_flags = ['-fPIC', '-shared']
if sys.platform == 'darwin':
- lib_dsuffix = 'dylib'
- load_flag = '-Wl,-all_load'
- no_load_flag = ''
+ shared_suffix = 'dylib'
+ shared_flags.extend(['-Wl,-all_load', 'libmetis.a'])
else:
- lib_dsuffix = 'so'
- load_flag = '-Wl,-whole-archive'
- no_load_flag = '-Wl,-no-whole-archive'
+ shared_suffix = 'so'
+ shared_flags.extend(['-Wl,-whole-archive', 'libmetis.a',
+ '-Wl,-no-whole-archive'])
- os.system(spack_cc + ' -fPIC -shared ' + load_flag +
- ' libmetis.a ' + no_load_flag + ' -o libmetis.' +
- lib_dsuffix)
- install('libmetis.' + lib_dsuffix, prefix.lib)
+ shared_out = '%s/libmetis.%s' % (prefix.lib, shared_suffix)
+ shared_flags.extend(['-o', shared_out])
- # Set up and run tests on installation
- symlink(join_path(prefix.share, 'io.c'), 'io.c')
- symlink(join_path(prefix.share, 'mtest.c'), 'mtest.c')
- os.system(spack_cc + ' -I%s' % prefix.include + ' -c io.c')
- os.system(spack_cc + ' -I%s' % prefix.include +
- ' -L%s' % prefix.lib + ' -lmetis mtest.c io.o -o mtest')
- _4eltgraph = join_path(prefix.share, '4elt.graph')
- test_mgraph = join_path(prefix.share, 'test.mgraph')
- metis_mesh = join_path(prefix.share, 'metis.mesh')
- kmetis = join_path(prefix.bin, 'kmetis')
- os.system('./mtest ' + _4eltgraph)
- os.system(kmetis + ' ' + _4eltgraph + ' 40')
- os.system(join_path(prefix.bin, 'onmetis') + ' ' + _4eltgraph)
- os.system(join_path(prefix.bin, 'pmetis') + ' ' + test_mgraph + ' 2')
- os.system(kmetis + ' ' + test_mgraph + ' 2')
- os.system(kmetis + ' ' + test_mgraph + ' 5')
- os.system(join_path(prefix.bin, 'partnmesh') + metis_mesh + ' 10')
- os.system(join_path(prefix.bin, 'partdmesh') + metis_mesh + ' 10')
- os.system(join_path(prefix.bin, 'mesh2dual') + metis_mesh)
+ ccompile(*shared_flags)
+ # Set up and run tests on installation
+ ccompile('-I%s' % prefix.include, '-L%s' % prefix.lib,
+ '-Wl,-rpath=%s' % (prefix.lib if '+shared' in spec else ''),
+ join_path('Programs', 'io.o'), join_path('Test', 'mtest.c'),
+ '-o', '%s/mtest' % prefix.bin, '-lmetis', '-lm')
+
+ test_bin = lambda testname: join_path(prefix.bin, testname)
+ test_graph = lambda graphname: join_path(prefix.share, graphname)
+
+ graph = test_graph('4elt.graph')
+ os.system('%s %s' % (test_bin('mtest'), graph))
+ os.system('%s %s 40' % (test_bin('kmetis'), graph))
+ os.system('%s %s' % (test_bin('onmetis'), graph))
+ graph = test_graph('test.mgraph')
+ os.system('%s %s 2' % (test_bin('pmetis'), graph))
+ os.system('%s %s 2' % (test_bin('kmetis'), graph))
+ os.system('%s %s 5' % (test_bin('kmetis'), graph))
+ graph = test_graph('metis.mesh')
+ os.system('%s %s 10' % (test_bin('partnmesh'), graph))
+ os.system('%s %s 10' % (test_bin('partdmesh'), graph))
+ os.system('%s %s' % (test_bin('mesh2dual'), graph))
+
+ # FIXME: The following code should replace the testing code in the
+ # block above since it causes installs to fail when one or more of the
+ # Metis tests fail, but it currently doesn't work because the 'mtest',
+ # 'onmetis', and 'partnmesh' tests return error codes that trigger
+ # false positives for failure.
+ """
+ Executable(test_bin('mtest'))(test_graph('4elt.graph'))
+ Executable(test_bin('kmetis'))(test_graph('4elt.graph'), '40')
+ Executable(test_bin('onmetis'))(test_graph('4elt.graph'))
+
+ Executable(test_bin('pmetis'))(test_graph('test.mgraph'), '2')
+ Executable(test_bin('kmetis'))(test_graph('test.mgraph'), '2')
+ Executable(test_bin('kmetis'))(test_graph('test.mgraph'), '5')
+
+ Executable(test_bin('partnmesh'))(test_graph('metis.mesh'), '10')
+ Executable(test_bin('partdmesh'))(test_graph('metis.mesh'), '10')
+ Executable(test_bin('mesh2dual'))(test_graph('metis.mesh'))
+ """
@when('@5:')
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
- options.append('-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=source_directory))
+ options.append('-DGKLIB_PATH:PATH=%s/GKlib' % source_directory)
options.append('-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % prefix)
if '+shared' in spec:
options.append('-DSHARED:BOOL=ON')
-
if '+debug' in spec:
options.extend(['-DDEBUG:BOOL=ON',
'-DCMAKE_BUILD_TYPE:STRING=Debug'])
-
if '+gdb' in spec:
options.append('-DGDB:BOOL=ON')
metis_header = join_path(source_directory, 'include', 'metis.h')
-
if '+idx64' in spec:
filter_file('IDXTYPEWIDTH 32', 'IDXTYPEWIDTH 64', metis_header)
-
- if '+double' in spec:
+ if '+real64' in spec:
filter_file('REALTYPEWIDTH 32', 'REALTYPEWIDTH 64', metis_header)
# Make clang 7.3 happy.
# Prevents "ld: section __DATA/__thread_bss extends beyond end of file"
# See upstream LLVM issue https://llvm.org/bugs/show_bug.cgi?id=27059
- # Adopted from https://github.com/Homebrew/homebrew-science/blob/master/metis.rb
+ # and https://github.com/Homebrew/homebrew-science/blob/master/metis.rb
if spec.satisfies('%clang@7.3.0'):
- filter_file('#define MAX_JBUFS 128', '#define MAX_JBUFS 24', join_path(source_directory, 'GKlib', 'error.c'))
+ filter_file('#define MAX_JBUFS 128', '#define MAX_JBUFS 24',
+ join_path(source_directory, 'GKlib', 'error.c'))
with working_dir(build_directory, create=True):
cmake(source_directory, *options)
make()
- make("install")
+ make('install')
+
# now run some tests:
- for f in ["4elt", "copter2", "mdual"]:
- graph = join_path(source_directory,'graphs','%s.graph' % f)
- Executable(join_path(prefix.bin,'graphchk'))(graph)
- Executable(join_path(prefix.bin,'gpmetis'))(graph,'2')
- Executable(join_path(prefix.bin,'ndmetis'))(graph)
+ for f in ['4elt', 'copter2', 'mdual']:
+ graph = join_path(source_directory, 'graphs', '%s.graph' % f)
+ Executable(join_path(prefix.bin, 'graphchk'))(graph)
+ Executable(join_path(prefix.bin, 'gpmetis'))(graph, '2')
+ Executable(join_path(prefix.bin, 'ndmetis'))(graph)
- graph = join_path(source_directory,'graphs','test.mgraph')
- Executable(join_path(prefix.bin,'gpmetis'))(graph,'2')
- graph = join_path(source_directory,'graphs','metis.mesh')
- Executable(join_path(prefix.bin,'mpmetis'))(graph,'2')
+ graph = join_path(source_directory, 'graphs', 'test.mgraph')
+ Executable(join_path(prefix.bin, 'gpmetis'))(graph, '2')
+ graph = join_path(source_directory, 'graphs', 'metis.mesh')
+ Executable(join_path(prefix.bin, 'mpmetis'))(graph, '2')
# install GKlib headers, which will be needed for ParMETIS
- GKlib_dist = join_path(prefix.include,'GKlib')
+ 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)
+ hfiles = glob.glob(join_path(source_directory, 'GKlib', '*.h'))
+ for hfile in hfiles:
+ install(hfile, GKlib_dist)
diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py
index f4997bdfa1..d1944023d1 100644
--- a/var/spack/repos/builtin/packages/mvapich2/package.py
+++ b/var/spack/repos/builtin/packages/mvapich2/package.py
@@ -25,6 +25,7 @@
from spack import *
import os
+
class Mvapich2(Package):
"""MVAPICH2 is an MPI implementation for Infiniband networks."""
homepage = "http://mvapich.cse.ohio-state.edu/"
@@ -43,8 +44,9 @@ class Mvapich2(Package):
variant('debug', default=False, description='Enables debug information and error messages at run-time')
##########
- # TODO : Process managers should be grouped into the same variant, as soon as variant capabilities will be extended
- # See https://groups.google.com/forum/#!topic/spack/F8-f8B4_0so
+ # TODO : Process managers should be grouped into the same variant,
+ # as soon as variant capabilities will be extended See
+ # https://groups.google.com/forum/#!topic/spack/F8-f8B4_0so
SLURM = 'slurm'
HYDRA = 'hydra'
GFORKER = 'gforker'
@@ -57,7 +59,8 @@ class Mvapich2(Package):
##########
##########
- # TODO : Network types should be grouped into the same variant, as soon as variant capabilities will be extended
+ # TODO : Network types should be grouped into the same variant, as
+ # soon as variant capabilities will be extended
PSM = 'psm'
SOCK = 'sock'
NEMESISIBTCP = 'nemesisibtcp'
@@ -84,8 +87,8 @@ class Mvapich2(Package):
@staticmethod
def enabled(x):
- """
- Given a variant name returns the string that means the variant is enabled
+ """Given a variant name returns the string that means the variant is
+ enabled
:param x: variant name
:return:
@@ -93,8 +96,8 @@ class Mvapich2(Package):
return '+' + x
def set_build_type(self, spec, configure_args):
- """
- Appends to configure_args the flags that depends only on the build type (i.e. release or debug)
+ """Appends to configure_args the flags that depends only on the build
+ type (i.e. release or debug)
:param spec: spec
:param configure_args: list of current configure arguments
@@ -104,7 +107,8 @@ class Mvapich2(Package):
"--disable-fast",
"--enable-error-checking=runtime",
"--enable-error-messages=all",
- "--enable-g=dbg", "--enable-debuginfo" # Permits debugging with TotalView
+ # Permits debugging with TotalView
+ "--enable-g=dbg", "--enable-debuginfo"
]
else:
build_type_options = ["--enable-fast=all"]
@@ -112,25 +116,41 @@ class Mvapich2(Package):
configure_args.extend(build_type_options)
def set_process_manager(self, spec, configure_args):
- """
- Appends to configure_args the flags that will enable the appropriate process managers
+ """Appends to configure_args the flags that will enable the
+ appropriate process managers
:param spec: spec
:param configure_args: list of current configure arguments
"""
- # Check that slurm variant is not activated together with other pm variants
- has_slurm_incompatible_variants = any(self.enabled(x) in spec for x in Mvapich2.SLURM_INCOMPATIBLE_PMS)
- if self.enabled(Mvapich2.SLURM) in spec and has_slurm_incompatible_variants:
- raise RuntimeError(" %s : 'slurm' cannot be activated together with other process managers" % self.name)
+ # Check that slurm variant is not activated together with
+ # other pm variants
+ has_slurm_incompatible_variants = \
+ any(self.enabled(x) in spec
+ for x in Mvapich2.SLURM_INCOMPATIBLE_PMS)
+
+ if self.enabled(Mvapich2.SLURM) in spec and \
+ has_slurm_incompatible_variants:
+ raise RuntimeError(" %s : 'slurm' cannot be activated \
+ together with other process managers" % self.name)
process_manager_options = []
+ # See: http://slurm.schedmd.com/mpi_guide.html#mvapich2
if self.enabled(Mvapich2.SLURM) in spec:
- process_manager_options = [
- "--with-pm=slurm"
- ]
+ if self.version > Version('2.0'):
+ process_manager_options = [
+ "--with-pmi=pmi2",
+ "--with-pm=slurm"
+ ]
+ else:
+ process_manager_options = [
+ "--with-pmi=slurm",
+ "--with-pm=no"
+ ]
+
elif has_slurm_incompatible_variants:
pms = []
- # The variant name is equal to the process manager name in the configuration options
+ # The variant name is equal to the process manager name in
+ # the configuration options
for x in Mvapich2.SLURM_INCOMPATIBLE_PMS:
if self.enabled(x) in spec:
pms.append(x)
@@ -146,7 +166,9 @@ class Mvapich2(Package):
if self.enabled(x) in spec:
count += 1
if count > 1:
- raise RuntimeError('network variants are mutually exclusive (only one can be selected at a time)')
+ 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:
@@ -164,6 +186,11 @@ class Mvapich2(Package):
configure_args.extend(network_options)
+ def setup_environment(self, spack_env, run_env):
+ if self.enabled(Mvapich2.SLURM) in self.spec and \
+ self.version > Version('2.0'):
+ run_env.set('SLURM_MPI_TYPE', 'pmi2')
+
def setup_dependent_environment(self, spack_env, run_env, extension_spec):
spack_env.set('MPICH_CC', spack_cc)
spack_env.set('MPICH_CXX', spack_cxx)
@@ -178,7 +205,8 @@ class Mvapich2(Package):
self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77')
def install(self, spec, prefix):
- # we'll set different configure flags depending on our environment
+ # we'll set different configure flags depending on our
+ # environment
configure_args = [
"--prefix=%s" % prefix,
"--enable-shared",
@@ -208,7 +236,6 @@ class Mvapich2(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.
@@ -228,8 +255,17 @@ class Mvapich2(Package):
spack_f77 = os.environ['F77']
spack_fc = os.environ['FC']
- kwargs = { 'ignore_absent' : True, 'backup' : False, 'string' : True }
- filter_file('CC="%s"' % spack_cc , 'CC="%s"' % self.compiler.cc, mpicc, **kwargs)
- filter_file('CXX="%s"'% spack_cxx, 'CXX="%s"' % self.compiler.cxx, mpicxx, **kwargs)
- filter_file('F77="%s"'% spack_f77, 'F77="%s"' % self.compiler.f77, mpif77, **kwargs)
- filter_file('FC="%s"' % spack_fc , 'FC="%s"' % self.compiler.fc, mpif90, **kwargs)
+ kwargs = {
+ 'ignore_absent': True,
+ 'backup': False,
+ 'string': True
+ }
+
+ filter_file('CC="%s"' % spack_cc,
+ 'CC="%s"' % self.compiler.cc, mpicc, **kwargs)
+ filter_file('CXX="%s"' % spack_cxx,
+ 'CXX="%s"' % self.compiler.cxx, mpicxx, **kwargs)
+ filter_file('F77="%s"' % spack_f77,
+ 'F77="%s"' % self.compiler.f77, mpif77, **kwargs)
+ filter_file('FC="%s"' % spack_fc,
+ 'FC="%s"' % self.compiler.fc, mpif90, **kwargs)
diff --git a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py
index b67ea299a8..f8af76429b 100644
--- a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py
+++ b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py
@@ -24,16 +24,21 @@
##############################################################################
from spack import *
+
class NetcdfCxx4(Package):
"""C++ interface for NetCDF4"""
homepage = "http://www.unidata.ucar.edu/software/netcdf"
- url = "http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.2.tar.gz"
+ url = "https://www.github.com/unidata/netcdf-cxx4/tarball/v4.3.0"
- version('4.2', 'd019853802092cf686254aaba165fc81')
+ version('4.3.0', '0dde8b9763eecdafbd69d076e687337e')
+ version('4.2.1', 'd019853802092cf686254aaba165fc81')
depends_on('netcdf')
+ depends_on("autoconf")
def install(self, spec, prefix):
+ # Rebuild to prevent problems of inconsistency in git repo
+ which('autoreconf')('-ivf')
configure('--prefix=%s' % prefix)
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/octave/package.py b/var/spack/repos/builtin/packages/octave/package.py
index 17c7ff82f4..72ff0ee6fc 100644
--- a/var/spack/repos/builtin/packages/octave/package.py
+++ b/var/spack/repos/builtin/packages/octave/package.py
@@ -23,6 +23,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
+import sys
+
class Octave(Package):
"""GNU Octave is a high-level language, primarily intended for numerical
@@ -34,7 +36,8 @@ class Octave(Package):
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')
+ version('4.0.2', 'c2a5cacc6e4c52f924739cdf22c2c687')
+ version('4.0.0', 'a69f8320a4f20a8480c1b278b1adb799')
# Variants
variant('readline', default=True)
@@ -62,33 +65,35 @@ class Octave(Package):
# Required dependencies
depends_on('blas')
depends_on('lapack')
+ # Octave does not configure with sed from darwin:
+ depends_on('sed', sys.platform == 'darwin')
depends_on('pcre')
+ depends_on('pkg-config')
# Strongly recommended dependencies
- depends_on('readline', when='+readline')
+ depends_on('readline', when='+readline')
# Optional dependencies
- depends_on('arpack', when='+arpack')
- depends_on('curl', when='+curl')
- depends_on('fftw', 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') # TODO: add package
- depends_on('qhull', when='+qhull')
- depends_on('qrupdate', when='+qrupdate')
- #depends_on('qscintilla', when='+qscintilla) # TODO: add package
- depends_on('qt', when='+qt')
- depends_on('suite-sparse',when='+suitesparse')
- depends_on('zlib', when='+zlib')
-
+ depends_on('arpack', when='+arpack')
+ depends_on('curl', when='+curl')
+ depends_on('fftw', 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') # TODO: add package
+ depends_on('qhull', when='+qhull')
+ depends_on('qrupdate', when='+qrupdate')
+ # depends_on('qscintilla', when='+qscintilla) # TODO: add package
+ depends_on('qt', when='+qt')
+ depends_on('suite-sparse', when='+suitesparse')
+ depends_on('zlib', when='+zlib')
def install(self, spec, prefix):
config_args = [
@@ -154,7 +159,8 @@ class Octave(Package):
config_args.append("--without-glpk")
if '+magick' in spec:
- config_args.append("--with-magick=%s" % spec['ImageMagick'].prefix.lib)
+ config_args.append("--with-magick=%s"
+ % spec['ImageMagick'].prefix.lib)
if '+hdf5' in spec:
config_args.extend([
@@ -187,7 +193,8 @@ class Octave(Package):
if '+qrupdate' in spec:
config_args.extend([
- "--with-qrupdate-includedir=%s" % spec['qrupdate'].prefix.include,
+ "--with-qrupdate-includedir=%s"
+ % spec['qrupdate'].prefix.include,
"--with-qrupdate-libdir=%s" % spec['qrupdate'].prefix.lib
])
else:
diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py
index 163990bf15..4e465e1784 100644
--- a/var/spack/repos/builtin/packages/openmpi/package.py
+++ b/var/spack/repos/builtin/packages/openmpi/package.py
@@ -27,6 +27,26 @@ import os
from spack import *
+def _verbs_dir():
+ """
+ Try to find the directory where the OpenFabrics verbs package is
+ installed. Return None if not found.
+ """
+ try:
+ # Try to locate Verbs by looking for a utility in the path
+ ibv_devices = which("ibv_devices")
+ # Run it (silently) to ensure it works
+ ibv_devices(output=str, error=str)
+ # Get path to executable
+ path = ibv_devices.exe[0]
+ # Remove executable name and "bin" directory
+ path = os.path.dirname(path)
+ path = os.path.dirname(path)
+ return path
+ except:
+ return None
+
+
class Openmpi(Package):
"""Open MPI is a project combining technologies and resources from
several other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI)
@@ -54,7 +74,7 @@ class Openmpi(Package):
variant('psm', default=False, description='Build support for the PSM library.')
variant('psm2', default=False, description='Build support for the Intel PSM2 library.')
variant('pmi', default=False, description='Build support for PMI-based launchers')
- variant('verbs', default=False, description='Build support for OpenFabrics verbs.')
+ variant('verbs', default=_verbs_dir() is not None, description='Build support for OpenFabrics verbs.')
variant('mxm', default=False, description='Build Mellanox Messaging support')
variant('thread_multiple', default=False, description='Enable MPI_THREAD_MULTIPLE support')
@@ -65,6 +85,8 @@ class Openmpi(Package):
variant('sqlite3', default=False, description='Build sqlite3 support')
+ variant('vt', default=True, description='Build support for contributed package vt')
+
# TODO : support for CUDA is missing
provides('mpi@:2.2', when='@1.6.5')
@@ -111,13 +133,21 @@ class Openmpi(Package):
# Fabrics
'--with-psm' if '+psm' in spec else '--without-psm',
'--with-psm2' if '+psm2' in spec else '--without-psm2',
- ('--with-%s' % self.verbs) if '+verbs' in spec else ('--without-%s' % self.verbs),
'--with-mxm' if '+mxm' in spec else '--without-mxm',
# Other options
'--enable-mpi-thread-multiple' if '+thread_multiple' in spec else '--disable-mpi-thread-multiple',
'--with-pmi' if '+pmi' in spec else '--without-pmi',
- '--with-sqlite3' if '+sqlite3' in spec else '--without-sqlite3'
+ '--with-sqlite3' if '+sqlite3' in spec else '--without-sqlite3',
+ '--enable-vt' if '+vt' in spec else '--disable-vt'
])
+ if '+verbs' in spec:
+ path = _verbs_dir()
+ if path is not None:
+ config_args.append('--with-%s=%s' % (self.verbs, path))
+ else:
+ config_args.append('--with-%s' % self.verbs)
+ else:
+ config_args.append('--without-%s' % self.verbs)
# TODO: use variants for this, e.g. +lanl, +llnl, etc.
# use this for LANL builds, but for LLNL builds, we need:
diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py
index 119cdd83c2..34ab0703ad 100644
--- a/var/spack/repos/builtin/packages/openssl/package.py
+++ b/var/spack/repos/builtin/packages/openssl/package.py
@@ -35,7 +35,7 @@ class Openssl(Package):
Transport Layer Security (TLS v1) protocols as well as a
full-strength general purpose cryptography library."""
homepage = "http://www.openssl.org"
- url = "http://www.openssl.org/source/openssl-1.0.1h.tar.gz"
+ url = "https://www.openssl.org/source/openssl-1.0.1h.tar.gz"
version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf')
version('1.0.1r', '1abd905e079542ccae948af37e393d28')
@@ -100,7 +100,7 @@ class Openssl(Package):
# in the environment, then this will override what is set in the
# Makefile, leading to build errors.
env.pop('APPS', None)
- if spec.satisfies("=darwin-x86_64") or spec.satisfies("=ppc64"):
+ if spec.satisfies("arch=darwin-x86_64") or spec.satisfies("arch=ppc64"):
# This needs to be done for all 64-bit architectures (except Linux,
# where it happens automatically?)
env['KERNEL_BITS'] = '64'
diff --git a/var/spack/repos/builtin/packages/parmetis/package.py b/var/spack/repos/builtin/packages/parmetis/package.py
index 2dead4a76a..9b36f273e4 100644
--- a/var/spack/repos/builtin/packages/parmetis/package.py
+++ b/var/spack/repos/builtin/packages/parmetis/package.py
@@ -26,33 +26,36 @@
from spack import *
import sys
+
class Parmetis(Package):
- """
- ParMETIS is an MPI-based parallel library that implements a variety of algorithms for partitioning unstructured
- graphs, meshes, and for computing fill-reducing orderings of sparse matrices.
- """
+ """ParMETIS is an MPI-based parallel library that implements a variety of
+ algorithms for partitioning unstructured graphs, meshes, and for
+ computing fill-reducing orderings of sparse matrices."""
+
homepage = 'http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview'
- url = 'http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz'
+ base_url = 'http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis'
version('4.0.3', 'f69c479586bf6bb7aff6a9bc0c739628')
+ version('4.0.2', '0912a953da5bb9b5e5e10542298ffdce')
variant('shared', default=True, description='Enables the build of shared libraries')
variant('debug', default=False, description='Builds the library in debug mode')
variant('gdb', default=False, description='Enables gdb support')
- depends_on('cmake @2.8:') # build dependency
+ depends_on('cmake@2.8:') # build dependency
depends_on('mpi')
-
- patch('enable_external_metis.patch')
depends_on('metis@5:')
+ patch('enable_external_metis.patch')
# bug fixes from PETSc developers
- # https://bitbucket.org/petsc/pkg-parmetis/commits/1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b/raw/
+ # https://bitbucket.org/petsc/pkg-parmetis/commits/1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b/raw/ # NOQA: ignore=E501
patch('pkg-parmetis-1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b.patch')
- # https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/
+ # https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/ # NOQA: ignore=E501
patch('pkg-parmetis-82409d68aa1d6cbc70740d0f35024aae17f7d5cb.patch')
- depends_on('gdb', when='+gdb')
+ def url_for_version(self, version):
+ verdir = 'OLD/' if version < Version('3.2.0') else ''
+ return '%s/%sparmetis-%s.tar.gz' % (Parmetis.base_url, verdir, version)
def install(self, spec, prefix):
options = []
@@ -60,30 +63,27 @@ class Parmetis(Package):
build_directory = join_path(self.stage.path, 'spack-build')
source_directory = self.stage.source_path
- metis_source = join_path(source_directory, 'metis')
- # 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=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'])
+ options.extend([
+ '-DGKLIB_PATH:PATH=%s/GKlib' % spec['metis'].prefix.include,
+ '-DMETIS_PATH:PATH=%s' % spec['metis'].prefix,
+ '-DCMAKE_C_COMPILER:STRING=%s' % spec['mpi'].mpicc,
+ '-DCMAKE_CXX_COMPILER:STRING=%s' % spec['mpi'].mpicxx
+ ])
if '+shared' in spec:
options.append('-DSHARED:BOOL=ON')
-
if '+debug' in spec:
options.extend(['-DDEBUG:BOOL=ON',
'-DCMAKE_BUILD_TYPE:STRING=Debug'])
-
if '+gdb' in spec:
options.append('-DGDB:BOOL=ON')
with working_dir(build_directory, create=True):
cmake(source_directory, *options)
make()
- make("install")
+ make('install')
- # The shared library is not installed correctly on Darwin; correct this
+ # The shared library is not installed correctly on Darwin; fix this
if (sys.platform == 'darwin') and ('+shared' in spec):
fix_darwin_install_name(prefix.lib)
diff --git a/var/spack/repos/builtin/packages/py-autopep8/package.py b/var/spack/repos/builtin/packages/py-autopep8/package.py
new file mode 100644
index 0000000000..f2fd3cd683
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-autopep8/package.py
@@ -0,0 +1,16 @@
+from spack import *
+
+class PyAutopep8(Package):
+ """Automatic pep8 formatter"""
+ homepage = "https://github.com/hhatto/autopep8"
+ url = "https://github.com/hhatto/autopep8/archive/ver1.2.2.tar.gz"
+
+ version('1.2.2', 'def3d023fc9dfd1b7113602e965ad8e1')
+
+ extends('python')
+ depends_on('py-setuptools')
+ depends_on('py-pep8')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
+
diff --git a/var/spack/repos/builtin/packages/py-pep8/package.py b/var/spack/repos/builtin/packages/py-pep8/package.py
new file mode 100644
index 0000000000..987783b392
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-pep8/package.py
@@ -0,0 +1,15 @@
+from spack import *
+
+class PyPep8(Package):
+ """python pep8 format checker"""
+ homepage = "https://github.com/PyCQA/pycodestyle"
+ url = "https://github.com/PyCQA/pycodestyle/archive/1.7.0.tar.gz"
+
+ version('1.7.0', '31070a3a6391928893cbf5fa523eb8d9')
+
+ extends('python')
+ depends_on('py-setuptools')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
+
diff --git a/var/spack/repos/builtin/packages/py-ply/package.py b/var/spack/repos/builtin/packages/py-ply/package.py
new file mode 100644
index 0000000000..47cd3b5dc8
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-ply/package.py
@@ -0,0 +1,38 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class PyPly(Package):
+ """PLY is nothing more than a straightforward lex/yacc implementation."""
+ homepage = "http://www.dabeaz.com/ply"
+ url = "http://www.dabeaz.com/ply/ply-3.8.tar.gz"
+
+ version('3.8', '94726411496c52c87c2b9429b12d5c50')
+
+ extends('python')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/rust-bindgen/package.py b/var/spack/repos/builtin/packages/rust-bindgen/package.py
new file mode 100644
index 0000000000..854016d12a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/rust-bindgen/package.py
@@ -0,0 +1,18 @@
+from spack import *
+import os
+
+
+class RustBindgen(Package):
+ """The rust programming language toolchain"""
+ homepage = "http://www.rust-lang.org"
+ url = "https://github.com/crabtw/rust-bindgen"
+
+ version('0.16', tag='0.16', git='https://github.com/crabtw/rust-bindgen')
+
+ extends("rust")
+ depends_on("llvm")
+
+ def install(self, spec, prefix):
+ env = dict(os.environ)
+ env['LIBCLANG_PATH'] = os.path.join(spec['llvm'].prefix, 'lib')
+ cargo('install', '--root', prefix, env=env)
diff --git a/var/spack/repos/builtin/packages/rust/package.py b/var/spack/repos/builtin/packages/rust/package.py
new file mode 100644
index 0000000000..65f81ce534
--- /dev/null
+++ b/var/spack/repos/builtin/packages/rust/package.py
@@ -0,0 +1,63 @@
+from spack import *
+import os
+
+
+def get_submodules():
+ git = which('git')
+ git('submodule', 'update', '--init', '--recursive')
+
+class Rust(Package):
+ """The rust programming language toolchain"""
+ homepage = "http://www.rust-lang.org"
+ url = "https://github.com/rust-lang/rust"
+
+ version('1.8.0', tag='1.8.0', git="https://github.com/rust-lang/rust")
+
+ resource(name='cargo',
+ git="https://github.com/rust-lang/cargo.git",
+ tag='0.10.0',
+ destination='cargo')
+
+ extendable = True
+
+ # Rust
+ depends_on("llvm")
+ depends_on("curl")
+ depends_on("git")
+ depends_on("cmake")
+ depends_on("python@:2.8")
+
+ # Cargo
+ depends_on("openssl")
+
+ def install(self, spec, prefix):
+ configure('--prefix=%s' % prefix,
+ '--llvm-root=' + spec['llvm'].prefix)
+
+ make()
+ make("install")
+
+ # Install cargo, rust package manager
+ with working_dir(os.path.join('cargo', 'cargo')):
+ get_submodules()
+ configure('--prefix=' + prefix,
+ '--local-rust-root=' + prefix)
+
+ make()
+ make("install")
+
+ def setup_dependent_package(self, module, ext_spec):
+ """
+ Called before python modules' install() methods.
+
+ In most cases, extensions will only need to have one or two lines::
+
+ cargo('build')
+ cargo('install', '--root', prefix)
+
+ or
+
+ cargo('install', '--root', prefix)
+ """
+ # Rust extension builds can have a global cargo executable function
+ module.cargo = Executable(join_path(self.spec.prefix.bin, 'cargo'))
diff --git a/var/spack/repos/builtin/packages/scotch/Makefile.esmumps b/var/spack/repos/builtin/packages/scotch/Makefile.esmumps
deleted file mode 100644
index 4bfc760197..0000000000
--- a/var/spack/repos/builtin/packages/scotch/Makefile.esmumps
+++ /dev/null
@@ -1,5 +0,0 @@
-esmumps : scotch
- (cd esmumps ; $(MAKE) scotch && $(MAKE) install)
-
-ptesmumps : ptscotch
- (cd esmumps ; $(MAKE) ptscotch && $(MAKE) ptinstall)
diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py
index e82c3acd42..3c2b4993ac 100644
--- a/var/spack/repos/builtin/packages/scotch/package.py
+++ b/var/spack/repos/builtin/packages/scotch/package.py
@@ -22,15 +22,16 @@
# 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
from spack import *
-import os, re
+
class Scotch(Package):
"""Scotch is a software package for graph and mesh/hypergraph
partitioning, graph clustering, and sparse matrix ordering."""
homepage = "http://www.labri.fr/perso/pelegrin/scotch/"
- url = "http://gforge.inria.fr/frs/download.php/latestfile/298/scotch_6.0.3.tar.gz"
+ url = "http://gforge.inria.fr/frs/download.php/latestfile/298/scotch_6.0.3.tar.gz"
base_url = "http://gforge.inria.fr/frs/download.php/latestfile/298"
list_url = "http://gforge.inria.fr/frs/?group_id=248"
@@ -38,10 +39,11 @@ class Scotch(Package):
version('6.0.0', 'c50d6187462ba801f9a82133ee666e8e')
version('5.1.10b', 'f587201d6cf5cf63527182fbfba70753')
- variant('mpi', default=False, description='Activate the compilation of PT-Scotch')
+ variant('mpi', default=False, description='Activate the compilation of parallel libraries')
variant('compression', default=True, description='Activate the posibility to use compressed files')
- variant('esmumps', default=False, description='Activate the compilation of the lib esmumps needed by mumps')
- variant('shared', default=True, description='Build shared libraries')
+ variant('esmumps', default=False, description='Activate the compilation of esmumps needed by mumps')
+ variant('shared', default=True, description='Build a shared version of the library')
+ variant('metis', default=True, description='Build metis and parmetis wrapper libraries')
depends_on('flex')
depends_on('bison')
@@ -51,43 +53,23 @@ class Scotch(Package):
# NOTE: Versions of Scotch up to version 6.0.0 don't include support for
# building with 'esmumps' in their default packages. In order to enable
# support for this feature, we must grab the 'esmumps' enabled archives
- # from the Scotch hosting site. These alternative archives include a strict
+ # from the Scotch hosting site. These alternative archives include a
# superset of the behavior in their default counterparts, so we choose to
# always grab these versions for older Scotch versions for simplicity.
- @when('@:6.0.0')
- def url_for_version(self, version):
- return '%s/scotch_%s_esmumps.tar.gz' % (Scotch.base_url, version)
-
- @when('@6.0.1:')
def url_for_version(self, version):
return super(Scotch, self).url_for_version(version)
- # NOTE: Several of the 'esmumps' enabled Scotch releases up to version 6.0.0
- # have broken build scripts that don't properly build 'esmumps' as a separate
- # target, so we need a patch procedure to remove 'esmumps' from existing targets
- # and to add it as a standalone target.
@when('@:6.0.0')
- def patch(self):
- makefile_path = os.path.join('src', 'Makefile')
- with open(makefile_path, 'r') as makefile:
- esmumps_enabled = any(re.search(r'^esmumps(\s*):(.*)$', line) for line in makefile.readlines())
-
- if not esmumps_enabled:
- mff = FileFilter(makefile_path)
- mff.filter(r'^.*((esmumps)|(ptesmumps)).*(install).*$', '')
-
- makefile_esmumps_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Makefile.esmumps')
- with open(makefile_path, 'a') as makefile:
- makefile.write('\ninclude %s\n' % makefile_esmumps_path)
+ def url_for_version(self, version):
+ return '%s/scotch_%s_esmumps.tar.gz' % (Scotch.base_url, version)
- @when('@6.0.1:')
def patch(self):
- pass
+ self.configure()
- # NOTE: Configuration of Scotch is achieved by writing a 'Makefile.inc' file
- # that contains all of the configuration variables and their desired values
- # for the installation. This function writes this file based on the given
- # installation variants.
+ # NOTE: Configuration of Scotch is achieved by writing a 'Makefile.inc'
+ # file that contains all of the configuration variables and their desired
+ # values for the installation. This function writes this file based on
+ # the given installation variants.
def configure(self):
makefile_inc = []
cflags = [
@@ -96,41 +78,41 @@ class Scotch(Package):
'-DSCOTCH_DETERMINISTIC',
'-DSCOTCH_RENAME',
'-DIDXSIZE64'
- ]
-
- ## Library Build Type ##
+ ]
+ # Library Build Type #
if '+shared' in self.spec:
makefile_inc.extend([
+ # todo change for Darwin systems
'LIB = .so',
'CLIBFLAGS = -shared -fPIC',
'RANLIB = echo',
- 'AR = $(CC)',
+ 'AR = $(CC)',
'ARFLAGS = -shared $(LDFLAGS) -o'
- ])
+ ])
cflags.append('-fPIC')
else:
makefile_inc.extend([
'LIB = .a',
'CLIBFLAGS = ',
'RANLIB = ranlib',
- 'AR = ar',
+ 'AR = ar',
'ARFLAGS = -ruv '
- ])
+ ])
- ## Compiler-Specific Options ##
+ # Compiler-Specific Options #
if self.compiler.name == 'gcc':
cflags.append('-Drestrict=__restrict')
elif self.compiler.name == 'intel':
cflags.append('-restrict')
+ mpicc_path = self.spec['mpi'].mpicc if '+mpi' in self.spec else 'mpicc'
makefile_inc.append('CCS = $(CC)')
- makefile_inc.append('CCP = %s' %
- (self.spec['mpi'].mpicc if '+mpi' in self.spec else 'mpicc'))
+ makefile_inc.append('CCP = %s' % mpicc_path)
makefile_inc.append('CCD = $(CCS)')
- ## Extra Features ##
+ # Extra Features #
ldflags = []
@@ -143,8 +125,10 @@ class Scotch(Package):
makefile_inc.append('LDFLAGS = %s' % ' '.join(ldflags))
- ## General Features ##
+ # General Features #
+ flex_path = os.path.join(self.spec['flex'].prefix.bin, 'flex')
+ bison_path = os.path.join(self.spec['bison'].prefix.bin, 'bison')
makefile_inc.extend([
'EXE =',
'OBJ = .o',
@@ -155,30 +139,59 @@ class Scotch(Package):
'MV = mv',
'CP = cp',
'CFLAGS = %s' % ' '.join(cflags),
- 'LEX = %s -Pscotchyy -olex.yy.c' % os.path.join(self.spec['flex'].prefix.bin , 'flex'),
- 'YACC = %s -pscotchyy -y -b y' % os.path.join(self.spec['bison'].prefix.bin, 'bison'),
+ 'LEX = %s -Pscotchyy -olex.yy.c' % flex_path,
+ 'YACC = %s -pscotchyy -y -b y' % bison_path,
'prefix = %s' % self.prefix
- ])
+ ])
with working_dir('src'):
with open('Makefile.inc', 'w') as fh:
fh.write('\n'.join(makefile_inc))
def install(self, spec, prefix):
- self.configure()
-
targets = ['scotch']
if '+mpi' in self.spec:
targets.append('ptscotch')
- if '+esmumps' in self.spec:
- targets.append('esmumps')
- if '+mpi' in self.spec:
- targets.append('ptesmumps')
+ if self.spec.version >= Version('6.0.0'):
+ if '+esmumps' in self.spec:
+ targets.append('esmumps')
+ if '+mpi' in self.spec:
+ targets.append('ptesmumps')
with working_dir('src'):
for target in targets:
- make(target, parallel=(target!='ptesmumps'))
+ # It seams that building ptesmumps in parallel fails, for
+ # version prior to 6.0.0 there is no separated targets force
+ # ptesmumps, this library is built by the ptscotch target. This
+ # should explain the test for the can_make_parallel variable
+ can_make_parallel = \
+ not (target == 'ptesmumps' or
+ (self.spec.version < Version('6.0.0') and
+ target == 'ptscotch'))
+ make(target, parallel=can_make_parallel)
+
+ # todo change this to take into account darwin systems
+ lib_ext = '.so' if '+shared' in self.spec else '.a'
+ # It seams easier to remove metis wrappers from the folder that will be
+ # installed than to tweak the Makefiles
+ if '+metis' not in self.spec:
+ with working_dir('lib'):
+ lib_ext = '.so' if '+shared' in self.spec else '.a'
+ force_remove('libscotchmetis{0}'.format(lib_ext))
+ force_remove('libptscotchparmetis{0}'.format(lib_ext))
+
+ with working_dir('include'):
+ force_remove('metis.h')
+ force_remove('parmetis.h')
+
+ if '~esmumps' in self.spec and self.spec.version < Version('6.0.0'):
+ with working_dir('lib'):
+ force_remove('libesmumps{0}'.format(lib_ext))
+ force_remove('libptesmumps{0}'.format(lib_ext))
+
+ with working_dir('include'):
+ force_remove('esmumps.h')
install_tree('bin', prefix.bin)
install_tree('lib', prefix.lib)
diff --git a/var/spack/repos/builtin/packages/sed/package.py b/var/spack/repos/builtin/packages/sed/package.py
new file mode 100644
index 0000000000..f2a240e1b3
--- /dev/null
+++ b/var/spack/repos/builtin/packages/sed/package.py
@@ -0,0 +1,39 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Sed(Package):
+ """GNU implementation of the famous stream editor."""
+ homepage = "http://www.gnu.org/software/sed/"
+ url = "http://ftpmirror.gnu.org/sed/sed-4.2.2.tar.bz2"
+
+ version('4.2.2', '7ffe1c7cdc3233e1e0c4b502df253974')
+
+ def install(self, spec, prefix):
+ configure('--prefix=%s' % prefix)
+
+ make()
+ make("install")
diff --git a/var/spack/repos/builtin/packages/stream/package.py b/var/spack/repos/builtin/packages/stream/package.py
new file mode 100644
index 0000000000..8b3f32af8a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/stream/package.py
@@ -0,0 +1,62 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Stream(Package):
+ """The STREAM benchmark is a simple synthetic benchmark program that
+ measures sustainable memory bandwidth (in MB/s) and the corresponding
+ computation rate for simple vector kernels."""
+
+ homepage = "https://www.cs.virginia.edu/stream/ref.html"
+
+ version('5.10', git='https://github.com/jeffhammond/STREAM.git')
+
+ variant('openmp', default=False, description='Build with OpenMP support')
+
+ def patch(self):
+ makefile = FileFilter('Makefile')
+
+ # Use the Spack compiler wrappers
+ makefile.filter('CC = .*', 'CC = cc')
+ makefile.filter('FC = .*', 'FC = f77')
+
+ cflags = '-O2'
+ fflags = '-O2'
+ if '+openmp' in self.spec:
+ cflags += ' ' + self.compiler.openmp_flag
+ fflags += ' ' + self.compiler.openmp_flag
+
+ # Set the appropriate flags for this compiler
+ makefile.filter('CFLAGS = .*', 'CFLAGS = {0}'.format(cflags))
+ makefile.filter('FFLAGS = .*', 'FFLAGS = {0}'.format(fflags))
+
+ def install(self, spec, prefix):
+ make()
+
+ # Manual installation
+ mkdir(prefix.bin)
+ install('stream_c.exe', prefix.bin)
+ install('stream_f.exe', prefix.bin)
diff --git a/var/spack/repos/builtin/packages/tbb/package.py b/var/spack/repos/builtin/packages/tbb/package.py
index 6c3ceb1e76..c88b170816 100644
--- a/var/spack/repos/builtin/packages/tbb/package.py
+++ b/var/spack/repos/builtin/packages/tbb/package.py
@@ -23,9 +23,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
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
@@ -35,35 +35,39 @@ class Tbb(Package):
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')
+ version('4.4.4', 'd4cee5e4ca75cab5181834877738619c56afeb71', url='https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160413oss_src.tgz') # NOQA: ignore=E501
+ version('4.4.3', '80707e277f69d9b20eeebdd7a5f5331137868ce1', url='https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160128oss_src_0.tgz') # NOQA: ignore=E501
- 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 ="):
+ 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 ="):
+ elif l.strip().startswith("CPLUS ="):
of.write("# coerced to spack\n")
of.write("CONLY = $(CC)\n")
- else:
- of.write(l);
+ 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
+ if spec.satisfies('%gcc@6.1:') and spec.satisfies('@:4.4.3'):
+ raise InstallError('Only TBB 4.4.4 and above build with GCC 6.1!')
+
+ # 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
+ # * 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())
+ # icc, gcc, clang (see coerce_to_spack());
#
self.coerce_to_spack("build")
@@ -74,7 +78,6 @@ class Tbb(Package):
else:
tbb_compiler = "gcc"
-
mkdirp(prefix)
mkdirp(prefix.lib)
@@ -82,10 +85,10 @@ class Tbb(Package):
# 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))
+ make("compiler=%s" % (tbb_compiler))
# install headers to {prefix}/include
- install_tree('include',prefix.include)
+ install_tree('include', prefix.include)
# install libs to {prefix}/lib
tbb_lib_names = ["libtbb",
@@ -94,10 +97,10 @@ class Tbb(Package):
for lib_name in tbb_lib_names:
# install release libs
- fs = glob.glob(join_path("build","*release",lib_name + ".*"))
+ 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.*"))
+ fs = glob.glob(join_path("build", "*debug", lib_name + "_debug.*"))
for f in fs:
install(f, prefix.lib)
diff --git a/var/spack/repos/builtin/packages/tetgen/package.py b/var/spack/repos/builtin/packages/tetgen/package.py
index 5e87ed7fba..c301a5b4e5 100644
--- a/var/spack/repos/builtin/packages/tetgen/package.py
+++ b/var/spack/repos/builtin/packages/tetgen/package.py
@@ -24,16 +24,19 @@
##############################################################################
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."""
+ """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')
+ version('1.5.0', '3b9fd9cdec121e52527b0308f7aad5c1', url='http://www.tetgen.org/1.5/src/tetgen1.5.0.tar.gz')
# TODO: Make this a build dependency once build dependencies are supported
# (see: https://github.com/LLNL/spack/pull/378).
diff --git a/var/spack/repos/builtin/packages/the_platinum_searcher/package.py b/var/spack/repos/builtin/packages/the_platinum_searcher/package.py
new file mode 100644
index 0000000000..9c9a66cdef
--- /dev/null
+++ b/var/spack/repos/builtin/packages/the_platinum_searcher/package.py
@@ -0,0 +1,21 @@
+from spack import *
+import os
+import shutil
+
+
+class ThePlatinumSearcher(Package):
+ """Fast parallel recursive grep alternative"""
+ homepage = "https://github.com/monochromegane/the_platinum_searcher"
+ url = "https://github.com/monochromegane/the_platinum_searcher"
+
+ package = 'github.com/monochromegane/the_platinum_searcher/...'
+
+ version('head', go=package)
+
+ extends("go")
+
+ def install(self, spec, prefix):
+ env = os.environ
+ env['GOPATH'] = self.stage.source_path + ':' + env['GOPATH']
+ go('install', self.package, env=env)
+ shutil.copytree('bin', os.path.join(prefix, 'bin'))