Merge branch 'develop' of https://github.com/LLNL/spack into bugfix/compiler_find

Forgot to pull branch changes before
This commit is contained in:
Mario Melara 2016-06-20 10:59:28 -07:00
commit 6fb7b0fcf7
44 changed files with 1619 additions and 343 deletions

View File

@ -22,8 +22,8 @@ modules:
include: include:
- CPATH - CPATH
lib/pkgconfig: lib/pkgconfig:
- PKGCONFIG - PKG_CONFIG_PATH
lib64/pkgconfig: lib64/pkgconfig:
- PKGCONFIG - PKG_CONFIG_PATH
'': '':
- CMAKE_PREFIX_PATH - CMAKE_PREFIX_PATH

4
lib/spack/env/cc vendored
View File

@ -324,8 +324,8 @@ fi
if [[ $SPACK_DEBUG == TRUE ]]; then if [[ $SPACK_DEBUG == TRUE ]]; then
input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.in.log" input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.in.log"
output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.out.log" output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.out.log"
echo "[$mode] $command $input_command" >> $input_log echo "[$mode] $command $input_command" >> "$input_log"
echo "[$mode] ${full_command[@]}" >> $output_log echo "[$mode] ${full_command[@]}" >> "$output_log"
fi fi
exec "${full_command[@]}" exec "${full_command[@]}"

View File

@ -22,28 +22,28 @@
# License along with this program; if not, write to the Free Software # License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
__all__ = ['set_install_permissions', 'install', 'install_tree', 'traverse_tree',
'expand_user', 'working_dir', 'touch', 'touchp', 'mkdirp',
'force_remove', 'join_path', 'ancestor', 'can_access', 'filter_file',
'FileFilter', 'change_sed_delimiter', 'is_exe', 'force_symlink',
'set_executable', 'copy_mode', 'unset_executable_mode',
'remove_dead_links', 'remove_linked_tree', 'find_library_path',
'fix_darwin_install_name']
import os import os
import glob import glob
import sys
import re import re
import shutil import shutil
import stat import stat
import errno import errno
import getpass import getpass
from contextlib import contextmanager, closing from contextlib import contextmanager, closing
from tempfile import NamedTemporaryFile
import subprocess import subprocess
import llnl.util.tty as tty import llnl.util.tty as tty
from spack.util.compression import ALLOWED_ARCHIVE_TYPES
__all__ = ['set_install_permissions', 'install', 'install_tree',
'traverse_tree',
'expand_user', 'working_dir', 'touch', 'touchp', 'mkdirp',
'force_remove', 'join_path', 'ancestor', 'can_access',
'filter_file',
'FileFilter', 'change_sed_delimiter', 'is_exe', 'force_symlink',
'set_executable', 'copy_mode', 'unset_executable_mode',
'remove_dead_links', 'remove_linked_tree', 'find_library_path',
'fix_darwin_install_name', 'to_link_flags']
def filter_file(regex, repl, *filenames, **kwargs): def filter_file(regex, repl, *filenames, **kwargs):
"""Like sed, but uses python regular expressions. """Like sed, but uses python regular expressions.
@ -69,6 +69,7 @@ def filter_file(regex, repl, *filenames, **kwargs):
# Allow strings to use \1, \2, etc. for replacement, like sed # Allow strings to use \1, \2, etc. for replacement, like sed
if not callable(repl): if not callable(repl):
unescaped = repl.replace(r'\\', '\\') unescaped = repl.replace(r'\\', '\\')
def replace_groups_with_groupid(m): def replace_groups_with_groupid(m):
def groupid_to_group(x): def groupid_to_group(x):
return m.group(int(x.group(1))) return m.group(int(x.group(1)))
@ -157,9 +158,12 @@ def set_install_permissions(path):
def copy_mode(src, dest): def copy_mode(src, dest):
src_mode = os.stat(src).st_mode src_mode = os.stat(src).st_mode
dest_mode = os.stat(dest).st_mode dest_mode = os.stat(dest).st_mode
if src_mode & stat.S_IXUSR: dest_mode |= stat.S_IXUSR if src_mode & stat.S_IXUSR:
if src_mode & stat.S_IXGRP: dest_mode |= stat.S_IXGRP dest_mode |= stat.S_IXUSR
if src_mode & stat.S_IXOTH: dest_mode |= stat.S_IXOTH if src_mode & stat.S_IXGRP:
dest_mode |= stat.S_IXGRP
if src_mode & stat.S_IXOTH:
dest_mode |= stat.S_IXOTH
os.chmod(dest, dest_mode) os.chmod(dest, dest_mode)
@ -224,9 +228,10 @@ def force_remove(*paths):
for path in paths: for path in paths:
try: try:
os.remove(path) os.remove(path)
except OSError, e: except OSError:
pass pass
@contextmanager @contextmanager
def working_dir(dirname, **kwargs): def working_dir(dirname, **kwargs):
if kwargs.get('create', False): if kwargs.get('create', False):
@ -240,7 +245,7 @@ def working_dir(dirname, **kwargs):
def touch(path): def touch(path):
"""Creates an empty file at the specified path.""" """Creates an empty file at the specified path."""
with open(path, 'a') as file: with open(path, 'a'):
os.utime(path, None) os.utime(path, None)
@ -253,7 +258,7 @@ def touchp(path):
def force_symlink(src, dest): def force_symlink(src, dest):
try: try:
os.symlink(src, dest) os.symlink(src, dest)
except OSError as e: except OSError:
os.remove(dest) os.remove(dest)
os.symlink(src, dest) os.symlink(src, dest)
@ -348,8 +353,9 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs):
# When follow_nonexisting isn't set, don't descend into dirs # When follow_nonexisting isn't set, don't descend into dirs
# in source that do not exist in dest # in source that do not exist in dest
if follow_nonexisting or os.path.exists(dest_child): if follow_nonexisting or os.path.exists(dest_child):
tuples = traverse_tree(source_root, dest_root, rel_child, **kwargs) tuples = traverse_tree(source_root, dest_root, rel_child, **kwargs) # NOQA: ignore=E501
for t in tuples: yield t for t in tuples:
yield t
# Treat as a file. # Treat as a file.
elif not ignore(os.path.join(rel_path, f)): elif not ignore(os.path.join(rel_path, f)):
@ -379,6 +385,7 @@ def remove_dead_links(root):
if not os.path.exists(real_path): if not os.path.exists(real_path):
os.unlink(path) os.unlink(path)
def remove_linked_tree(path): def remove_linked_tree(path):
""" """
Removes a directory and its contents. If the directory is a Removes a directory and its contents. If the directory is a
@ -402,9 +409,9 @@ def fix_darwin_install_name(path):
Fix install name of dynamic libraries on Darwin to have full path. Fix install name of dynamic libraries on Darwin to have full path.
There are two parts of this task: There are two parts of this task:
(i) use install_name('-id',...) to change install name of a single lib; (i) use install_name('-id',...) to change install name of a single lib;
(ii) use install_name('-change',...) to change the cross linking between libs. (ii) use install_name('-change',...) to change the cross linking between
The function assumes that all libraries are in one folder and currently won't libs. The function assumes that all libraries are in one folder and
follow subfolders. currently won't follow subfolders.
Args: Args:
path: directory in which .dylib files are alocated path: directory in which .dylib files are alocated
@ -413,17 +420,30 @@ def fix_darwin_install_name(path):
libs = glob.glob(join_path(path, "*.dylib")) libs = glob.glob(join_path(path, "*.dylib"))
for lib in libs: for lib in libs:
# fix install name first: # fix install name first:
subprocess.Popen(["install_name_tool", "-id",lib,lib], stdout=subprocess.PIPE).communicate()[0] subprocess.Popen(["install_name_tool", "-id", lib, lib], stdout=subprocess.PIPE).communicate()[0] # NOQA: ignore=E501
long_deps = subprocess.Popen(["otool", "-L",lib], stdout=subprocess.PIPE).communicate()[0].split('\n') long_deps = subprocess.Popen(["otool", "-L", lib], stdout=subprocess.PIPE).communicate()[0].split('\n') # NOQA: ignore=E501
deps = [dep.partition(' ')[0][1::] for dep in long_deps[2:-1]] deps = [dep.partition(' ')[0][1::] for dep in long_deps[2:-1]]
# fix all dependencies: # fix all dependencies:
for dep in deps: for dep in deps:
for loc in libs: for loc in libs:
if dep == os.path.basename(loc): if dep == os.path.basename(loc):
subprocess.Popen(["install_name_tool", "-change",dep,loc,lib], stdout=subprocess.PIPE).communicate()[0] subprocess.Popen(["install_name_tool", "-change", dep, loc, lib], stdout=subprocess.PIPE).communicate()[0] # NOQA: ignore=E501
break break
def to_link_flags(library):
"""Transforms a path to a <library> into linking flags -L<dir> -l<name>.
Return:
A string of linking flags.
"""
dir = os.path.dirname(library)
# Asume libXYZ.suffix
name = os.path.basename(library)[3:].split(".")[0]
res = '-L%s -l%s' % (dir, name)
return res
def find_library_path(libname, *paths): def find_library_path(libname, *paths):
"""Searches for a file called <libname> in each path. """Searches for a file called <libname> in each path.

View File

@ -24,7 +24,6 @@
############################################################################## ##############################################################################
import os import os
from llnl.util.filesystem import *
import llnl.util.tty as tty import llnl.util.tty as tty
import spack import spack
@ -34,6 +33,7 @@
# here, as it is the shortest I could find on a modern OS. # here, as it is the shortest I could find on a modern OS.
shebang_limit = 127 shebang_limit = 127
def shebang_too_long(path): def shebang_too_long(path):
"""Detects whether a file has a shebang line that is too long.""" """Detects whether a file has a shebang line that is too long."""
with open(path, 'r') as script: with open(path, 'r') as script:
@ -57,16 +57,10 @@ def filter_shebang(path):
if original.startswith(new_sbang_line): if original.startswith(new_sbang_line):
return return
backup = path + ".shebang.bak"
os.rename(path, backup)
with open(path, 'w') as new_file: with open(path, 'w') as new_file:
new_file.write(new_sbang_line) new_file.write(new_sbang_line)
new_file.write(original) new_file.write(original)
copy_mode(backup, path)
unset_executable_mode(backup)
tty.warn("Patched overly long shebang in %s" % path) tty.warn("Patched overly long shebang in %s" % path)

View File

@ -1,8 +1,16 @@
import os
import shutil
from tempfile import mkdtemp
from llnl.util.filesystem import set_executable, mkdirp
import spack.spec import spack.spec
import spack.cmd.compiler import spack.cmd.compiler
import spack.compilers import spack.compilers
from spack.version import Version
from spack.test.mock_packages_test import * from spack.test.mock_packages_test import *
test_version = '4.5-spacktest'
class MockArgs(object): class MockArgs(object):
def __init__(self, add_paths=[], scope=None, compiler_spec=None, all=None): def __init__(self, add_paths=[], scope=None, compiler_spec=None, all=None):
@ -12,23 +20,62 @@ def __init__(self, add_paths=[], scope=None, compiler_spec=None, all=None):
self.all = all self.all = all
def make_mock_compiler():
"""Make a directory containing a fake, but detectable compiler."""
mock_compiler_dir = mkdtemp()
bin_dir = os.path.join(mock_compiler_dir, 'bin')
mkdirp(bin_dir)
gcc_path = os.path.join(bin_dir, 'gcc')
gxx_path = os.path.join(bin_dir, 'g++')
gfortran_path = os.path.join(bin_dir, 'gfortran')
with open(gcc_path, 'w') as f:
f.write("""\
#!/bin/sh
for arg in "$@"; do
if [ "$arg" = -dumpversion ]; then
echo '%s'
fi
done
""" % test_version)
# Create some mock compilers in the temporary directory
set_executable(gcc_path)
shutil.copy(gcc_path, gxx_path)
shutil.copy(gcc_path, gfortran_path)
return mock_compiler_dir
class CompilerCmdTest(MockPackagesTest): class CompilerCmdTest(MockPackagesTest):
""" Test compiler commands for add and remove """ """ Test compiler commands for add and remove """
def test_compiler_remove(self): def test_compiler_remove(self):
args = MockArgs(all=True, compiler_spec='gcc@4.5.0') args = MockArgs(all=True, compiler_spec='gcc@4.5.0')
spack.cmd.compiler.compiler_remove(args) spack.cmd.compiler.compiler_remove(args)
compilers = spack.compilers.all_compilers() compilers = spack.compilers.all_compilers()
self.assertTrue(spack.spec.CompilerSpec("gcc@4.5.0") not in compilers) self.assertTrue(spack.spec.CompilerSpec("gcc@4.5.0") not in compilers)
def test_compiler_add(self): def test_compiler_add(self):
# Probably not a good a assumption but might try finding local # compilers available by default.
# compilers old_compilers = set(spack.compilers.all_compilers())
# installed in /usr
compilers = spack.compilers.all_compilers() # add our new compiler and find again.
s = set(compilers) compiler_dir = make_mock_compiler()
args = MockArgs(add_paths=["/usr"])
try:
args = MockArgs(add_paths=[compiler_dir])
spack.cmd.compiler.compiler_find(args) spack.cmd.compiler.compiler_find(args)
new_compilers = spack.compilers.all_compilers()
new_compiler = [x for x in new_compilers if x not in s] # ensure new compiler is in there
new_compilers = set(spack.compilers.all_compilers())
new_compiler = new_compilers - old_compilers
self.assertTrue(new_compiler) self.assertTrue(new_compiler)
self.assertTrue(new_compiler.pop().version == Version(test_version))
finally:
shutil.rmtree(compiler_dir, ignore_errors=True)

