diff options
82 files changed, 2501 insertions, 272 deletions
@@ -79,6 +79,15 @@ # Obviously, for this to work, `sbang` needs to have a short enough # path that *it* will run without hitting OS limits. # +# For Lua, scripts the second line can't start with #!, as # is not +# the comment character in lua (even though lua ignores #! on the +# *first* line of a script). So, instrument a lua script like this, +# using -- instead of # on the second line: +# +# 1 #!/bin/bash /path/to/sbang +# 2 --!/long/path/to/lua with arguments +# 3 +# 4 print "success!" # # How it works # ----------------------------- @@ -95,6 +104,8 @@ lines=0 while read line && ((lines < 2)) ; do if [[ "$line" = '#!'* ]]; then interpreter="${line#\#!}" + elif [[ "$line" = '--!'*lua* ]]; then + interpreter="${line#--!}" fi lines=$((lines+1)) done < "$script" @@ -77,7 +77,7 @@ import llnl.util.tty as tty from llnl.util.tty.color import * import spack from spack.error import SpackError -from external import argparse +import argparse # Command parsing parser = argparse.ArgumentParser( diff --git a/lib/spack/docs/configuration.rst b/lib/spack/docs/configuration.rst index c613071c65..a6f876b2aa 100644 --- a/lib/spack/docs/configuration.rst +++ b/lib/spack/docs/configuration.rst @@ -140,7 +140,6 @@ Here's an example packages.yaml file that sets preferred packages: packages: dyninst: compiler: [gcc@4.9] - variants: +debug gperftools: version: [2.2, 2.4, 2.3] all: @@ -150,8 +149,8 @@ Here's an example packages.yaml file that sets preferred packages: At a high level, this example is specifying how packages should be -concretized. The dyninst package should prefer using gcc 4.9 and -be built with debug options. The gperftools package should prefer version +concretized. The dyninst package should prefer using gcc 4.9. +The gperftools package should prefer version 2.2 over 2.4. Every package on the system should prefer mvapich for its MPI and gcc 4.4.7 (except for Dyninst, which overrides this by preferring gcc 4.9). These options are used to fill in implicit defaults. Any of them can be overwritten @@ -160,7 +159,7 @@ on the command line if explicitly requested. Each packages.yaml file begins with the string ``packages:`` and package names are specified on the next level. The special string ``all`` applies settings to each package. Underneath each package name is -one or more components: ``compiler``, ``variants``, ``version``, +one or more components: ``compiler``, ``version``, or ``providers``. Each component has an ordered list of spec ``constraints``, with earlier entries in the list being preferred over later entries. diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index d72e8bae92..e800c6717a 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -48,7 +48,7 @@ __all__ = ['set_install_permissions', 'install', 'install_tree', def filter_file(regex, repl, *filenames, **kwargs): """Like sed, but uses python regular expressions. - Filters every line of file through regex and replaces the file + Filters every line of each file through regex and replaces the file with a filtered version. Preserves mode of filtered files. As with re.sub, ``repl`` can be either a string or a callable. @@ -59,7 +59,7 @@ def filter_file(regex, repl, *filenames, **kwargs): Keyword Options: string[=False] If True, treat regex as a plain string. - backup[=True] Make a backup files suffixed with ~ + backup[=True] Make backup file(s) suffixed with ~ ignore_absent[=False] Ignore any files that don't exist. """ string = kwargs.get('string', False) @@ -80,26 +80,26 @@ def filter_file(regex, repl, *filenames, **kwargs): regex = re.escape(regex) for filename in filenames: - backup = filename + "~" + backup_filename = filename + "~" if ignore_absent and not os.path.exists(filename): continue - shutil.copy(filename, backup) + shutil.copy(filename, backup_filename) try: - with closing(open(backup)) as infile: + with closing(open(backup_filename)) as infile: with closing(open(filename, 'w')) as outfile: for line in infile: foo = re.sub(regex, repl, line) outfile.write(foo) except: # clean up the original file on failure. - shutil.move(backup, filename) + shutil.move(backup_filename, filename) raise finally: if not backup: - shutil.rmtree(backup, ignore_errors=True) + os.remove(backup_filename) class FileFilter(object): @@ -114,7 +114,7 @@ class FileFilter(object): def change_sed_delimiter(old_delim, new_delim, *filenames): """Find all sed search/replace commands and change the delimiter. e.g., if the file contains seds that look like 's///', you can - call change_sed_delimeter('/', '@', file) to change the + call change_sed_delimiter('/', '@', file) to change the delimiter to '@'. NOTE that this routine will fail if the delimiter is ' or ". @@ -179,7 +179,7 @@ def install(src, dest): """Manually install a file to a particular location.""" tty.debug("Installing %s to %s" % (src, dest)) - # Expand dsst to its eventual full path if it is a directory. + # Expand dest to its eventual full path if it is a directory. if os.path.isdir(dest): dest = join_path(dest, os.path.basename(src)) @@ -219,7 +219,7 @@ def mkdirp(*paths): if not os.path.exists(path): os.makedirs(path) elif not os.path.isdir(path): - raise OSError(errno.EEXIST, "File alredy exists", path) + raise OSError(errno.EEXIST, "File already exists", path) def force_remove(*paths): @@ -309,7 +309,7 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs): Optional args: - order=[pre|post] -- Whether to do pre- or post-order traveral. + order=[pre|post] -- Whether to do pre- or post-order traversal. ignore=<predicate> -- Predicate indicating which files to ignore. @@ -414,7 +414,7 @@ def fix_darwin_install_name(path): currently won't follow subfolders. Args: - path: directory in which .dylib files are alocated + path: directory in which .dylib files are located """ libs = glob.glob(join_path(path, "*.dylib")) @@ -438,7 +438,7 @@ def to_link_flags(library): A string of linking flags. """ dir = os.path.dirname(library) - # Asume libXYZ.suffix + # Assume libXYZ.suffix name = os.path.basename(library)[3:].split(".")[0] res = '-L%s -l%s' % (dir, name) return res diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py index cbac7b41d6..a7cda2bf68 100644 --- a/lib/spack/spack/architecture.py +++ b/lib/spack/spack/architecture.py @@ -91,16 +91,10 @@ from spack.util.multiproc import parmap import spack.error as serr -class InvalidSysTypeError(serr.SpackError): - def __init__(self, sys_type): - super(InvalidSysTypeError, self).__init__( - "Invalid sys_type value for Spack: " + sys_type) - - -class NoSysTypeError(serr.SpackError): +class NoPlatformError(serr.SpackError): def __init__(self): - super(NoSysTypeError, self).__init__( - "Could not determine sys_type for this machine.") + super(NoPlatformError, self).__init__( + "Could not determine a platform for this machine.") @key_ordering @@ -345,14 +339,17 @@ class OperatingSystem(object): @key_ordering class Arch(object): - "Architecture is now a class to help with setting attributes" - - def __init__(self, platform=None, platform_os=None, target=None): - self.platform = platform - if platform and platform_os: - platform_os = self.platform.operating_system(platform_os) - self.platform_os = platform_os - if platform and target: + """Architecture is now a class to help with setting attributes. + + TODO: refactor so that we don't need this class. + """ + + def __init__(self, plat=None, os=None, target=None): + self.platform = plat + if plat and os: + os = self.platform.operating_system(os) + self.platform_os = os + if plat and target: target = self.platform.target(target) self.target = target @@ -409,27 +406,27 @@ class Arch(object): return d -def _target_from_dict(target_name, platform=None): +def _target_from_dict(target_name, plat=None): """ Creates new instance of target and assigns all the attributes of that target from the dictionary """ - if not platform: - platform = sys_type() - return platform.target(target_name) + if not plat: + plat = platform() + return plat.target(target_name) -def _operating_system_from_dict(os_name, platform=None): +def _operating_system_from_dict(os_name, plat=None): """ uses platform's operating system method to grab the constructed operating systems that are valid on the platform. """ - if not platform: - platform = sys_type() + if not plat: + plat = platform() if isinstance(os_name, dict): name = os_name['name'] version = os_name['version'] - return platform.operating_system(name+version) + return plat.operating_system(name+version) else: - return platform.operating_system(os_name) + return plat.operating_system(os_name) def _platform_from_dict(platform_name): @@ -504,16 +501,35 @@ def all_platforms(): @memoized -def sys_type(): - """ Gather a list of all available subclasses of platforms. - Sorts the list according to their priority looking. Priority is - an arbitrarily set number. Detects platform either using uname or - a file path (/opt/cray...) +def platform(): + """Detects the platform for this machine. + + Gather a list of all available subclasses of platforms. + Sorts the list according to their priority looking. Priority is + an arbitrarily set number. Detects platform either using uname or + a file path (/opt/cray...) """ # Try to create a Platform object using the config file FIRST platform_list = all_platforms() platform_list.sort(key=lambda a: a.priority) - for platform in platform_list: - if platform.detect(): - return platform() + for platform_cls in platform_list: + if platform_cls.detect(): + return platform_cls() + + +@memoized +def sys_type(): + """Print out the "default" platform-os-target tuple for this machine. + + On machines with only one target OS/target, prints out the + platform-os-target for the frontend. For machines with a frontend + and a backend, prints the default backend. + + TODO: replace with use of more explicit methods to get *all* the + backends, as client code should really be aware of cross-compiled + architectures. + + """ + arch = Arch(platform(), 'default_os', 'default_target') + return str(arch) diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 60703a9df9..99c4cae020 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -63,7 +63,7 @@ from llnl.util.filesystem import * import spack from spack.environment import EnvironmentModifications, validate from spack.util.environment import * -from spack.util.executable import Executable +from spack.util.executable import Executable, which # # This can be set by the user to globally disable parallel builds. diff --git a/lib/spack/spack/cmd/repo.py b/lib/spack/spack/cmd/repo.py index 399237b169..cbd8f4784e 100644 --- a/lib/spack/spack/cmd/repo.py +++ b/lib/spack/spack/cmd/repo.py @@ -26,7 +26,7 @@ import os import re import shutil -from external import argparse +import argparse import llnl.util.tty as tty from llnl.util.filesystem import join_path, mkdirp diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py index a70d42982f..0ba94741da 100644 --- a/lib/spack/spack/compilers/__init__.py +++ b/lib/spack/spack/compilers/__init__.py @@ -93,7 +93,7 @@ def get_compiler_config(scope=None, init_config=True): for compiler in compilers: compilers_dict.append(_to_dict(compiler)) spack.config.update_config('compilers', compilers_dict, scope=scope) - + config = spack.config.get_config('compilers', scope=scope) # Update the configuration if there are currently no compilers # configured. Avoid updating automatically if there ARE site @@ -142,8 +142,8 @@ def remove_compiler_from_config(compiler_spec, scope=None): """ compiler_config = get_compiler_config(scope) config_length = len(compiler_config) - - filtered_compiler_config = [comp for comp in compiler_config + + filtered_compiler_config = [comp for comp in compiler_config if spack.spec.CompilerSpec(comp['compiler']['spec']) != compiler_spec] # Need a better way for this global _cache_config_file @@ -315,7 +315,7 @@ def all_os_classes(): """ classes = [] - platform = spack.architecture.sys_type() + platform = spack.architecture.platform() for os_class in platform.operating_sys.values(): classes.append(os_class) diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index 1f37455c77..f792008c49 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -221,7 +221,7 @@ class DefaultConcretizer(object): if isinstance(spec.root.architecture.platform,spack.architecture.Platform): spec.architecture.platform = spec.root.architecture.platform else: - spec.architecture.platform = spack.architecture.sys_type() + spec.architecture.platform = spack.architecture.platform() return True #changed? def concretize_architecture(self, spec): @@ -334,7 +334,7 @@ class DefaultConcretizer(object): Default specs set at the compiler level will still be added later. """ - + if not spec.architecture.platform_os: #Although this usually means changed, this means awaiting other changes return True @@ -347,7 +347,7 @@ class DefaultConcretizer(object): and flag in p.compiler_flags)) if not flag in spec.compiler_flags or \ not (sorted(spec.compiler_flags[flag]) >= sorted(nearest.compiler_flags[flag])): - if flag in spec.compiler_flags: + if flag in spec.compiler_flags: spec.compiler_flags[flag] = list(set(spec.compiler_flags[flag]) | set(nearest.compiler_flags[flag])) else: diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index db0787edc6..84179e1469 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -307,6 +307,8 @@ section_schemas = { 'autoload': {'$ref': '#/definitions/dependency_selection'}, 'prerequisites': {'$ref': '#/definitions/dependency_selection'}, 'conflict': {'$ref': '#/definitions/array_of_strings'}, + 'load': {'$ref': '#/definitions/array_of_strings'}, + 'suffixes': {'$ref': '#/definitions/dictionary_of_strings'}, 'environment': { 'type': 'object', 'default': {}, diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py index f941346bb1..a4bbff3d5a 100644 --- a/lib/spack/spack/database.py +++ b/lib/spack/spack/database.py @@ -631,11 +631,13 @@ class WriteTransaction(_Transaction): class CorruptDatabaseError(SpackError): def __init__(self, path, msg=''): super(CorruptDatabaseError, self).__init__( - "Spack database is corrupt: %s. %s" % (path, msg)) + "Spack database is corrupt: %s. %s." + \ + "Try running `spack reindex` to fix." % (path, msg)) class InvalidDatabaseVersionError(SpackError): def __init__(self, expected, found): super(InvalidDatabaseVersionError, self).__init__( - "Expected database version %s but found version %s" % + "Expected database version %s but found version %s." + \ + "Try running `spack reindex` to fix." % (expected, found)) diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index 7e20365b0f..ee13e2dcbc 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -165,7 +165,7 @@ class DirectoryLayout(object): class YamlDirectoryLayout(DirectoryLayout): """Lays out installation directories like this:: <install root>/ - <target>/ + <platform-os-target>/ <compiler>-<compiler version>/ <name>-<version>-<variants>-<hash> diff --git a/lib/spack/spack/hooks/sbang.py b/lib/spack/spack/hooks/sbang.py index cb0ad42b14..3a957c6e0e 100644 --- a/lib/spack/spack/hooks/sbang.py +++ b/lib/spack/spack/hooks/sbang.py @@ -23,6 +23,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## import os +import re import llnl.util.tty as tty @@ -57,11 +58,15 @@ def filter_shebang(path): if original.startswith(new_sbang_line): return + # Use --! instead of #! on second line for lua. + if re.search(r'^#!(/[^/]*)*lua\b', original): + original = re.sub(r'^#', '--', original) + with open(path, 'w') as new_file: new_file.write(new_sbang_line) new_file.write(original) - tty.warn("Patched overly long shebang in %s" % path) + tty.warn("Patched overlong shebang in %s" % path) def filter_shebangs_in_directory(directory): diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index d2b819e80a..ce46047fa3 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -285,11 +285,18 @@ class EnvModule(object): naming_tokens = self.tokens naming_scheme = self.naming_scheme name = naming_scheme.format(**naming_tokens) - name += '-' + self.spec.dag_hash( - ) # Always append the hash to make the module file unique # Not everybody is working on linux... parts = name.split('/') name = join_path(*parts) + # Add optional suffixes based on constraints + configuration, _ = parse_config_options(self) + suffixes = [name] + for constraint, suffix in configuration.get('suffixes', {}).items(): + if constraint in self.spec: + suffixes.append(suffix) + # Always append the hash to make the module file unique + suffixes.append(self.spec.dag_hash()) + name = '-'.join(suffixes) return name @property @@ -381,6 +388,8 @@ class EnvModule(object): for x in filter_blacklisted( module_configuration.pop('autoload', []), self.name): module_file_content += self.autoload(x) + for x in module_configuration.pop('load', []): + module_file_content += self.autoload(x) for x in filter_blacklisted( module_configuration.pop('prerequisites', []), self.name): module_file_content += self.prerequisite(x) @@ -402,8 +411,12 @@ class EnvModule(object): return tuple() def autoload(self, spec): - m = type(self)(spec) - return self.autoload_format.format(module_file=m.use_name) + if not isinstance(spec, str): + m = type(self)(spec) + module_file = m.use_name + else: + module_file = spec + return self.autoload_format.format(module_file=module_file) def prerequisite(self, spec): m = type(self)(spec) @@ -441,7 +454,6 @@ class EnvModule(object): class Dotkit(EnvModule): name = 'dotkit' - path = join_path(spack.share_path, "dotkit") environment_modifications_formats = { PrependPath: 'dk_alter {name} {value}\n', @@ -454,7 +466,7 @@ class Dotkit(EnvModule): @property def file_name(self): - return join_path(Dotkit.path, self.spec.architecture, + return join_path(spack.share_path, "dotkit", self.spec.architecture, '%s.dk' % self.use_name) @property @@ -482,7 +494,6 @@ class Dotkit(EnvModule): class TclModule(EnvModule): name = 'tcl' - path = join_path(spack.share_path, "modules") environment_modifications_formats = { PrependPath: 'prepend-path --delim "{delim}" {name} \"{value}\"\n', @@ -503,7 +514,7 @@ class TclModule(EnvModule): @property def file_name(self): - return join_path(TclModule.path, self.spec.architecture, self.use_name) + return join_path(spack.share_path, "modules", self.spec.architecture, self.use_name) @property def header(self): diff --git a/lib/spack/spack/multimethod.py b/lib/spack/spack/multimethod.py index 170ef3cea2..0818f9092f 100644 --- a/lib/spack/spack/multimethod.py +++ b/lib/spack/spack/multimethod.py @@ -149,7 +149,7 @@ class when(object): @when('arch=chaos_5_x86_64_ib') def install(self, prefix): # This will be executed instead of the default install if - # the package's sys_type() is chaos_5_x86_64_ib. + # the package's platform() is chaos_5_x86_64_ib. @when('arch=bgqos_0") def install(self, prefix): diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 98fd51b262..6a61b3d52b 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -398,6 +398,12 @@ class Package(object): spack.repo.get(self.extendee_spec)._check_extendable() @property + def package_dir(self): + """Return the directory where the package.py file lives.""" + return os.path.dirname(self.module.__file__) + + + @property def global_license_dir(self): """Returns the directory where global license files for all packages are stored.""" @@ -687,7 +693,7 @@ class Package(object): """Get the spack.compiler.Compiler object used to build this package""" if not self.spec.concrete: raise ValueError("Can only get a compiler for a concrete package.") - return spack.compilers.compiler_for_spec(self.spec.compiler, + return spack.compilers.compiler_for_spec(self.spec.compiler, self.spec.architecture) def url_version(self, version): diff --git a/lib/spack/spack/repository.py b/lib/spack/spack/repository.py index 70134964ad..2c160a5f45 100644 --- a/lib/spack/spack/repository.py +++ b/lib/spack/spack/repository.py @@ -30,7 +30,7 @@ import imp import re import traceback from bisect import bisect_left -from external import yaml +import yaml import llnl.util.tty as tty from llnl.util.filesystem import * diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 54219ec1b4..77bc57147d 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -2216,7 +2216,7 @@ class SpecParser(spack.parse.Parser): for spec in specs: for s in spec.traverse(): if s.architecture.os_string or s.architecture.target_string: - s._set_platform(spack.architecture.sys_type()) + s._set_platform(spack.architecture.platform()) return specs def parse_compiler(self, text): diff --git a/lib/spack/spack/test/architecture.py b/lib/spack/spack/test/architecture.py index a6847c5744..ae3f08deed 100644 --- a/lib/spack/spack/test/architecture.py +++ b/lib/spack/spack/test/architecture.py @@ -5,7 +5,7 @@ import unittest import os import platform as py_platform import spack -from spack.architecture import * +import spack.architecture from spack.spec import * from spack.platforms.cray_xc import CrayXc from spack.platforms.linux import Linux @@ -19,14 +19,14 @@ class ArchitectureTest(MockPackagesTest): def setUp(self): super(ArchitectureTest, self).setUp() - self.platform = sys_type() + self.platform = spack.architecture.platform() def tearDown(self): super(ArchitectureTest, self).tearDown() def test_dict_functions_for_architecture(self): - arch = Arch() - arch.platform = spack.architecture.sys_type() + arch = spack.architecture.Arch() + arch.platform = spack.architecture.platform() arch.platform_os = arch.platform.operating_system('default_os') arch.target = arch.platform.target('default_target') @@ -36,18 +36,23 @@ class ArchitectureTest(MockPackagesTest): self.assertEqual(arch, new_arch) - self.assertTrue( isinstance(arch, Arch) ) - self.assertTrue( isinstance(arch.platform, Platform) ) - self.assertTrue( isinstance(arch.platform_os, OperatingSystem) ) - self.assertTrue( isinstance(arch.target, Target) ) - self.assertTrue( isinstance(new_arch, Arch) ) - self.assertTrue( isinstance(new_arch.platform, Platform) ) - self.assertTrue( isinstance(new_arch.platform_os, OperatingSystem) ) - self.assertTrue( isinstance(new_arch.target, Target) ) - - - def test_sys_type(self): - output_platform_class = sys_type() + self.assertTrue( isinstance(arch, spack.architecture.Arch) ) + self.assertTrue( isinstance(arch.platform, spack.architecture.Platform) ) + self.assertTrue( isinstance(arch.platform_os, + spack.architecture.OperatingSystem) ) + self.assertTrue( isinstance(arch.target, + spack.architecture.Target) ) + self.assertTrue( isinstance(new_arch, spack.architecture.Arch) ) + self.assertTrue( isinstance(new_arch.platform, + spack.architecture.Platform) ) + self.assertTrue( isinstance(new_arch.platform_os, + spack.architecture.OperatingSystem) ) + self.assertTrue( isinstance(new_arch.target, + spack.architecture.Target) ) + + + def test_platform(self): + output_platform_class = spack.architecture.platform() my_arch_class = None if os.path.exists('/opt/cray/craype'): my_platform_class = CrayXc() diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index ab201f406a..ce02b08bc3 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -257,8 +257,8 @@ class ConcretizeTest(MockPackagesTest): def test_external_package_module(self): # No tcl modules on darwin/linux machines # TODO: improved way to check for this. - if (spack.architecture.sys_type().name == 'darwin' or - spack.architecture.sys_type().name == 'linux'): + if (spack.architecture.platform().name == 'darwin' or + spack.architecture.platform().name == 'linux'): return spec = Spec('externalmodule') diff --git a/lib/spack/spack/test/install.py b/lib/spack/spack/test/install.py index cfe6ea9b27..390ec096a9 100644 --- a/lib/spack/spack/test/install.py +++ b/lib/spack/spack/test/install.py @@ -28,6 +28,7 @@ import tempfile import spack from llnl.util.filesystem import * from spack.directory_layout import YamlDirectoryLayout +from spack.database import Database from spack.fetch_strategy import URLFetchStrategy, FetchStrategyComposite from spack.test.mock_packages_test import * from spack.test.mock_repo import MockArchive @@ -49,7 +50,10 @@ class InstallTest(MockPackagesTest): # installed pkgs and mock packages. self.tmpdir = tempfile.mkdtemp() self.orig_layout = spack.install_layout + self.orig_db = spack.installed_db + spack.install_layout = YamlDirectoryLayout(self.tmpdir) + spack.installed_db = Database(self.tmpdir) def tearDown(self): @@ -61,6 +65,7 @@ class InstallTest(MockPackagesTest): # restore spack's layout. spack.install_layout = self.orig_layout + spack.installed_db = self.orig_db shutil.rmtree(self.tmpdir, ignore_errors=True) @@ -71,7 +76,7 @@ class InstallTest(MockPackagesTest): pkg.fetcher = fetcher - def ztest_install_and_uninstall(self): + def test_install_and_uninstall(self): # Get a basic concrete spec for the trivial install package. spec = Spec('trivial_install_test_package') spec.concretize() diff --git a/lib/spack/spack/test/mock_packages_test.py b/lib/spack/spack/test/mock_packages_test.py index a56bd8ebdc..e1acc32cb7 100644 --- a/lib/spack/spack/test/mock_packages_test.py +++ b/lib/spack/spack/test/mock_packages_test.py @@ -34,7 +34,7 @@ from ordereddict_backport import OrderedDict from spack.repository import RepoPath from spack.spec import Spec -platform = spack.architecture.sys_type() +platform = spack.architecture.platform() linux_os_name = 'debian' linux_os_version = '6' @@ -56,7 +56,7 @@ compilers: fc: None modules: 'None' - compiler: - spec: gcc@4.5.0 + spec: gcc@4.5.0 operating_system: {0}{1} paths: cc: /path/to/gcc @@ -144,7 +144,7 @@ compilers: fc: /path/to/gfortran operating_system: elcapitan spec: gcc@4.5.0 - modules: 'None' + modules: 'None' - compiler: spec: clang@3.3 operating_system: elcapitan @@ -201,6 +201,10 @@ class MockPackagesTest(unittest.TestCase): spack.config.ConfigScope('site', self.mock_site_config) spack.config.ConfigScope('user', self.mock_user_config) + # Keep tests from interfering with the actual module path. + self.real_share_path = spack.share_path + spack.share_path = tempfile.mkdtemp() + # Store changes to the package's dependencies so we can # restore later. self.saved_deps = {} @@ -235,6 +239,9 @@ class MockPackagesTest(unittest.TestCase): pkg.dependencies.clear() pkg.dependencies.update(deps) + shutil.rmtree(spack.share_path, ignore_errors=True) + spack.share_path = self.real_share_path + def setUp(self): self.initmock() diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 582e067860..6d2e3705bd 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -27,6 +27,7 @@ from contextlib import contextmanager import StringIO import spack.modules +import unittest from spack.test.mock_packages_test import MockPackagesTest FILE_REGISTRY = collections.defaultdict(StringIO.StringIO) @@ -67,6 +68,24 @@ configuration_autoload_all = { } } +configuration_prerequisites_direct = { + 'enable': ['tcl'], + 'tcl': { + 'all': { + 'prerequisites': 'direct' + } + } +} + +configuration_prerequisites_all = { + 'enable': ['tcl'], + 'tcl': { + 'all': { + 'prerequisites': 'all' + } + } +} + configuration_alter_environment = { 'enable': ['tcl'], 'tcl': { @@ -74,8 +93,13 @@ configuration_alter_environment = { 'filter': {'environment_blacklist': ['CMAKE_PREFIX_PATH']} }, 'platform=test target=x86_64': { - 'environment': {'set': {'FOO': 'foo'}, - 'unset': ['BAR']} + 'environment': { + 'set': {'FOO': 'foo'}, + 'unset': ['BAR'] + } + }, + 'platform=test target=x86_32': { + 'load': ['foo/bar'] } } } @@ -83,7 +107,8 @@ configuration_alter_environment = { configuration_blacklist = { 'enable': ['tcl'], 'tcl': { - 'blacklist': ['callpath'], + 'whitelist': ['zmpi'], + 'blacklist': ['callpath', 'mpi'], 'all': { 'autoload': 'direct' } @@ -100,8 +125,68 @@ configuration_conflicts = { } } +configuration_wrong_conflicts = { + 'enable': ['tcl'], + 'tcl': { + 'naming_scheme': '{name}/{version}-{compiler.name}', + 'all': { + 'conflict': ['{name}/{compiler.name}'] + } + } +} + +configuration_suffix = { + 'enable': ['tcl'], + 'tcl': { + 'mpileaks': { + 'suffixes': { + '+debug': 'foo', + '~debug': 'bar' + } + } + } +} + + +class HelperFunctionsTests(MockPackagesTest): + + def test_update_dictionary_extending_list(self): + target = { + 'foo': { + 'a': 1, + 'b': 2, + 'd': 4 + }, + 'bar': [1, 2, 4], + 'baz': 'foobar' + } + update = { + 'foo': { + 'c': 3, + }, + 'bar': [3], + 'baz': 'foobaz', + 'newkey': { + 'd': 4 + } + } + spack.modules.update_dictionary_extending_lists(target, update) + self.assertTrue(len(target) == 4) + self.assertTrue(len(target['foo']) == 4) + self.assertTrue(len(target['bar']) == 4) + self.assertEqual(target['baz'], 'foobaz') + + def test_inspect_path(self): + env = spack.modules.inspect_path('/usr') + names = [item.name for item in env] + self.assertTrue('PATH' in names) + self.assertTrue('LIBRARY_PATH' in names) + self.assertTrue('LD_LIBRARY_PATH' in names) + self.assertTrue('CPATH' in names) + class TclTests(MockPackagesTest): + def setUp(self): super(TclTests, self).setUp() self.configuration_obj = spack.modules.CONFIGURATION @@ -116,7 +201,6 @@ class TclTests(MockPackagesTest): def get_modulefile_content(self, spec): spec.concretize() - print spec, '&&&&&' generator = spack.modules.TclModule(spec) generator.write() content = FILE_REGISTRY[generator.file_name].split('\n') @@ -127,6 +211,8 @@ class TclTests(MockPackagesTest): spec = spack.spec.Spec('mpich@3.0.4') content = self.get_modulefile_content(spec) self.assertTrue('module-whatis "mpich @3.0.4"' in content) + self.assertRaises(TypeError, spack.modules.dependencies, + spec, 'non-existing-tag') def test_autoload(self): spack.modules.CONFIGURATION = configuration_autoload_direct @@ -141,11 +227,21 @@ class TclTests(MockPackagesTest): self.assertEqual(len([x for x in content if 'is-loaded' in x]), 5) self.assertEqual(len([x for x in content if 'module load ' in x]), 5) + def test_prerequisites(self): + spack.modules.CONFIGURATION = configuration_prerequisites_direct + spec = spack.spec.Spec('mpileaks arch=x86-linux') + content = self.get_modulefile_content(spec) + self.assertEqual(len([x for x in content if 'prereq' in x]), 2) + + spack.modules.CONFIGURATION = configuration_prerequisites_all + spec = spack.spec.Spec('mpileaks arch=x86-linux') + content = self.get_modulefile_content(spec) + self.assertEqual(len([x for x in content if 'prereq' in x]), 5) + def test_alter_environment(self): spack.modules.CONFIGURATION = configuration_alter_environment spec = spack.spec.Spec('mpileaks platform=test target=x86_64') content = self.get_modulefile_content(spec) - print content self.assertEqual( len([x for x in content @@ -156,7 +252,6 @@ class TclTests(MockPackagesTest): spec = spack.spec.Spec('libdwarf %clang platform=test target=x86_32') content = self.get_modulefile_content(spec) - print content self.assertEqual( len([x for x in content @@ -164,6 +259,10 @@ class TclTests(MockPackagesTest): self.assertEqual( len([x for x in content if 'setenv FOO "foo"' in x]), 0) self.assertEqual(len([x for x in content if 'unsetenv BAR' in x]), 0) + self.assertEqual( + len([x for x in content if 'is-loaded foo/bar' in x]), 1) + self.assertEqual( + len([x for x in content if 'module load foo/bar' in x]), 1) def test_blacklist(self): spack.modules.CONFIGURATION = configuration_blacklist @@ -171,6 +270,13 @@ class TclTests(MockPackagesTest): content = self.get_modulefile_content(spec) self.assertEqual(len([x for x in content if 'is-loaded' in x]), 1) self.assertEqual(len([x for x in content if 'module load ' in x]), 1) + spec = spack.spec.Spec('callpath arch=x86-linux') + # Returns a StringIO instead of a string as no module file was written + self.assertRaises(AttributeError, self.get_modulefile_content, spec) + spec = spack.spec.Spec('zmpi arch=x86-linux') + content = self.get_modulefile_content(spec) + self.assertEqual(len([x for x in content if 'is-loaded' in x]), 1) + self.assertEqual(len([x for x in content if 'module load ' in x]), 1) def test_conflicts(self): spack.modules.CONFIGURATION = configuration_conflicts @@ -182,3 +288,57 @@ class TclTests(MockPackagesTest): len([x for x in content if x == 'conflict mpileaks']), 1) self.assertEqual( len([x for x in content if x == 'conflict intel/14.0.1']), 1) + + spack.modules.CONFIGURATION = configuration_wrong_conflicts + self.assertRaises(SystemExit, self.get_modulefile_content, spec) + + def test_suffixes(self): + spack.modules.CONFIGURATION = configuration_suffix + spec = spack.spec.Spec('mpileaks+debug arch=x86-linux') + spec.concretize() + generator = spack.modules.TclModule(spec) + self.assertTrue('foo' in generator.use_name) + + spec = spack.spec.Spec('mpileaks~debug arch=x86-linux') + spec.concretize() + generator = spack.modules.TclModule(spec) + self.assertTrue('bar' in generator.use_name) + + +configuration_dotkit = { + 'enable': ['dotkit'], + 'dotkit': { + 'all': { + 'prerequisites': 'direct' + } + } +} + + +class DotkitTests(MockPackagesTest): + + def setUp(self): + super(DotkitTests, self).setUp() + self.configuration_obj = spack.modules.CONFIGURATION + spack.modules.open = mock_open + # Make sure that a non-mocked configuration will trigger an error + spack.modules.CONFIGURATION = None + + def tearDown(self): + del spack.modules.open + spack.modules.CONFIGURATION = self.configuration_obj + super(DotkitTests, self).tearDown() + + def get_modulefile_content(self, spec): + spec.concretize() + generator = spack.modules.Dotkit(spec) + generator.write() + content = FILE_REGISTRY[generator.file_name].split('\n') + return content + + def test_dotkit(self): + spack.modules.CONFIGURATION = configuration_dotkit + spec = spack.spec.Spec('mpileaks arch=x86-linux') + content = self.get_modulefile_content(spec) + self.assertTrue('#c spack' in content) + self.assertTrue('#d mpileaks @2.3' in content) diff --git a/lib/spack/spack/test/multimethod.py b/lib/spack/spack/test/multimethod.py index 034e6b3923..c233ea4fd6 100644 --- a/lib/spack/spack/test/multimethod.py +++ b/lib/spack/spack/test/multimethod.py @@ -93,7 +93,7 @@ class MultiMethodTest(MockPackagesTest): def test_target_match(self): - platform = spack.architecture.sys_type() + platform = spack.architecture.platform() targets = platform.targets.values() for target in targets[:-1]: pkg = spack.repo.get('multimethod target='+target.name) diff --git a/lib/spack/spack/test/sbang.py b/lib/spack/spack/test/sbang.py index 6aea1a68c7..ed54ff90b0 100644 --- a/lib/spack/spack/test/sbang.py +++ b/lib/spack/spack/test/sbang.py @@ -34,10 +34,12 @@ from llnl.util.filesystem import * from spack.hooks.sbang import filter_shebangs_in_directory import spack -short_line = "#!/this/is/short/bin/bash\n" -long_line = "#!/this/" + ('x' * 200) + "/is/long\n" -sbang_line = '#!/bin/bash %s/bin/sbang\n' % spack.spack_root -last_line = "last!\n" +short_line = "#!/this/is/short/bin/bash\n" +long_line = "#!/this/" + ('x' * 200) + "/is/long\n" +lua_line = "#!/this/" + ('x' * 200) + "/is/lua\n" +lua_line_patched = "--!/this/" + ('x' * 200) + "/is/lua\n" +sbang_line = '#!/bin/bash %s/bin/sbang\n' % spack.spack_root +last_line = "last!\n" class SbangTest(unittest.TestCase): def setUp(self): @@ -59,6 +61,12 @@ class SbangTest(unittest.TestCase): f.write(long_line) f.write(last_line) + # Lua script with long shebang + self.lua_shebang = os.path.join(self.tempdir, 'lua') + with open(self.lua_shebang, 'w') as f: + f.write(lua_line) + f.write(last_line) + # Script already using sbang. self.has_shebang = os.path.join(self.tempdir, 'shebang') with open(self.has_shebang, 'w') as f: @@ -71,7 +79,6 @@ class SbangTest(unittest.TestCase): shutil.rmtree(self.tempdir, ignore_errors=True) - def test_shebang_handling(self): filter_shebangs_in_directory(self.tempdir) @@ -86,6 +93,12 @@ class SbangTest(unittest.TestCase): self.assertEqual(f.readline(), long_line) self.assertEqual(f.readline(), last_line) + # Make sure this got patched. + with open(self.lua_shebang, 'r') as f: + self.assertEqual(f.readline(), sbang_line) + self.assertEqual(f.readline(), lua_line_patched) + self.assertEqual(f.readline(), last_line) + # Make sure this is untouched with open(self.has_shebang, 'r') as f: self.assertEqual(f.readline(), sbang_line) diff --git a/lib/spack/spack/test/spec_dag.py b/lib/spack/spack/test/spec_dag.py index 712f07ac4d..c56c70b1fe 100644 --- a/lib/spack/spack/test/spec_dag.py +++ b/lib/spack/spack/test/spec_dag.py @@ -242,7 +242,7 @@ class SpecDagTest(MockPackagesTest): def test_unsatisfiable_architecture(self): - platform = spack.architecture.sys_type() + platform = spack.architecture.platform() self.set_pkg_dep('mpileaks', 'mpich platform=test target=be') spec = Spec('mpileaks ^mpich platform=test target=fe ^callpath ^dyninst ^libelf ^libdwarf') diff --git a/lib/spack/spack/test/spec_semantics.py b/lib/spack/spack/test/spec_semantics.py index 9876bfd5a8..b174e5305c 100644 --- a/lib/spack/spack/test/spec_semantics.py +++ b/lib/spack/spack/test/spec_semantics.py @@ -141,7 +141,6 @@ class SpecSematicsTest(MockPackagesTest): def test_satisfies_architecture(self): - platform = spack.architecture.sys_type() self.check_satisfies( 'foo platform=test target=frontend os=frontend', 'platform=test target=frontend os=frontend') @@ -396,7 +395,7 @@ class SpecSematicsTest(MockPackagesTest): self.check_constrain_changed('libelf', 'debug=2') self.check_constrain_changed('libelf', 'cppflags="-O3"') - platform = spack.architecture.sys_type() + platform = spack.architecture.platform() self.check_constrain_changed('libelf', 'target='+platform.target('default_target').name) self.check_constrain_changed('libelf', 'os='+platform.operating_system('default_os').name) @@ -412,7 +411,7 @@ class SpecSematicsTest(MockPackagesTest): self.check_constrain_not_changed('libelf debug=2', 'debug=2') self.check_constrain_not_changed('libelf cppflags="-O3"', 'cppflags="-O3"') - platform = spack.architecture.sys_type() + platform = spack.architecture.platform() default_target = platform.target('default_target').name self.check_constrain_not_changed('libelf target='+default_target, 'target='+default_target) @@ -425,7 +424,7 @@ class SpecSematicsTest(MockPackagesTest): self.check_constrain_changed('libelf^foo', 'libelf^foo+debug') self.check_constrain_changed('libelf^foo', 'libelf^foo~debug') - platform = spack.architecture.sys_type() + platform = spack.architecture.platform() default_target = platform.target('default_target').name self.check_constrain_changed('libelf^foo', 'libelf^foo target='+default_target) @@ -439,6 +438,6 @@ class SpecSematicsTest(MockPackagesTest): self.check_constrain_not_changed('libelf^foo~debug', 'libelf^foo~debug') self.check_constrain_not_changed('libelf^foo cppflags="-O3"', 'libelf^foo cppflags="-O3"') - platform = spack.architecture.sys_type() + platform = spack.architecture.platform() default_target = platform.target('default_target').name self.check_constrain_not_changed('libelf^foo target='+default_target, 'libelf^foo target='+default_target) diff --git a/var/spack/repos/builtin.mock/packages/multimethod/package.py b/var/spack/repos/builtin.mock/packages/multimethod/package.py index 649afa5945..ca991632dd 100644 --- a/var/spack/repos/builtin.mock/packages/multimethod/package.py +++ b/var/spack/repos/builtin.mock/packages/multimethod/package.py @@ -106,17 +106,11 @@ class Multimethod(Package): # # Make sure we can switch methods on different target # -# for platform_name in ['cray_xc', 'darwin', 'linux']: -# file_path = join_path(spack.platform_path, platform_name) -# platform_mod = imp.load_source('spack.platforms', file_path + '.py') -# cls = getattr(platform_mod, mod_to_class(platform_name)) - -# platform = cls() - platform = spack.architecture.sys_type() + platform = spack.architecture.platform() targets = platform.targets.values() if len(targets) > 1: targets = targets[:-1] - + for target in targets: @when('target='+target.name) def different_by_target(self): diff --git a/var/spack/packages/adios/package.py b/var/spack/repos/builtin/packages/adios/package.py index 260dcbe851..9e0452ba6f 100644 --- a/var/spack/packages/adios/package.py +++ b/var/spack/repos/builtin/packages/adios/package.py @@ -1,15 +1,18 @@ import os from spack import * + + class Adios(Package): - """The Adaptable IO System (ADIOS) provides a simple, - flexible way for scientists to describe the - data in their code that may need to be written, - read, or processed outside of the running simulation """ - + The Adaptable IO System (ADIOS) provides a simple, + flexible way for scientists to describe the + data in their code that may need to be written, + read, or processed outside of the running simulation + """ + homepage = "http://www.olcf.ornl.gov/center-projects/adios/" - url = "http://users.nccs.gov/~pnorbert/adios-1.9.0.tar.gz" + url = "http://users.nccs.gov/~pnorbert/adios-1.9.0.tar.gz" version('1.9.0', 'dbf5cb10e32add2f04c9b4052b7ffa76') @@ -22,13 +25,13 @@ class Adios(Package): depends_on('mxml') def install(self, spec, prefix): - configure_args = ["--prefix=%s" % prefix, - "--with-mxml=%s" % spec['mxml'].prefix, + configure_args = ["--prefix=%s" % prefix, + "--with-mxml=%s" % spec['mxml'].prefix, "--with-hdf5=%s" % spec['hdf5'].prefix, "--with-netcdf=%s" % os.environ["NETCDF_DIR"], "--with-infiniband=no", - "MPICC=cc","MPICXX=CC","MPIFC=ftn", - "CPPFLAGS=-DMPICH_IGNORE_CXX_SEEK"] + "MPICC=cc", "MPICXX=CC", "MPIFC=ftn", + "CPPFLAGS=-DMPICH_IGNORE_CXX_SEEK"] if spec.satisfies('%gcc'): configure_args.extend(["CC=gcc", "CXX=g++", "FC=gfortran"]) diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py index d920855a2f..770ceed48b 100644 --- a/var/spack/repos/builtin/packages/autoconf/package.py +++ b/var/spack/repos/builtin/packages/autoconf/package.py @@ -24,18 +24,36 @@ ############################################################################## from spack import * + class Autoconf(Package): - """Autoconf -- system configuration part of autotools""" - homepage = "https://www.gnu.org/software/autoconf/" - url = "http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz" + """ + Autoconf -- system configuration part of autotools + """ + homepage = 'https://www.gnu.org/software/autoconf/' + url = 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz' version('2.69', '82d05e03b93e45f5a39b828dc9c6c29b') version('2.62', '6c1f3b3734999035d77da5024aab4fbd') - depends_on("m4") + depends_on('m4') + + def _make_executable(self, name): + return Executable(join_path(self.prefix.bin, name)) + + def setup_dependent_package(self, module, dependent_spec): + # Autoconf is very likely to be a build dependency, + # so we add the tools it provides to the dependent module + executables = ['autoconf', + 'autoheader', + 'autom4te', + 'autoreconf', + 'autoscan', + 'autoupdate', + 'ifnames'] + for name in executables: + setattr(module, name, self._make_executable(name)) def install(self, spec, prefix): configure("--prefix=%s" % prefix) - make() make("install") diff --git a/var/spack/repos/builtin/packages/automake/package.py b/var/spack/repos/builtin/packages/automake/package.py index 331b364496..78b0a5b34f 100644 --- a/var/spack/repos/builtin/packages/automake/package.py +++ b/var/spack/repos/builtin/packages/automake/package.py @@ -24,10 +24,13 @@ ############################################################################## from spack import * + class Automake(Package): - """Automake -- make file builder part of autotools""" - homepage = "http://www.gnu.org/software/automake/" - url = "http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz" + """ + Automake -- make file builder part of autotools + """ + homepage = 'http://www.gnu.org/software/automake/' + url = 'http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz' version('1.15', '716946a105ca228ab545fc37a70df3a3') version('1.14.1', 'd052a3e884631b9c7892f2efce542d75') @@ -35,8 +38,17 @@ class Automake(Package): depends_on('autoconf') + def _make_executable(self, name): + return Executable(join_path(self.prefix.bin, name)) + + def setup_dependent_package(self, module, dependent_spec): + # Automake is very likely to be a build dependency, + # so we add the tools it provides to the dependent module + executables = ['aclocal', 'automake'] + for name in executables: + setattr(module, name, self._make_executable(name)) + def install(self, spec, prefix): configure("--prefix=%s" % prefix) - make() make("install") diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py index 5f305abb02..35d52128c3 100644 --- a/var/spack/repos/builtin/packages/binutils/package.py +++ b/var/spack/repos/builtin/packages/binutils/package.py @@ -24,11 +24,12 @@ ############################################################################## from spack import * + class Binutils(Package): """GNU binutils, which contain the linker, assembler, objdump and others""" - homepage = "http://www.gnu.org/software/binutils/" - url="https://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.bz2" + homepage = "http://www.gnu.org/software/binutils/" + url = "https://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.bz2" # 2.26 is incompatible with py-pillow build for some reason. version('2.26', '64146a0faa3b411ba774f47d41de239f') @@ -41,12 +42,15 @@ class Binutils(Package): depends_on('flex') depends_on('bison') - # Add a patch that creates binutils libiberty_pic.a which is preferred by OpenSpeedShop and cbtf-krell - variant('krellpatch', default=False, description="build with openspeedshop based patch.") + # Add a patch that creates binutils libiberty_pic.a which is preferred by + # OpenSpeedShop and cbtf-krell + variant('krellpatch', default=False, + description="build with openspeedshop based patch.") variant('gold', default=True, description="build the gold linker") patch('binutilskrell-2.24.patch', when='@2.24+krellpatch') patch('cr16.patch') + patch('update_symbol-2.26.patch', when='@2.26') variant('libiberty', default=False, description='Also install libiberty.') diff --git a/var/spack/repos/builtin/packages/binutils/update_symbol-2.26.patch b/var/spack/repos/builtin/packages/binutils/update_symbol-2.26.patch new file mode 100644 index 0000000000..2601f63a6b --- /dev/null +++ b/var/spack/repos/builtin/packages/binutils/update_symbol-2.26.patch @@ -0,0 +1,104 @@ +From 544ddf9322b1b83982e5cb84a54d084ee7e718ea Mon Sep 17 00:00:00 2001 +From: H.J. Lu <hjl.tools@gmail.com> +Date: Wed, 24 Feb 2016 15:13:35 -0800 +Subject: [PATCH] Update symbol version for symbol from linker script + +We need to update symbol version for symbols from linker script. + +Backport from master + +bfd/ + + PR ld/19698 + * elflink.c (bfd_elf_record_link_assignment): Set versioned if + symbol version is unknown. + +ld/ + + PR ld/19698 + * testsuite/ld-elf/pr19698.d: New file. + * testsuite/ld-elf/pr19698.s: Likewise. + * testsuite/ld-elf/pr19698.t: Likewise. +--- + bfd/ChangeLog | 9 +++++++++ + bfd/elflink.c | 13 +++++++++++++ + ld/ChangeLog | 10 ++++++++++ + ld/testsuite/ld-elf/pr19698.d | 10 ++++++++++ + ld/testsuite/ld-elf/pr19698.s | 5 +++++ + ld/testsuite/ld-elf/pr19698.t | 11 +++++++++++ + 6 files changed, 58 insertions(+), 0 deletions(-) + create mode 100644 ld/testsuite/ld-elf/pr19698.d + create mode 100644 ld/testsuite/ld-elf/pr19698.s + create mode 100644 ld/testsuite/ld-elf/pr19698.t + +diff --git a/bfd/elflink.c b/bfd/elflink.c +index ae8d148..8fcaadd 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -555,6 +555,19 @@ bfd_elf_record_link_assignment (bfd *output_bfd, + if (h == NULL) + return provide; + ++ if (h->versioned == unknown) ++ { ++ /* Set versioned if symbol version is unknown. */ ++ char *version = strrchr (name, ELF_VER_CHR); ++ if (version) ++ { ++ if (version > name && version[-1] != ELF_VER_CHR) ++ h->versioned = versioned_hidden; ++ else ++ h->versioned = versioned; ++ } ++ } ++ + switch (h->root.type) + { + case bfd_link_hash_defined: +diff --git a/ld/testsuite/ld-elf/pr19698.d b/ld/testsuite/ld-elf/pr19698.d +new file mode 100644 +index 0000000..a39f67a +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr19698.d +@@ -0,0 +1,10 @@ ++#ld: -shared $srcdir/$subdir/pr19698.t ++#readelf : --dyn-syms --wide ++#target: *-*-linux* *-*-gnu* *-*-solaris* ++ ++Symbol table '\.dynsym' contains [0-9]+ entries: ++#... ++ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +foo@VERS.1 ++#... ++ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +foo@@VERS.2 ++#pass +diff --git a/ld/testsuite/ld-elf/pr19698.s b/ld/testsuite/ld-elf/pr19698.s +new file mode 100644 +index 0000000..875dca4 +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr19698.s +@@ -0,0 +1,5 @@ ++ .text ++ .globl foo ++ .type foo, %function ++foo: ++ .byte 0 +diff --git a/ld/testsuite/ld-elf/pr19698.t b/ld/testsuite/ld-elf/pr19698.t +new file mode 100644 +index 0000000..09d9125 +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr19698.t +@@ -0,0 +1,11 @@ ++"foo@VERS.1" = foo; ++ ++VERSION { ++VERS.2 { ++ global: ++ foo; ++}; ++ ++VERS.1 { ++}; ++} +-- +1.7.1 + diff --git a/var/spack/repos/builtin/packages/cairo/package.py b/var/spack/repos/builtin/packages/cairo/package.py index 5c7c2fae22..ddb8d2fd03 100644 --- a/var/spack/repos/builtin/packages/cairo/package.py +++ b/var/spack/repos/builtin/packages/cairo/package.py @@ -24,8 +24,10 @@ ############################################################################## from spack import * + class Cairo(Package): - """Cairo is a 2D graphics library with support for multiple output devices.""" + """Cairo is a 2D graphics library with support for multiple output + devices.""" homepage = "http://cairographics.org" url = "http://cairographics.org/releases/cairo-1.14.0.tar.xz" @@ -34,11 +36,12 @@ class Cairo(Package): depends_on("libpng") depends_on("glib") depends_on("pixman") - depends_on("fontconfig@2.10.91:") # Require newer version of fontconfig. + depends_on("freetype") + depends_on("fontconfig@2.10.91:") # Require newer version of fontconfig. def install(self, spec, prefix): configure("--prefix=%s" % prefix, - "--disable-trace", # can cause problems with libiberty + "--disable-trace", # can cause problems with libiberty "--enable-tee") make() make("install") diff --git a/var/spack/repos/builtin/packages/curl/package.py b/var/spack/repos/builtin/packages/curl/package.py index e3de6ee5a1..79570205fa 100644 --- a/var/spack/repos/builtin/packages/curl/package.py +++ b/var/spack/repos/builtin/packages/curl/package.py @@ -24,6 +24,7 @@ ############################################################################## from spack import * + class Curl(Package): """cURL is an open source command line tool and library for transferring data with URL syntax""" @@ -31,6 +32,7 @@ class Curl(Package): homepage = "http://curl.haxx.se" url = "http://curl.haxx.se/download/curl-7.46.0.tar.bz2" + version('7.49.1', '6bb1f7af5b58b30e4e6414b8c1abccab') version('7.47.1', '9ea3123449439bbd960cd25cf98796fb') version('7.46.0', '9979f989a2a9930d10f1b3deeabc2148') version('7.45.0', '62c1a352b28558f25ba6209214beadc8') diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py index e20fcffdd7..9ff4107619 100644 --- a/var/spack/repos/builtin/packages/eigen/package.py +++ b/var/spack/repos/builtin/packages/eigen/package.py @@ -28,7 +28,9 @@ from spack import * class Eigen(Package): """ - Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms + Eigen is a C++ template library for linear algebra + + Matrices, vectors, numerical solvers, and related algorithms """ homepage = 'http://eigen.tuxfamily.org/' @@ -42,16 +44,16 @@ class Eigen(Package): variant('scotch', default=True, description='Enables scotch backend') variant('fftw', default=True, description='Enables FFTW backend') variant('suitesparse', default=True, description='Enables SuiteSparse support') + variant('mpfr', default=True, description='Enables support for multi-precisions floating points via mpfr') # TODO : dependency on googlehash, superlu, adolc missing - depends_on('cmake') depends_on('metis@5:', when='+metis') depends_on('scotch', when='+scotch') depends_on('fftw', when='+fftw') depends_on('suite-sparse', when='+suitesparse') - depends_on('mpfr@2.3.0:') # Eigen 3.2.7 requires at least 2.3.0 - depends_on('gmp') + depends_on('mpfr@2.3.0:', when="+mpfr") + depends_on('gmp', when="+mpfr") def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py index 4b05864a1e..a9ebd6d42f 100644 --- a/var/spack/repos/builtin/packages/emacs/package.py +++ b/var/spack/repos/builtin/packages/emacs/package.py @@ -23,23 +23,44 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +import llnl.util.tty as tty + class Emacs(Package): """The Emacs programmable text editor.""" + homepage = "https://www.gnu.org/software/emacs" url = "http://ftp.gnu.org/gnu/emacs/emacs-24.5.tar.gz" version('24.5', 'd74b597503a68105e61b5b9f6d065b44') + variant('X', default=True, description="Enable a X toolkit (GTK+)") + variant('gtkplus', default=False, description="Enable a GTK+ as X toolkit (this variant is ignored if ~X)") + depends_on('ncurses') - # Emacs also depends on: - # GTK or other widget library - # libtiff, png, etc. - # For now, we assume the system provides all that stuff. - # For Ubuntu 14.04 LTS: - # sudo apt-get install libgtk-3-dev libxpm-dev libtiff5-dev libjpeg8-dev libgif-dev libpng12-dev + depends_on('libtiff', when='+X') + depends_on('libpng', when='+X') + depends_on('libxpm', when='+X') + depends_on('giflib', when='+X') + depends_on('gtkplus', when='+X+gtkplus') def install(self, spec, prefix): - configure('--prefix=%s' % prefix) + args = [] + if '+X' in spec: + if '+gtkplus' in spec: + toolkit = 'gtk{0}'.format(spec['gtkplus'].version.up_to(1)) + else: + toolkit = 'no' + args = [ + '--with-x', + '--with-x-toolkit={0}'.format(toolkit) + ] + else: + args = ['--without-x'] + if '+gtkplus' in spec: + tty.warn('The variant +gtkplus is ignored if ~X is selected.') + + configure('--prefix={0}'.format(prefix), *args) + make() make("install") diff --git a/var/spack/repos/builtin/packages/fenics/package.py b/var/spack/repos/builtin/packages/fenics/package.py index 0845237656..465ab651be 100644 --- a/var/spack/repos/builtin/packages/fenics/package.py +++ b/var/spack/repos/builtin/packages/fenics/package.py @@ -57,6 +57,9 @@ class Fenics(Package): # variant('slepc4py', default=True, description='Uses SLEPc4py') # variant('pastix', default=True, description='Compile with Pastix') + patch('petsc-3.7.patch', when='^petsc@3.7:') + patch('petsc-version-detection.patch', when='@:1.6.1') + extends('python') depends_on('py-numpy') diff --git a/var/spack/repos/builtin/packages/fenics/petsc-3.7.patch b/var/spack/repos/builtin/packages/fenics/petsc-3.7.patch new file mode 100644 index 0000000000..c1ba5c4da6 --- /dev/null +++ b/var/spack/repos/builtin/packages/fenics/petsc-3.7.patch @@ -0,0 +1,394 @@ +diff -Naur dolfin-1.6.0/dolfin/common/SubSystemsManager.cpp dolfin-1.6.0.new/dolfin/common/SubSystemsManager.cpp +--- dolfin-1.6.0/dolfin/common/SubSystemsManager.cpp 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/common/SubSystemsManager.cpp 2016-06-26 23:42:56.391929550 +0200 +@@ -179,7 +179,7 @@ + PetscInitialized(&is_initialized); + if (is_initialized) + { +- PetscOptionsInsert(&argc, &argv, PETSC_NULL); ++ PetscOptionsInsert(NULL, &argc, &argv, PETSC_NULL); + } + else + { +@@ -187,12 +187,12 @@ + PetscInitializeNoArguments(); + + // Set options to avoid common failures with some 3rd party solvers +- PetscOptionsSetValue("-mat_mumps_icntl_7", "0"); +- PetscOptionsSetValue("-mat_superlu_dist_colperm", "MMD_AT_PLUS_A"); ++ PetscOptionsSetValue(NULL, "-mat_mumps_icntl_7", "0"); ++ PetscOptionsSetValue(NULL, "-mat_superlu_dist_colperm", "MMD_AT_PLUS_A"); + + // Pass command line arguments to PETSc (will overwrite any + // default above) +- PetscOptionsInsert(&argc, &argv, PETSC_NULL); ++ PetscOptionsInsert(NULL, &argc, &argv, PETSC_NULL); + } + + // Set PETSc +diff -Naur dolfin-1.6.0/dolfin/la/PETScKrylovSolver.cpp dolfin-1.6.0.new/dolfin/la/PETScKrylovSolver.cpp +--- dolfin-1.6.0/dolfin/la/PETScKrylovSolver.cpp 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/la/PETScKrylovSolver.cpp 2016-06-26 23:33:02.418351380 +0200 +@@ -564,6 +564,11 @@ + return solve(x, b); + } + //----------------------------------------------------------------------------- ++PetscErrorCode PETScKrylovSolver::ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *vf) ++{ ++ KSPMonitorTrueResidualNorm(ksp, n, rnorm, static_cast<PetscViewerAndFormat *>(vf)); ++} ++//----------------------------------------------------------------------------- + void PETScKrylovSolver::set_petsc_ksp_options() + { + PetscErrorCode ierr; +@@ -585,7 +590,8 @@ + const bool monitor_convergence = parameters["monitor_convergence"]; + if (monitor_convergence) + { +- ierr = KSPMonitorSet(_ksp, KSPMonitorTrueResidualNorm, 0, 0); ++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &_vf); ++ ierr = KSPMonitorSet(_ksp, ksp_monitor_norm, _vf, 0); + if (ierr != 0) petsc_error(ierr, __FILE__, "KSPMonitorSet"); + } + +diff -Naur dolfin-1.6.0/dolfin/la/PETScKrylovSolver.h dolfin-1.6.0.new/dolfin/la/PETScKrylovSolver.h +--- dolfin-1.6.0/dolfin/la/PETScKrylovSolver.h 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/la/PETScKrylovSolver.h 2016-06-26 23:19:40.767042975 +0200 +@@ -179,6 +179,12 @@ + // PETSc solver pointer + KSP _ksp; + ++ // viewer for monitoring ++ PetscViewerAndFormat* _vf; ++ ++ // monitoring function ++ static PetscErrorCode ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx); ++ + // DOLFIN-defined PETScUserPreconditioner + PETScUserPreconditioner* pc_dolfin; + +diff -Naur dolfin-1.6.0/dolfin/la/PETScLUSolver.cpp dolfin-1.6.0.new/dolfin/la/PETScLUSolver.cpp +--- dolfin-1.6.0/dolfin/la/PETScLUSolver.cpp 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/la/PETScLUSolver.cpp 2016-06-26 23:13:36.903732301 +0200 +@@ -246,14 +246,14 @@ + if (parameters["num_threads"].is_set()) + { + // Use number of threads specified for LU solver +- ierr = PetscOptionsSetValue("-mat_pastix_threadnbr", ++ ierr = PetscOptionsSetValue(NULL, "-mat_pastix_threadnbr", + parameters["num_threads"].value_str().c_str()); + if (ierr != 0) petsc_error(ierr, __FILE__, "PetscOptionsSetValue"); + } + else + { + // Use global number of threads +- ierr = PetscOptionsSetValue("-mat_pastix_threadnbr", ++ ierr = PetscOptionsSetValue(NULL, "-mat_pastix_threadnbr", + dolfin::parameters["num_threads"].value_str().c_str()); + if (ierr != 0) petsc_error(ierr, __FILE__, "PetscOptionsSetValue"); + } +diff -Naur dolfin-1.6.0/dolfin/la/PETScOptions.cpp dolfin-1.6.0.new/dolfin/la/PETScOptions.cpp +--- dolfin-1.6.0/dolfin/la/PETScOptions.cpp 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/la/PETScOptions.cpp 2016-06-26 23:37:58.613121118 +0200 +@@ -54,7 +54,7 @@ + { + SubSystemsManager::init_petsc(); + PetscErrorCode ierr; +- ierr = PetscOptionsClearValue(option.c_str()); ++ ierr = PetscOptionsClearValue(NULL, option.c_str()); + if (ierr != 0) + { + dolfin_error("PETScOptions.cpp", +diff -Naur dolfin-1.6.0/dolfin/la/PETScOptions.h dolfin-1.6.0.new/dolfin/la/PETScOptions.h +--- dolfin-1.6.0/dolfin/la/PETScOptions.h 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/la/PETScOptions.h 2016-06-26 23:37:54.352023709 +0200 +@@ -65,7 +65,7 @@ + + PetscErrorCode ierr; + std::string _option = "-" + option; +- ierr = PetscOptionsSetValue(_option.c_str(), ++ ierr = PetscOptionsSetValue(NULL, _option.c_str(), + boost::lexical_cast<std::string>(value).c_str()); + if (ierr != 0) + { +diff -Naur dolfin-1.6.0/dolfin/la/SLEPcEigenSolver.cpp dolfin-1.6.0.new/dolfin/la/SLEPcEigenSolver.cpp +--- dolfin-1.6.0/dolfin/la/SLEPcEigenSolver.cpp 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/la/SLEPcEigenSolver.cpp 2016-06-26 23:35:25.930631132 +0200 +@@ -99,6 +99,19 @@ + solve(_matA->size(0)); + } + //----------------------------------------------------------------------------- ++PetscErrorCode SLEPcEigenSolver::eps_monitor(EPS eps, PetscInt its, PetscInt nconv, PetscScalar* eigr, ++ PetscScalar* eigi, PetscReal* errest, ++ PetscInt nest, void *vf) ++{ ++ EPSMonitorAll(eps, its, nconv, eigr, eigi, errest, nest, ++ static_cast<PetscViewerAndFormat *>(vf)); ++} ++//----------------------------------------------------------------------------- ++PetscErrorCode SLEPcEigenSolver::ksp_monitor(KSP ksp, PetscInt n, PetscReal rnorm, void *vf) ++{ ++ KSPMonitorDefault(ksp, n, rnorm, static_cast<PetscViewerAndFormat *>(vf)); ++} ++//----------------------------------------------------------------------------- + void SLEPcEigenSolver::solve(std::size_t n) + { + dolfin_assert(_matA); +@@ -139,10 +152,11 @@ + { + KSP ksp; + ST st; +- EPSMonitorSet(_eps, EPSMonitorAll, NULL, NULL); ++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &_vf); ++ EPSMonitorSet(_eps, eps_monitor, _vf, NULL); + EPSGetST(_eps, &st); + STGetKSP(st, &ksp); +- KSPMonitorSet(ksp, KSPMonitorDefault, NULL, NULL); ++ KSPMonitorSet(ksp, ksp_monitor, _vf, NULL); + EPSView(_eps, PETSC_VIEWER_STDOUT_SELF); + } + +diff -Naur dolfin-1.6.0/dolfin/la/SLEPcEigenSolver.h dolfin-1.6.0.new/dolfin/la/SLEPcEigenSolver.h +--- dolfin-1.6.0/dolfin/la/SLEPcEigenSolver.h 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/la/SLEPcEigenSolver.h 2016-06-26 23:36:08.784610612 +0200 +@@ -231,6 +231,11 @@ + // SLEPc solver pointer + EPS _eps; + ++ PetscViewerAndFormat* _vf; ++ static PetscErrorCode eps_monitor(EPS eps, int its, int nconv, PetscScalar *eigr, ++ PetscScalar *eigi, PetscReal* errest, ++ int nest, void *mctx); ++ static PetscErrorCode ksp_monitor(KSP ksp, PetscInt n, PetscReal rnorm, void *vf); + }; + + } +diff -Naur dolfin-1.6.0/dolfin/nls/PETScSNESSolver.cpp dolfin-1.6.0.new/dolfin/nls/PETScSNESSolver.cpp +--- dolfin-1.6.0/dolfin/nls/PETScSNESSolver.cpp 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/nls/PETScSNESSolver.cpp 2016-06-26 23:19:40.166029256 +0200 +@@ -195,6 +195,15 @@ + return this->solve(nonlinear_problem, x); + } + //----------------------------------------------------------------------------- ++PetscErrorCode ++PETScSNESSolver::snes_monitor(SNES snes, PetscInt its, ++ PetscReal fgnorm, void *vf) ++{ ++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf); ++ SNESMonitorDefault(snes, its, fgnorm, _vf); ++ return(0); ++} ++//----------------------------------------------------------------------------- + void + PETScSNESSolver::init(NonlinearProblem& nonlinear_problem, + GenericVector& x) +@@ -237,9 +246,11 @@ + } + + // Set some options from the parameters +- if (report) +- SNESMonitorSet(_snes, SNESMonitorDefault, PETSC_NULL, PETSC_NULL); +- ++ if (report) { ++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &_snes_ctx.vf); ++ SNESMonitorSet(_snes, PETScSNESSolver::snes_monitor, _snes_ctx.vf, PETSC_NULL); ++ } ++ + // Set the bounds, if any + set_bounds(x); + +@@ -293,8 +304,8 @@ + SNESGetLineSearch(_snes, &linesearch); + #endif + +- if (report) +- SNESLineSearchSetMonitor(linesearch, PETSC_TRUE); ++ // if (report) ++ // SNESLineSearchSetMonitor(linesearch, PETSC_TRUE); + const std::string line_search_type = std::string(parameters["line_search"]); + SNESLineSearchSetType(linesearch, line_search_type.c_str()); + +@@ -466,6 +477,24 @@ + } + #endif + //----------------------------------------------------------------------------- ++PetscErrorCode ++PETScSNESSolver::ksp_monitor(KSP ksp, PetscInt n, ++ PetscReal rnorm, void *vf) ++{ ++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf); ++ KSPMonitorDefault(ksp, n, rnorm, _vf); ++ return(0); ++} ++//----------------------------------------------------------------------------- ++PetscErrorCode ++PETScSNESSolver::ksp_monitor_norm(KSP ksp, PetscInt n, ++ PetscReal rnorm, void *vf) ++{ ++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf); ++ KSPMonitorTrueResidualNorm(ksp, n, rnorm, _vf); ++ return(0); ++} ++//----------------------------------------------------------------------------- + void PETScSNESSolver::set_linear_solver_parameters() + { + KSP ksp; +@@ -482,7 +511,7 @@ + PetscObjectGetComm((PetscObject)_snes, &comm); + + if (parameters["report"]) +- KSPMonitorSet(ksp, KSPMonitorDefault, PETSC_NULL, PETSC_NULL); ++ KSPMonitorSet(ksp, PETScSNESSolver::ksp_monitor, _snes_ctx.vf, PETSC_NULL); + + const std::string linear_solver = parameters["linear_solver"]; + const std::string preconditioner = parameters["preconditioner"]; +@@ -518,7 +547,7 @@ + KSPSetInitialGuessNonzero(ksp, PETSC_FALSE); + + if (krylov_parameters["monitor_convergence"]) +- KSPMonitorSet(ksp, KSPMonitorTrueResidualNorm, 0, 0); ++ KSPMonitorSet(ksp, PETScSNESSolver::ksp_monitor_norm, _snes_ctx.vf, 0); + + // Set tolerances + const int max_iters = krylov_parameters["maximum_iterations"]; +diff -Naur dolfin-1.6.0/dolfin/nls/PETScSNESSolver.h dolfin-1.6.0.new/dolfin/nls/PETScSNESSolver.h +--- dolfin-1.6.0/dolfin/nls/PETScSNESSolver.h 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/nls/PETScSNESSolver.h 2016-06-26 22:31:21.554129282 +0200 +@@ -24,6 +24,7 @@ + + #include <map> + #include <petscsnes.h> ++#include <petscviewer.h> + #include <memory> + #include <dolfin/nls/NewtonSolver.h> + #include <dolfin/parameter/Parameters.h> +@@ -124,8 +125,15 @@ + Vec f_tmp; + const PETScVector* xl; + const PETScVector* xu; ++ PetscViewerAndFormat* vf; + }; + ++ ++ // monitoring functions ++ static PetscErrorCode snes_monitor(SNES snes, PetscInt its, PetscReal fgnorm, void* ctx); ++ static PetscErrorCode ksp_monitor(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx); ++ static PetscErrorCode ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx); ++ + // PETSc solver pointer + SNES _snes; + +diff -Naur dolfin-1.6.0/dolfin/nls/PETScTAOSolver.cpp dolfin-1.6.0.new/dolfin/nls/PETScTAOSolver.cpp +--- dolfin-1.6.0/dolfin/nls/PETScTAOSolver.cpp 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/nls/PETScTAOSolver.cpp 2016-06-27 19:14:47.367885081 +0200 +@@ -186,6 +186,15 @@ + init(optimisation_problem, x.down_cast<PETScVector>(), lb, ub); + } + //----------------------------------------------------------------------------- ++PetscErrorCode ++PETScTAOSolver::ksp_monitor_norm(KSP ksp, PetscInt n, ++ PetscReal rnorm, void * vf) ++{ ++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf); ++ KSPMonitorTrueResidualNorm(ksp, n, rnorm, _vf); ++ return(0); ++} ++//----------------------------------------------------------------------------- + void PETScTAOSolver::init(OptimisationProblem& optimisation_problem, + PETScVector& x, + const PETScVector& lb, +@@ -365,9 +374,7 @@ + set_tao(parameters["method"]); + + // Set tolerances +- TaoSetTolerances(_tao, parameters["function_absolute_tol"], +- parameters["function_relative_tol"], +- parameters["gradient_absolute_tol"], ++ TaoSetTolerances(_tao, parameters["gradient_absolute_tol"], + parameters["gradient_relative_tol"], + parameters["gradient_t_tol"]); + +@@ -490,8 +497,10 @@ + KSPSetInitialGuessNonzero(ksp, PETSC_FALSE); + + // KSP monitor +- if (krylov_parameters["monitor_convergence"]) +- KSPMonitorSet(ksp, KSPMonitorTrueResidualNorm, 0, 0); ++ if (krylov_parameters["monitor_convergence"]) { ++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &vf); ++ KSPMonitorSet(ksp, ksp_monitor_norm, vf, 0); ++ } + + // Get integer tolerances (to take care of casting to PetscInt) + const int max_iter = krylov_parameters["maximum_iterations"]; +diff -Naur dolfin-1.6.0/dolfin/nls/PETScTAOSolver.h dolfin-1.6.0.new/dolfin/nls/PETScTAOSolver.h +--- dolfin-1.6.0/dolfin/nls/PETScTAOSolver.h 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/nls/PETScTAOSolver.h 2016-06-27 19:08:00.634361160 +0200 +@@ -146,6 +146,10 @@ + // TAO pointer + Tao _tao; + ++ // monitoring functions ++ PetscViewerAndFormat* vf; ++ static PetscErrorCode ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx); ++ + // Update parameters when tao/ksp/pc_types are explictly given + void update_parameters(const std::string tao_type, + const std::string ksp_type, +diff -Naur dolfin-1.6.0/dolfin/nls/TAOLinearBoundSolver.cpp dolfin-1.6.0.new/dolfin/nls/TAOLinearBoundSolver.cpp +--- dolfin-1.6.0/dolfin/nls/TAOLinearBoundSolver.cpp 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/nls/TAOLinearBoundSolver.cpp 2016-06-27 19:17:10.390216576 +0200 +@@ -313,9 +313,7 @@ + dolfin_assert(_tao); + + // Set tolerances +- TaoSetTolerances(_tao, parameters["function_absolute_tol"], +- parameters["function_relative_tol"], +- parameters["gradient_absolute_tol"], ++ TaoSetTolerances(_tao, parameters["gradient_absolute_tol"], + parameters["gradient_relative_tol"], + parameters["gradient_t_tol"]); + +@@ -340,6 +338,15 @@ + set_solver(method); + } + //----------------------------------------------------------------------------- ++PetscErrorCode ++TAOLinearBoundSolver::ksp_monitor_norm(KSP ksp, PetscInt n, ++ PetscReal rnorm, void * vf) ++{ ++ PetscViewerAndFormat * _vf = static_cast<PetscViewerAndFormat *>(vf); ++ KSPMonitorTrueResidualNorm(ksp, n, rnorm, _vf); ++ return(0); ++} ++//----------------------------------------------------------------------------- + void TAOLinearBoundSolver::set_ksp_options() + { + dolfin_assert(_tao); +@@ -360,8 +367,10 @@ + else + KSPSetInitialGuessNonzero(ksp, PETSC_FALSE); + +- if (krylov_parameters["monitor_convergence"]) +- KSPMonitorSet(ksp, KSPMonitorTrueResidualNorm, 0, 0); ++ if (krylov_parameters["monitor_convergence"]) { ++ PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_DEFAULT, &vf); ++ KSPMonitorSet(ksp, ksp_monitor_norm, vf, 0); ++ } + + // Set tolerances + const int max_ksp_it = krylov_parameters["maximum_iterations"]; +diff -Naur dolfin-1.6.0/dolfin/nls/TAOLinearBoundSolver.h dolfin-1.6.0.new/dolfin/nls/TAOLinearBoundSolver.h +--- dolfin-1.6.0/dolfin/nls/TAOLinearBoundSolver.h 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0.new/dolfin/nls/TAOLinearBoundSolver.h 2016-06-27 19:08:09.157561005 +0200 +@@ -174,6 +174,10 @@ + // Tao solver pointer + Tao _tao; + ++ // monitoring functions ++ PetscViewerAndFormat* vf; ++ static PetscErrorCode ksp_monitor_norm(KSP ksp, PetscInt n, PetscReal rnorm, void *ctx); ++ + // Petsc preconditioner + std::shared_ptr<PETScPreconditioner> preconditioner; + diff --git a/var/spack/repos/builtin/packages/fenics/petsc-version-detection.patch b/var/spack/repos/builtin/packages/fenics/petsc-version-detection.patch new file mode 100644 index 0000000000..1429cd7bc6 --- /dev/null +++ b/var/spack/repos/builtin/packages/fenics/petsc-version-detection.patch @@ -0,0 +1,39 @@ +--- dolfin-1.6.0.orig/cmake/modules/FindPETSc.cmake 2015-07-28 17:05:55.000000000 +0200 ++++ dolfin-1.6.0/cmake/modules/FindPETSc.cmake 2016-06-27 17:16:02.484402705 +0200 +@@ -207,13 +207,7 @@ + + endif() + +-# Build PETSc test program +-if (DOLFIN_SKIP_BUILD_TESTS) +- set(PETSC_TEST_RUNS TRUE) +- set(PETSC_VERSION "UNKNOWN") +- set(PETSC_VERSION_OK TRUE) +-elseif (FOUND_PETSC_CONF) +- ++if (FOUND_PETSC_CONF) + # Set flags for building test program + set(CMAKE_REQUIRED_INCLUDES ${PETSC_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES ${PETSC_LIBRARIES}) +@@ -271,7 +265,10 @@ + set(PETSC_VERSION_OK TRUE) + endif() + mark_as_advanced(PETSC_VERSION_OK) ++endif() + ++ # Build PETSc test program ++if (NOT DOLFIN_SKIP_BUILD_TESTS AND FOUND_PETSC_CONF) + # Run PETSc test program + set(PETSC_TEST_LIB_CPP + "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/petsc_test_lib.cpp") +@@ -359,7 +356,9 @@ + else() + message(STATUS "PETSc configured without Cusp support") + endif() +- ++else() ++ set(PETSC_TEST_RUNS TRUE) ++ + endif() + + # Check sizeof(PetscInt) diff --git a/var/spack/repos/builtin/packages/foam-extend/package.py b/var/spack/repos/builtin/packages/foam-extend/package.py new file mode 100644 index 0000000000..4479fc9bee --- /dev/null +++ b/var/spack/repos/builtin/packages/foam-extend/package.py @@ -0,0 +1,235 @@ +from spack import * +from spack.environment import * + +import multiprocessing +import os + + +class FoamExtend(Package): + """The foam-extend project is a fork of the OpenFOAM open source library + for Computational Fluid Dynamics (CFD).""" + + homepage = "http://www.extend-project.de/" + + version('3.2', git='http://git.code.sf.net/p/foam-extend/foam-extend-3.2') + version('3.1', git='http://git.code.sf.net/p/foam-extend/foam-extend-3.1') + version('3.0', git='http://git.code.sf.net/p/foam-extend/foam-extend-3.0') + + variant('paraview', default=False, description='Enable ParaFOAM') + variant('scotch', default=True, description='Activate Scotch as a possible decomposition library') + variant('ptscotch', default=True, description='Activate PT-Scotch as a possible decomposition library') + variant('metis', default=True, description='Activate Metis as a possible decomposition library') + variant('parmetis', default=True, description='Activate Parmetis as a possible decomposition library') + variant('parmgridgen', default=True, description='Activate Parmgridgen support') + variant('source', default=True, description='Installs also the source folder') + + supported_compilers = {'clang': 'Clang', 'gcc': 'Gcc', 'intel': 'Icc'} + + depends_on('mpi') + depends_on('python') + depends_on('flex@:2.5.99') + depends_on('zlib') + + depends_on('scotch ~ metis', when='~ptscotch+scotch') + depends_on('scotch ~ metis + mpi', when='+ptscotch') + depends_on('metis@5:', when='+metis') + depends_on('parmetis', when='+parmetis') + depends_on('parmgridgen', when='+parmgridgen') + + depends_on('paraview', when='+paraview') + + def set_arch(self): + (sysname, nodename, release, version, machine) = os.uname() + + if self.compiler.name not in self.supported_compilers: + raise RuntimeError('{0} is not a supported compiler \ + to compile OpenFOAM'.format(self.compiler.name)) + + foam_compiler = self.supported_compilers[self.compiler.name] + if sysname == 'Linux': + arch = 'linux' + if foam_compiler == 'Clang': + raise RuntimeError('OS, compiler combination not\ + supported ({0} {1})'.format(sysname, foam_compiler)) + elif sysname == 'Darwin': + if machine == 'x86_64': + arch = 'darwinIntel' + if foam_compiler == 'Icc': + raise RuntimeError('OS, compiler combination not\ + supported ({0} {1})'.format(sysname, foam_compiler)) + else: + raise RuntimeError('{0} {1} is not a \ + supported architecture'.format(sysname, machine)) + + return (arch, foam_compiler) + + def get_openfoam_environment(self): + return EnvironmentModifications.from_sourcing_files( + join_path(self.stage.source_path, + 'etc/bashrc')) + + def patch(self): + # change names to match the package and not the one patch in + # the Third-Party of foam-extend + if '+parmgridgen' in self.spec: + filter_file(r'-lMGridGen', + r'-lmgrid', + 'src/dbns/Make/options') + + filter_file( + r'-lMGridGen', + r'-lmgrid', + 'src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options') # NOQA: ignore=501 + + # Get the wmake arch and compiler + (arch, foam_compiler) = self.set_arch() + + prefs_dict = { + 'compilerInstall': 'System', + 'WM_COMPILER': foam_compiler, + 'WM_ARCH_OPTION': '64', + 'WM_PRECISION_OPTION': 'DP', + 'WM_COMPILE_OPTION': 'SPACKOpt', + 'WM_MPLIB': 'SPACK', + + 'CMAKE_DIR': self.spec['cmake'].prefix, + 'CMAKE_BIN_DIR': self.spec['cmake'].prefix.bin, + 'PYTHON_DIR': self.spec['python'].prefix, + 'PYTHON_BIN_DIR': self.spec['python'].prefix.bin, + + 'FLEX_SYSTEM': 1, + 'FLEX_DIR': self.spec['flex'].prefix, + + 'BISON_SYSTEM': 1, + 'BISON_DIR': self.spec['flex'].prefix, + + 'ZLIB_SYSTEM': 1, + 'ZLIB_DIR': self.spec['zlib'].prefix, + } + + if '+scotch' in self.spec or '+ptscotch' in self.spec: + prefs_dict['SCOTCH_SYSTEM'] = 1 + prefs_dict['SCOTCH_DIR'] = self.spec['scotch'].prefix + prefs_dict['SCOTCH_BIN_DIR'] = self.spec['scotch'].prefix.bin + prefs_dict['SCOTCH_LIB_DIR'] = self.spec['scotch'].prefix.lib + prefs_dict['SCOTCH_INCLUDE_DIR'] = \ + self.spec['scotch'].prefix.include + + if '+metis' in self.spec: + prefs_dict['METIS_SYSTEM'] = 1 + prefs_dict['METIS_DIR'] = self.spec['metis'].prefix + prefs_dict['METIS_BIN_DIR'] = self.spec['metis'].prefix.bin + prefs_dict['METIS_LIB_DIR'] = self.spec['metis'].prefix.lib + prefs_dict['METIS_INCLUDE_DIR'] = self.spec['metis'].prefix.include + + if '+parmetis' in self.spec: + prefs_dict['PARMETIS_SYSTEM'] = 1 + prefs_dict['PARMETIS_DIR'] = self.spec['parmetis'].prefix + prefs_dict['PARMETIS_BIN_DIR'] = self.spec['parmetis'].prefix.bin + prefs_dict['PARMETIS_LIB_DIR'] = self.spec['parmetis'].prefix.lib + prefs_dict['PARMETIS_INCLUDE_DIR'] = \ + self.spec['parmetis'].prefix.include + + if '+parmgridgen' in self.spec: + prefs_dict['PARMGRIDGEN_SYSTEM'] = 1 + prefs_dict['PARMGRIDGEN_DIR'] = self.spec['parmgridgen'].prefix + prefs_dict['PARMGRIDGEN_BIN_DIR'] = \ + self.spec['parmgridgen'].prefix.bin + prefs_dict['PARMGRIDGEN_LIB_DIR'] = \ + self.spec['parmgridgen'].prefix.lib + prefs_dict['PARMGRIDGEN_INCLUDE_DIR'] = \ + self.spec['parmgridgen'].prefix.include + + if '+paraview' in self.spec: + prefs_dict['PARAVIEW_SYSTEM'] = 1 + prefs_dict['PARAVIEW_DIR'] = self.spec['paraview'].prefix, + prefs_dict['PARAVIEW_BIN_DIR'] = self.spec['paraview'].prefix.bin, + prefs_dict['QT_SYSTEM'] = 1 + prefs_dict['QT_DIR'] = self.spec['qt'].prefix, + prefs_dict['QT_BIN_DIR'] = self.spec['qt'].prefix.bin, + + # write the prefs files to define the configuration needed, + # only the prefs.sh is used by this script but both are + # installed for end users + with working_dir('.'): + with open("etc/prefs.sh", "w") as fh: + for key in sorted(prefs_dict): + fh.write('export {0}={1}\n'.format(key, prefs_dict[key])) + + with open("etc/prefs.csh", "w") as fh: + for key in sorted(prefs_dict): + fh.write('setenv {0}={1}\n'.format(key, prefs_dict[key])) + + # Defining a different mpi and optimisation file to be able to + # make wmake get spack info with minimum modifications on + # configurations scripts + mpi_info = [ + 'PFLAGS = -DOMPI_SKIP_MPICXX -DMPICH_IGNORE_CXX_SEEK', + 'PINC = -I{0}'.format(self.spec['mpi'].prefix.include), + 'PLIBS = -L{0} -lmpi'.format(self.spec['mpi'].prefix.lib) + ] + + arch_path = ''.join([arch, prefs_dict['WM_ARCH_OPTION'], + foam_compiler]) + option_path = ''.join([arch_path, + prefs_dict['WM_PRECISION_OPTION'], + prefs_dict['WM_COMPILE_OPTION']]) + rule_path = join_path("wmake", "rules", arch_path) + build_path = join_path(self.stage.source_path, 'lib', option_path) + install_path = \ + join_path(self.prefix, + 'foam-extend-{0}'.format(self.version.up_to(2)), + option_path) + + rpaths_foam = ' '.join([ + '{0}{1}'.format(self.compiler.cxx_rpath_arg, + install_path), + '{0}{1}'.format(self.compiler.cxx_rpath_arg, + build_path) + ]) + + compiler_flags = { + 'DBUG': rpaths_foam, + 'OPT': '-O3', + } + + with working_dir(rule_path): + with open('mplibSPACK', "w") as fh: + fh.write('\n'.join(mpi_info)) + + for comp in ['c', 'c++']: + with open('{0}SPACKOpt'.format(comp), "w") as fh: + for key, val in compiler_flags.iteritems(): + fh.write('{0}{1} = {2}\n'.format(comp, key, val)) + + def setup_environment(self, spack_env, run_env): + with working_dir(self.stage.path): + spack_env.set('FOAM_INST_DIR', os.path.abspath('.')) + + (arch, foam_compiler) = self.set_arch() + + run_env.set('FOAM_INST_DIR', self.prefix) + + def install(self, spec, prefix): + env_openfoam = self.get_openfoam_environment() + env_openfoam.apply_modifications() + + if self.parallel: + os.environ['WM_NCOMPPROCS'] = str(self.make_jobs) \ + if self.make_jobs else str(multiprocessing.cpu_count()) + + allwmake = Executable('./Allwmake') + allwmake() + + install_path = \ + join_path(self.prefix, + 'foam-extend-{0}'.format(self.version.up_to(2))) + + if '+source' in spec: + install_tree('src', join_path(install_path, 'src')) + + install_tree('lib', join_path(install_path, 'lib')) + install_tree('bin', join_path(install_path, 'bin')) + install_tree('applications', join_path(install_path, 'applications')) + install_tree('etc', join_path(install_path, 'etc')) + install_tree('wmake', join_path(install_path, 'wmake')) diff --git a/var/spack/repos/builtin/packages/freetype/package.py b/var/spack/repos/builtin/packages/freetype/package.py index 897c011396..dd181623d0 100644 --- a/var/spack/repos/builtin/packages/freetype/package.py +++ b/var/spack/repos/builtin/packages/freetype/package.py @@ -24,17 +24,18 @@ ############################################################################## from spack import * + class Freetype(Package): """Font package""" homepage = "http://http://www.freetype.org" url = "http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz" - version('2.5.3' , 'cafe9f210e45360279c730d27bf071e9') + version('2.5.3', 'cafe9f210e45360279c730d27bf071e9') depends_on('libpng') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure("--prefix=%s" % prefix, "--with-harfbuzz=no") make() make("install") diff --git a/var/spack/repos/builtin/packages/giflib/package.py b/var/spack/repos/builtin/packages/giflib/package.py new file mode 100644 index 0000000000..7082384b9b --- /dev/null +++ b/var/spack/repos/builtin/packages/giflib/package.py @@ -0,0 +1,41 @@ +############################################################################## +# 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 Giflib(Package): + """The GIFLIB project maintains the giflib service library, which has + been pulling images out of GIFs since 1989.""" + + homepage = "http://giflib.sourceforge.net/" + url = "https://downloads.sourceforge.net/project/giflib/giflib-5.1.4.tar.bz2" + + version('5.1.4', '2c171ced93c0e83bb09e6ccad8e3ba2b') + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix) + + make() + make("install") diff --git a/var/spack/repos/builtin/packages/glib/g_date_strftime.patch b/var/spack/repos/builtin/packages/glib/g_date_strftime.patch new file mode 100644 index 0000000000..532c743277 --- /dev/null +++ b/var/spack/repos/builtin/packages/glib/g_date_strftime.patch @@ -0,0 +1,34 @@ +From 00148329967adb196138372771052a3f606a6ea3 Mon Sep 17 00:00:00 2001 +From: coypu <coypu@sdf.org> +Date: Wed, 2 Mar 2016 19:43:10 +0200 +Subject: [PATCH 2/2] gdate: Suppress string format literal warning + +Newer versions of GCC emit an error here, but we know it's safe. +https://bugzilla.gnome.org/761550 +--- + glib/gdate.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/glib/gdate.c b/glib/gdate.c +index 4aece02..92c34d2 100644 +--- a/glib/gdate.c ++++ b/glib/gdate.c +@@ -2439,6 +2439,9 @@ win32_strftime_helper (const GDate *d, + * + * Returns: number of characters written to the buffer, or 0 the buffer was too small + */ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" ++ + gsize + g_date_strftime (gchar *s, + gsize slen, +@@ -2549,3 +2552,5 @@ g_date_strftime (gchar *s, + return retval; + #endif + } ++ ++#pragma GCC diagnostic pop +-- +2.7.1 + diff --git a/var/spack/repos/builtin/packages/glib/package.py b/var/spack/repos/builtin/packages/glib/package.py index b146ea63d8..342a61a6a1 100644 --- a/var/spack/repos/builtin/packages/glib/package.py +++ b/var/spack/repos/builtin/packages/glib/package.py @@ -25,20 +25,24 @@ from spack import * import sys + class Glib(Package): """The GLib package contains a low-level libraries useful for providing data structure handling for C, portability wrappers and interfaces for such runtime functionality as an event loop, threads, dynamic loading and an object system.""" homepage = "https://developer.gnome.org/glib/" - url = "http://ftp.gnome.org/pub/gnome/sources/glib/2.42/glib-2.42.1.tar.xz" + url = "http://ftp.gnome.org/pub/gnome/sources/glib/2.42/glib-2.42.1.tar.xz" version('2.42.1', '89c4119e50e767d3532158605ee9121a') depends_on("libffi") depends_on("zlib") depends_on("pkg-config") - depends_on('gettext', sys.platform=='darwin') + depends_on('gettext', sys.platform == 'darwin') + + # The following patch is needed for gcc-6.1 + patch('g_date_strftime.patch') def install(self, spec, prefix): configure("--prefix=%s" % prefix) diff --git a/var/spack/repos/builtin/packages/harfbuzz/package.py b/var/spack/repos/builtin/packages/harfbuzz/package.py index e4c1b80de3..f8d73d651b 100644 --- a/var/spack/repos/builtin/packages/harfbuzz/package.py +++ b/var/spack/repos/builtin/packages/harfbuzz/package.py @@ -24,6 +24,7 @@ ############################################################################## from spack import * + class Harfbuzz(Package): """The Harfbuzz package contains an OpenType text shaping engine.""" homepage = "http://www.freedesktop.org/wiki/Software/HarfBuzz/" @@ -34,6 +35,8 @@ class Harfbuzz(Package): depends_on("glib") depends_on("icu") depends_on("freetype") + depends_on("cairo") + depends_on("zlib") def patch(self): change_sed_delimiter('@', ';', 'src/Makefile.in') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index e46f432be5..51a5823aa5 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -70,7 +70,8 @@ class Hdf5(Package): raise RuntimeError(msg) if '+threadsafe' in spec and ('+cxx' in spec or '+fortran' in spec): - raise RuntimeError("cannot use variant +threadsafe with either +cxx or +fortran") + msg = 'cannot use variant +threadsafe with either +cxx or +fortran' + raise RuntimeError(msg) def install(self, spec, prefix): self.validate(spec) @@ -164,7 +165,7 @@ int main(int argc, char **argv) { """ expected = """\ HDF5 version {version} {version} -""".format(version=str(spec.version)) +""".format(version=str(spec.version.up_to(3))) with open("check.c", 'w') as f: f.write(source) if '+mpi' in spec: @@ -185,24 +186,30 @@ HDF5 version {version} {version} if not success: print "Produced output does not match expected output." print "Expected output:" - print '-'*80 + print '-' * 80 print expected - print '-'*80 + print '-' * 80 print "Produced output:" - print '-'*80 + print '-' * 80 print output - print '-'*80 + print '-' * 80 raise RuntimeError("HDF5 install check failed") shutil.rmtree(checkdir) def url_for_version(self, version): - v = str(version) + base_url = "http://www.hdfgroup.org/ftp/HDF5/releases" if version == Version("1.2.2"): - return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + v + ".tar.gz" + return "{0}/hdf5-{1}.tar.gz".format(base_url, version) + elif version < Version("1.6.6"): + return "{0}/hdf5-{1}/hdf5-{2}.tar.gz".format( + base_url, version.up_to(2), version) elif version < Version("1.7"): - return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + version.up_to(2) + "/hdf5-" + v + ".tar.gz" + return "{0}/hdf5-{1}/hdf5-{2}/src/hdf5-{2}.tar.gz".format( + base_url, version.up_to(2), version) elif version < Version("1.10"): - return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + v + "/src/hdf5-" + v + ".tar.gz" + return "{0}/hdf5-{1}/src/hdf5-{1}.tar.gz".format( + base_url, version) else: - return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + version.up_to(2) + "/hdf5-" + v + "/src/hdf5-" + v + ".tar.gz" + return "{0}/hdf5-{1}/hdf5-{2}/src/hdf5-{2}.tar.gz".format( + base_url, version.up_to(2), version) diff --git a/var/spack/repos/builtin/packages/julia/package.py b/var/spack/repos/builtin/packages/julia/package.py index 69b52130e9..99d138dcff 100644 --- a/var/spack/repos/builtin/packages/julia/package.py +++ b/var/spack/repos/builtin/packages/julia/package.py @@ -22,8 +22,9 @@ # 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 Julia(Package): """The Julia Language: A fresh approach to technical computing""" @@ -32,10 +33,14 @@ class Julia(Package): version('master', git='https://github.com/JuliaLang/julia.git', branch='master') + version('release-0.4', + git='https://github.com/JuliaLang/julia.git', branch='release-0.4') + version('0.4.6', 'd88db18c579049c23ab8ef427ccedf5d', preferred=True) version('0.4.5', '69141ff5aa6cee7c0ec8c85a34aa49a6') version('0.4.3', '8a4a59fd335b05090dd1ebefbbe5aaac') - patch('gc.patch') + patch('gc.patch', when='@0.4:0.4.5') + patch('gc.patch', when='@release-0.4') patch('openblas.patch', when='@0.4:0.4.5') # Build-time dependencies: @@ -92,25 +97,21 @@ class Julia(Package): depends_on("mpi") def install(self, spec, prefix): - if '@master' in spec: - # Julia needs to know the offset from a specific commit - git = which('git') - git('fetch', '--unshallow') - # Explicitly setting CC, CXX, or FC breaks building libuv, one # of Julia's dependencies. This might be a Darwin-specific # problem. Given how Spack sets up compilers, Julia should # still use Spack's compilers, even if we don't specify them # explicitly. - options = [#"CC=cc", - #"CXX=c++", - #"FC=fc", - #"USE_SYSTEM_ARPACK=1", - #"USE_SYSTEM_FFTW=1", - #"USE_SYSTEM_GMP=1", - #"USE_SYSTEM_MPFR=1", - #TODO "USE_SYSTEM_PCRE=1", - "prefix=%s" % prefix] + options = [ + # "CC=cc", + # "CXX=c++", + # "FC=fc", + # "USE_SYSTEM_ARPACK=1", + # "USE_SYSTEM_FFTW=1", + # "USE_SYSTEM_GMP=1", + # "USE_SYSTEM_MPFR=1", + # "USE_SYSTEM_PCRE=1", + "prefix=%s" % prefix] with open('Make.user', 'w') as f: f.write('\n'.join(options) + '\n') make() diff --git a/var/spack/repos/builtin/packages/libaio/package.py b/var/spack/repos/builtin/packages/libaio/package.py new file mode 100644 index 0000000000..735ced047b --- /dev/null +++ b/var/spack/repos/builtin/packages/libaio/package.py @@ -0,0 +1,43 @@ +############################################################################## +# 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 Libaio(Package): + """This is the linux native Asynchronous I/O interface library.""" + + homepage = "https://git.fedorahosted.org/cgit/libaio.git" + url = "https://git.fedorahosted.org/cgit/libaio.git/snapshot/libaio-0.3.110-1.tar.gz" + + version('0.3.110-1', 'eb6b1b435afadb5b80c5dd80984249f6') + + def install(self, spec, prefix): + # libaio is not supported on OS X + if spec.satisfies('arch=darwin-x86_64'): + # create a dummy directory + mkdir(prefix.lib) + return + + make('prefix={0}'.format(prefix), 'install') diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index 90e7b3b643..0e410a5061 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -24,18 +24,30 @@ ############################################################################## from spack import * + class Libtool(Package): - """libtool -- library building part of autotools""" - homepage = "https://www.gnu.org/software/libtool/" - url = "http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz" + """ + libtool -- library building part of autotools + """ + homepage = 'https://www.gnu.org/software/libtool/' + url = 'http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz' - version('2.4.6' , 'addf44b646ddb4e3919805aa88fa7c5e') - version('2.4.2' , 'd2f3b7d4627e69e13514a40e72a24d50') + version('2.4.6', 'addf44b646ddb4e3919805aa88fa7c5e') + version('2.4.2', 'd2f3b7d4627e69e13514a40e72a24d50') depends_on('m4') + def _make_executable(self, name): + return Executable(join_path(self.prefix.bin, name)) + + def setup_dependent_package(self, module, dependent_spec): + # Automake is very likely to be a build dependency, + # so we add the tools it provides to the dependent module + executables = ['libtoolize', 'libtool'] + for name in executables: + setattr(module, name, self._make_executable(name)) + def install(self, spec, prefix): configure("--prefix=%s" % prefix) - make() make("install") diff --git a/var/spack/repos/builtin/packages/libxpm/package.py b/var/spack/repos/builtin/packages/libxpm/package.py new file mode 100644 index 0000000000..10ca8158c2 --- /dev/null +++ b/var/spack/repos/builtin/packages/libxpm/package.py @@ -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 Libxpm(Package): + """Xpm file format library""" + + homepage = "https://www.x.org/" + url = "https://www.x.org/archive//individual/lib/libXpm-3.5.11.tar.gz" + + version('3.5.11', '7c67c878ee048206b070bc0b24154f04') + version('3.5.10', 'a70507638d74541bf30a771f1e5938bb') + version('3.5.9', 'd6d4b0f76248a6b346eb42dfcdaa72a6') + version('3.5.8', '2d81d6633e67ac5562e2fbee126b2897') + version('3.5.7', '7bbc8f112f7143ed6961a58ce4e14558') + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix) + + make() + make("install") diff --git a/var/spack/repos/builtin/packages/lrzip/package.py b/var/spack/repos/builtin/packages/lrzip/package.py new file mode 100644 index 0000000000..42542acfdb --- /dev/null +++ b/var/spack/repos/builtin/packages/lrzip/package.py @@ -0,0 +1,61 @@ +############################################################################## +# 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 Lrzip(Package): + """A compression utility that excels at compressing large files + (usually > 10-50 MB). Larger files and/or more free RAM means that the + utility will be able to more effectively compress your files (ie: faster / + smaller size), especially if the filesize(s) exceed 100 MB. You can either + choose to optimise for speed (fast compression / decompression) or size, + but not both.""" + + homepage = 'http://lrzip.kolivas.org' + url = 'https://github.com/ckolivas/lrzip/archive/v0.630.tar.gz' + + version('master', git='https://github.com/ckolivas/lrzip.git') + version('0.630', '3ca7f1d1365aa105089d1fbfc6b0924a') + version('0.621', '1f07227b39ae81a98934411e8611e341') + version('0.616', 'd40bdb046d0807ef602e36b1e9782cc0') + version('0.615', 'f1c01e7f3de07f54d916b61c989dfaf2') + + # depends_on('coreutils') + depends_on('lzo') + depends_on('zlib') + depends_on('bzip2') + + def install(self, spec, prefix): + set_executable('./autogen.sh') + autogen = Executable('./autogen.sh') + + configure_args = [ + '--prefix={0}'.format(prefix), + '--disable-dependency-tracking' + ] + autogen(*configure_args) + + make() + make('install') diff --git a/var/spack/repos/builtin/packages/lzo/package.py b/var/spack/repos/builtin/packages/lzo/package.py new file mode 100644 index 0000000000..0961bbb58c --- /dev/null +++ b/var/spack/repos/builtin/packages/lzo/package.py @@ -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 Lzo(Package): + """Real-time data compression library""" + + homepage = 'https://www.oberhumer.com/opensource/lzo/' + url = 'https://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz' + + version('2.09', 'c7ffc9a103afe2d1bba0b015e7aa887f') + version('2.08', 'fcec64c26a0f4f4901468f360029678f') + version('2.07', '4011935e95171e78ad4894f7335c982a') + version('2.06', '95380bd4081f85ef08c5209f4107e9f8') + version('2.05', 'c67cda5fa191bab761c7cb06fe091e36') + + def install(self, spec, prefix): + configure_args = [ + '--prefix={0}'.format(prefix), + '--disable-dependency-tracking', + '--enable-shared' + ] + configure(*configure_args) + make() + make('check') + make('install') diff --git a/var/spack/repos/builtin/packages/mariadb/package.py b/var/spack/repos/builtin/packages/mariadb/package.py new file mode 100644 index 0000000000..d9df200d02 --- /dev/null +++ b/var/spack/repos/builtin/packages/mariadb/package.py @@ -0,0 +1,59 @@ +############################################################################## +# 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 Mariadb(Package): + """MariaDB turns data into structured information in a wide array of + applications, ranging from banking to websites. It is an enhanced, drop-in + replacement for MySQL. MariaDB is used because it is fast, scalable and + robust, with a rich ecosystem of storage engines, plugins and many other + tools make it very versatile for a wide variety of use cases.""" + + homepage = "https://mariadb.org/about/" + url = "https://downloads.mariadb.org/f/mariadb-10.1.14/source/mariadb-10.1.14.tar.gz" + + version('10.1.14', '294925531e0fd2f0461e3894496a5adc') + version('5.5.49', '67b5a499a5f158b2a586e6e3bfb4f304') + + variant('nonblocking', default=True, description='Allow non blocking ' + 'operations in the mariadb client library.') + + depends_on('boost') + depends_on('cmake') + depends_on('jemalloc') + depends_on('libaio') + depends_on('libedit') + depends_on('libevent', when='+nonblocking') + depends_on('ncurses') + depends_on('zlib') + + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + + cmake('..', *std_cmake_args) + + make() + make('install') diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index ea1844aea0..90670ee517 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -50,6 +50,11 @@ class Mpich(Package): provides('mpi@:1.3', when='@1:') def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc')) + spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpic++')) + spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77')) + spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90')) + spack_env.set('MPICH_CC', spack_cc) spack_env.set('MPICH_CXX', spack_cxx) spack_env.set('MPICH_F77', spack_f77) diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py index 34bace10d6..da386445bb 100644 --- a/var/spack/repos/builtin/packages/mvapich2/package.py +++ b/var/spack/repos/builtin/packages/mvapich2/package.py @@ -191,6 +191,11 @@ class Mvapich2(Package): run_env.set('SLURM_MPI_TYPE', 'pmi2') def setup_dependent_environment(self, spack_env, run_env, extension_spec): + spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc')) + spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpicxx')) + spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77')) + spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90')) + spack_env.set('MPICH_CC', spack_cc) spack_env.set('MPICH_CXX', spack_cxx) spack_env.set('MPICH_F77', spack_f77) diff --git a/var/spack/packages/mxml/package.py b/var/spack/repos/builtin/packages/mxml/package.py index f79251d312..254a5f1595 100644 --- a/var/spack/packages/mxml/package.py +++ b/var/spack/repos/builtin/packages/mxml/package.py @@ -1,14 +1,15 @@ -import os from spack import * + class Mxml(Package): - """Mini-XML is a small XML library that you can use to read and write XML - and XML-like data files in your application without requiring large - non-standard libraries + """ + Mini-XML is a small XML library that you can use to read and write XML + and XML-like data files in your application without requiring large + non-standard libraries """ homepage = "http://www.msweet.org" - url = "http://www.msweet.org/files/project3/mxml-2.9.tar.gz" + url = "http://www.msweet.org/files/project3/mxml-2.9.tar.gz" version('2.9', 'e21cad0f7aacd18f942aa0568a8dee19') version('2.8', 'd85ee6d30de053581242c4a86e79a5d2') @@ -16,11 +17,11 @@ class Mxml(Package): version('2.6', '68977789ae64985dddbd1a1a1652642e') version('2.5', 'f706377fba630b39fa02fd63642b17e5') - # module swap PrgEnv-intel PrgEnv-$COMP (Can use whatever compiler you want to use) + # module swap PrgEnv-intel PrgEnv-$COMP + # (Can use whatever compiler you want to use) # Case statement to change CC and CXX flags def install(self, spec, prefix): configure('--prefix=%s' % prefix, "--disable-shared", 'CFLAGS=-static') make() make("install") - diff --git a/var/spack/repos/builtin/packages/netcdf-fortran/package.py b/var/spack/repos/builtin/packages/netcdf-fortran/package.py index 3d1951ceee..e52ff1af87 100644 --- a/var/spack/repos/builtin/packages/netcdf-fortran/package.py +++ b/var/spack/repos/builtin/packages/netcdf-fortran/package.py @@ -24,12 +24,14 @@ ############################################################################## from spack import * + class NetcdfFortran(Package): """Fortran interface for NetCDF4""" homepage = "http://www.unidata.ucar.edu/software/netcdf" url = "http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.4.3.tar.gz" + version('4.4.4', 'e855c789cd72e1b8bc1354366bf6ac72') version('4.4.3', 'bfd4ae23a34635b273d3eb0d91cbde9e') depends_on('netcdf') diff --git a/var/spack/repos/builtin/packages/openjpeg/package.py b/var/spack/repos/builtin/packages/openjpeg/package.py index 9b2063593a..1d00edb06d 100644 --- a/var/spack/repos/builtin/packages/openjpeg/package.py +++ b/var/spack/repos/builtin/packages/openjpeg/package.py @@ -24,6 +24,7 @@ ############################################################################## from spack import * + class Openjpeg(Package): """ OpenJPEG is an open-source JPEG 2000 codec written in C language. @@ -36,12 +37,13 @@ class Openjpeg(Package): homepage = "https://github.com/uclouvain/openjpeg" url = "https://github.com/uclouvain/openjpeg/archive/version.2.1.tar.gz" - version('2.1' , '3e1c451c087f8462955426da38aa3b3d') + version('2.1', '3e1c451c087f8462955426da38aa3b3d') version('2.0.1', '105876ed43ff7dbb2f90b41b5a43cfa5') - version('2.0' , 'cdf266530fee8af87454f15feb619609') + version('2.0', 'cdf266530fee8af87454f15feb619609') version('1.5.2', '545f98923430369a6b046ef3632ef95c') version('1.5.1', 'd774e4b5a0db5f0f171c4fc0aabfa14e') + depends_on('cmake') def install(self, spec, prefix): cmake('.', *std_cmake_args) diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 588d862d96..15c8eefe96 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -109,6 +109,11 @@ class Openmpi(Package): 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): + spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc')) + spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpic++')) + spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77')) + spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90')) + spack_env.set('OMPI_CC', spack_cc) spack_env.set('OMPI_CXX', spack_cxx) spack_env.set('OMPI_FC', spack_fc) diff --git a/var/spack/repos/builtin/packages/parmgridgen/package.py b/var/spack/repos/builtin/packages/parmgridgen/package.py new file mode 100644 index 0000000000..02be777c36 --- /dev/null +++ b/var/spack/repos/builtin/packages/parmgridgen/package.py @@ -0,0 +1,71 @@ +############################################################################## +# 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 Parmgridgen(Package): + """MGRIDGEN is a serial library written entirely in ANSI C that implements + (serial) algorithms for obtaining a sequence of successive coarse grids + that are well-suited for geometric multigrid methods. + ParMGridGen is the parallel version of MGridGen + """ + + homepage = "http://www-users.cs.umn.edu/~moulitsa/software.html" + url = "http://www-users.cs.umn.edu/~moulitsa/download/ParMGridGen-1.0.tar.gz" + + version('1.0', '2872fa95b7fb91d6bd525490eed62038') + + depends_on('mpi') + + def install(self, spec, prefix): + make_opts = [ + 'make=make', + 'COPTIONS=-fPIC', + 'LDOPTIONS=-fPIC', + 'CC={0}'.format(self.compiler.cc), + 'PARCC={0}'.format(spec['mpi'].mpicc), + 'LD={0}'.format(self.compiler.cc), + 'PARLD={0}'.format(spec['mpi'].mpicc), + 'LIBDIR=-L../..', + 'PARLIBS=-L../../ -lparmgrid -lmgrid -lm', + 'LIBS=-L../../ -lmgrid -lm', + 'parallel' + ] + + make(*make_opts, parallel=False) + + mkdirp(prefix.include, prefix.lib, prefix.bin) + + install("mgridgen.h", prefix.include) + install("parmgridgen.h", prefix.include) + + install("MGridGen/IMlib/libIMlib.a", + join_path(prefix.lib, 'libIMlib.a')) + install("libmgrid.a", prefix.lib) + install("libparmgrid.a", prefix.lib) + + install("mgridgen", prefix.bin) + install("parmgridgen", prefix.bin) diff --git a/var/spack/repos/builtin/packages/postgresql/package.py b/var/spack/repos/builtin/packages/postgresql/package.py index 9362234881..caf3768362 100644 --- a/var/spack/repos/builtin/packages/postgresql/package.py +++ b/var/spack/repos/builtin/packages/postgresql/package.py @@ -24,18 +24,21 @@ ############################################################################## from spack import * + class Postgresql(Package): - """PostgreSQL is a powerful, open source object-relational - database system. It has more than 15 years of active - development and a proven architecture that has earned it a - strong reputation for reliability, data integrity, and - correctness.""" + """PostgreSQL is a powerful, open source object-relational database system. + It has more than 15 years of active development and a proven architecture + that has earned it a strong reputation for reliability, data integrity, and + correctness.""" + homepage = "http://www.postgresql.org/" url = "http://ftp.postgresql.org/pub/source/v9.3.4/postgresql-9.3.4.tar.bz2" version('9.3.4', 'd0a41f54c377b2d2fab4a003b0dac762') + version('9.5.3', '3f0c388566c688c82b01a0edf1e6b7a0') - depends_on("openssl") + depends_on('openssl') + depends_on('readline') def install(self, spec, prefix): configure("--prefix=%s" % prefix, diff --git a/var/spack/repos/builtin/packages/py-basemap/package.py b/var/spack/repos/builtin/packages/py-basemap/package.py index 95d02bce91..13f604bacd 100644 --- a/var/spack/repos/builtin/packages/py-basemap/package.py +++ b/var/spack/repos/builtin/packages/py-basemap/package.py @@ -23,10 +23,12 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -import os + class PyBasemap(Package): - """The matplotlib basemap toolkit is a library for plotting 2D data on maps in Python.""" + """The matplotlib basemap toolkit is a library for plotting + 2D data on maps in Python.""" + homepage = "http://matplotlib.org/basemap/" url = "https://downloads.sourceforge.net/project/matplotlib/matplotlib-toolkits/basemap-1.0.7/basemap-1.0.7.tar.gz" @@ -36,7 +38,7 @@ class PyBasemap(Package): depends_on('py-setuptools') depends_on('py-numpy') depends_on('py-matplotlib+gui') - depends_on('py-pillow') + depends_on('pil') depends_on("geos") def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/py-pil/package.py b/var/spack/repos/builtin/packages/py-pil/package.py index dc4418fdfe..2b3cce26d3 100644 --- a/var/spack/repos/builtin/packages/py-pil/package.py +++ b/var/spack/repos/builtin/packages/py-pil/package.py @@ -24,14 +24,19 @@ ############################################################################## from spack import * + class PyPil(Package): - """The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.""" + """The Python Imaging Library (PIL) adds image processing capabilities + to your Python interpreter. This library supports many file formats, + and provides powerful image processing and graphics capabilities.""" homepage = "http://www.pythonware.com/products/pil/" url = "http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz" version('1.1.7', 'fc14a54e1ce02a0225be8854bfba478e') + provides('pil') + extends('python') def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/py-pillow/package.py b/var/spack/repos/builtin/packages/py-pillow/package.py index cdbc57e0a5..25cf412b31 100644 --- a/var/spack/repos/builtin/packages/py-pillow/package.py +++ b/var/spack/repos/builtin/packages/py-pillow/package.py @@ -23,77 +23,108 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -import os + class PyPillow(Package): - """Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors. The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.""" + """Pillow is a fork of the Python Imaging Library (PIL). It adds image + processing capabilities to your Python interpreter. This library supports + many file formats, and provides powerful image processing and graphics + capabilities.""" - homepage = "https://python-pillow.github.io/" + homepage = "https://python-pillow.org/" url = "https://pypi.python.org/packages/source/P/Pillow/Pillow-3.0.0.tar.gz" + # TODO: This version should be deleted once the next release comes out. + # TODO: It fixes a bug that prevented us from linking to Tk/Tcl. + # TODO: Tk/Tcl support is necessary for tkinter bitmap and photo images. + # TODO: If you require this support, run the following command: + # TODO: `spack install py-pillow@3.3.0.dev0 ^python+tk` + version('3.3.0.dev0', git='https://github.com/python-pillow/Pillow.git', + commit='30eced62868141a6c859a4370efd40b9434a7c3f') + + version('3.2.0', '7cfd093c11205d9e2ebe3c51dfcad510', preferred=True) version('3.0.0', 'fc8ac44e93da09678eac7e30c9b7377d') - provides('PIL') + + provides('pil') # These defaults correspond to Pillow defaults variant('jpeg', default=True, description='Provide JPEG functionality') variant('zlib', default=True, description='Access to compressed PNGs') variant('tiff', default=False, description='Access to TIFF files') variant('freetype', default=False, description='Font related services') - variant('tk', default=False, description='Support for tkinter bitmap and photo images') variant('lcms', default=False, description='Color management') + variant('jpeg2000', default=False, description='Provide JPEG 2000 functionality') # Spack does not (yet) support these modes of building - # variant('webp', default=False, description='') - # variant('webpmux', default=False, description='') - # variant('jpeg2000', default=False, description='') + # variant('webp', default=False, description='Provide the WebP format') + # variant('webpmux', default=False, description='WebP metadata, relies on WebP support') # NOQA: ignore=E501 + # variant('imagequant', default=False, description='Provide improved color quantization') # NOQA: ignore=E501 + # Required dependencies extends('python') depends_on('binutils') depends_on('py-setuptools') - depends_on('jpeg', when='+jpeg') # BUG: It will use the system libjpeg anyway + # Recommended dependencies + depends_on('jpeg', when='+jpeg') depends_on('zlib', when='+zlib') - depends_on('tiff', when='+tiff') + + # Optional dependencies + depends_on('libtiff', when='+tiff') depends_on('freetype', when='+freetype') depends_on('lcms', when='+lcms') - depends_on('tcl', when='+tk') - depends_on('tk', when='+tk') + depends_on('openjpeg', when='+jpeg2000') - def install(self, spec, prefix): - libpath=[] + # Spack does not (yet) support these modes of building + # depends_on('webp', when='+webp') + # depends_on('webpmux', when='+webpmux') + # depends_on('imagequant', when='+imagequant') + + def patch(self): + """Patch setup.py to provide lib and include directories + for dependencies.""" + + spec = self.spec + setup = FileFilter('setup.py') if '+jpeg' in spec: - libpath.append(join_path(spec['jpeg'].prefix, 'lib')) + setup.filter('JPEG_ROOT = None', + 'JPEG_ROOT = ("{0}", "{1}")'.format( + spec['jpeg'].prefix.lib, + spec['jpeg'].prefix.include)) if '+zlib' in spec: - libpath.append(join_path(spec['zlib'].prefix, 'lib')) + setup.filter('ZLIB_ROOT = None', + 'ZLIB_ROOT = ("{0}", "{1}")'.format( + spec['zlib'].prefix.lib, + spec['zlib'].prefix.include)) if '+tiff' in spec: - libpath.append(join_path(spec['tiff'].prefix, 'lib')) + setup.filter('TIFF_ROOT = None', + 'TIFF_ROOT = ("{0}", "{1}")'.format( + spec['libtiff'].prefix.lib, + spec['libtiff'].prefix.include)) if '+freetype' in spec: - libpath.append(join_path(spec['freetype'].prefix, 'lib')) + setup.filter('FREETYPE_ROOT = None', + 'FREETYPE_ROOT = ("{0}", "{1}")'.format( + spec['freetype'].prefix.lib, + spec['freetype'].prefix.include)) if '+lcms' in spec: - libpath.append(join_path(spec['lcms'].prefix, 'lib')) - - # This has not been tested, and likely needs some other treatment. - #if '+tk' in spec: - # libpath.append(join_path(spec['tcl'].prefix, 'lib')) - # libpath.append(join_path(spec['tk'].prefix, 'lib')) - - # -------- Building - cmd = ['build_ext', - '--%s-jpeg' % ('enable' if '+jpeg' in spec else 'disable'), - '--%s-zlib' % ('enable' if '+zlib' in spec else 'disable'), - '--%s-tiff' % ('enable' if '+tiff' in spec else 'disable'), - '--%s-freetype' % ('enable' if '+freetype' in spec else 'disable'), - '--%s-lcms' % ('enable' if '+lcms' in spec else 'disable'), - '-L'+':'.join(libpath) # NOTE: This does not make it find libjpeg - ] - - #if '+tk' in spec: - # cmd.extend(['--enable-tcl', '--enable-tk']) - #else: - # cmd.extend(['--disable-tcl', '--disable-tk']) - - # --------- Installation - cmd.extend(['install', '--prefix=%s' % prefix]) - - python('setup.py', *cmd) + setup.filter('LCMS_ROOT = None', + 'LCMS_ROOT = ("{0}", "{1}")'.format( + spec['lcms'].prefix.lib, + spec['lcms'].prefix.include)) + if '+jpeg2000' in spec: + setup.filter('JPEG2K_ROOT = None', + 'JPEG2K_ROOT = ("{0}", "{1}")'.format( + spec['openjpeg'].prefix.lib, + spec['openjpeg'].prefix.include)) + + def install(self, spec, prefix): + def variant_to_flag(variant): + able = 'enable' if '+{0}'.format(variant) in spec else 'disable' + return '--{0}-{1}'.format(able, variant) + + variants = ['jpeg', 'zlib', 'tiff', 'freetype', 'lcms', 'jpeg2000'] + build_args = list(map(variant_to_flag, variants)) + + python('setup.py', 'build_ext', *build_args) + python('setup.py', 'install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-protobuf/package.py b/var/spack/repos/builtin/packages/py-protobuf/package.py new file mode 100644 index 0000000000..da3a65c22e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-protobuf/package.py @@ -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 PyProtobuf(Package): + """Protocol buffers are Google's language-neutral, platform-neutral, + extensible mechanism for serializing structured data - think XML, but + smaller, faster, and simpler. You define how you want your data to be + structured once, then you can use special generated source code to easily + write and read your structured data to and from a variety of data streams + and using a variety of languages.""" + + homepage = 'https://developers.google.com/protocol-buffers/' + url = 'https://pypi.python.org/packages/source/p/protobuf/protobuf-3.0.0b2.tar.gz' + + version('3.0.0b2', 'f0d3bd2394345a9af4a277cd0302ae83') + version('2.6.1', '6bf843912193f70073db7f22e2ea55e2') + version('2.5.0', '338813f3629d59e9579fed9035ecd457') + version('2.4.1', '72f5141d20ab1bcae6b1e00acfb1068a') + version('2.3.0', 'bb020c962f252fe81bfda8fb433bafdd') + + extends('python') + + depends_on('py-setuptools') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-scikit-image/package.py b/var/spack/repos/builtin/packages/py-scikit-image/package.py index 0479e9eb0a..4c8fd0942a 100644 --- a/var/spack/repos/builtin/packages/py-scikit-image/package.py +++ b/var/spack/repos/builtin/packages/py-scikit-image/package.py @@ -24,8 +24,11 @@ ############################################################################## from spack import * + class PyScikitImage(Package): - """Image processing algorithms for SciPy, including IO, morphology, filtering, warping, color manipulation, object detection, etc.""" + """Image processing algorithms for SciPy, including IO, morphology, + filtering, warping, color manipulation, object detection, etc.""" + homepage = "http://scikit-image.org/" url = "https://pypi.python.org/packages/source/s/scikit-image/scikit-image-0.12.3.tar.gz" @@ -34,7 +37,7 @@ class PyScikitImage(Package): extends('python', ignore=r'bin/.*\.py$') depends_on('py-dask') - depends_on('py-pillow') + depends_on('pil') depends_on('py-networkx') depends_on('py-six') depends_on('py-scipy') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index b6a62bf742..8033c52b91 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -203,8 +203,10 @@ class Python(Package): r'site-packages/site[^/]*\.pyc?$', r'site-packages/__pycache__/site[^/]*\.pyc?$' ]) + if ext_pkg.name != 'py-pygments': + patterns.append(r'bin/pygmentize$') if ext_pkg.name != 'py-numpy': - patterns.append(r'bin/f2py$') + patterns.append(r'bin/f2py3?$') return match_predicate(ignore_arg, patterns) diff --git a/var/spack/repos/builtin/packages/r-dbi/package.py b/var/spack/repos/builtin/packages/r-dbi/package.py new file mode 100644 index 0000000000..a1e06d5100 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-dbi/package.py @@ -0,0 +1,43 @@ +############################################################################## +# 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 RDbi(Package): + """A database interface definition for communication between R and + relational database management systems. All classes in this package are + virtual and need to be extended by the various R/DBMS implementations.""" + + homepage = "https://github.com/rstats-db/DBI" + url = "https://cran.r-project.org/src/contrib/DBI_0.4-1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/DBI" + + version('0.4-1', 'c7ee8f1c5037c2284e99c62698d0f087') + + extends('R') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-foreign/package.py b/var/spack/repos/builtin/packages/r-foreign/package.py new file mode 100644 index 0000000000..df38fc5680 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-foreign/package.py @@ -0,0 +1,43 @@ +############################################################################## +# 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 RForeign(Package): + """Functions for reading and writing data stored by some versions of Epi + Info, Minitab, S, SAS, SPSS, Stata, Systat and Weka and for reading and + writing some dBase files.""" + + homepage = "https://cran.r-project.org/web/packages/foreign/index.html" + url = "https://cran.r-project.org/src/contrib/foreign_0.8-66.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/foreign" + + version('0.8-66', 'ff12190f4631dca31e30ca786c2c8f62') + + extends('R') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-rjava/package.py b/var/spack/repos/builtin/packages/r-rjava/package.py new file mode 100644 index 0000000000..0ce0942602 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rjava/package.py @@ -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 RRjava(Package): + """Low-level interface to Java VM very much like .C/.Call and friends. + Allows creation of objects, calling methods and accessing fields.""" + + homepage = "http://www.rforge.net/rJava/" + url = "https://cran.r-project.org/src/contrib/rJava_0.9-8.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/rJava" + + version('0.9-8', '51ae0d690ceed056ebe7c4be71fc6c7a') + + extends('R') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-rmysql/package.py b/var/spack/repos/builtin/packages/r-rmysql/package.py new file mode 100644 index 0000000000..774c166f8b --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rmysql/package.py @@ -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 RRmysql(Package): + """Implements 'DBI' Interface to 'MySQL' and 'MariaDB' Databases.""" + + homepage = "https://github.com/rstats-db/rmysql" + url = "https://cran.r-project.org/src/contrib/RMySQL_0.10.9.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/RMySQL" + + version('0.10.9', '3628200a1864ac3005cfd55cc7cde17a') + + extends('R') + + depends_on('r-DBI') + depends_on('mariadb') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-rodbc/package.py b/var/spack/repos/builtin/packages/r-rodbc/package.py new file mode 100644 index 0000000000..9cc9aebd9a --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rodbc/package.py @@ -0,0 +1,43 @@ +############################################################################## +# 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 RRodbc(Package): + """An ODBC database interface.""" + + homepage = "https://cran.rstudio.com/web/packages/RODBC/" + url = "https://cran.rstudio.com/src/contrib/RODBC_1.3-13.tar.gz" + list_url = "https://cran.rstudio.com/src/contrib/Archive/RODBC" + + version('1.3-13', 'c52ef9139c2ed85adc53ad6effa7d68e') + + extends('R') + + depends_on('unixODBC') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-rpostgresql/package.py b/var/spack/repos/builtin/packages/r-rpostgresql/package.py new file mode 100644 index 0000000000..83c9b85525 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rpostgresql/package.py @@ -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 RRpostgresql(Package): + """Database interface and PostgreSQL driver for R This package provides a + Database Interface (DBI) compliant driver for R to access PostgreSQL + database systems. In order to build and install this package from source, + PostgreSQL itself must be present your system to provide PostgreSQL + functionality via its libraries and header files. These files are provided + as postgresql-devel package under some Linux distributions. On Microsoft + Windows system the attached libpq library source will be used. A wiki and + issue tracking system for the package are available at Google Code at + https://code.google.com/p/rpostgresql/.""" + + homepage = "https://code.google.com/p/rpostgresql/" + url = "https://cran.r-project.org/src/contrib/RPostgreSQL_0.4-1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/RPostgreSQL" + + version('0.4-1', 'e7b22e212afbb2cbb88bab937f93e55a') + + extends('R') + + depends_on('r-DBI') + depends_on('postgresql') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-rsqlite/package.py b/var/spack/repos/builtin/packages/r-rsqlite/package.py new file mode 100644 index 0000000000..9602f6d927 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rsqlite/package.py @@ -0,0 +1,45 @@ +############################################################################## +# 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 RRsqlite(Package): + """This package embeds the SQLite database engine in R and provides an + interface compliant with the DBI package. The source for the SQLite engine + (version 3.8.6) is included.""" + + homepage = "https://github.com/rstats-db/RSQLite" + url = "https://cran.r-project.org/src/contrib/RSQLite_1.0.0.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/RSQLite" + + version('1.0.0', 'e6cbe2709612b687c13a10d30c7bad45') + + extends('R') + + depends_on('r-DBI') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-xlconnect/package.py b/var/spack/repos/builtin/packages/r-xlconnect/package.py new file mode 100644 index 0000000000..919291a023 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-xlconnect/package.py @@ -0,0 +1,45 @@ +############################################################################## +# 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 RXlconnect(Package): + """Provides comprehensive functionality to read, write and format Excel + data.""" + + homepage = "http://miraisolutions.wordpress.com/" + url = "https://cran.r-project.org/src/contrib/XLConnect_0.2-11.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/XLConnect" + + version('0.2-11', '9d1769a103cda05665df399cc335017d') + + extends('R') + + depends_on('r-XLConnectJars') + depends_on('r-rJava') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-xlconnectjars/package.py b/var/spack/repos/builtin/packages/r-xlconnectjars/package.py new file mode 100644 index 0000000000..15d08cc5af --- /dev/null +++ b/var/spack/repos/builtin/packages/r-xlconnectjars/package.py @@ -0,0 +1,43 @@ +############################################################################## +# 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 RXlconnectjars(Package): + """Provides external JAR dependencies for the XLConnect package.""" + + homepage = "http://miraisolutions.wordpress.com/" + url = "https://cran.r-project.org/src/contrib/XLConnectJars_0.2-9.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/XLConnectJars" + + version('0.2-9', 'e6d6b1acfede26acaa616ee421bd30fb') + + extends('R') + + depends_on('r-rJava') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-xlsx/package.py b/var/spack/repos/builtin/packages/r-xlsx/package.py new file mode 100644 index 0000000000..0aac6cdd1f --- /dev/null +++ b/var/spack/repos/builtin/packages/r-xlsx/package.py @@ -0,0 +1,45 @@ +############################################################################## +# 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 RXlsx(Package): + """Provide R functions to read/write/format Excel 2007 and Excel + 97/2000/XP/2003 file formats.""" + + homepage = "http://code.google.com/p/rexcel/" + url = "https://cran.rstudio.com/src/contrib/xlsx_0.5.7.tar.gz" + list_url = "https://cran.rstudio.com/src/contrib/Archive/xlsx" + + version('0.5.7', '36b1b16f29c54b6089b1dae923180dd5') + + extends('R') + + depends_on('r-rJava') + depends_on('r-xlsxjars') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/r-xlsxjars/package.py b/var/spack/repos/builtin/packages/r-xlsxjars/package.py new file mode 100644 index 0000000000..cff6e7427e --- /dev/null +++ b/var/spack/repos/builtin/packages/r-xlsxjars/package.py @@ -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 RXlsxjars(Package): + """The xlsxjars package collects all the external jars required for the + xlxs package. This release corresponds to POI 3.10.1.""" + + homepage = "https://cran.rstudio.com/web/packages/xlsxjars/index.html" + url = "https://cran.rstudio.com/src/contrib/xlsxjars_0.6.1.tar.gz" + list_url = "https://cran.rstudio.com/src/contrib/Archive/xlsxjars" + + version('0.6.1', '5a1721d5733cb42f3a29e3f353e39166') + + extends('R') + + depends_on('r-rJava') + + def install(self, spec, prefix): + R('CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), + self.stage.source_path) diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py index 3c2b4993ac..2f6e42c439 100644 --- a/var/spack/repos/builtin/packages/scotch/package.py +++ b/var/spack/repos/builtin/packages/scotch/package.py @@ -171,15 +171,13 @@ class Scotch(Package): target == 'ptscotch')) make(target, parallel=can_make_parallel) - # todo change this to take into account darwin systems - lib_ext = '.so' if '+shared' in self.spec else '.a' + lib_ext = dso_suffix if '+shared' in self.spec else 'a' # It seams easier to remove metis wrappers from the folder that will be # installed than to tweak the Makefiles if '+metis' not in self.spec: with working_dir('lib'): - lib_ext = '.so' if '+shared' in self.spec else '.a' - force_remove('libscotchmetis{0}'.format(lib_ext)) - force_remove('libptscotchparmetis{0}'.format(lib_ext)) + force_remove('libscotchmetis.{0}'.format(lib_ext)) + force_remove('libptscotchparmetis.{0}'.format(lib_ext)) with working_dir('include'): force_remove('metis.h') @@ -187,8 +185,8 @@ class Scotch(Package): if '~esmumps' in self.spec and self.spec.version < Version('6.0.0'): with working_dir('lib'): - force_remove('libesmumps{0}'.format(lib_ext)) - force_remove('libptesmumps{0}'.format(lib_ext)) + force_remove('libesmumps.{0}'.format(lib_ext)) + force_remove('libptesmumps.{0}'.format(lib_ext)) with working_dir('include'): force_remove('esmumps.h') diff --git a/var/spack/repos/builtin/packages/swiftsim/package.py b/var/spack/repos/builtin/packages/swiftsim/package.py new file mode 100644 index 0000000000..e4607d9146 --- /dev/null +++ b/var/spack/repos/builtin/packages/swiftsim/package.py @@ -0,0 +1,79 @@ +############################################################################## +# 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 spack.environment +import llnl.util.tty as tty + +# Needed to be able to download from the Durham gitlab repository +tty.warn('Setting "GIT_SSL_NO_VERIFY=1"') +tty.warn('This is needed to clone SWIFT repository') +gitlab_env = spack.environment.EnvironmentModifications() +gitlab_env.set('GIT_SSL_NO_VERIFY', 1) +gitlab_env.apply_modifications() + + +class Swiftsim(Package): + """ + SPH With Inter-dependent Fine-grained Tasking (SWIFT) provides + astrophysicists with a state of the art framework to perform + particle based simulations. + """ + + homepage = 'http://icc.dur.ac.uk/swift/' + url = 'http://gitlab.cosma.dur.ac.uk/swift/swiftsim/repository/archive.tar.gz?ref=v0.3.0' + + version('0.3.0', git='https://gitlab.cosma.dur.ac.uk/swift/swiftsim.git', tag='v0.3.0') + + variant('mpi', default=True, description='Enable distributed memory parallelism') + + # Build dependencies + depends_on('autoconf') + depends_on('automake') + depends_on('libtool') + depends_on('m4') + # link-time / run-time dependencies + depends_on('mpi', when='+mpi') + depends_on('metis') + depends_on('hdf5~mpi', when='~mpi') + depends_on('hdf5+mpi', when='+mpi') + + def install(self, spec, prefix): + # Generate configure from configure.ac + # and Makefile.am + libtoolize() + aclocal() + autoconf() + autogen = Executable('./autogen.sh') + autogen() + + # Configure and install + options = ['--prefix=%s' % prefix, + '--enable-mpi' if '+mpi' in spec else '--disable-mpi', + '--enable-optimization'] + configure(*options) + make() + make("install") diff --git a/var/spack/repos/builtin/packages/unixodbc/package.py b/var/spack/repos/builtin/packages/unixodbc/package.py new file mode 100644 index 0000000000..15de127b7e --- /dev/null +++ b/var/spack/repos/builtin/packages/unixodbc/package.py @@ -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 Unixodbc(Package): + """ODBC is an open specification for providing application developers with + a predictable API with which to access Data Sources. Data Sources include + SQL Servers and any Data Source with an ODBC Driver.""" + + homepage = "http://www.unixodbc.org/" + url = "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.4.tar.gz" + + version('2.3.4', 'bd25d261ca1808c947cb687e2034be81') + + def install(self, spec, prefix): + configure('--prefix={0}'.format(prefix)) + + make() + make('install') |