View File

@ -29,6 +29,8 @@ for file in $changed; do
perl -i -pe 's/^(\s*url\s*=.*)$/\1 # NOQA: ignore=E501/' $file perl -i -pe 's/^(\s*url\s*=.*)$/\1 # NOQA: ignore=E501/' $file
perl -i -pe 's/^(\s*version\(.*\).*)$/\1 # NOQA: ignore=E501/' $file perl -i -pe 's/^(\s*version\(.*\).*)$/\1 # NOQA: ignore=E501/' $file
perl -i -pe 's/^(\s*variant\(.*\).*)$/\1 # NOQA: ignore=E501/' $file perl -i -pe 's/^(\s*variant\(.*\).*)$/\1 # NOQA: ignore=E501/' $file
perl -i -pe 's/^(\s*depends_on\(.*\).*)$/\1 # NOQA: ignore=E501/' $file
perl -i -pe 's/^(\s*extends\(.*\).*)$/\1 # NOQA: ignore=E501/' $file
# Exempt '@when' decorated functions from redefinition errors. # Exempt '@when' decorated functions from redefinition errors.
perl -i -pe 's/^(\s*\@when\(.*\).*)$/\1 # NOQA: ignore=F811/' $file perl -i -pe 's/^(\s*\@when\(.*\).*)$/\1 # NOQA: ignore=F811/' $file

View File

@ -22,30 +22,25 @@
# License along with this program; if not, write to the Free Software # License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
import functools
import glob
import inspect
import os import os
import re
from contextlib import closing
import spack
from llnl.util.lang import match_predicate
from spack import * from spack import *
from spack.util.environment import * from spack.util.environment import *
class R(Package): class R(Package):
""" """R is 'GNU S', a freely available language and environment for
R is 'GNU S', a freely available language and environment for statistical computing and graphics which provides a statistical computing and graphics which provides a wide variety of
wide variety of statistical and graphical techniques: linear and nonlinear modelling, statistical tests, time series statistical and graphical techniques: linear and nonlinear modelling,
analysis, classification, clustering, etc. Please consult the R project homepage for further information. statistical tests, time series analysis, classification, clustering, etc.
""" Please consult the R project homepage for further information."""
homepage = "https://www.r-project.org" homepage = "https://www.r-project.org"
url = "http://cran.cnr.berkeley.edu/src/base/R-3/R-3.1.2.tar.gz" url = "http://cran.cnr.berkeley.edu/src/base/R-3/R-3.1.2.tar.gz"
extendable = True extendable = True
version('3.3.0', '5a7506c8813432d1621c9725e86baf7a')
version('3.2.3', '1ba3dac113efab69e706902810cc2970') version('3.2.3', '1ba3dac113efab69e706902810cc2970')
version('3.2.2', '57cef5c2e210a5454da1979562a10e5b') version('3.2.2', '57cef5c2e210a5454da1979562a10e5b')
version('3.2.1', 'c2aac8b40f84e08e7f8c9068de9239a3') version('3.2.1', 'c2aac8b40f84e08e7f8c9068de9239a3')
@ -53,7 +48,8 @@ class R(Package):
version('3.1.3', '53a85b884925aa6b5811dfc361d73fc4') version('3.1.3', '53a85b884925aa6b5811dfc361d73fc4')
version('3.1.2', '3af29ec06704cbd08d4ba8d69250ae74') version('3.1.2', '3af29ec06704cbd08d4ba8d69250ae74')
variant('external-lapack', default=False, description='Links to externally installed BLAS/LAPACK') variant('external-lapack', default=False,
description='Links to externally installed BLAS/LAPACK')
# Virtual dependencies # Virtual dependencies
depends_on('blas', when='+external-lapack') depends_on('blas', when='+external-lapack')
@ -65,6 +61,7 @@ class R(Package):
depends_on('icu') depends_on('icu')
depends_on('glib') depends_on('glib')
depends_on('zlib') depends_on('zlib')
depends_on('bzip2')
depends_on('libtiff') depends_on('libtiff')
depends_on('jpeg') depends_on('jpeg')
depends_on('cairo') depends_on('cairo')
@ -72,18 +69,21 @@ class R(Package):
depends_on('freetype') depends_on('freetype')
depends_on('tcl') depends_on('tcl')
depends_on('tk') depends_on('tk')
depends_on('curl')
depends_on('pcre')
depends_on('jdk')
def install(self, spec, prefix): def install(self, spec, prefix):
rlibdir = join_path(prefix, 'rlib') rlibdir = join_path(prefix, 'rlib')
options = ['--prefix=%s' % prefix, configure_args = ['--prefix=%s' % prefix,
'--libdir=%s' % rlibdir, '--libdir=%s' % rlibdir,
'--enable-R-shlib', '--enable-R-shlib',
'--enable-BLAS-shlib', '--enable-BLAS-shlib',
'--enable-R-framework=no'] '--enable-R-framework=no']
if '+external-lapack' in spec: if '+external-lapack' in spec:
options.extend(['--with-blas', '--with-lapack']) configure_args.extend(['--with-blas', '--with-lapack'])
configure(*options) configure(*configure_args)
make() make()
make('install') make('install')
@ -106,25 +106,24 @@ def setup_dependent_environment(self, spack_env, run_env, extension_spec):
r_libs_path = ':'.join(r_libs_path) r_libs_path = ':'.join(r_libs_path)
spack_env.set('R_LIBS', r_libs_path) spack_env.set('R_LIBS', r_libs_path)
# For run time environment set only the path for extension_spec and prepend it to R_LIBS # For run time environment set only the path for extension_spec and
# prepend it to R_LIBS
if extension_spec.package.extends(self.spec): if extension_spec.package.extends(self.spec):
run_env.prepend_path('R_LIBS', os.path.join(extension_spec.prefix, self.r_lib_dir)) run_env.prepend_path('R_LIBS', os.path.join(
extension_spec.prefix, self.r_lib_dir))
def setup_dependent_package(self, module, ext_spec): def setup_dependent_package(self, module, ext_spec):
""" """Called before R modules' install() methods. In most cases,
Called before R modules' install() methods. extensions will only need to have one line:
R('CMD', 'INSTALL', '--library=%s' % self.module.r_lib_dir, '%s' %
In most cases, extensions will only need to have one line:: self.stage.source_path)"""
R('CMD', 'INSTALL', '--library=%s' % self.module.r_lib_dir, '%s' % self.stage.archive_file)
"""
# R extension builds can have a global R executable function # R extension builds can have a global R executable function
module.R = Executable(join_path(self.spec.prefix.bin, 'R')) module.R = Executable(join_path(self.spec.prefix.bin, 'R'))
# Add variable for library directry # Add variable for library directry
module.r_lib_dir = os.path.join(ext_spec.prefix, self.r_lib_dir) module.r_lib_dir = os.path.join(ext_spec.prefix, self.r_lib_dir)
# Make the site packages directory for extensions, if it does not exist already. # Make the site packages directory for extensions, if it does not exist
# already.
if ext_spec.package.is_extension: if ext_spec.package.is_extension:
mkdirp(module.r_lib_dir) mkdirp(module.r_lib_dir)

View File

@ -0,0 +1,67 @@
##############################################################################
# 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 Armadillo(Package):
"""Armadillo is a high quality linear algebra library (matrix maths)
for the C++ language, aiming towards a good balance between speed and
ease of use."""
homepage = "http://arma.sourceforge.net/"
url = "http://sourceforge.net/projects/arma/files/armadillo-7.200.1.tar.xz"
version('7.200.1', 'ed86d6df0058979e107502e1fe3e469e')
variant('hdf5', default=False, description='Include HDF5 support')
depends_on('arpack')
depends_on('blas')
depends_on('lapack')
depends_on('superlu@5.2:')
depends_on('hdf5', when='+hdf5')
def install(self, spec, prefix):
cmake_args = [
# ARPACK support
'-DARPACK_LIBRARY={0}/libarpack.a'.format(
spec['arpack'].prefix.lib),
# BLAS support
'-DBLAS_LIBRARY={0}'.format(spec['blas'].blas_shared_lib),
# LAPACK support
'-DLAPACK_LIBRARY={0}'.format(spec['lapack'].lapack_shared_lib),
# SuperLU support
'-DSuperLU_INCLUDE_DIR={0}'.format(spec['superlu'].prefix.include),
'-DSuperLU_LIBRARY={0}/libsuperlu.a'.format(
spec['superlu'].prefix.lib64),
# HDF5 support
'-DDETECT_HDF5={0}'.format('ON' if '+hdf5' in spec else 'OFF')
]
cmake_args.extend(std_cmake_args)
cmake('.', *cmake_args)
make()
make('install')

View File

@ -24,12 +24,12 @@
############################################################################## ##############################################################################
from spack import * from spack import *
import os import os
import shutil
class Arpack(Package): class Arpack(Package):
"""A collection of Fortran77 subroutines designed to solve large scale """A collection of Fortran77 subroutines designed to solve large scale
eigenvalue problems. eigenvalue problems."""
"""
homepage = "http://www.caam.rice.edu/software/ARPACK/" homepage = "http://www.caam.rice.edu/software/ARPACK/"
url = "http://www.caam.rice.edu/software/ARPACK/SRC/arpack96.tar.gz" url = "http://www.caam.rice.edu/software/ARPACK/SRC/arpack96.tar.gz"
@ -39,27 +39,35 @@ class Arpack(Package):
depends_on('lapack') depends_on('lapack')
def patch(self): def patch(self):
# Filter the cray makefile to make a spack one.
shutil.move('ARMAKES/ARmake.CRAY', 'ARmake.inc')
makefile = FileFilter('ARmake.inc') makefile = FileFilter('ARmake.inc')
# Be sure to use Spack F77 wrapper # Section 1: Paths and Libraries
makefile.filter('^FC.*', 'FC = f77')
makefile.filter('^FFLAGS.*', 'FFLAGS = -O2 -g')
# Set up some variables. # Change the build directory
makefile.filter('^PLAT.*', 'PLAT = ')
makefile.filter('^home.*', 'home = %s' % os.getcwd()) makefile.filter('^home.*', 'home = %s' % os.getcwd())
makefile.filter('^BLASdir.*', 'BLASdir = %s' % self.spec['blas'].prefix)
makefile.filter('^LAPACKdir.*', 'LAPACKdir = %s' % self.spec['lapack'].prefix)
# build the library in our own prefix. # Use external BLAS/LAPACK
makefile.filter('^ARPACKLIB.*', 'ARPACKLIB = %s/libarpack.a' % os.getcwd()) makefile.filter('^BLASdir.*',
'BLASdir = %s' % self.spec['blas'].prefix)
makefile.filter('^LAPACKdir.*',
'LAPACKdir = %s' % self.spec['lapack'].prefix)
# Do not include the platform in the library name
makefile.filter('^PLAT.*', 'PLAT = ')
makefile.filter('^ARPACKLIB.*', 'ARPACKLIB = $(home)/libarpack.a')
# Section 2: Compilers
# Be sure to use the Spack compiler wrapper
makefile.filter('^FC.*', 'FC = {0}'.format(os.environ['F77']))
makefile.filter('^FFLAGS.*', 'FFLAGS = -O2 -g -fPIC')
if not which('ranlib'):
makefile.filter('^RANLIB.*', 'RANLIB = touch')
def install(self, spec, prefix): def install(self, spec, prefix):
with working_dir('SRC'): with working_dir('SRC'):
make('all') make('all')
mkdirp(prefix.lib) mkdir(prefix.lib)
install('libarpack.a', prefix.lib) install('libarpack.a', prefix.lib)

View File

@ -25,7 +25,6 @@
from spack import * from spack import *
import spack import spack
import sys import sys
import os import os
@ -91,6 +90,7 @@ class Boost(Package):
'system', 'system',
'test', 'test',
'thread', 'thread',
'timer',
'wave']) 'wave'])
# mpi/python are not installed by default because they pull in many # mpi/python are not installed by default because they pull in many

View File

@ -80,8 +80,8 @@ class Dealii(Package):
depends_on("netcdf-cxx", when='+netcdf+mpi') depends_on("netcdf-cxx", when='+netcdf+mpi')
depends_on("oce", when='+oce') depends_on("oce", when='+oce')
depends_on("p4est", when='+p4est+mpi') depends_on("p4est", when='+p4est+mpi')
depends_on("petsc+mpi", when='+petsc+mpi') depends_on("petsc@:3.6.4+mpi", when='+petsc+mpi') # FIXME: update after 3.7 is supported upstream. # NOQA: ignore=E501
depends_on("slepc", when='+slepc+petsc+mpi') depends_on("slepc@:3.6.3", when='+slepc+petsc+mpi')
depends_on("trilinos", when='+trilinos+mpi') depends_on("trilinos", when='+trilinos+mpi')
# developer dependnecies # developer dependnecies
@ -108,11 +108,10 @@ def install(self, spec, prefix):
# of Spack's. Be more specific to avoid this. # of Spack's. Be more specific to avoid this.
# Note that both lapack and blas are provided in -DLAPACK_XYZ. # Note that both lapack and blas are provided in -DLAPACK_XYZ.
'-DLAPACK_FOUND=true', '-DLAPACK_FOUND=true',
'-DLAPACK_INCLUDE_DIRS=%s;%s' % '-DLAPACK_INCLUDE_DIRS=%s;%s' % (
(spec['lapack'].prefix.include, spec['lapack'].prefix.include, spec['blas'].prefix.include),
spec['blas'].prefix.include), '-DLAPACK_LIBRARIES=%s;%s' % (
'-DLAPACK_LIBRARIES=%s;%s' % spec['lapack'].lapack_shared_lib,
(spec['lapack'].lapack_shared_lib,
spec['blas'].blas_shared_lib), spec['blas'].blas_shared_lib),
'-DMUPARSER_DIR=%s' % spec['muparser'].prefix, '-DMUPARSER_DIR=%s' % spec['muparser'].prefix,
'-DUMFPACK_DIR=%s' % spec['suite-sparse'].prefix, '-DUMFPACK_DIR=%s' % spec['suite-sparse'].prefix,
@ -168,13 +167,13 @@ def install(self, spec, prefix):
if '+netcdf' in spec: if '+netcdf' in spec:
options.extend([ options.extend([
'-DNETCDF_FOUND=true', '-DNETCDF_FOUND=true',
'-DNETCDF_LIBRARIES=%s;%s' % '-DNETCDF_LIBRARIES=%s;%s' % (
(join_path(spec['netcdf-cxx'].prefix.lib, join_path(spec['netcdf-cxx'].prefix.lib,
'libnetcdf_c++.%s' % dsuf), 'libnetcdf_c++.%s' % dsuf),
join_path(spec['netcdf'].prefix.lib, join_path(spec['netcdf'].prefix.lib,
'libnetcdf.%s' % dsuf)), 'libnetcdf.%s' % dsuf)),
'-DNETCDF_INCLUDE_DIRS=%s;%s' % '-DNETCDF_INCLUDE_DIRS=%s;%s' % (
(spec['netcdf-cxx'].prefix.include, spec['netcdf-cxx'].prefix.include,
spec['netcdf'].prefix.include), spec['netcdf'].prefix.include),
]) ])
else: else:
@ -266,9 +265,9 @@ def install(self, spec, prefix):
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::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;)', filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)',
(''), 'step-40.cc') (''), 'step-40.cc')
filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)', filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)', # NOQA: ignore=E501
(''), 'step-40.cc') (''), 'step-40.cc')
filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', # NOQA: ignore=E501
(''), 'step-40.cc') (''), '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'(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') filter_file(r'(preconditioner\);)', (''), 'step-40.cc')

View File

@ -0,0 +1,103 @@
##############################################################################
# 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 *
import os
class Ferret(Package):
"""Ferret is an interactive computer visualization and analysis environment
designed to meet the needs of oceanographers and meteorologists
analyzing large and complex gridded data sets."""
homepage = "http://ferret.noaa.gov/Ferret/"
url = "ftp://ftp.pmel.noaa.gov/ferret/pub/source/fer_source.tar.gz"
version('6.96', '51722027c864369f41bab5751dfff8cc',
url="ftp://ftp.pmel.noaa.gov/ferret/pub/source/fer_source.tar.gz")
depends_on("hdf5~mpi~fortran")
depends_on("netcdf~mpi")
depends_on("netcdf-fortran")
depends_on("readline")
depends_on("zlib")
def patch(self):
hdf5_prefix = self.spec['hdf5'].prefix
netcdff_prefix = self.spec['netcdf-fortran'].prefix
readline_prefix = self.spec['readline'].prefix
libz_prefix = self.spec['zlib'].prefix
filter_file(r'^BUILDTYPE.+',
'BUILDTYPE = x86_64-linux',
'FERRET/site_specific.mk')
filter_file(r'^INSTALL_FER_DIR.+',
'INSTALL_FER_DIR = %s' % self.spec.prefix,
'FERRET/site_specific.mk')
filter_file(r'^HDF5_DIR.+',
'HDF5_DIR = %s' % hdf5_prefix,
'FERRET/site_specific.mk')
filter_file(r'^NETCDF4_DIR.+',
'NETCDF4_DIR = %s' % netcdff_prefix,
'FERRET/site_specific.mk')
filter_file(r'^READLINE_DIR.+',
'READLINE_DIR = %s' % readline_prefix,
'FERRET/site_specific.mk')
filter_file(r'^LIBZ_DIR.+',
'LIBZ_DIR = %s' % libz_prefix,
'FERRET/site_specific.mk')
filter_file(r'^JAVA_HOME.+',
' ',
'FERRET/site_specific.mk')
filter_file(r'-lm',
'-lgfortran -lm',
'FERRET/platform_specific.mk.x86_64-linux')
def install(self, spec, prefix):
hdf5_prefix = spec['hdf5'].prefix
netcdff_prefix = spec['netcdf-fortran'].prefix
netcdf_prefix = spec['netcdf'].prefix
libz_prefix = spec['zlib'].prefix
ln = which('ln')
ln('-sf',
hdf5_prefix + '/lib',
hdf5_prefix + '/lib64')
ln('-sf',
netcdff_prefix + '/lib',
netcdff_prefix + '/lib64')
ln('-sf',
netcdf_prefix + '/lib/libnetcdf.a',
netcdff_prefix + '/lib/libnetcdf.a')
ln('-sf',
netcdf_prefix + '/lib/libnetcdf.la',
netcdff_prefix + '/lib/libnetcdf.la')
ln('-sf',
libz_prefix + '/lib',
libz_prefix + '/lib64')
os.environ['LDFLAGS'] = '-lquadmath'
with working_dir('FERRET', create=False):
os.environ['LD_X11'] = '-L/usr/lib/X11 -lX11'
os.environ['HOSTTYPE'] = 'x86_64-linux'
make(parallel=False)
make("install")

View File

@ -23,7 +23,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
from spack import * from spack import *
import os
class Mpich(Package): class Mpich(Package):
@ -42,7 +41,8 @@ class Mpich(Package):
version('3.1', '5643dd176499bfb7d25079aaff25f2ec') version('3.1', '5643dd176499bfb7d25079aaff25f2ec')
version('3.0.4', '9c5d5d4fe1e17dd12153f40bc5b6dbc0') version('3.0.4', '9c5d5d4fe1e17dd12153f40bc5b6dbc0')
variant('verbs', default=False, description='Build support for OpenFabrics verbs.') variant('verbs', default=False,
description='Build support for OpenFabrics verbs.')
variant('pmi', default=True, description='Build with PMI support') variant('pmi', default=True, description='Build with PMI support')
variant('hydra', default=True, description='Build the hydra process manager') variant('hydra', default=True, description='Build the hydra process manager')
@ -92,7 +92,6 @@ def install(self, spec, prefix):
self.filter_compilers() self.filter_compilers()
def filter_compilers(self): def filter_compilers(self):
"""Run after install to make the MPI compilers use the """Run after install to make the MPI compilers use the
compilers that Spack built the package with. compilers that Spack built the package with.
@ -102,18 +101,20 @@ def filter_compilers(self):
be bound to whatever compiler they were built with. be bound to whatever compiler they were built with.
""" """
bin = self.prefix.bin bin = self.prefix.bin
mpicc = os.path.join(bin, 'mpicc') mpicc = join_path(bin, 'mpicc')
mpicxx = os.path.join(bin, 'mpicxx') mpicxx = join_path(bin, 'mpicxx')
mpif77 = os.path.join(bin, 'mpif77') mpif77 = join_path(bin, 'mpif77')
mpif90 = os.path.join(bin, 'mpif90') mpif90 = join_path(bin, 'mpif90')
spack_cc = os.environ['CC']
spack_cxx = os.environ['CXX']
spack_f77 = os.environ['F77']
spack_fc = os.environ['FC']
# Substitute Spack compile wrappers for the real
# underlying compiler
kwargs = {'ignore_absent': True, 'backup': False, 'string': True} kwargs = {'ignore_absent': True, 'backup': False, 'string': True}
filter_file('CC="%s"' % spack_cc , 'CC="%s"' % self.compiler.cc, mpicc, **kwargs) filter_file(env['CC'], self.compiler.cc, mpicc, **kwargs)
filter_file('CXX="%s"'% spack_cxx, 'CXX="%s"' % self.compiler.cxx, mpicxx, **kwargs) filter_file(env['CXX'], self.compiler.cxx, mpicxx, **kwargs)
filter_file('F77="%s"'% spack_f77, 'F77="%s"' % self.compiler.f77, mpif77, **kwargs) filter_file(env['F77'], self.compiler.f77, mpif77, **kwargs)
filter_file('FC="%s"' % spack_fc , 'FC="%s"' % self.compiler.fc, mpif90, **kwargs) filter_file(env['FC'], self.compiler.fc, mpif90, **kwargs)
# Remove this linking flag if present
# (it turns RPATH into RUNPATH)
for wrapper in (mpicc, mpicxx, mpif77, mpif90):
filter_file('-Wl,--enable-new-dtags', '', wrapper, **kwargs)

View File

@ -0,0 +1,119 @@
diff -Naur MUMPS_5.0.1/libseq/Makefile MUMPS_5.0.1.new/libseq/Makefile
--- MUMPS_5.0.1/libseq/Makefile 2015-07-23 19:08:32.000000000 +0200
+++ MUMPS_5.0.1.new/libseq/Makefile 2016-06-07 10:41:16.585179151 +0200
@@ -8,11 +8,15 @@
include ../Makefile.inc
-libmpiseq: libmpiseq$(PLAT)$(LIBEXT)
+libmpiseq: libmpiseq$(PLAT)$(LIBEXT) libmpiseq$(PLAT)$(SHLIBEXT)
libmpiseq$(PLAT)$(LIBEXT): mpi.o mpic.o elapse.o
$(AR)$@ mpi.o mpic.o elapse.o
$(RANLIB) $@
+
+libmpiseq$(PLAT)$(SHLIBEXT): mpi.o mpic.o elapse.o
+ $(FC) $(LDFLAGS) $^ -o libmpiseq$(PLAT)$(SHLIBEXT)
+
.f.o:
$(FC) $(OPTF) -c $*.f $(OUTF)$*.o
.c.o:
diff -Naur MUMPS_5.0.1/Makefile MUMPS_5.0.1.new/Makefile
--- MUMPS_5.0.1/Makefile 2015-07-23 19:08:29.000000000 +0200
+++ MUMPS_5.0.1.new/Makefile 2016-06-07 10:50:21.863281217 +0200
@@ -51,7 +51,7 @@
dexamples: d
(cd examples ; $(MAKE) d)
-requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT)$(LIBEXT)
+requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT)$(LIBEXT) $(libdir)/libpord$(PLAT)$(SHLIBEXT)
# dummy MPI library (sequential version)
@@ -62,16 +62,25 @@
$(libdir)/libpord$(PLAT)$(LIBEXT):
if [ "$(LPORDDIR)" != "" ] ; then \
cd $(LPORDDIR); \
- $(MAKE) CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" RANLIB="$(RANLIB)" OUTC="$(OUTC)" LIBEXT=$(LIBEXT); \
+ $(MAKE) CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" OUTC="$(OUTC)" LIBEXT=$(LIBEXT) PLAT=$(PLAT) SHLIBEXT=$(SHLIBEXT); \
fi;
if [ "$(LPORDDIR)" != "" ] ; then \
cp $(LPORDDIR)/libpord$(LIBEXT) $@; \
fi;
+$(libdir)/libpord$(PLAT)$(SHLIBEXT):
+ if [ "$(LPORDDIR)" != "" ] ; then \
+ cd $(LPORDDIR); \
+ $(MAKE) CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" OUTC="$(OUTC)" LIBEXT=$(LIBEXT) PLAT=$(PLAT) SHLIBEXT=$(SHLIBEXT) libpord$(PLAT)$(SHLIBEXT); \
+ fi;
+ if [ "$(LPORDDIR)" != "" ] ; then \
+ cp $(LPORDDIR)/libpord$(PLAT)$(SHLIBEXT) $@; \
+ fi;
+
clean:
(cd src; $(MAKE) clean)
(cd examples; $(MAKE) clean)
- (cd $(libdir); $(RM) *$(PLAT)$(LIBEXT))
+ (cd $(libdir); $(RM) *$(PLAT)$(LIBEXT) *$(PLAT)$(SHLIBEXT))
(cd libseq; $(MAKE) clean)
if [ "$(LPORDDIR)" != "" ] ; then \
cd $(LPORDDIR); $(MAKE) realclean; \
diff -Naur MUMPS_5.0.1/PORD/lib/Makefile MUMPS_5.0.1.new/PORD/lib/Makefile
--- MUMPS_5.0.1/PORD/lib/Makefile 2015-07-23 19:08:29.000000000 +0200
+++ MUMPS_5.0.1.new/PORD/lib/Makefile 2016-06-07 10:49:48.889000958 +0200
@@ -13,7 +13,7 @@
OBJS = graph.o gbipart.o gbisect.o ddcreate.o ddbisect.o nestdiss.o \
multisector.o gelim.o bucket.o tree.o \
- symbfac.o interface.o sort.o minpriority.o
+ symbfac.o interface.o sort.o minpriority.o
# Note: numfac.c read.c mapping.c triangular.c matrix.c kernel.c
# were not direcly used by MUMPS and have been removed from the
@@ -24,12 +24,15 @@
.c.o:
$(CC) $(COPTIONS) -c $*.c $(OUTC)$*.o
-libpord$(LIBEXT):$(OBJS)
+libpord$(PLAT)$(LIBEXT):$(OBJS)
$(AR)$@ $(OBJS)
$(RANLIB) $@
+libpord$(PLAT)$(SHLIBEXT): $(OBJS)
+ $(CC) $(LDFLAGS) $(OBJS) -o libpord$(PLAT)$(SHLIBEXT)
+
clean:
rm -f *.o
realclean:
- rm -f *.o libpord.a
+ rm -f *.o libpord$(PLAT)$(SHLIBEXT) libpord$(PLAT)$(LIBEXT)
diff -Naur MUMPS_5.0.1/src/Makefile MUMPS_5.0.1.new/src/Makefile
--- MUMPS_5.0.1/src/Makefile 2015-07-23 19:08:29.000000000 +0200
+++ MUMPS_5.0.1.new/src/Makefile 2016-06-07 10:40:52.534703722 +0200
@@ -24,7 +24,10 @@
include $(topdir)/Makefile.inc
mumps_lib: $(libdir)/libmumps_common$(PLAT)$(LIBEXT) \
- $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT)
+ $(libdir)/libmumps_common$(PLAT)$(SHLIBEXT) \
+ $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT) \
+ $(libdir)/lib$(ARITH)mumps$(PLAT)$(SHLIBEXT)
+
OBJS_COMMON_MOD = \
ana_omp_m.o\
@@ -162,6 +165,13 @@
$(AR)$@ $?
$(RANLIB) $@
+$(libdir)/libmumps_common$(PLAT)$(SHLIBEXT): $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
+ $(FC) $(LDFLAGS) $^ -L$(libdir) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS) -o $(libdir)/libmumps_common$(PLAT)$(SHLIBEXT)
+
+
+$(libdir)/lib$(ARITH)mumps$(PLAT)$(SHLIBEXT): $(OBJS_MOD) $(OBJS_OTHER)
+ $(FC) $(LDFLAGS) $^ -L$(libdir) -lmumps_common$(PLAT) $(LORDERINGS) $(LIBS) $(LIBBLAS) $(LIBOTHERS) -o $(libdir)/lib$(ARITH)mumps$(PLAT)$(SHLIBEXT)
+
# Dependencies between modules:
$(ARITH)mumps_load.o: $(ARITH)mumps_comm_buffer.o \
$(ARITH)mumps_struc_def.o \

View File

@ -23,7 +23,10 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
from spack import * from spack import *
import os, sys, glob import os
import sys
import subprocess
class Mumps(Package): class Mumps(Package):
"""MUMPS: a MUltifrontal Massively Parallel sparse direct Solver""" """MUMPS: a MUltifrontal Massively Parallel sparse direct Solver"""
@ -44,7 +47,6 @@ class Mumps(Package):
variant('idx64', default=False, description='Use int64_t/integer*8 as default index type') variant('idx64', default=False, description='Use int64_t/integer*8 as default index type')
variant('shared', default=True, description='Build shared libraries') variant('shared', default=True, description='Build shared libraries')
depends_on('scotch + esmumps', when='~ptscotch+scotch') depends_on('scotch + esmumps', when='~ptscotch+scotch')
depends_on('scotch + esmumps + mpi', when='+ptscotch') depends_on('scotch + esmumps + mpi', when='+ptscotch')
depends_on('metis@5:', when='+metis') depends_on('metis@5:', when='+metis')
@ -54,49 +56,64 @@ class Mumps(Package):
depends_on('scalapack', when='+mpi') depends_on('scalapack', when='+mpi')
depends_on('mpi', when='+mpi') depends_on('mpi', when='+mpi')
patch('mumps-shared.patch', when='+shared')
# this function is not a patch function because in case scalapack # this function is not a patch function because in case scalapack
# is needed it uses self.spec['scalapack'].fc_link set by the # is needed it uses self.spec['scalapack'].fc_link set by the
# setup_dependent_environment in scalapck. This happen after patch # setup_dependent_environment in scalapck. This happen after patch
# end before install # end before install
# def patch(self): # def patch(self):
def write_makefile_inc(self): def write_makefile_inc(self):
if ('+parmetis' in self.spec or '+ptscotch' in self.spec) and '+mpi' not in self.spec: if (('+parmetis' in self.spec or
raise RuntimeError('You cannot use the variants parmetis or ptscotch without mpi') '+ptscotch' in self.spec)) and '+mpi' not in self.spec:
raise RuntimeError('You cannot use the variants parmetis or ptscotch without mpi') # NOQA: E501
makefile_conf = ["LIBBLAS = -L%s -lblas" % self.spec['blas'].prefix.lib] makefile_conf = [
"LIBBLAS = -L%s -lblas" % self.spec['blas'].prefix.lib
]
orderings = ['-Dpord'] orderings = ['-Dpord']
if '+ptscotch' in self.spec or '+scotch' in self.spec: if '+ptscotch' in self.spec or '+scotch' in self.spec:
join_lib = ' -l%s' % ('pt' if '+ptscotch' in self.spec else '') join_lib = ' -l%s' % ('pt' if '+ptscotch' in self.spec else '')
makefile_conf.extend( makefile_conf.extend([
["ISCOTCH = -I%s" % self.spec['scotch'].prefix.include, "ISCOTCH = -I%s" % self.spec['scotch'].prefix.include,
"LSCOTCH = -L%s %s%s" % (self.spec['scotch'].prefix.lib, "LSCOTCH = -L%s %s%s" % (self.spec['scotch'].prefix.lib,
join_lib, join_lib,
join_lib.join(['esmumps', 'scotch', 'scotcherr']))]) join_lib.join(['esmumps',
'scotch',
'scotcherr']))
])
orderings.append('-Dscotch') orderings.append('-Dscotch')
if '+ptscotch' in self.spec: if '+ptscotch' in self.spec:
orderings.append('-Dptscotch') orderings.append('-Dptscotch')
if '+parmetis' in self.spec and '+metis' in self.spec: if '+parmetis' in self.spec and '+metis' in self.spec:
libname = 'parmetis' if '+parmetis' in self.spec else 'metis' makefile_conf.extend([
makefile_conf.extend( "IMETIS = -I%s" % self.spec['parmetis'].prefix.include,
["IMETIS = -I%s" % self.spec['parmetis'].prefix.include, "LMETIS = -L%s -l%s -L%s -l%s" % (
"LMETIS = -L%s -l%s -L%s -l%s" % (self.spec['parmetis'].prefix.lib, 'parmetis',self.spec['metis'].prefix.lib, 'metis')]) self.spec['parmetis'].prefix.lib, 'parmetis',
self.spec['metis'].prefix.lib, 'metis')
])
orderings.append('-Dparmetis') orderings.append('-Dparmetis')
elif '+metis' in self.spec: elif '+metis' in self.spec:
makefile_conf.extend( makefile_conf.extend([
["IMETIS = -I%s" % self.spec['metis'].prefix.include, "IMETIS = -I%s" % self.spec['metis'].prefix.include,
"LMETIS = -L%s -l%s" % (self.spec['metis'].prefix.lib, 'metis')]) "LMETIS = -L%s -l%s" % (self.spec['metis'].prefix.lib,
'metis')
])
orderings.append('-Dmetis') orderings.append('-Dmetis')
makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings))) makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings)))
# when building shared libs need -fPIC, otherwise # when building shared libs need -fPIC, otherwise /usr/bin/ld:
# /usr/bin/ld: graph.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC # graph.o: relocation R_X86_64_32 against `.rodata.str1.1' can
# not be used when making a shared object; recompile with
# -fPIC
fpic = '-fPIC' if '+shared' in self.spec else '' fpic = '-fPIC' if '+shared' in self.spec else ''
# TODO: test this part, it needs a full blas, scalapack and # TODO: test this part, it needs a full blas, scalapack and
# partitionning environment with 64bit integers # partitionning environment with 64bit integers
if '+idx64' in self.spec: if '+idx64' in self.spec:
@ -104,7 +121,7 @@ def write_makefile_inc(self):
# the fortran compilation flags most probably are # the fortran compilation flags most probably are
# working only for intel and gnu compilers this is # working only for intel and gnu compilers this is
# perhaps something the compiler should provide # perhaps something the compiler should provide
['OPTF = %s -O -DALLOW_NON_INIT %s' % (fpic,'-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8'), ['OPTF = %s -O -DALLOW_NON_INIT %s' % (fpic, '-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8'), # NOQA: E501
'OPTL = %s -O ' % fpic, 'OPTL = %s -O ' % fpic,
'OPTC = %s -O -DINTSIZE64' % fpic]) 'OPTC = %s -O -DINTSIZE64' % fpic])
else: else:
@ -113,48 +130,46 @@ def write_makefile_inc(self):
'OPTL = %s -O ' % fpic, 'OPTL = %s -O ' % fpic,
'OPTC = %s -O ' % fpic]) 'OPTC = %s -O ' % fpic])
if '+mpi' in self.spec: if '+mpi' in self.spec:
makefile_conf.extend( makefile_conf.extend(
["CC = %s" % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), ["CC = %s" % self.spec['mpi'].mpicc,
"FC = %s" % join_path(self.spec['mpi'].prefix.bin, 'mpif90'), "FC = %s" % self.spec['mpi'].mpifc,
"FL = %s" % join_path(self.spec['mpi'].prefix.bin, 'mpif90'),
"SCALAP = %s" % self.spec['scalapack'].fc_link, "SCALAP = %s" % self.spec['scalapack'].fc_link,
"MUMPS_TYPE = par"]) "MUMPS_TYPE = par"])
else: else:
makefile_conf.extend( makefile_conf.extend(
["CC = cc", ["CC = cc",
"FC = fc", "FC = fc",
"FL = fc",
"MUMPS_TYPE = seq"]) "MUMPS_TYPE = seq"])
# TODO: change the value to the correct one according to the # TODO: change the value to the correct one according to the
# compiler possible values are -DAdd_, -DAdd__ and/or -DUPPER # compiler possible values are -DAdd_, -DAdd__ and/or -DUPPER
makefile_conf.append("CDEFS = -DAdd_") makefile_conf.extend([
'CDEFS = -DAdd_',
'FL = $(FC)',
])
if '+shared' in self.spec: if '+shared' in self.spec:
makefile_conf.append('SHLIBEXT = .%s' % dso_suffix)
if sys.platform == 'darwin': if sys.platform == 'darwin':
# Building dylibs with mpif90 causes segfaults on 10.8 and 10.10. Use gfortran. (Homebrew) makefile_conf.append(
makefile_conf.extend([ 'LDFLAGS = -dynamiclib -Wl,-install_name -Wl,{0}/$(notdir $@) {1}{0} -undefined dynamic_lookup'.format(prefix.lib, self.compiler.fc_rpath_arg) # NOQA: E501
'LIBEXT=.dylib', )
'AR=%s -dynamiclib -Wl,-install_name -Wl,%s/$(notdir $@) -undefined dynamic_lookup -o ' % (os.environ['FC'],prefix.lib),
'RANLIB=echo'
])
else:
makefile_conf.extend([
'LIBEXT=.so',
'AR=$(FL) -shared -Wl,-soname -Wl,%s/$(notdir $@) -o' % prefix.lib,
'RANLIB=echo'
])
else: else:
makefile_conf.append(
'LDFLAGS = -shared {0}{1}'.format(
self.compiler.fc_rpath_arg,
prefix.lib)
)
makefile_conf.extend([ makefile_conf.extend([
'LIBEXT = .a', 'LIBEXT = .a',
'AR = ar vr ', 'AR = ar vr ',
'RANLIB = ranlib' 'RANLIB = ranlib'
]) ])
makefile_inc_template = \
makefile_inc_template = join_path(os.path.dirname(self.module.__file__), join_path(os.path.dirname(self.module.__file__),
'Makefile.inc') 'Makefile.inc')
with open(makefile_inc_template, "r") as fh: with open(makefile_inc_template, "r") as fh:
makefile_conf.extend(fh.read().split('\n')) makefile_conf.extend(fh.read().split('\n'))
@ -164,46 +179,53 @@ def write_makefile_inc(self):
makefile_inc = '\n'.join(makefile_conf) makefile_inc = '\n'.join(makefile_conf)
fh.write(makefile_inc) fh.write(makefile_inc)
def install(self, spec, prefix): def install(self, spec, prefix):
make_libs = [] make_libs = []
# the choice to compile ?examples is to have kind of a sanity # the choice to compile ?examples is to have kind of a sanity
# check on the libraries generated. # check on the libraries generated.
if '+float' in spec: if '+float' in spec:
make_libs.append('sexamples') make_libs.append('s')
if '+complex' in spec: if '+complex' in spec:
make_libs.append('cexamples') make_libs.append('c')
if '+double' in spec: if '+double' in spec:
make_libs.append('dexamples') make_libs.append('d')
if '+complex' in spec: if '+complex' in spec:
make_libs.append('zexamples') make_libs.append('z')
self.write_makefile_inc() self.write_makefile_inc()
# Build fails in parallel make('mumps_lib', parallel=False)
make(*make_libs, parallel=False) make(*make_libs)
install_tree('lib', prefix.lib) install_tree('lib', prefix.lib)
install_tree('include', prefix.include) install_tree('include', prefix.include)
if '~mpi' in spec: if '~mpi' in spec:
lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so' install('libseq/libmpiseq.a', prefix.lib)
lib_suffix = lib_dsuffix if '+shared' in spec else '.a' if '+shared' in spec:
install('libseq/libmpiseq%s' % lib_suffix, prefix.lib) install('libseq/libmpiseq.{0}'.format(dso_suffix), prefix.lib)
for f in glob.glob(join_path('libseq','*.h')): install('libseq/mpi.h', prefix.include)
install(f, prefix.include) install('libseq/mpif.h', prefix.include)
# FIXME: extend the tests to mpirun -np 2 (or alike) when
# build with MPI
# FIXME: use something like numdiff to compare blessed output
# with the current
# TODO: test the installed mumps and not the one in stage
if '~mpi' in spec:
for t in make_libs:
make('{0}examples'.format(t))
# FIXME: extend the tests to mpirun -np 2 (or alike) when build with MPI
# FIXME: use something like numdiff to compare blessed output with the current
with working_dir('examples'): with working_dir('examples'):
if '+float' in spec: for t in make_libs:
os.system('./ssimpletest < input_simpletest_real') input_file = 'input_simpletest_{0}'.format(
if '+complex' in spec: 'real' if t in ['s', 'd'] else 'cmplx')
os.system('./csimpletest < input_simpletest_real') with open(input_file) as input:
if '+double' in spec: test = './{0}simpletest'.format(t)
os.system('./dsimpletest < input_simpletest_real') ret = subprocess.call(test,
if '+complex' in spec: stdin=input)
os.system('./zsimpletest < input_simpletest_cmplx') if ret is not 0:
raise RuntimeError(
'The test {0} did not pass'.format(test))

View File

@ -23,7 +23,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
from spack import * from spack import *
import os
class Mvapich2(Package): class Mvapich2(Package):
@ -245,27 +244,20 @@ def filter_compilers(self):
be bound to whatever compiler they were built with. be bound to whatever compiler they were built with.
""" """
bin = self.prefix.bin bin = self.prefix.bin
mpicc = os.path.join(bin, 'mpicc') mpicc = join_path(bin, 'mpicc')
mpicxx = os.path.join(bin, 'mpicxx') mpicxx = join_path(bin, 'mpicxx')
mpif77 = os.path.join(bin, 'mpif77') mpif77 = join_path(bin, 'mpif77')
mpif90 = os.path.join(bin, 'mpif90') mpif90 = join_path(bin, 'mpif90')
spack_cc = os.environ['CC'] # Substitute Spack compile wrappers for the real
spack_cxx = os.environ['CXX'] # underlying compiler
spack_f77 = os.environ['F77'] kwargs = {'ignore_absent': True, 'backup': False, 'string': True}
spack_fc = os.environ['FC'] filter_file(env['CC'], self.compiler.cc, mpicc, **kwargs)
filter_file(env['CXX'], self.compiler.cxx, mpicxx, **kwargs)
filter_file(env['F77'], self.compiler.f77, mpif77, **kwargs)
filter_file(env['FC'], self.compiler.fc, mpif90, **kwargs)
kwargs = { # Remove this linking flag if present
'ignore_absent': True, # (it turns RPATH into RUNPATH)
'backup': False, for wrapper in (mpicc, mpicxx, mpif77, mpif90):
'string': True filter_file('-Wl,--enable-new-dtags', '', wrapper, **kwargs)
}
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)

View File

@ -48,6 +48,13 @@ class Openblas(Package):
patch('make.patch') patch('make.patch')
def install(self, spec, prefix): def install(self, spec, prefix):
# As of 06/2016 there is no mechanism to specify that packages which
# depends on Blas/Lapack need C or/and Fortran symbols. For now
# require both.
if self.compiler.f77 is None:
raise InstallError('OpenBLAS requires both C and Fortran ',
'compilers!')
# Configure fails to pick up fortran from FC=/abs/path/to/f77, but # Configure fails to pick up fortran from FC=/abs/path/to/f77, but
# works fine with FC=/abs/path/to/gfortran. # works fine with FC=/abs/path/to/gfortran.
# When mixing compilers make sure that # When mixing compilers make sure that

View File

@ -61,6 +61,7 @@ class Openmpi(Package):
list_url = "http://www.open-mpi.org/software/ompi/" list_url = "http://www.open-mpi.org/software/ompi/"
list_depth = 3 list_depth = 3
version('1.10.3', 'e2fe4513200e2aaa1500b762342c674b')
version('1.10.2', 'b2f43d9635d2d52826e5ef9feb97fd4c') version('1.10.2', 'b2f43d9635d2d52826e5ef9feb97fd4c')
version('1.10.1', 'f0fcd77ed345b7eafb431968124ba16e') version('1.10.1', 'f0fcd77ed345b7eafb431968124ba16e')
version('1.10.0', '280cf952de68369cebaca886c5ce0304') version('1.10.0', '280cf952de68369cebaca886c5ce0304')
@ -72,20 +73,27 @@ class Openmpi(Package):
patch('configure.patch', when="@1.10.0:1.10.1") patch('configure.patch', when="@1.10.0:1.10.1")
variant('psm', default=False, description='Build support for the PSM library.') variant('psm', default=False, description='Build support for the PSM library.')
variant('psm2', default=False, description='Build support for the Intel PSM2 library.') variant('psm2', default=False,
variant('pmi', default=False, description='Build support for PMI-based launchers') description='Build support for the Intel PSM2 library.')
variant('verbs', default=_verbs_dir() is not None, description='Build support for OpenFabrics verbs.') variant('pmi', default=False,
description='Build support for PMI-based launchers')
variant('verbs', default=_verbs_dir() is not None,
description='Build support for OpenFabrics verbs.')
variant('mxm', default=False, description='Build Mellanox Messaging support') variant('mxm', default=False, description='Build Mellanox Messaging support')
variant('thread_multiple', default=False, description='Enable MPI_THREAD_MULTIPLE support') variant('thread_multiple', default=False,
description='Enable MPI_THREAD_MULTIPLE support')
# TODO : variant support for alps, loadleveler is missing # TODO : variant support for alps, loadleveler is missing
variant('tm', default=False, description='Build TM (Torque, PBSPro, and compatible) support') variant('tm', default=False,
variant('slurm', default=False, description='Build SLURM scheduler component') description='Build TM (Torque, PBSPro, and compatible) support')
variant('slurm', default=False,
description='Build SLURM scheduler component')
variant('sqlite3', default=False, description='Build sqlite3 support') variant('sqlite3', default=False, description='Build sqlite3 support')
variant('vt', default=True, description='Build support for contributed package vt') variant('vt', default=True,
description='Build support for contributed package vt')
# TODO : support for CUDA is missing # TODO : support for CUDA is missing
@ -96,8 +104,7 @@ class Openmpi(Package):
depends_on('sqlite', when='+sqlite3') depends_on('sqlite', when='+sqlite3')
def url_for_version(self, version): def url_for_version(self, version):
return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version) return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version) # NOQA: ignore=E501
def setup_dependent_environment(self, spack_env, run_env, dependent_spec): def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
spack_env.set('OMPI_CC', spack_cc) spack_env.set('OMPI_CC', spack_cc)
@ -113,7 +120,8 @@ def setup_dependent_package(self, module, dep_spec):
@property @property
def verbs(self): def verbs(self):
# Up through version 1.6, this option was previously named --with-openib # Up through version 1.6, this option was previously named
# --with-openib
if self.spec.satisfies('@:1.6'): if self.spec.satisfies('@:1.6'):
return 'openib' return 'openib'
# In version 1.7, it was renamed to be --with-verbs # In version 1.7, it was renamed to be --with-verbs
@ -121,6 +129,13 @@ def verbs(self):
return 'verbs' return 'verbs'
def install(self, spec, prefix): def install(self, spec, prefix):
# As of 06/2016 there is no mechanism to specify that packages which
# depends on MPI need C or/and Fortran implementation. For now
# require both.
if (self.compiler.f77 is None) or (self.compiler.fc is None):
raise InstallError('OpenMPI requires both C and Fortran ',
'compilers!')
config_args = ["--prefix=%s" % prefix, config_args = ["--prefix=%s" % prefix,
"--with-hwloc=%s" % spec['hwloc'].prefix, "--with-hwloc=%s" % spec['hwloc'].prefix,
"--enable-shared", "--enable-shared",
@ -135,7 +150,7 @@ def install(self, spec, prefix):
'--with-psm2' if '+psm2' in spec else '--without-psm2', '--with-psm2' if '+psm2' in spec else '--without-psm2',
'--with-mxm' if '+mxm' in spec else '--without-mxm', '--with-mxm' if '+mxm' in spec else '--without-mxm',
# Other options # Other options
'--enable-mpi-thread-multiple' if '+thread_multiple' in spec else '--disable-mpi-thread-multiple', '--enable-mpi-thread-multiple' if '+thread_multiple' in spec else '--disable-mpi-thread-multiple', # NOQA: ignore=E501
'--with-pmi' if '+pmi' in spec else '--without-pmi', '--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' '--enable-vt' if '+vt' in spec else '--disable-vt'
@ -153,7 +168,7 @@ def install(self, spec, prefix):
# use this for LANL builds, but for LLNL builds, we need: # use this for LANL builds, but for LLNL builds, we need:
# "--with-platform=contrib/platform/llnl/optimized" # "--with-platform=contrib/platform/llnl/optimized"
if self.version == ver("1.6.5") and '+lanl' in spec: if self.version == ver("1.6.5") and '+lanl' in spec:
config_args.append("--with-platform=contrib/platform/lanl/tlcc2/optimized-nopanasas") config_args.append("--with-platform=contrib/platform/lanl/tlcc2/optimized-nopanasas") # NOQA: ignore=E501
if not self.compiler.f77 and not self.compiler.fc: if not self.compiler.f77 and not self.compiler.fc:
config_args.append("--enable-mpi-fortran=no") config_args.append("--enable-mpi-fortran=no")
@ -173,40 +188,33 @@ def filter_compilers(self):
be bound to whatever compiler they were built with. be bound to whatever compiler they were built with.
""" """
kwargs = {'ignore_absent': True, 'backup': False, 'string': False} kwargs = {'ignore_absent': True, 'backup': False, 'string': False}
dir = os.path.join(self.prefix, 'share/openmpi/') wrapper_basepath = join_path(self.prefix, 'share', 'openmpi')
cc_wrappers = ['mpicc-vt-wrapper-data.txt', 'mpicc-wrapper-data.txt', wrappers = [
'ortecc-wrapper-data.txt', 'shmemcc-wrapper-data.txt'] ('mpicc-vt-wrapper-data.txt', self.compiler.cc),
('mpicc-wrapper-data.txt', self.compiler.cc),
('ortecc-wrapper-data.txt', self.compiler.cc),
('shmemcc-wrapper-data.txt', self.compiler.cc),
('mpic++-vt-wrapper-data.txt', self.compiler.cxx),
('mpic++-wrapper-data.txt', self.compiler.cxx),
('ortec++-wrapper-data.txt', self.compiler.cxx),
('mpifort-vt-wrapper-data.txt', self.compiler.fc),
('mpifort-wrapper-data.txt', self.compiler.fc),
('shmemfort-wrapper-data.txt', self.compiler.fc),
('mpif90-vt-wrapper-data.txt', self.compiler.fc),
('mpif90-wrapper-data.txt', self.compiler.fc),
('mpif77-vt-wrapper-data.txt', self.compiler.f77),
('mpif77-wrapper-data.txt', self.compiler.f77)
]
cxx_wrappers = ['mpic++-vt-wrapper-data.txt', 'mpic++-wrapper-data.txt', for wrapper_name, compiler in wrappers:
'ortec++-wrapper-data.txt'] wrapper = join_path(wrapper_basepath, wrapper_name)
if not os.path.islink(wrapper):
fc_wrappers = ['mpifort-vt-wrapper-data.txt', # Substitute Spack compile wrappers for the real
'mpifort-wrapper-data.txt', 'shmemfort-wrapper-data.txt'] # underlying compiler
match = 'compiler=.*'
for wrapper in cc_wrappers: substitute = 'compiler={compiler}'.format(compiler=compiler)
filter_file('compiler=.*', 'compiler=%s' % self.compiler.cc, filter_file(match, substitute, wrapper, **kwargs)
os.path.join(dir, wrapper), **kwargs) # Remove this linking flag if present
# (it turns RPATH into RUNPATH)
for wrapper in cxx_wrappers: filter_file('-Wl,--enable-new-dtags', '', wrapper, **kwargs)
filter_file('compiler=.*', 'compiler=%s' % self.compiler.cxx,
os.path.join(dir, wrapper), **kwargs)
for wrapper in fc_wrappers:
filter_file('compiler=.*', 'compiler=%s' % self.compiler.fc,
os.path.join(dir, wrapper), **kwargs)
# These are symlinks in newer versions, so check that here
f77_wrappers = ['mpif77-vt-wrapper-data.txt', 'mpif77-wrapper-data.txt']
f90_wrappers = ['mpif90-vt-wrapper-data.txt', 'mpif90-wrapper-data.txt']
for wrapper in f77_wrappers:
path = os.path.join(dir, wrapper)
if not os.path.islink(path):
filter_file('compiler=.*', 'compiler=%s' % self.compiler.f77,
path, **kwargs)
for wrapper in f90_wrappers:
path = os.path.join(dir, wrapper)
if not os.path.islink(path):
filter_file('compiler=.*', 'compiler=%s' % self.compiler.fc,
path, **kwargs)

View File

@ -29,6 +29,7 @@ class Pcre(Package):
"""The PCRE package contains Perl Compatible Regular Expression """The PCRE package contains Perl Compatible Regular Expression
libraries. These are useful for implementing regular expression libraries. These are useful for implementing regular expression
pattern matching using the same syntax and semantics as Perl 5.""" pattern matching using the same syntax and semantics as Perl 5."""
homepage = "http://www.pcre.org""" homepage = "http://www.pcre.org"""
url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.bz2" url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.bz2"
@ -37,7 +38,15 @@ class Pcre(Package):
patch("intel.patch") patch("intel.patch")
variant('utf', default=True,
description='Enable support for UTF-8/16/32, '
'incompatible with EBCDIC.')
def install(self, spec, prefix): def install(self, spec, prefix):
configure("--prefix=%s" % prefix) configure_args = ['--prefix=%s' % prefix]
if '+utf' in spec:
configure_args.append('--enable-utf')
configure(*configure_args)
make() make()
make("install") make("install")

View File

@ -28,13 +28,16 @@
class Petsc(Package): class Petsc(Package):
""" """
PETSc is a suite of data structures and routines for the scalable (parallel) solution of scientific applications PETSc is a suite of data structures and routines for the scalable
modeled by partial differential equations. (parallel) solution of scientific applications modeled by partial
differential equations.
""" """
homepage = "http://www.mcs.anl.gov/petsc/index.html" homepage = "http://www.mcs.anl.gov/petsc/index.html"
url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.5.3.tar.gz" url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.5.3.tar.gz"
version('3.7.2', '50da49867ce7a49e7a0c1b37f4ec7b34')
version('3.6.4', '7632da2375a3df35b8891c9526dbdde7')
version('3.6.3', '91dd3522de5a5ef039ff8f50800db606') version('3.6.3', '91dd3522de5a5ef039ff8f50800db606')
version('3.5.3', 'd4fd2734661e89f18ac6014b5dd1ef2f') version('3.5.3', 'd4fd2734661e89f18ac6014b5dd1ef2f')
version('3.5.2', 'ad170802b3b058b5deb9cd1f968e7e13') version('3.5.2', 'ad170802b3b058b5deb9cd1f968e7e13')
@ -69,10 +72,12 @@ class Petsc(Package):
depends_on('hdf5+mpi', when='+hdf5+mpi') depends_on('hdf5+mpi', when='+hdf5+mpi')
depends_on('parmetis', when='+metis+mpi') depends_on('parmetis', when='+metis+mpi')
# Hypre does not support complex numbers. # Hypre does not support complex numbers.
# Also PETSc prefer to build it without internal superlu, likely due to conflict in headers # Also PETSc prefer to build it without internal superlu, likely due to
# see https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py # conflict in headers see
# https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py # NOQA: ignore=E501
depends_on('hypre~internal-superlu', when='+hypre+mpi~complex') depends_on('hypre~internal-superlu', when='+hypre+mpi~complex')
depends_on('superlu-dist', when='+superlu-dist+mpi') depends_on('superlu-dist@:4.3', when='@:3.6.4+superlu-dist+mpi')
depends_on('superlu-dist@5.0.0:', when='@3.7:+superlu-dist+mpi')
depends_on('mumps+mpi', when='+mumps+mpi') depends_on('mumps+mpi', when='+mumps+mpi')
depends_on('scalapack', when='+mumps+mpi') depends_on('scalapack', when='+mumps+mpi')
@ -80,16 +85,16 @@ def mpi_dependent_options(self):
if '~mpi' in self.spec: if '~mpi' in self.spec:
compiler_opts = [ compiler_opts = [
'--with-cc=%s' % os.environ['CC'], '--with-cc=%s' % os.environ['CC'],
'--with-cxx=%s' % (os.environ['CXX'] if self.compiler.cxx is not None else '0'), '--with-cxx=%s' % (os.environ['CXX'] if self.compiler.cxx is not None else '0'), # NOQA: ignore=E501
'--with-fc=%s' % (os.environ['FC'] if self.compiler.fc is not None else '0'), '--with-fc=%s' % (os.environ['FC'] if self.compiler.fc is not None else '0'), # NOQA: ignore=E501
'--with-mpi=0' '--with-mpi=0'
] ]
error_message_fmt = '\t{library} support requires "+mpi" to be activated' error_message_fmt = '\t{library} support requires "+mpi" to be activated' # NOQA: ignore=E501
# If mpi is disabled (~mpi), it's an error to have any of these enabled. # If mpi is disabled (~mpi), it's an error to have any of these
# This generates a list of any such errors. # enabled. This generates a list of any such errors.
errors = [error_message_fmt.format(library=x) errors = [error_message_fmt.format(library=x)
for x in ('hdf5', 'hypre', 'parmetis','mumps','superlu-dist') for x in ('hdf5', 'hypre', 'parmetis', 'mumps', 'superlu-dist') # NOQA: ignore=E501
if ('+' + x) in self.spec] if ('+' + x) in self.spec]
if errors: if errors:
errors = ['incompatible variants given'] + errors errors = ['incompatible variants given'] + errors
@ -105,26 +110,31 @@ def install(self, spec, prefix):
options = ['--with-ssl=0'] options = ['--with-ssl=0']
options.extend(self.mpi_dependent_options()) options.extend(self.mpi_dependent_options())
options.extend([ options.extend([
'--with-precision=%s' % ('double' if '+double' in spec else 'single'), '--with-precision=%s' % ('double' if '+double' in spec else 'single'), # NOQA: ignore=E501
'--with-scalar-type=%s' % ('complex' if '+complex' in spec else 'real'), '--with-scalar-type=%s' % ('complex' if '+complex' in spec else 'real'), # NOQA: ignore=E501
'--with-shared-libraries=%s' % ('1' if '+shared' in spec else '0'), '--with-shared-libraries=%s' % ('1' if '+shared' in spec else '0'),
'--with-debugging=%s' % ('1' if '+debug' in spec else '0'), '--with-debugging=%s' % ('1' if '+debug' in spec else '0'),
'--with-blas-lapack-dir=%s' % spec['lapack'].prefix '--with-blas-lapack-dir=%s' % spec['lapack'].prefix
]) ])
# Activates library support if needed # Activates library support if needed
for library in ('metis', 'boost', 'hdf5', 'hypre', 'parmetis','mumps','scalapack'): for library in ('metis', 'boost', 'hdf5', 'hypre', 'parmetis',
'mumps', 'scalapack'):
options.append( options.append(
'--with-{library}={value}'.format(library=library, value=('1' if library in spec else '0')) '--with-{library}={value}'.format(library=library, value=('1' if library in spec else '0')) # NOQA: ignore=E501
) )
if library in spec: if library in spec:
options.append( options.append(
'--with-{library}-dir={path}'.format(library=library, path=spec[library].prefix) '--with-{library}-dir={path}'.format(library=library, path=spec[library].prefix) # NOQA: ignore=E501
) )
# PETSc does not pick up SuperluDist from the dir as they look for superlu_dist_4.1.a # PETSc does not pick up SuperluDist from the dir as they look for
# superlu_dist_4.1.a
if 'superlu-dist' in spec: if 'superlu-dist' in spec:
options.extend([ options.extend([
'--with-superlu_dist-include=%s' % spec['superlu-dist'].prefix.include, '--with-superlu_dist-include=%s' %
'--with-superlu_dist-lib=%s' % join_path(spec['superlu-dist'].prefix.lib, 'libsuperlu_dist.a'), spec['superlu-dist'].prefix.include,
'--with-superlu_dist-lib=%s' %
join_path(spec['superlu-dist'].prefix.lib,
'libsuperlu_dist.a'),
'--with-superlu_dist=1' '--with-superlu_dist=1'
]) ])
else: else:

View File

@ -0,0 +1,115 @@
##############################################################################
# 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 *
import os
class Psi4(Package):
"""Psi4 is an open-source suite of ab initio quantum chemistry
programs designed for efficient, high-accuracy simulations of
a variety of molecular properties."""
homepage = "http://www.psicode.org/"
url = "https://github.com/psi4/psi4/archive/0.5.tar.gz"
version('0.5', '53041b8a9be3958384171d0d22f9fdd0')
# Required dependencies
depends_on('blas')
depends_on('lapack')
depends_on('boost+chrono+filesystem+python+regex+serialization+system+timer+thread')
depends_on('python')
depends_on('cmake')
depends_on('py-numpy')
# Optional dependencies
# TODO: add packages for these
# depends_on('perl')
# depends_on('erd')
# depends_on('pcm-solver')
# depends_on('chemps2')
def install(self, spec, prefix):
cmake_args = [
'-DBLAS_TYPE={0}'.format(spec['blas'].name.upper()),
'-DBLAS_LIBRARIES={0}'.format(spec['blas'].blas_shared_lib),
'-DLAPACK_TYPE={0}'.format(spec['lapack'].name.upper()),
'-DLAPACK_LIBRARIES={0}'.format(spec['lapack'].lapack_shared_lib),
'-DBOOST_INCLUDEDIR={0}'.format(spec['boost'].prefix.include),
'-DBOOST_LIBRARYDIR={0}'.format(spec['boost'].prefix.lib),
'-DENABLE_CHEMPS2=OFF'
]
cmake_args.extend(std_cmake_args)
with working_dir('spack-build', create=True):
cmake('..', *cmake_args)
make()
make('install')
self.filter_compilers(spec, prefix)
def filter_compilers(self, spec, prefix):
"""Run after install to tell the configuration files to
use the compilers that Spack built the package with.
If this isn't done, they'll have PLUGIN_CXX set to
Spack's generic cxx. We want it to be bound to
whatever compiler it was built with."""
kwargs = {'ignore_absent': True, 'backup': False, 'string': True}
cc_files = ['bin/psi4-config']
cxx_files = ['bin/psi4-config', 'include/psi4/psiconfig.h']
template = 'share/psi4/plugin/Makefile.template'
for filename in cc_files:
filter_file(os.environ['CC'], self.compiler.cc,
os.path.join(prefix, filename), **kwargs)
for filename in cxx_files:
filter_file(os.environ['CXX'], self.compiler.cxx,
os.path.join(prefix, filename), **kwargs)
# The binary still keeps track of the compiler used to install Psi4
# and uses it when creating a plugin template
filter_file('@PLUGIN_CXX@', self.compiler.cxx,
os.path.join(prefix, template), **kwargs)
# The binary links to the build include directory instead of the
# installation include directory:
# https://github.com/psi4/psi4/issues/410
filter_file('@PLUGIN_INCLUDES@', '-I{0}'.format(
' -I'.join([
os.path.join(spec['psi4'].prefix.include, 'psi4'),
os.path.join(spec['boost'].prefix.include, 'boost'),
os.path.join(spec['python'].prefix.include, 'python{0}'.format(
spec['python'].version.up_to(2))),
spec['lapack'].prefix.include,
spec['blas'].prefix.include,
'/usr/include'
])
), os.path.join(prefix, template), **kwargs)

View File

@ -24,15 +24,33 @@
############################################################################## ##############################################################################
from spack import * from spack import *
class RBiocgenerics(Package): class RBiocgenerics(Package):
"""S4 generic functions needed by many Bioconductor packages.""" """S4 generic functions needed by many Bioconductor packages."""
homepage = 'https://www.bioconductor.org/packages/release/bioc/html/BiocGenerics.html' homepage = 'https://bioconductor.org/packages/BiocGenerics/'
url = "https://www.bioconductor.org/packages/release/bioc/src/contrib/BiocGenerics_0.16.1.tar.gz" version('bioc-3.3',
git='https://github.com/Bioconductor-mirror/BiocGenerics.git',
version('0.16.1', 'c2148ffd86fc6f1f819c7f68eb2c744f', expand=False) branch='release-3.3')
version('bioc-3.2',
git='https://github.com/Bioconductor-mirror/BiocGenerics.git',
branch='release-3.2')
extends('R') extends('R')
def validate(self, spec):
"""
Checks that the version of R is appropriate for the Bioconductor
version.
"""
if spec.satisfies('@bioc-3.3'):
if not spec.satisfies('^R@3.3.0:3.3.9'):
raise InstallError('Must use R-3.3 for Bioconductor-3.3')
elif spec.satisfies('@bioc-3.2'):
if not spec.satisfies('^R@3.2.0:3.2.9'):
raise InstallError('Must use R-3.2 for Bioconductor-3.2')
def install(self, spec, prefix): def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library=%s' % self.module.r_lib_dir, '%s' % self.stage.archive_file) self.validate(spec)
R('CMD', 'INSTALL', '--library=%s' %
self.module.r_lib_dir, '%s' % self.stage.source_path)

View File

@ -0,0 +1,46 @@
##############################################################################
# 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 RR6(Package):
"""The R6 package allows the creation of classes with reference semantics,
similar to R's built-in reference classes. Compared to reference classes,
R6 classes are simpler and lighter-weight, and they are not built on S4
classes so they do not require the methods package. These classes allow
public and private members, and they support inheritance, even when the
classes are defined in different packages."""
homepage = "https://github.com/wch/R6/"
url = "https://cran.r-project.org/src/contrib/R6_2.1.2.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/R6"
version('2.1.2', 'b6afb9430e48707be87638675390e457')
extends('R')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -24,6 +24,7 @@
############################################################################## ##############################################################################
from spack import * from spack import *
class RAbind(Package): class RAbind(Package):
"""Combine multidimensional arrays into a single array. This is a """Combine multidimensional arrays into a single array. This is a
generalization of 'cbind' and 'rbind'. Works with vectors, matrices, and generalization of 'cbind' and 'rbind'. Works with vectors, matrices, and
@ -32,11 +33,12 @@ class RAbind(Package):
homepage = "https://cran.r-project.org/" homepage = "https://cran.r-project.org/"
url = "https://cran.r-project.org/src/contrib/abind_1.4-3.tar.gz" url = "https://cran.r-project.org/src/contrib/abind_1.4-3.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/abind"
version('1.4-3', '10fcf80c677b991bf263d38be35a1fc5', expand=False) version('1.4-3', '10fcf80c677b991bf263d38be35a1fc5')
extends('R') extends('R')
def install(self, spec, prefix): def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
R('CMD', 'INSTALL', '--library=%s' % self.module.r_lib_dir, '%s' % self.stage.archive_file) self.stage.source_path)

View File

@ -0,0 +1,51 @@
##############################################################################
# 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 RCurl(Package):
"""The curl() and curl_download() functions provide highly configurable
drop-in replacements for base url() and download.file() with better
performance, support for encryption (https, ftps), gzip compression,
authentication, and other libcurl goodies. The core of the package
implements a framework for performing fully customized requests where data
can be processed either in memory, on disk, or streaming via the callback
or connection interfaces. Some knowledge of libcurl is recommended; for a
more-user-friendly web client see the 'httr' package which builds on this
package with http specific tools and logic."""
homepage = "https://github.com/jeroenooms/curl"
url = "https://cran.r-project.org/src/contrib/curl_0.9.7.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/RCurl"
version('0.9.7', 'a101f7de948cb828fef571c730f39217')
extends('R')
depends_on('curl')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,50 @@
##############################################################################
# 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 RDevtools(Package):
"""Collection of package development tools."""
homepage = "https://github.com/hadley/devtools"
url = "https://cran.r-project.org/src/contrib/devtools_1.11.1.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/devtools"
version('1.11.1', '242672ee27d24dddcbdaac88c586b6c2')
extends('R')
depends_on('r-httr')
depends_on('r-memoise')
depends_on('r-whisker')
depends_on('r-digest')
depends_on('r-rstudioapi')
depends_on('r-jsonlite')
depends_on('r-git2r')
depends_on('r-withr')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,56 @@
##############################################################################
# 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 RDigest(Package):
"""Implementation of a function 'digest()' for the creation of hash digests
of arbitrary R objects (using the md5, sha-1, sha-256, crc32, xxhash and
murmurhash algorithms) permitting easy comparison of R language objects, as
well as a function 'hmac()' to create hash-based message authentication
code. The md5 algorithm by Ron Rivest is specified in RFC 1321, the sha-1
and sha-256 algorithms are specified in FIPS-180-1 and FIPS-180-2, and the
crc32 algorithm is described in
ftp://ftp.rocksoft.com/cliens/rocksoft/papers/crc_v3.txt. For md5, sha-1,
sha-256 and aes, this package uses small standalone implementations that
were provided by Christophe Devine. For crc32, code from the zlib library
is used. For sha-512, an implementation by Aaron D. Gifford is used. For
xxhash, the implementation by Yann Collet is used. For murmurhash, an
implementation by Shane Day is used. Please note that this package is not
meant to be deployed for cryptographic purposes for which more
comprehensive (and widely tested) libraries such as OpenSSL should be
used."""
homepage = "http://dirk.eddelbuettel.com/code/digest.html"
url = "https://cran.r-project.org/src/contrib/digest_0.6.9.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/digest"
version('0.6.9', '48048ce6c466bdb124716e45ba4a0e83')
extends('R')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -24,6 +24,7 @@
############################################################################## ##############################################################################
from spack import * from spack import *
class RFilehash(Package): class RFilehash(Package):
"""Implements a simple key-value style database where character string keys """Implements a simple key-value style database where character string keys
are associated with data values that are stored on the disk. A simple are associated with data values that are stored on the disk. A simple
@ -37,10 +38,12 @@ class RFilehash(Package):
homepage = 'https://cran.r-project.org/' homepage = 'https://cran.r-project.org/'
url = "https://cran.r-project.org/src/contrib/filehash_2.3.tar.gz" url = "https://cran.r-project.org/src/contrib/filehash_2.3.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/filehash"
version('2.3', '01fffafe09b148ccadc9814c103bdc2f', expand=False) version('2.3', '01fffafe09b148ccadc9814c103bdc2f')
extends('R') extends('R')
def install(self, spec, prefix): def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library=%s' % self.module.r_lib_dir, '%s' % self.stage.archive_file) R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,46 @@
##############################################################################
# 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 RGit2r(Package):
"""Interface to the 'libgit2' library, which is a pure C implementation of
the 'Git' core methods. Provides access to 'Git' repositories to extract
data and running some basic 'Git' commands."""
homepage = "https://github.com/ropensci/git2r"
url = "https://cran.r-project.org/src/contrib/git2r_0.15.0.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/git2r"
version('0.15.0', '57658b3298f9b9aadc0dd77b4ef6a1e1')
extends('R')
depends_on('zlib')
depends_on('openssl')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,49 @@
##############################################################################
# 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 RHttr(Package):
"""Useful tools for working with HTTP organised by HTTP verbs (GET(),
POST(), etc). Configuration functions make it easy to control additional
request components (authenticate(), add_headers() and so on)."""
homepage = "https://github.com/hadley/httr"
url = "https://cran.r-project.org/src/contrib/httr_1.1.0.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/httr"
version('1.1.0', '5ffbbc5c2529e49f00aaa521a2b35600')
extends('R')
depends_on('r-jsonlite')
depends_on('r-mime')
depends_on('r-curl')
depends_on('r-openssl')
depends_on('r-R6')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,50 @@
##############################################################################
# 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 RJsonlite(Package):
"""A fast JSON parser and generator optimized for statistical data and the
web. Started out as a fork of 'RJSONIO', but has been completely rewritten
in recent versions. The package offers flexible, robust, high performance
tools for working with JSON in R and is particularly powerful for building
pipelines and interacting with a web API. The implementation is based on
the mapping described in the vignette (Ooms, 2014). In addition to
converting JSON data from/to R objects, 'jsonlite' contains functions to
stream, validate, and prettify JSON data. The unit tests included with the
package verify that all edge cases are encoded and decoded consistently for
use with dynamic data in systems and applications."""
homepage = "https://github.com/jeroenooms/jsonlite"
url = "https://cran.r-project.org/src/contrib/jsonlite_0.9.21.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/jsonlite"
version('0.9.21', '4fc382747f88a79ff0718a0d06bed45d')
extends('R')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -24,6 +24,7 @@
############################################################################## ##############################################################################
from spack import * from spack import *
class RMagic(Package): class RMagic(Package):
"""A collection of efficient, vectorized algorithms for the creation and """A collection of efficient, vectorized algorithms for the creation and
investigation of magic squares and hypercubes, including a variety of investigation of magic squares and hypercubes, including a variety of
@ -32,12 +33,14 @@ class RMagic(Package):
homepage = "https://cran.r-project.org/" homepage = "https://cran.r-project.org/"
url = "https://cran.r-project.org/src/contrib/magic_1.5-6.tar.gz" url = "https://cran.r-project.org/src/contrib/magic_1.5-6.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/magic"
version('1.5-6', 'a68e5ced253b2196af842e1fc84fd029', expand=False) version('1.5-6', 'a68e5ced253b2196af842e1fc84fd029')
extends('R') extends('R')
depends_on('r-abind') depends_on('r-abind')
def install(self, spec, prefix): def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library=%s' % self.module.r_lib_dir, '%s' % self.stage.archive_file) R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,44 @@
##############################################################################
# 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 RMemoise(Package):
"""Cache the results of a function so that when you call it again with the
same arguments it returns the pre-computed value."""
homepage = "https://github.com/hadley/memoise"
url = "https://cran.r-project.org/src/contrib/memoise_1.0.0.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/memoise"
version('1.0.0', 'd31145292e2a88ae9a504cab1602e4ac')
extends('R')
depends_on('r-digest')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,42 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class RMime(Package):
"""Guesses the MIME type from a filename extension using the data derived
from /etc/mime.types in UNIX-type systems."""
homepage = "https://github.com/yihui/mime"
url = "https://cran.r-project.org/src/contrib/mime_0.4.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/mime"
version('0.4', '789cb33e41db2206c6fc7c3e9fbc2c02')
extends('R')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,52 @@
##############################################################################
# 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 ROpenssl(Package):
"""Bindings to OpenSSL libssl and libcrypto, plus custom SSH pubkey
parsers. Supports RSA, DSA and EC curves P-256, P-384 and P-521.
Cryptographic signatures can either be created and verified manually or via
x509 certificates. AES can be used in cbc, ctr or gcm mode for symmetric
encryption; RSA for asymmetric (public key) encryption or EC for Diffie
Hellman. High-level envelope functions combine RSA and AES for encrypting
arbitrary sized data. Other utilities include key generators, hash
functions (md5, sha1, sha256, etc), base64 encoder, a secure random number
generator, and 'bignum' math methods for manually performing crypto
calculations on large multibyte integers."""
homepage = "https://github.com/jeroenooms/openssl#readme"
url = "https://cran.r-project.org/src/contrib/openssl_0.9.4.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/openssl"
version('0.9.4', '82a890e71ed0e74499878bedacfb8ccb')
extends('R')
depends_on('openssl')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,42 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class RPackrat(Package):
"""Manage the R packages your project depends on in an isolated, portable,
and reproducible way."""
homepage = "https://github.com/rstudio/packrat/"
url = "https://cran.r-project.org/src/contrib/packrat_0.4.7-1.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/packrat"
version('0.4.7-1', '80c2413269b292ade163a70ba5053e84')
extends('R')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,42 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class RRstudioapi(Package):
"""Access the RStudio API (if available) and provide informative error
messages when it's not."""
homepage = "https://cran.r-project.org/web/packages/rstudioapi/index.html"
url = "https://cran.r-project.org/src/contrib/rstudioapi_0.5.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/rstudioapi"
version('0.5', '6ce1191da74e7bcbf06b61339486b3ba')
extends('R')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,42 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class RWhisker(Package):
"""logicless templating, reuse templates in many programming languages
including R"""
homepage = "http://github.com/edwindj/whisker"
url = "https://cran.r-project.org/src/contrib/whisker_0.3-2.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/whisker"
version('0.3-2', 'c4b9bf9a22e69ce003fe68663ab5e8e6')
extends('R')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -0,0 +1,44 @@
##############################################################################
# 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 RWithr(Package):
"""A set of functions to run code 'with' safely and temporarily modified
global state. Many of these functions were originally a part of the
'devtools' package, this provides a simple package with limited
dependencies to provide access to these functions."""
homepage = "http://github.com/jimhester/withr"
url = "https://cran.r-project.org/src/contrib/withr_1.0.1.tar.gz"
list_url = "https://cran.r-project.org/src/contrib/Archive/withr"
version('1.0.1', 'ac38af2c6f74027c9592dd8f0acb7598')
extends('R')
def install(self, spec, prefix):
R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir),
self.stage.source_path)

View File

@ -34,11 +34,14 @@ class Slepc(Package):
homepage = "http://www.grycap.upv.es/slepc" homepage = "http://www.grycap.upv.es/slepc"
url = "http://slepc.upv.es/download/download.php?filename=slepc-3.6.2.tar.gz" url = "http://slepc.upv.es/download/download.php?filename=slepc-3.6.2.tar.gz"
version('3.7.1', '670216f263e3074b21e0623c01bc0f562fdc0bffcd7bd42dd5d8edbe73a532c2')
version('3.6.3', '384939d009546db37bc05ed81260c8b5ba451093bf891391d32eb7109ccff876')
version('3.6.2', '2ab4311bed26ccf7771818665991b2ea3a9b15f97e29fd13911ab1293e8e65df') version('3.6.2', '2ab4311bed26ccf7771818665991b2ea3a9b15f97e29fd13911ab1293e8e65df')
variant('arpack', default=False, description='Enables Arpack wrappers') variant('arpack', default=True, description='Enables Arpack wrappers')
depends_on('petsc') depends_on('petsc@3.7:', when='@3.7.1:')
depends_on('petsc@3.6.3:3.6.4', when='@3.6.2:3.6.3')
depends_on('arpack-ng~mpi', when='+arpack^petsc~mpi') depends_on('arpack-ng~mpi', when='+arpack^petsc~mpi')
depends_on('arpack-ng+mpi', when='+arpack^petsc+mpi') depends_on('arpack-ng+mpi', when='+arpack^petsc+mpi')

View File

@ -25,14 +25,15 @@
from spack import * from spack import *
import glob import glob
class SuperluDist(Package): class SuperluDist(Package):
"""A general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear equations on high performance machines.""" """A general purpose library for the direct solution of large, sparse,
nonsymmetric systems of linear equations on high performance machines."""
homepage = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" homepage = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_4.1.tar.gz" url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_4.1.tar.gz"
version('5.0.0', '2b53baf1b0ddbd9fcf724992577f0670') version('5.0.0', '2b53baf1b0ddbd9fcf724992577f0670')
# default to version 4.3 since petsc and trilinos are not tested with 5.0. version('4.3', 'ee66c84e37b4f7cc557771ccc3dc43ae')
version('4.3', 'ee66c84e37b4f7cc557771ccc3dc43ae', preferred=True)
version('4.2', 'ae9fafae161f775fbac6eba11e530a65') version('4.2', 'ae9fafae161f775fbac6eba11e530a65')
version('4.1', '4edee38cc29f687bd0c8eb361096a455') version('4.1', '4edee38cc29f687bd0c8eb361096a455')
version('4.0', 'c0b98b611df227ae050bc1635c6940e0') version('4.0', 'c0b98b611df227ae050bc1635c6940e0')
@ -47,28 +48,31 @@ def install(self, spec, prefix):
makefile_inc = [] makefile_inc = []
makefile_inc.extend([ makefile_inc.extend([
'PLAT = _mac_x', 'PLAT = _mac_x',
'DSuperLUroot = %s' % self.stage.source_path, #self.stage.path, prefix 'DSuperLUroot = %s' % self.stage.source_path,
'DSUPERLULIB = $(DSuperLUroot)/lib/libsuperlu_dist.a', 'DSUPERLULIB = $(DSuperLUroot)/lib/libsuperlu_dist.a',
'BLASDEF = -DUSE_VENDOR_BLAS', 'BLASDEF = -DUSE_VENDOR_BLAS',
'BLASLIB = -L%s -llapack %s -lblas' % (spec['lapack'].prefix.lib, spec['blas'].prefix.lib), # FIXME: avoid hardcoding blas/lapack lib names 'BLASLIB = %s %s' %
(to_link_flags(spec['lapack'].lapack_shared_lib),
to_link_flags(spec['blas'].blas_shared_lib)),
'METISLIB = -L%s -lmetis' % spec['metis'].prefix.lib, 'METISLIB = -L%s -lmetis' % spec['metis'].prefix.lib,
'PARMETISLIB = -L%s -lparmetis' % spec['parmetis'].prefix.lib, 'PARMETISLIB = -L%s -lparmetis' % spec['parmetis'].prefix.lib,
'FLIBS =', 'FLIBS =',
'LIBS = $(DSUPERLULIB) $(BLASLIB) $(PARMETISLIB) $(METISLIB)', 'LIBS = $(DSUPERLULIB) $(BLASLIB) $(PARMETISLIB) $(METISLIB)', # NOQA: ignore=E501
'ARCH = ar', 'ARCH = ar',
'ARCHFLAGS = cr', 'ARCHFLAGS = cr',
'RANLIB = true', 'RANLIB = true',
'CC = mpicc', # FIXME avoid hardcoding MPI compiler names 'CC = %s' % spec['mpi'].mpicc,
'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s' %(spec['parmetis'].prefix.include, spec['metis'].prefix.include), 'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s' %
(spec['parmetis'].prefix.include,
spec['metis'].prefix.include),
'NOOPTS = -fPIC -std=c99', 'NOOPTS = -fPIC -std=c99',
'FORTRAN = mpif77', 'FORTRAN = %s' % spec['mpi'].mpif77,
'F90FLAGS = -O2', 'F90FLAGS = -O2',
'LOADER = mpif77', 'LOADER = %s' % spec['mpi'].mpif77,
'LOADOPTS =', 'LOADOPTS =',
'CDEFS = -DAdd_' 'CDEFS = -DAdd_'
]) ])
#with working_dir('src'):
with open('make.inc', 'w') as fh: with open('make.inc', 'w') as fh:
fh.write('\n'.join(makefile_inc)) fh.write('\n'.join(makefile_inc))
@ -87,5 +91,6 @@ def install(self, spec, prefix):
for h in headers: for h in headers:
install(h, headers_location) install(h, headers_location)
superludist_lib = join_path(self.stage.source_path, 'lib/libsuperlu_dist.a') superludist_lib = join_path(self.stage.source_path,
'lib/libsuperlu_dist.a')
install(superludist_lib, self.prefix.lib) install(superludist_lib, self.prefix.lib)

View File

@ -0,0 +1,54 @@
##############################################################################
# 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 Superlu(Package):
"""SuperLU is a general purpose library for the direct solution of large,
sparse, nonsymmetric systems of linear equations on high performance
machines. SuperLU is designed for sequential machines."""
homepage = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/#superlu"
url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_5.2.1.tar.gz"
version('5.2.1', '3a1a9bff20cb06b7d97c46d337504447')
depends_on('blas')
def install(self, spec, prefix):
cmake_args = [
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
# BLAS support
'-Denable_blaslib=OFF',
'-DBLAS_blas_LIBRARY={0}'.format(spec['blas'].blas_shared_lib)
]
cmake_args.extend(std_cmake_args)
with working_dir('spack-build', create=True):
cmake('..', *cmake_args)
make()
make('install')

View File

@ -24,26 +24,33 @@
############################################################################## ##############################################################################
from spack import * from spack import *
class Tmux(Package): class Tmux(Package):
"""tmux is a terminal multiplexer. What is a terminal multiplexer? It lets """tmux is a terminal multiplexer. What is a terminal multiplexer? It lets
you switch easily between several programs in one terminal, detach them (they you switch easily between several programs in one terminal, detach them
keep running in the background) and reattach them to a different terminal. And (they keep running in the background) and reattach them to a different
do a lot more. terminal. And do a lot more.
""" """
homepage = "http://tmux.github.io" homepage = "http://tmux.github.io"
url = "https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz" url = "https://github.com/tmux/tmux/releases/download/2.2/tmux-2.2.tar.gz"
version('1.9a', 'b07601711f96f1d260b390513b509a2d') version('1.9a', 'b07601711f96f1d260b390513b509a2d')
version('2.1', '74a2855695bccb51b6e301383ad4818c') version('2.1', '74a2855695bccb51b6e301383ad4818c')
version('2.2', 'bd95ee7205e489c62c616bb7af040099')
depends_on('libevent') depends_on('libevent')
depends_on('ncurses') depends_on('ncurses')
def install(self, spec, prefix): def install(self, spec, prefix):
pkg_config_path = ':'.join([
spec['libevent'].prefix,
spec['ncurses'].prefix
])
configure( configure(
"--prefix=%s" % prefix, "--prefix=%s" % prefix,
"PKG_CONFIG_PATH=%s:%s" % (spec['libevent'].prefix, spec['ncurses'].prefix)) "PKG_CONFIG_PATH=%s" % pkg_config_path)
make() make()
make("install") make("install")

View File

@ -45,6 +45,8 @@ class Trilinos(Package):
homepage = "https://trilinos.org/" homepage = "https://trilinos.org/"
url = "http://trilinos.csbsju.edu/download/files/trilinos-12.2.1-Source.tar.gz" url = "http://trilinos.csbsju.edu/download/files/trilinos-12.2.1-Source.tar.gz"
version('12.6.3', '960f5f4d3f7c3da818e5a5fb4684559eff7e0c25f959ef576561b8a52f0e4d1e')
version('12.6.2', '0c076090508170ddee5efeed317745027f9418319720dc40a072e478775279f9')
version('12.6.1', 'adcf2d3aab74cdda98f88fee19cd1442604199b0515ee3da4d80cbe8f37d00e4') version('12.6.1', 'adcf2d3aab74cdda98f88fee19cd1442604199b0515ee3da4d80cbe8f37d00e4')
version('12.4.2', '7c830f7f0f68b8ad324690603baf404e') version('12.4.2', '7c830f7f0f68b8ad324690603baf404e')
version('12.2.1', '6161926ea247863c690e927687f83be9') version('12.2.1', '6161926ea247863c690e927687f83be9')
@ -89,7 +91,8 @@ class Trilinos(Package):
# work at the end. But let's avoid all this by simply using shared libs # work at the end. But let's avoid all this by simply using shared libs
depends_on('mumps@5.0:+mpi+shared', when='+mumps') depends_on('mumps@5.0:+mpi+shared', when='+mumps')
depends_on('scalapack', when='+mumps') depends_on('scalapack', when='+mumps')
depends_on('superlu-dist', when='+superlu-dist') depends_on('superlu-dist@:4.3', when='@:12.6.1+superlu-dist')
depends_on('superlu-dist', when='@12.6.2:+superlu-dist')
depends_on('hypre~internal-superlu', when='+hypre') depends_on('hypre~internal-superlu', when='+hypre')
depends_on('hdf5+mpi', when='+hdf5') depends_on('hdf5+mpi', when='+hdf5')
depends_on('python', when='+python') depends_on('python', when='+python')