diff options
75 files changed, 1939 insertions, 192 deletions
@@ -128,6 +128,8 @@ parser.add_argument('-p', '--profile', action='store_true', help="Profile execution using cProfile.") parser.add_argument('-v', '--verbose', action='store_true', help="Print additional output during builds") +parser.add_argument('-s', '--stacktrace', action='store_true', + help="Add stacktrace information to all printed statements") parser.add_argument('-V', '--version', action='version', version="%s" % spack.spack_version) @@ -155,6 +157,7 @@ def main(): # Set up environment based on args. tty.set_verbose(args.verbose) tty.set_debug(args.debug) + tty.set_stacktrace(args.stacktrace) spack.debug = args.debug if spack.debug: diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst index 03e6d581a4..12f48dde4e 100644 --- a/lib/spack/docs/basic_usage.rst +++ b/lib/spack/docs/basic_usage.rst @@ -838,8 +838,6 @@ add a version specifier to the spec: Notice that the package versions that provide insufficient MPI versions are now filtered out. -.. _shell-support: - --------------------------- Extensions & Python support --------------------------- diff --git a/lib/spack/docs/getting_started.rst b/lib/spack/docs/getting_started.rst index 34cbf453e1..6ec55cca48 100644 --- a/lib/spack/docs/getting_started.rst +++ b/lib/spack/docs/getting_started.rst @@ -47,8 +47,7 @@ to your path and you're ready to go: $ export PATH=$SPACK_ROOT/bin:$PATH $ spack install libelf -For a richer experience, use Spack's `shell support -<http://software.llnl.gov/spack/basic_usage.html#environment-modules>`_: +For a richer experience, use Spack's shell support: .. code-block:: console @@ -60,7 +59,9 @@ For a richer experience, use Spack's `shell support $ setenv SPACK_ROOT /path/to/spack $ source $SPACK_ROOT/share/spack/setup-env.csh -This automatically adds Spack to your ``PATH``. +This automatically adds Spack to your ``PATH`` and allows the ``spack`` +command to :ref:`load environment modules <shell-support>` and execute +:ref:`useful packaging commands <packaging-shell-support>`. ^^^^^^^^^^^^^^^^^ Clean Environment diff --git a/lib/spack/docs/module_file_support.rst b/lib/spack/docs/module_file_support.rst index f07bd31c2e..0daa9232ed 100644 --- a/lib/spack/docs/module_file_support.rst +++ b/lib/spack/docs/module_file_support.rst @@ -24,7 +24,7 @@ directly with automatically generated module files. we advise you to use either Environment Modules or LMod. See :ref:`InstallEnvironmentModules` for more details. -.. _shell_support: +.. _shell-support: ------------- Shell support diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index a22fcd71ba..aa9a3874bb 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -3120,6 +3120,8 @@ example: This graph can be provided as input to other graphing tools, such as those in `Graphviz <http://www.graphviz.org>`_. +.. _packaging-shell-support: + ------------------------- Interactive shell support ------------------------- diff --git a/lib/spack/docs/tutorial_sc16.rst b/lib/spack/docs/tutorial_sc16.rst index 6fa630c57b..6a3cebe20d 100644 --- a/lib/spack/docs/tutorial_sc16.rst +++ b/lib/spack/docs/tutorial_sc16.rst @@ -15,12 +15,12 @@ the live demo scripts to see how Spack is used in practice. .. rubric:: Slides .. figure:: tutorial/sc16-tutorial-slide-preview.png - :target: http://software.llnl.gov/spack/files/Spack-SC16-Tutorial.pdf + :target: http://llnl.github.io/spack/files/Spack-SC16-Tutorial.pdf :height: 72px :align: left :alt: Slide Preview -`Download Slides <software.llnl.gov/spack/files/Spack-SC16-Tutorial.pdf>`_. +`Download Slides <http://llnl.github.io/spack/files/Spack-SC16-Tutorial.pdf>`_. **Full citation:** Todd Gamblin, Massimiliano Culpo, Gregory Becker, Matt Legendre, Greg Lee, Elizabeth Fischer, and Benedikt Hegner. diff --git a/lib/spack/docs/tutorial_sc16_modules.rst b/lib/spack/docs/tutorial_sc16_modules.rst index 1e786674bb..00684223cd 100644 --- a/lib/spack/docs/tutorial_sc16_modules.rst +++ b/lib/spack/docs/tutorial_sc16_modules.rst @@ -34,7 +34,7 @@ Prerequisites Before proceeding further ensure: - you have LMod or Environment Modules available -- have :ref:`shell support <shell_support>` activated in Spack +- have :ref:`shell support <shell-support>` activated in Spack If you need to install Lmod or Environment module you can refer to the documentation :ref:`here <InstallEnvironmentModules>`. diff --git a/lib/spack/external/distro.py b/lib/spack/external/distro.py index 091bba3db8..ca25339ec9 100644 --- a/lib/spack/external/distro.py +++ b/lib/spack/external/distro.py @@ -31,14 +31,16 @@ more information. import os import re import sys +import json import shlex +import logging +import argparse import subprocess if not sys.platform.startswith('linux'): raise ImportError('Unsupported platform: {0}'.format(sys.platform)) - _UNIXCONFDIR = '/etc' _OS_RELEASE_BASENAME = 'os-release' @@ -75,7 +77,6 @@ NORMALIZED_DISTRO_ID = { 'redhat': 'rhel', # RHEL 6.x, 7.x } - # Pattern for content of distro release file (reversed) _DISTRO_RELEASE_CONTENT_REVERSED_PATTERN = re.compile( r'(?:[^)]*\)(.*)\()? *(?:STL )?([\d.+\-a-z]*\d) *(?:esaeler *)?(.+)') @@ -119,7 +120,7 @@ def linux_distribution(full_distribution_name=True): method normalizes the distro ID string to a reliable machine-readable value for a number of popular Linux distributions. """ - return _distroi.linux_distribution(full_distribution_name) + return _distro.linux_distribution(full_distribution_name) def id(): @@ -194,7 +195,7 @@ def id(): command, with ID values that differ from what was previously determined from the distro release file name. """ - return _distroi.id() + return _distro.id() def name(pretty=False): @@ -233,7 +234,7 @@ def name(pretty=False): with the value of the pretty version ("<version_id>" and "<codename>" fields) of the distro release file, if available. """ - return _distroi.name(pretty) + return _distro.name(pretty) def version(pretty=False, best=False): @@ -277,7 +278,7 @@ def version(pretty=False, best=False): the lsb_release command, if it follows the format of the distro release files. """ - return _distroi.version(pretty, best) + return _distro.version(pretty, best) def version_parts(best=False): @@ -294,7 +295,7 @@ def version_parts(best=False): For a description of the *best* parameter, see the :func:`distro.version` method. """ - return _distroi.version_parts(best) + return _distro.version_parts(best) def major_version(best=False): @@ -307,7 +308,7 @@ def major_version(best=False): For a description of the *best* parameter, see the :func:`distro.version` method. """ - return _distroi.major_version(best) + return _distro.major_version(best) def minor_version(best=False): @@ -320,7 +321,7 @@ def minor_version(best=False): For a description of the *best* parameter, see the :func:`distro.version` method. """ - return _distroi.minor_version(best) + return _distro.minor_version(best) def build_number(best=False): @@ -333,7 +334,7 @@ def build_number(best=False): For a description of the *best* parameter, see the :func:`distro.version` method. """ - return _distroi.build_number(best) + return _distro.build_number(best) def like(): @@ -350,7 +351,7 @@ def like(): `os-release man page <http://www.freedesktop.org/software/systemd/man/os-release.html>`_. """ - return _distroi.like() + return _distro.like() def codename(): @@ -374,7 +375,7 @@ def codename(): * the value of the "<codename>" field of the distro release file. """ - return _distroi.codename() + return _distro.codename() def info(pretty=False, best=False): @@ -418,7 +419,7 @@ def info(pretty=False, best=False): For a description of the *pretty* and *best* parameters, see the :func:`distro.version` method. """ - return _distroi.info(pretty, best) + return _distro.info(pretty, best) def os_release_info(): @@ -428,7 +429,7 @@ def os_release_info(): See `os-release file`_ for details about these information items. """ - return _distroi.os_release_info() + return _distro.os_release_info() def lsb_release_info(): @@ -439,7 +440,7 @@ def lsb_release_info(): See `lsb_release command output`_ for details about these information items. """ - return _distroi.lsb_release_info() + return _distro.lsb_release_info() def distro_release_info(): @@ -449,7 +450,7 @@ def distro_release_info(): See `distro release file`_ for details about these information items. """ - return _distroi.distro_release_info() + return _distro.distro_release_info() def os_release_attr(attribute): @@ -468,7 +469,7 @@ def os_release_attr(attribute): See `os-release file`_ for details about these information items. """ - return _distroi.os_release_attr(attribute) + return _distro.os_release_attr(attribute) def lsb_release_attr(attribute): @@ -488,7 +489,7 @@ def lsb_release_attr(attribute): See `lsb_release command output`_ for details about these information items. """ - return _distroi.lsb_release_attr(attribute) + return _distro.lsb_release_attr(attribute) def distro_release_attr(attribute): @@ -507,7 +508,7 @@ def distro_release_attr(attribute): See `distro release file`_ for details about these information items. """ - return _distroi.distro_release_attr(attribute) + return _distro.distro_release_attr(attribute) class LinuxDistribution(object): @@ -590,12 +591,14 @@ class LinuxDistribution(object): self.os_release_file = os_release_file or \ os.path.join(_UNIXCONFDIR, _OS_RELEASE_BASENAME) self.distro_release_file = distro_release_file or '' # updated later - self._os_release_info = self._os_release_info() - self._lsb_release_info = self._lsb_release_info() \ + self._os_release_info = self._get_os_release_info() + self._lsb_release_info = self._get_lsb_release_info() \ if include_lsb else {} - self._distro_release_info = self._distro_release_info() + self._distro_release_info = self._get_distro_release_info() def __repr__(self): + """Return repr of all info + """ return \ "LinuxDistribution(" \ "os_release_file={0!r}, " \ @@ -624,25 +627,25 @@ class LinuxDistribution(object): ) def id(self): - """ - Return the distro ID of the Linux distribution, as a string. + """Return the distro ID of the Linux distribution, as a string. For details, see :func:`distro.id`. """ + def normalize(distro_id, table): + distro_id = distro_id.lower().replace(' ', '_') + return table.get(distro_id, distro_id) + distro_id = self.os_release_attr('id') if distro_id: - distro_id = distro_id.lower().replace(' ', '_') - return NORMALIZED_OS_ID.get(distro_id, distro_id) + return normalize(distro_id, NORMALIZED_OS_ID) distro_id = self.lsb_release_attr('distributor_id') if distro_id: - distro_id = distro_id.lower().replace(' ', '_') - return NORMALIZED_LSB_ID.get(distro_id, distro_id) + return normalize(distro_id, NORMALIZED_LSB_ID) distro_id = self.distro_release_attr('id') if distro_id: - distro_id = distro_id.lower().replace(' ', '_') - return NORMALIZED_DISTRO_ID.get(distro_id, distro_id) + return normalize(distro_id, NORMALIZED_DISTRO_ID) return '' @@ -707,10 +710,10 @@ class LinuxDistribution(object): """ version_str = self.version(best=best) if version_str: - g = re.compile(r'(\d+)\.?(\d+)?\.?(\d+)?') - m = g.match(version_str) - if m: - major, minor, build_number = m.groups() + version_regex = re.compile(r'(\d+)\.?(\d+)?\.?(\d+)?') + matches = version_regex.match(version_str) + if matches: + major, minor, build_number = matches.groups() return major, minor or '', build_number or '' return '', '', '' @@ -832,7 +835,7 @@ class LinuxDistribution(object): """ return self._distro_release_info.get(attribute, '') - def _os_release_info(self): + def _get_os_release_info(self): """ Get the information items from the specified os-release file. @@ -840,8 +843,8 @@ class LinuxDistribution(object): A dictionary containing all information items. """ if os.path.isfile(self.os_release_file): - with open(self.os_release_file, 'r') as f: - return self._parse_os_release_content(f) + with open(self.os_release_file) as release_file: + return self._parse_os_release_content(release_file) return {} @staticmethod @@ -904,7 +907,7 @@ class LinuxDistribution(object): pass return props - def _lsb_release_info(self): + def _get_lsb_release_info(self): """ Get the information items from the lsb_release command output. @@ -912,26 +915,26 @@ class LinuxDistribution(object): A dictionary containing all information items. """ cmd = 'lsb_release -a' - p = subprocess.Popen( + process = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = p.communicate() - out, err = out.decode('ascii'), err.decode('ascii') - rc = p.returncode - if rc == 0: - content = out.splitlines() + stdout, stderr = process.communicate() + stdout, stderr = stdout.decode('utf-8'), stderr.decode('utf-8') + code = process.returncode + if code == 0: + content = stdout.splitlines() return self._parse_lsb_release_content(content) - elif rc == 127: # Command not found + elif code == 127: # Command not found return {} else: if sys.version_info[:2] >= (3, 5): - raise subprocess.CalledProcessError(rc, cmd, out, err) + raise subprocess.CalledProcessError(code, cmd, stdout, stderr) elif sys.version_info[:2] >= (2, 7): - raise subprocess.CalledProcessError(rc, cmd, out) + raise subprocess.CalledProcessError(code, cmd, stdout) elif sys.version_info[:2] == (2, 6): - raise subprocess.CalledProcessError(rc, cmd) + raise subprocess.CalledProcessError(code, cmd) @staticmethod def _parse_lsb_release_content(lines): @@ -949,8 +952,7 @@ class LinuxDistribution(object): """ props = {} for line in lines: - if isinstance(line, bytes): - line = line.decode('utf-8') + line = line.decode('utf-8') if isinstance(line, bytes) else line kv = line.strip('\n').split(':', 1) if len(kv) != 2: # Ignore lines without colon. @@ -959,7 +961,7 @@ class LinuxDistribution(object): props.update({k.replace(' ', '_').lower(): v.strip()}) return props - def _distro_release_info(self): + def _get_distro_release_info(self): """ Get the information items from the specified distro release file. @@ -1012,7 +1014,7 @@ class LinuxDistribution(object): A dictionary containing all information items. """ if os.path.isfile(filepath): - with open(filepath, 'r') as fp: + with open(filepath) as fp: # Only parse the first line. For instance, on SLES there # are multiple lines. We don't want them... return self._parse_distro_release_content(fp.readline()) @@ -1032,18 +1034,48 @@ class LinuxDistribution(object): """ if isinstance(line, bytes): line = line.decode('utf-8') - m = _DISTRO_RELEASE_CONTENT_REVERSED_PATTERN.match( + matches = _DISTRO_RELEASE_CONTENT_REVERSED_PATTERN.match( line.strip()[::-1]) distro_info = {} - if m: - distro_info['name'] = m.group(3)[::-1] # regexp ensures non-None - if m.group(2): - distro_info['version_id'] = m.group(2)[::-1] - if m.group(1): - distro_info['codename'] = m.group(1)[::-1] + if matches: + # regexp ensures non-None + distro_info['name'] = matches.group(3)[::-1] + if matches.group(2): + distro_info['version_id'] = matches.group(2)[::-1] + if matches.group(1): + distro_info['codename'] = matches.group(1)[::-1] elif line: distro_info['name'] = line.strip() return distro_info -_distroi = LinuxDistribution() +_distro = LinuxDistribution() + + +def main(): + logger = logging.getLogger(__name__) + logger.setLevel(logging.DEBUG) + logger.addHandler(logging.StreamHandler(sys.stdout)) + + parser = argparse.ArgumentParser(description="Linux distro info tool") + parser.add_argument( + '--json', + '-j', + help="Output in machine readable format", + action="store_true") + args = parser.parse_args() + + if args.json: + logger.info(json.dumps(info(), indent=4, sort_keys=True)) + else: + logger.info('Name: %s', name(pretty=True)) + distribution_version = version(pretty=True) + if distribution_version: + logger.info('Version: %s', distribution_version) + distribution_codename = codename() + if distribution_codename: + logger.info('Codename: %s', distribution_codename) + + +if __name__ == '__main__': + main() diff --git a/lib/spack/llnl/util/tty/__init__.py b/lib/spack/llnl/util/tty/__init__.py index db74aaba6b..1381bb2f7d 100644 --- a/lib/spack/llnl/util/tty/__init__.py +++ b/lib/spack/llnl/util/tty/__init__.py @@ -28,12 +28,14 @@ import textwrap import fcntl import termios import struct +import traceback from StringIO import StringIO from llnl.util.tty.color import * _debug = False _verbose = False +_stacktrace = False indent = " " @@ -45,6 +47,10 @@ def is_debug(): return _debug +def is_stacktrace(): + return _stacktrace + + def set_debug(flag): global _debug _debug = flag @@ -53,10 +59,35 @@ def set_debug(flag): def set_verbose(flag): global _verbose _verbose = flag + + +def set_stacktrace(flag): + global _stacktrace + _stacktrace = flag + + +def process_stacktrace(countback): + """Gives file and line frame 'countback' frames from the bottom""" + st = traceback.extract_stack() + # Not all entries may be spack files, we have to remove those that aren't. + file_list = [] + for frame in st: + # Check that the file is a spack file + if frame[0].find("/spack") >= 0: + file_list.append(frame[0]) + # We use commonprefix to find what the spack 'root' directory is. + root_dir = os.path.commonprefix(file_list) + root_len = len(root_dir) + st_idx = len(st) - countback - 1 + st_text = "%s:%i " % (st[st_idx][0][root_len:], st[st_idx][1]) + return st_text def msg(message, *args): - cprint("@*b{==>} %s" % cescape(message)) + st_text = "" + if _stacktrace: + st_text = process_stacktrace(2) + cprint("@*b{%s==>} %s" % (st_text, cescape(message))) for arg in args: print indent + str(arg) @@ -66,8 +97,13 @@ def info(message, *args, **kwargs): stream = kwargs.get('stream', sys.stdout) wrap = kwargs.get('wrap', False) break_long_words = kwargs.get('break_long_words', False) + st_countback = kwargs.get('countback', 3) - cprint("@%s{==>} %s" % (format, cescape(str(message))), stream=stream) + st_text = "" + if _stacktrace: + st_text = process_stacktrace(st_countback) + cprint("@%s{%s==>} %s" % (format, st_text, cescape(str(message))), + stream=stream) for arg in args: if wrap: lines = textwrap.wrap( @@ -105,6 +141,7 @@ def warn(message, *args, **kwargs): def die(message, *args, **kwargs): + kwargs.setdefault('countback', 4) error(message, *args, **kwargs) sys.exit(1) diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py index feed3b8772..f22fa14602 100644 --- a/lib/spack/spack/cmd/create.py +++ b/lib/spack/spack/cmd/create.py @@ -145,10 +145,10 @@ class AutotoolsGuess(DefaultGuess): body = """\ def configure_args(self): - # FIXME: Add arguments other than --prefix - # FIXME: If not needed delete the function - args = [] - return args""" + # FIXME: Add arguments other than --prefix + # FIXME: If not needed delete the function + args = [] + return args""" class CMakeGuess(DefaultGuess): @@ -161,11 +161,11 @@ class CMakeGuess(DefaultGuess): body = """\ def cmake_args(self): - # FIXME: Add arguments other than - # FIXME: CMAKE_INSTALL_PREFIX and CMAKE_BUILD_TYPE - # FIXME: If not needed delete the function - args = [] - return args""" + # FIXME: Add arguments other than + # FIXME: CMAKE_INSTALL_PREFIX and CMAKE_BUILD_TYPE + # FIXME: If not needed delete the function + args = [] + return args""" class SconsGuess(DefaultGuess): diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py index de45c7ca4f..38994790ae 100644 --- a/lib/spack/spack/cmd/install.py +++ b/lib/spack/spack/cmd/install.py @@ -26,6 +26,7 @@ import argparse import codecs import functools import os +import platform import time import xml.dom.minidom import xml.etree.ElementTree as ET @@ -106,9 +107,10 @@ class TestResult(object): class TestSuite(object): - def __init__(self): + def __init__(self, spec): self.root = ET.Element('testsuite') self.tests = [] + self.spec = spec def append(self, item): if not isinstance(item, TestCase): @@ -128,6 +130,8 @@ class TestSuite(object): ) self.root.set('failures', str(number_of_failures)) self.root.set('tests', str(len(self.tests))) + self.root.set('name', self.spec.short_spec) + self.root.set('hostname', platform.node()) for item in self.tests: self.root.append(item.element) @@ -243,7 +247,7 @@ def junit_output(spec, test_suite): test_case.set_duration(duration) text = fetch_text(self.build_log_path) test_case.set_result( - TestResult.ERRORED, + TestResult.FAILED, message='Unable to fetch package', text=text ) @@ -253,7 +257,7 @@ def junit_output(spec, test_suite): test_case.set_duration(duration) text = fetch_text(self.build_log_path) test_case.set_result( - TestResult.ERRORED, + TestResult.FAILED, message='Unexpected exception thrown during install', text=text ) @@ -263,7 +267,7 @@ def junit_output(spec, test_suite): test_case.set_duration(duration) text = fetch_text(self.build_log_path) test_case.set_result( - TestResult.ERRORED, + TestResult.FAILED, message='Unknown error', text=text ) @@ -322,7 +326,7 @@ def install(parser, args, **kwargs): if not log_filename: log_filename = default_log_file(spec) # Create the test suite in which to log results - test_suite = TestSuite() + test_suite = TestSuite(spec) # Decorate PackageBase.do_install to get installation status PackageBase.do_install = junit_output( spec, test_suite diff --git a/lib/spack/spack/compilers/clang.py b/lib/spack/spack/compilers/clang.py index da18adcecd..b2095defe5 100644 --- a/lib/spack/spack/compilers/clang.py +++ b/lib/spack/spack/compilers/clang.py @@ -78,6 +78,10 @@ class Clang(Compiler): else: return "-std=c++11" + @property + def pic_flag(self): + return "-fPIC" + @classmethod def default_version(cls, comp): """The '--version' option works for clang compilers. diff --git a/lib/spack/spack/compilers/gcc.py b/lib/spack/spack/compilers/gcc.py index 557b1c13a9..80d24910c3 100644 --- a/lib/spack/spack/compilers/gcc.py +++ b/lib/spack/spack/compilers/gcc.py @@ -74,6 +74,10 @@ class Gcc(Compiler): else: return "-std=c++14" + @property + def pic_flag(self): + return "-fPIC" + @classmethod def fc_version(cls, fc): return get_compiler_version( diff --git a/lib/spack/spack/compilers/intel.py b/lib/spack/spack/compilers/intel.py index 14f4d2dc91..4ff7185c84 100644 --- a/lib/spack/spack/compilers/intel.py +++ b/lib/spack/spack/compilers/intel.py @@ -65,6 +65,10 @@ class Intel(Compiler): else: return "-std=c++11" + @property + def pic_flag(self): + return "-fPIC" + @classmethod def default_version(cls, comp): """The '--version' option seems to be the most consistent one diff --git a/lib/spack/spack/compilers/nag.py b/lib/spack/spack/compilers/nag.py index 5ba235adbb..c1da95a6c3 100644 --- a/lib/spack/spack/compilers/nag.py +++ b/lib/spack/spack/compilers/nag.py @@ -56,6 +56,10 @@ class Nag(Compiler): # However, it can be mixed with a compiler that does support it return "-std=c++11" + @property + def pic_flag(self): + return "-PIC" + # Unlike other compilers, the NAG compiler passes options to GCC, which # then passes them to the linker. Therefore, we need to doubly wrap the # options with '-Wl,-Wl,,' diff --git a/lib/spack/spack/compilers/pgi.py b/lib/spack/spack/compilers/pgi.py index 37ffe44028..146c153041 100644 --- a/lib/spack/spack/compilers/pgi.py +++ b/lib/spack/spack/compilers/pgi.py @@ -55,6 +55,10 @@ class Pgi(Compiler): def cxx11_flag(self): return "-std=c++11" + @property + def pic_flag(self): + return "-fpic" + @classmethod def default_version(cls, comp): """The '-V' option works for all the PGI compilers. diff --git a/lib/spack/spack/compilers/xl.py b/lib/spack/spack/compilers/xl.py index 5c83209781..f4b7c4237d 100644 --- a/lib/spack/spack/compilers/xl.py +++ b/lib/spack/spack/compilers/xl.py @@ -58,6 +58,10 @@ class Xl(Compiler): else: return "-qlanglvl=extended0x" + @property + def pic_flag(self): + return "-qpic" + @classmethod def default_version(cls, comp): """The '-qversion' is the standard option fo XL compilers. diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index 5084a68e08..23f3b9a41e 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -911,7 +911,10 @@ def from_list_url(pkg): versions = pkg.fetch_remote_versions() try: url_from_list = versions[pkg.version] - return URLFetchStrategy(url=url_from_list, digest=None) + digest = None + if pkg.version in pkg.versions: + digest = pkg.versions[pkg.version].get('md5', None) + return URLFetchStrategy(url=url_from_list, digest=digest) except KeyError: tty.msg("Can not find version %s in url_list" % self.version) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 7462a73533..8bb19042cc 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -703,7 +703,13 @@ class PackageBase(object): # Construct a path where the stage should build.. s = self.spec stage_name = "%s-%s-%s" % (s.name, s.version, s.dag_hash()) - stage = Stage(fetcher, mirror_path=mp, name=stage_name, path=self.path) + + def download_search(): + dynamic_fetcher = fs.from_list_url(self) + return [dynamic_fetcher] if dynamic_fetcher else [] + + stage = Stage(fetcher, mirror_path=mp, name=stage_name, path=self.path, + search_fn=download_search) return stage def _make_stage(self): diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index 4157511ce0..91f77839d8 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -162,7 +162,7 @@ class Stage(object): def __init__( self, url_or_fetch_strategy, name=None, mirror_path=None, keep=False, path=None, lock=True, - alternate_fetchers=None): + search_fn=None): """Create a stage object. Parameters: url_or_fetch_strategy @@ -198,7 +198,7 @@ class Stage(object): self.fetcher.set_stage(self) # self.fetcher can change with mirrors. self.default_fetcher = self.fetcher - self.alternate_fetchers = alternate_fetchers + self.search_fn = search_fn # used for mirrored archives of repositories. self.skip_checksum_for_mirror = True @@ -416,10 +416,17 @@ class Stage(object): self.mirror_path, digest, expand=expand, extension=extension)) - if self.alternate_fetchers: - fetchers.extend(self.alternate_fetchers) - - for fetcher in fetchers: + def generate_fetchers(): + for fetcher in fetchers: + yield fetcher + # The search function may be expensive, so wait until now to + # call it so the user can stop if a prior fetcher succeeded + if self.search_fn and not mirror_only: + dynamic_fetchers = self.search_fn() + for fetcher in dynamic_fetchers: + yield fetcher + + for fetcher in generate_fetchers(): try: fetcher.set_stage(self) self.fetcher = fetcher diff --git a/lib/spack/spack/test/stage.py b/lib/spack/spack/test/stage.py index 64cfa222db..cfeb80dd35 100644 --- a/lib/spack/spack/test/stage.py +++ b/lib/spack/spack/test/stage.py @@ -59,6 +59,26 @@ def use_tmp(use_tmp): yield +def fail_search_fn(): + raise Exception("This should not have been called") + + +class FailingFetchStrategy(spack.fetch_strategy.FetchStrategy): + def fetch(self): + raise spack.fetch_strategy.FailedDownloadError( + "<non-existent URL>", + "This implementation of FetchStrategy always fails") + + +class MockSearchFunction(object): + def __init__(self): + self.performed_search = False + + def __call__(self): + self.performed_search = True + return [] + + class StageTest(MockPackagesTest): def setUp(self): @@ -251,6 +271,32 @@ class StageTest(MockPackagesTest): self.check_fetch(stage, self.stage_name) self.check_destroy(stage, self.stage_name) + def test_no_search_if_default_succeeds(self): + with Stage(self.archive_url, name=self.stage_name, + search_fn=fail_search_fn) as stage: + stage.fetch() + self.check_destroy(stage, self.stage_name) + + def test_no_search_mirror_only(self): + with Stage(FailingFetchStrategy(), name=self.stage_name, + search_fn=fail_search_fn) as stage: + try: + stage.fetch(mirror_only=True) + except spack.fetch_strategy.FetchError: + pass + self.check_destroy(stage, self.stage_name) + + def test_search_if_default_fails(self): + test_search = MockSearchFunction() + with Stage(FailingFetchStrategy(), name=self.stage_name, + search_fn=test_search) as stage: + try: + stage.fetch(mirror_only=False) + except spack.fetch_strategy.FetchError: + pass + self.check_destroy(stage, self.stage_name) + self.assertTrue(test_search.performed_search) + def test_expand_archive(self): with Stage(self.archive_url, name=self.stage_name) as stage: stage.fetch() diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index f602ea627e..943db72612 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -58,7 +58,7 @@ function spack { # Zsh does not do word splitting by default, this enables it for this function only - if [ -n "$ZSH_VERSION" ]; then + if [ -n "${ZSH_VERSION:-}" ]; then emulate -L sh fi diff --git a/var/spack/repos/builtin/packages/R/package.py b/var/spack/repos/builtin/packages/R/package.py index a0899084d0..000e337ce0 100644 --- a/var/spack/repos/builtin/packages/R/package.py +++ b/var/spack/repos/builtin/packages/R/package.py @@ -50,6 +50,8 @@ class R(Package): variant('external-lapack', default=False, description='Links to externally installed BLAS/LAPACK') + variant('X', default=True, + description='Enable X11 support (call configure --with-x)') # Virtual dependencies depends_on('blas', when='+external-lapack') @@ -65,10 +67,16 @@ class R(Package): depends_on('libtiff') depends_on('jpeg') depends_on('cairo') + depends_on('cairo+X', when='+X') + depends_on('cairo~X', when='~X') depends_on('pango') depends_on('freetype') depends_on('tcl') depends_on('tk') + depends_on('tk+X', when='+X') + depends_on('tk~X', when='~X') + depends_on('libx11', when='+X') + depends_on('libxt', when='+X') depends_on('curl') depends_on('pcre') depends_on('jdk') diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py index b6aba8c03f..d812350ae8 100644 --- a/var/spack/repos/builtin/packages/autoconf/package.py +++ b/var/spack/repos/builtin/packages/autoconf/package.py @@ -27,6 +27,7 @@ from spack import * class Autoconf(AutotoolsPackage): """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' @@ -35,7 +36,7 @@ class Autoconf(AutotoolsPackage): version('2.59', 'd4d45eaa1769d45e59dcb131a4af17a0') version('2.13', '9de56d4a161a723228220b0f425dc711') - depends_on('m4', type='build') + depends_on('m4@1.4.6:', type='build') def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) diff --git a/var/spack/repos/builtin/packages/automake/package.py b/var/spack/repos/builtin/packages/automake/package.py index 78b0a5b34f..6c0a47ff95 100644 --- a/var/spack/repos/builtin/packages/automake/package.py +++ b/var/spack/repos/builtin/packages/automake/package.py @@ -25,10 +25,9 @@ from spack import * -class Automake(Package): - """ - Automake -- make file builder part of autotools - """ +class Automake(AutotoolsPackage): + """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' @@ -36,7 +35,7 @@ class Automake(Package): version('1.14.1', 'd052a3e884631b9c7892f2efce542d75') version('1.11.6', '0286dc30295b62985ca51919202ecfcc') - depends_on('autoconf') + depends_on('autoconf', type='build') def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) @@ -47,8 +46,3 @@ class Automake(Package): 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/cairo/package.py b/var/spack/repos/builtin/packages/cairo/package.py index 12c7838f63..fce7da3f17 100644 --- a/var/spack/repos/builtin/packages/cairo/package.py +++ b/var/spack/repos/builtin/packages/cairo/package.py @@ -33,6 +33,12 @@ class Cairo(AutotoolsPackage): version('1.14.0', 'fc3a5edeba703f906f2241b394f0cced') + variant('X', default=True, description="Build with X11 support") + + depends_on('libx11', when='+X') + depends_on('libxext', when='+X') + depends_on('libxrender', when='+X') + depends_on('libxcb', when='+X') depends_on("libpng") depends_on("glib") depends_on("pixman") diff --git a/var/spack/repos/builtin/packages/flex/package.py b/var/spack/repos/builtin/packages/flex/package.py index 9b173bb0dd..a2e0c85903 100644 --- a/var/spack/repos/builtin/packages/flex/package.py +++ b/var/spack/repos/builtin/packages/flex/package.py @@ -25,20 +25,44 @@ from spack import * -class Flex(Package): +class Flex(AutotoolsPackage): """Flex is a tool for generating scanners.""" - homepage = "http://flex.sourceforge.net/" - url = "http://download.sourceforge.net/flex/flex-2.5.39.tar.gz" + homepage = "https://github.com/westes/flex" + url = "https://github.com/westes/flex/releases/download/v2.6.2/flex-2.6.2.tar.gz" - version('2.6.0', '5724bcffed4ebe39e9b55a9be80859ec') - version('2.5.39', 'e133e9ead8ec0a58d81166b461244fde') + version('2.6.2', 'cc6d76c333db7653d5caf423a3335239') + version('2.6.1', '05bcd8fb629e0ae130311e8a6106fa82') + version('2.6.0', '760be2ee9433e822b6eb65318311c19d') + version('2.5.39', '5865e76ac69c05699f476515592750d7') - depends_on("bison", type='build') - depends_on("m4", type='build') + depends_on('bison', type='build') + depends_on('gettext@0.19:', type='build') + depends_on('help2man', type='build') - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + # Older tarballs don't come with a configure script + depends_on('m4', type='build', when='@:2.6.0') + depends_on('autoconf', type='build', when='@:2.6.0') + depends_on('automake', type='build', when='@:2.6.0') + depends_on('libtool', type='build', when='@:2.6.0') - make() - make("install") + def url_for_version(self, version): + url = "https://github.com/westes/flex" + if version >= Version('2.6.1'): + url += "/releases/download/v{0}/flex-{0}.tar.gz".format(version) + elif version == Version('2.6.0'): + url += "/archive/v{0}.tar.gz".format(version) + elif version >= Version('2.5.37'): + url += "/archive/flex-{0}.tar.gz".format(version) + else: + url += "/archive/flex-{0}.tar.gz".format(version.dashed) + + return url + + def autoreconf(self, spec, prefix): + pass + + @when('@:2.6.0') + def autoreconf(self, spec, prefix): + libtoolize('--install', '--force') + autoreconf('--install', '--force') diff --git a/var/spack/repos/builtin/packages/go-bootstrap/package.py b/var/spack/repos/builtin/packages/go-bootstrap/package.py index d48c7c9756..77a074e809 100644 --- a/var/spack/repos/builtin/packages/go-bootstrap/package.py +++ b/var/spack/repos/builtin/packages/go-bootstrap/package.py @@ -41,14 +41,17 @@ class GoBootstrap(Package): extendable = True - # NOTE: Go@1.4.2 is the only supported bootstrapping compiler because all + # NOTE: Go@1.4.x is the only supported bootstrapping compiler because all # later versions require a Go compiler to build. - # See: https://golang.org/doc/install/source - version('1.4.2', git='https://go.googlesource.com/go', tag='go1.4.2') + # See: https://golang.org/doc/install/source#go14 and + # https://github.com/golang/go/issues/17545 and + # https://github.com/golang/go/issues/16352 + version('1.4-bootstrap-20161024', '76e42c8152e8560ded880a6d1d1f53cb', + url='https://storage.googleapis.com/golang/go1.4-bootstrap-20161024.tar.gz') variant('test', default=True, description='Build and run tests as part of the build.') - provides('golang@:1.4.2') + provides('golang@:1.4-bootstrap-20161024') depends_on('git', type='alldeps') @@ -69,6 +72,7 @@ class GoBootstrap(Package): pass def install(self, spec, prefix): + env['CGO_ENABLED'] = '0' bash = which('bash') with working_dir('src'): bash('{0}.bash'.format('all' if '+test' in spec else 'make')) diff --git a/var/spack/repos/builtin/packages/go/misc-cgo-testcshared.patch b/var/spack/repos/builtin/packages/go/misc-cgo-testcshared.patch new file mode 100644 index 0000000000..17751df816 --- /dev/null +++ b/var/spack/repos/builtin/packages/go/misc-cgo-testcshared.patch @@ -0,0 +1,11 @@ +--- misc/cgo/testcshared/test.bash.orig 2016-11-19 00:00:11.917000000 +0000 ++++ misc/cgo/testcshared/test.bash 2016-11-19 00:00:22.081000000 +0000 +@@ -107,7 +107,7 @@ + + # test0: exported symbols in shared lib are accessible. + # TODO(iant): using _shared here shouldn't really be necessary. +-$(go env CC) ${GOGCCFLAGS} -I ${installdir} -o testp main0.c libgo.$libext ++$(go env CC) ${GOGCCFLAGS} -I ${installdir} -o testp main0.c ./libgo.$libext + binpush testp + + output=$(run LD_LIBRARY_PATH=. ./testp) diff --git a/var/spack/repos/builtin/packages/go/package.py b/var/spack/repos/builtin/packages/go/package.py index 5fa3017ab5..7f4d509466 100644 --- a/var/spack/repos/builtin/packages/go/package.py +++ b/var/spack/repos/builtin/packages/go/package.py @@ -32,13 +32,12 @@ from spack import * class Go(Package): """The golang compiler and build environment""" homepage = "https://golang.org" - url = "https://go.googlesource.com/go" + url='https://storage.googleapis.com/golang/go1.7.3.src.tar.gz' extendable = True - version('1.6.2', git='https://go.googlesource.com/go', tag='go1.6.2') - version('1.5.4', git='https://go.googlesource.com/go', tag='go1.5.4') - version('1.4.2', git='https://go.googlesource.com/go', tag='go1.4.2') + version('1.7.3', '83d1b7bd4281479ab7d153e5152c9fc9') + version('1.6.2', 'd1b50fa98d9a71eeee829051411e6207') variant('test', default=True, description='Build and run tests as part of the build.') @@ -49,6 +48,12 @@ class Go(Package): # should be a dep on external go compiler depends_on('go-bootstrap', type='build') + # https://github.com/golang/go/issues/17545 + patch('time_test.patch', when='@1.6.2:1.7.3') + + # https://github.com/golang/go/issues/17986 + patch('misc-cgo-testcshared.patch', level=0, when='@1.6.2:1.7.3') + # NOTE: Older versions of Go attempt to download external files that have # since been moved while running the test suite. This patch modifies the # test files so that these tests don't cause false failures. @@ -65,6 +70,9 @@ class Go(Package): def patch(self): pass + def url_for_version(self, version): + return "https://storage.googleapis.com/golang/go{0}.src.tar.gz".format(version) + def install(self, spec, prefix): bash = which('bash') with working_dir('src'): diff --git a/var/spack/repos/builtin/packages/go/time_test.patch b/var/spack/repos/builtin/packages/go/time_test.patch new file mode 100644 index 0000000000..c3e0697c91 --- /dev/null +++ b/var/spack/repos/builtin/packages/go/time_test.patch @@ -0,0 +1,18 @@ +diff --git a/src/time/time_test.go b/src/time/time_test.go +index 68236fd..2e47d08 100644 +--- a/src/time/time_test.go ++++ b/src/time/time_test.go +@@ -943,8 +943,11 @@ func TestLoadFixed(t *testing.T) { + // but Go and most other systems use "east is positive". + // So GMT+1 corresponds to -3600 in the Go zone, not +3600. + name, offset := Now().In(loc).Zone() +- if name != "GMT+1" || offset != -1*60*60 { +- t.Errorf("Now().In(loc).Zone() = %q, %d, want %q, %d", name, offset, "GMT+1", -1*60*60) ++ // The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1" ++ // on earlier versions; we accept both. (Issue #17276). ++ if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 { ++ t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d", ++ name, offset, "GMT+1", "-01", -1*60*60) + } + } + diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 2820a3a304..75aa239be3 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -175,7 +175,9 @@ HDF5 version {version} {version} # TODO: Automate these path and library settings cc('-c', "-I%s" % join_path(spec.prefix, "include"), "check.c") cc('-o', "check", "check.o", - "-L%s" % join_path(spec.prefix, "lib"), "-lhdf5", + "-L%s" % join_path(spec.prefix, "lib"), + "-L%s" % join_path(spec.prefix, "lib64"), + "-lhdf5", "-lz") try: check = Executable('./check') diff --git a/var/spack/repos/builtin/packages/help2man/package.py b/var/spack/repos/builtin/packages/help2man/package.py new file mode 100644 index 0000000000..506b1c1465 --- /dev/null +++ b/var/spack/repos/builtin/packages/help2man/package.py @@ -0,0 +1,37 @@ +############################################################################## +# 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 Help2man(AutotoolsPackage): + """help2man produces simple manual pages from the '--help' and '--version' + output of other commands.""" + + homepage = "https://www.gnu.org/software/help2man/" + url = "http://gnu.askapache.com/help2man/help2man-1.47.4.tar.xz" + + version('1.47.4', '544aca496a7d89de3e5d99e56a2f03d3') + + depends_on('gettext', type='build') diff --git a/var/spack/repos/builtin/packages/icet/package.py b/var/spack/repos/builtin/packages/icet/package.py new file mode 100644 index 0000000000..cdace1481f --- /dev/null +++ b/var/spack/repos/builtin/packages/icet/package.py @@ -0,0 +1,47 @@ +############################################################################## +# 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 Icet(CMakePackage): + """The Image Composition Engine for Tiles (IceT) is a high-performance + sort-last parallel rendering library.""" + + homepage = "http://icet.sandia.gov" + url = "https://example.com/icet-1.2.3.tar.gz" + + version('develop', branch='master', + git='https://gitlab.kitware.com/icet/icet.git') + version('2.1.1', '4f971c51105a64937460d482adca2a6c') + + depends_on('cmake', type='build') + depends_on('mpi') + + def url_for_version(self, version): + return ("https://gitlab.kitware.com/icet/icet/repository/" + "archive.tar.bz2?ref=IceT-{0}".format(version.dotted)) + + def cmake_args(self): + return ['-DICET_USE_OPENGL:BOOL=OFF'] diff --git a/var/spack/repos/builtin/packages/jemalloc/package.py b/var/spack/repos/builtin/packages/jemalloc/package.py index e13d4292f8..839251f47b 100644 --- a/var/spack/repos/builtin/packages/jemalloc/package.py +++ b/var/spack/repos/builtin/packages/jemalloc/package.py @@ -31,6 +31,7 @@ class Jemalloc(Package): homepage = "http://www.canonware.com/jemalloc/" url = "https://github.com/jemalloc/jemalloc/releases/download/4.0.4/jemalloc-4.0.4.tar.bz2" + version('4.3.1', 'f204c0ea1aef92fbb339dc640de338a6') version('4.2.1', '094b0a7b8c77c464d0dc8f0643fd3901') version('4.2.0', 'e6b5d5a1ea93a04207528d274efdd144') version('4.1.0', 'c4e53c947905a533d5899e5cc3da1f94') diff --git a/var/spack/repos/builtin/packages/libsigsegv/package.py b/var/spack/repos/builtin/packages/libsigsegv/package.py index 6c8b27478a..a5a3e8eb5f 100644 --- a/var/spack/repos/builtin/packages/libsigsegv/package.py +++ b/var/spack/repos/builtin/packages/libsigsegv/package.py @@ -25,8 +25,9 @@ from spack import * -class Libsigsegv(Package): +class Libsigsegv(AutotoolsPackage): """GNU libsigsegv is a library for handling page faults in user mode.""" + homepage = "https://www.gnu.org/software/libsigsegv/" url = "ftp://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.10.tar.gz" @@ -34,9 +35,5 @@ class Libsigsegv(Package): version('2.10', '7f96fb1f65b3b8cbc1582fb7be774f0f') - def install(self, spec, prefix): - configure('--prefix=%s' % prefix, - '--enable-shared') - - make() - make("install") + def configure_args(self): + return ['--enable-shared'] diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index a0070d72d0..cd12503681 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -25,17 +25,16 @@ from spack import * -class Libtool(Package): - """ - libtool -- library building part of autotools - """ +class Libtool(AutotoolsPackage): + """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') - depends_on('m4', type='build') + depends_on('m4@1.4.6:', type='build') def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) @@ -46,8 +45,3 @@ class Libtool(Package): 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/llvm-lld/package.py b/var/spack/repos/builtin/packages/llvm-lld/package.py index 1dcf88e3c0..6a167cca33 100644 --- a/var/spack/repos/builtin/packages/llvm-lld/package.py +++ b/var/spack/repos/builtin/packages/llvm-lld/package.py @@ -38,7 +38,7 @@ class LlvmLld(Package): depends_on('cmake', type='build') def install(self, spec, prefix): - env['CXXFLAGS'] = self.compier.cxx11_flag + env['CXXFLAGS'] = self.compiler.cxx11_flag with working_dir('spack-build', create=True): cmake('..', diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index f7150727fe..15dbf4793b 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -26,8 +26,9 @@ from spack import * import sys -class M4(Package): +class M4(AutotoolsPackage): """GNU M4 is an implementation of the traditional Unix macro processor.""" + homepage = "https://www.gnu.org/software/m4/m4.html" url = "ftp://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz" @@ -40,19 +41,19 @@ class M4(Package): depends_on('libsigsegv', when='+sigsegv') - def install(self, spec, prefix): - configure_args = [] - if 'libsigsegv' in spec: - configure_args.append('--with-libsigsegv-prefix=%s' % - spec['libsigsegv'].prefix) + def configure_args(self): + spec = self.spec + args = ['--enable-c++'] + + if '+sigsegv' in spec: + args.append('--with-libsigsegv-prefix={0}'.format( + spec['libsigsegv'].prefix)) else: - configure_args.append('--without-libsigsegv-prefix') + args.append('--without-libsigsegv-prefix') # http://lists.gnu.org/archive/html/bug-m4/2016-09/msg00002.html - if (sys.platform == "darwin") and (spec.satisfies('%gcc')) and \ - (spec.architecture.platform_os.version == "10.12"): - configure_args.append('ac_cv_type_struct_sched_param=yes') + if (sys.platform == 'darwin') and (spec.satisfies('%gcc')) and \ + (spec.architecture.platform_os.version == '10.12'): + args.append('ac_cv_type_struct_sched_param=yes') - configure("--prefix=%s" % prefix, *configure_args) - make() - make("install") + return args diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index b1e406157b..38bbc4e5ba 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -39,8 +39,12 @@ class Netcdf(Package): version('4.4.0', 'cffda0cbd97fdb3a06e9274f7aef438e') version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') - variant('mpi', default=True, description='Enables MPI parallelism') - variant('hdf4', default=False, description='Enable HDF4 support') + variant('mpi', default=True, description='Enables MPI parallelism') + variant('hdf4', default=False, description='Enable HDF4 support') + variant('shared', default=True, description='Enable shared library') + variant('parallel-netcdf', default=False, description='Enable PnetCDF support') + variant('dap', default=False, description='Enable DAP support') + variant('cdmremote', default=False, description='Enable CDM Remote support') # These variants control the number of dimensions (i.e. coordinates and # attributes) and variables (e.g. time, entity ID, number of coordinates) # that can be used in any particular NetCDF file. @@ -51,9 +55,9 @@ class Netcdf(Package): depends_on("m4", type='build') depends_on("hdf", when='+hdf4') - - # Required for DAP support - depends_on("curl@7.18.0:") + depends_on("curl@7.18.0:", when='+dap') + depends_on("curl@7.18.0:", when='+cdmremote') + depends_on('parallel-netcdf', when='@4.2.1.1:+parallel-netcdf') # Required for NetCDF-4 support depends_on("zlib@1.2.5:") @@ -84,6 +88,7 @@ class Netcdf(Package): 'hdf5+mpi, but spec asked for hdf5~mpi.') # Environment variables + CFLAGS = [] CPPFLAGS = [] LDFLAGS = [] LIBS = [] @@ -93,23 +98,38 @@ class Netcdf(Package): "--enable-fsync", "--enable-v2", "--enable-utilities", - "--enable-shared", "--enable-static", "--enable-largefile", # necessary for HDF5 support "--enable-netcdf-4", "--enable-dynamic-loading", - # necessary for DAP support - "--enable-dap" ] - # Make sure Netcdf links against Spack's curl, otherwise - # otherwise it may pick up system's curl, which can give link - # errors, e.g.: - # undefined reference to `SSL_CTX_use_certificate_chain_file` - LIBS.append("-lcurl") - CPPFLAGS.append("-I%s" % spec['curl'].prefix.include) - LDFLAGS.append("-L%s" % spec['curl'].prefix.lib) + if '+shared' in spec: + config_args.append('--enable-shared') + else: + config_args.append('--disable-shared') + # We don't have shared libraries but we still want it to be + # possible to use this library in shared builds + CFLAGS.append('-fPIC') + + if '+dap' in spec: + config_args.append('--enable-dap') + else: + config_args.append('--disable-dap') + + if '+cdmremote' in spec: + config_args.append('--enable-cdmremote') + else: + config_args.append('--disable-cdmremote') + + if '+dap' in spec or '+cdmremote' in spec: + # Make sure Netcdf links against Spack's curl, otherwise it may + # pick up system's curl, which can give link errors, e.g.: + # undefined reference to `SSL_CTX_use_certificate_chain_file` + LIBS.append("-lcurl") + CPPFLAGS.append("-I%s" % spec['curl'].prefix.include) + LDFLAGS.append("-L%s" % spec['curl'].prefix.lib) if '+mpi' in spec: config_args.append('--enable-parallel4') @@ -131,10 +151,18 @@ class Netcdf(Package): LDFLAGS.append("-L%s/lib" % spec['szip'].prefix) LIBS.append("-l%s" % "sz") + # PnetCDF support + if '+parallel-netcdf' in spec: + config_args.append('--enable-pnetcdf') + config_args.append('CC=%s' % spec['mpi'].mpicc) + CPPFLAGS.append("-I%s/include" % spec['parallel-netcdf'].prefix) + LDFLAGS.append("-L%s/lib" % spec['parallel-netcdf'].prefix) + # Fortran support # In version 4.2+, NetCDF-C and NetCDF-Fortran have split. # Use the netcdf-fortran package to install Fortran support. + config_args.append('CFLAGS=%s' % ' '.join(CFLAGS)) config_args.append('CPPFLAGS=%s' % ' '.join(CPPFLAGS)) config_args.append('LDFLAGS=%s' % ' '.join(LDFLAGS)) config_args.append('LIBS=%s' % ' '.join(LIBS)) diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 4ac96b8127..276237a536 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -37,6 +37,7 @@ class Petsc(Package): homepage = "http://www.mcs.anl.gov/petsc/index.html" url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.5.3.tar.gz" + version('develop', git='https://bitbucket.org/petsc/petsc.git', tag='master') version('3.7.4', 'aaf94fa54ef83022c14091f10866eedf') version('3.7.2', '50da49867ce7a49e7a0c1b37f4ec7b34') version('3.6.4', '7632da2375a3df35b8891c9526dbdde7') @@ -67,6 +68,9 @@ class Petsc(Package): description='Activates support for SuperluDist (only parallel)') # Virtual dependencies + # Git repository needs sowing to build Fortran interface + depends_on('sowing', when='@develop') + depends_on('blas') depends_on('lapack') depends_on('mpi', when='+mpi') @@ -127,6 +131,7 @@ class Petsc(Package): def install(self, spec, prefix): options = ['--with-ssl=0', '--download-c2html=0', + '--download-sowing=0', '--download-hwloc=0'] options.extend(self.mpi_dependent_options()) options.extend([ diff --git a/var/spack/repos/builtin/packages/py-pyqt/package.py b/var/spack/repos/builtin/packages/py-pyqt/package.py index de68bfaa90..43f2e2630b 100644 --- a/var/spack/repos/builtin/packages/py-pyqt/package.py +++ b/var/spack/repos/builtin/packages/py-pyqt/package.py @@ -39,7 +39,7 @@ class PyPyqt(Package): # TODO: allow qt5 when conditional deps are supported. # TODO: Fix version matching so that @4 works like @:4 - depends_on('qt@:4') + depends_on('qt@:4+phonon+dbus') def install(self, spec, prefix): python('configure.py', diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 6447d7d6d4..1db651c02b 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -51,6 +51,7 @@ class Qt(Package): variant('webkit', default=False, description="Build the Webkit extension") variant('examples', default=False, description="Build examples.") variant('dbus', default=False, description="Build with D-Bus support.") + variant('phonon', default=False, description="Build with phonon support.") patch('qt3krell.patch', when='@3.3.8b+krellpatch') @@ -179,7 +180,7 @@ class Qt(Package): if '~examples' in self.spec: config_args.extend(['-nomake', 'examples']) - if '@4' in self.spec: + if '@4' in self.spec and '~phonon' in self.spec: config_args.append('-no-phonon') if '+dbus' in self.spec: diff --git a/var/spack/repos/builtin/packages/r-bitops/package.py b/var/spack/repos/builtin/packages/r-bitops/package.py new file mode 100644 index 0000000000..6399202aba --- /dev/null +++ b/var/spack/repos/builtin/packages/r-bitops/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 RBitops(Package): + """Functions for bitwise operations on integer vectors.""" + + homepage = "https://cran.r-project.org/package=bitops" + url = "https://cran.r-project.org/src/contrib/bitops_1.0-6.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/bitops" + + version('1.0-6', 'fba16485a51b1ccd354abde5816b6bdd') + + 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-c50/package.py b/var/spack/repos/builtin/packages/r-c50/package.py new file mode 100644 index 0000000000..e9b582b52f --- /dev/null +++ b/var/spack/repos/builtin/packages/r-c50/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 RC50(Package): + """C5.0 decision trees and rule-based models for pattern recognition.""" + + homepage = "https://cran.r-project.org/package=C50" + url = "https://cran.r-project.org/src/contrib/C50_0.1.0-24.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/C50" + + version('0.1.0-24', '42631e65c5c579532cc6edf5ea175949') + + extends('R') + + depends_on('r-partykit', type=nolink) + + 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-catools/package.py b/var/spack/repos/builtin/packages/r-catools/package.py new file mode 100644 index 0000000000..adc64e269c --- /dev/null +++ b/var/spack/repos/builtin/packages/r-catools/package.py @@ -0,0 +1,47 @@ +############################################################################## +# 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 RCatools(Package): + """Contains several basic utility functions including: moving (rolling, + running) window statistic functions, read/write for GIF and ENVI binary + files, fast calculation of AUC, LogitBoost classifier, base64 + encoder/decoder, round-off-error-free sum and cumsum, etc.""" + + homepage = "https://cran.r-project.org/package=caTools" + url = "https://cran.r-project.org/src/contrib/caTools_1.17.1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/caTools" + + version('1.17.1', '5c872bbc78b177b306f36709deb44498') + + extends('R') + + depends_on('r-bitops', type=nolink) + + 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-deoptim/package.py b/var/spack/repos/builtin/packages/r-deoptim/package.py new file mode 100644 index 0000000000..16aacccd0e --- /dev/null +++ b/var/spack/repos/builtin/packages/r-deoptim/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 RDeoptim(Package): + """Implements the differential evolution algorithm for global optimization + of a real-valued function of a real-valued parameter vector.""" + + homepage = "https://cran.r-project.org/package=DEoptim" + url = "https://cran.r-project.org/src/contrib/DEoptim_2.2-3.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/DEoptim" + + version('2.2-3', 'ed406e6790f8f1568aa9bec159f80326') + + 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-evaluate/package.py b/var/spack/repos/builtin/packages/r-evaluate/package.py new file mode 100644 index 0000000000..5583c0ed68 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-evaluate/package.py @@ -0,0 +1,46 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + + +from spack import * + + +class REvaluate(Package): + """Parsing and evaluation tools that make it easy to recreate the command + line behaviour of R.""" + + homepage = "https://github.com/hadley/evaluate" + url = "https://cran.rstudio.com/src/contrib/evaluate_0.9.tar.gz" + list_url = "https://cran.rstudio.com/src/contrib/Archive/evaluate" + + version('0.9', '877d89ce8a9ef7f403b1089ca1021775') + + extends('R') + + depends_on('r-stringr', type=nolink) + + 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-formatr/package.py b/var/spack/repos/builtin/packages/r-formatr/package.py new file mode 100644 index 0000000000..4c92e1f34b --- /dev/null +++ b/var/spack/repos/builtin/packages/r-formatr/package.py @@ -0,0 +1,51 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + +from spack import * + + +class RFormatr(Package): + """Provides a function tidy_source() to format R source code. Spaces and + indent will be added to the code automatically, and comments will be + preserved under certain conditions, so that R code will be more + human-readable and tidy. There is also a Shiny app as a user interface in + this package.""" + + homepage = "http://yihui.name/formatR" + url = "https://cran.r-project.org/src/contrib/formatR_1.4.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/formatR" + + version('1.4', '98b9b64b2785b35f9df403e1aab6c73c') + + extends('R') + + depends_on('r-codetools', type=nolink) + depends_on('r-shiny', type=nolink) + depends_on('r-testit', type=nolink) + # depends_on('r-knitr', type=nolink) - mutual dependency + + 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-formula/package.py b/var/spack/repos/builtin/packages/r-formula/package.py new file mode 100644 index 0000000000..3c4347ee50 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-formula/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 RFormula(Package): + """Infrastructure for extended formulas with multiple parts on the right-hand + side and/or multiple responses on the left-hand side.""" + + homepage = "https://cran.r-project.org/package=Formula" + url = "https://cran.r-project.org/src/contrib/Formula_1.2-1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/Formula" + + version('1.2-1', '2afb31e637cecd0c1106317aca1e4849') + + 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-gistr/package.py b/var/spack/repos/builtin/packages/r-gistr/package.py new file mode 100644 index 0000000000..646299b97b --- /dev/null +++ b/var/spack/repos/builtin/packages/r-gistr/package.py @@ -0,0 +1,55 @@ +############################################################################## +# 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 RGistr(Package): + """Work with 'GitHub' 'gists' from 'R'. This package allows the user to + create new 'gists', update 'gists' with new files, rename files, delete + files, get and delete 'gists', star and 'un-star' 'gists', fork 'gists', + open a 'gist' in your default browser, get embed code for a 'gist', list + 'gist' 'commits', and get rate limit information when 'authenticated'. Some + requests require authentication and some do not.""" + + homepage = "https://github.com/ropensci/gistr" + url = "https://cran.r-project.org/src/contrib/gistr_0.3.6.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/gistr" + + version('0.3.6', '49d548cb3eca0e66711aece37757a2c0') + + extends('R') + + depends_on('r-jsonlite', type=nolink) + depends_on('r-httr', type=nolink) + depends_on('r-magrittr', type=nolink) + depends_on('r-assertthat', type=nolink) + depends_on('r-knitr', type=nolink) + depends_on('r-rmarkdown', type=nolink) + depends_on('r-dplyr', type=nolink) + + 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-hexbin/package.py b/var/spack/repos/builtin/packages/r-hexbin/package.py new file mode 100644 index 0000000000..5d2972ff96 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-hexbin/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 RHexbin(Package): + """Binning and plotting functions for hexagonal bins. Now uses and relies + on grid graphics and formal (S4) classes and methods.""" + + homepage = "http://github.com/edzer/hexbin" + url = "https://cran.r-project.org/src/contrib/hexbin_1.27.1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/hexbin" + + version('1.27.1', '7f380390c6511e97df10a810a3b3bb7c') + + extends('R') + + depends_on('r-lattice', type=nolink) + + 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-highr/package.py b/var/spack/repos/builtin/packages/r-highr/package.py new file mode 100644 index 0000000000..f977a7302f --- /dev/null +++ b/var/spack/repos/builtin/packages/r-highr/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 RHighr(Package): + """Provides syntax highlighting for R source code. Currently it supports + LaTeX and HTML output. Source code of other languages is supported via + Andre Simon's highlight package.""" + + homepage = "https://github.com/yihui/highr" + url = "https://cran.r-project.org/src/contrib/highr_0.6.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/highr" + + version('0.6', 'bf47388c5f57dc61962362fb7e1d8b16') + + 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-irdisplay/package.py b/var/spack/repos/builtin/packages/r-irdisplay/package.py new file mode 100644 index 0000000000..a3c49feb93 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-irdisplay/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 RIrdisplay(Package): + """An interface to the rich display capabilities of Jupyter front-ends + (e.g. 'Jupyter Notebook') Designed to be used from a running IRkernel + session""" + + homepage = "https://irkernel.github.io" + url = "https://cran.rstudio.com/src/contrib/IRdisplay_0.4.4.tar.gz" + + version('0.4.4', '5be672fb82185b90f23bd99ac1e1cdb6') + + extends('R') + + depends_on('r-repr', type=nolink) + + 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-irkernel/package.py b/var/spack/repos/builtin/packages/r-irkernel/package.py new file mode 100644 index 0000000000..34b5c3c363 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-irkernel/package.py @@ -0,0 +1,51 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + +from spack import * + + +class RIrkernel(Package): + """R kernel for Jupyter""" + + homepage = "https://irkernel.github.io/" + + # Git repository + version('master', git='https://github.com/IRkernel/IRkernel.git', + tag='0.7') + + extends('R') + + depends_on('r-repr', type=nolink) + depends_on('r-irdisplay', type=nolink) + depends_on('r-evaluate', type=nolink) + depends_on('r-crayon', type=nolink) + depends_on('r-pbdzmq', type=nolink) + depends_on('r-devtools', type=nolink) + depends_on('r-uuid', type=nolink) + depends_on('r-digest', type=nolink) + + 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-knitr/package.py b/var/spack/repos/builtin/packages/r-knitr/package.py new file mode 100644 index 0000000000..4976e12b45 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-knitr/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 RKnitr(Package): + """Provides a general-purpose tool for dynamic report generation in R using + Literate Programming techniques.""" + + homepage = "http://yihui.name/knitr/" + url = "https://cran.rstudio.com/src/contrib/knitr_1.14.tar.gz" + list_url = "https://cran.rstudio.com/src/contrib/Archive/knitr" + + version('1.14', 'ef0fbeaa9372f99ffbc57212a7781511') + version('0.6' , 'c67d6db84cd55594a9e870c90651a3db') + + extends('R') + + depends_on('r-evaluate', type=nolink) + depends_on('r-digest', type=nolink) + depends_on('r-formatr', type=nolink) + depends_on('r-highr', type=nolink) + depends_on('r-stringr', type=nolink) + depends_on('r-markdown', type=nolink) + depends_on('r-yaml', type=nolink) + + 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-lattice/package.py b/var/spack/repos/builtin/packages/r-lattice/package.py index ba29feefc4..a798b1ce65 100644 --- a/var/spack/repos/builtin/packages/r-lattice/package.py +++ b/var/spack/repos/builtin/packages/r-lattice/package.py @@ -32,10 +32,10 @@ class RLattice(Package): handle most nonstandard requirements. See ?Lattice for an introduction.""" homepage = "http://lattice.r-forge.r-project.org/" - url = "https://cran.r-project.org/src/contrib/lattice_0.20-33.tar.gz" + url = "https://cran.r-project.org/src/contrib/lattice_0.20-34.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/lattice" - version('0.20-33', 'd487c94db1bfe00a27270f4c71baf53e') + version('0.20-34', 'c2a648b22d4206ae7526fb70b8e90fed') extends('R') diff --git a/var/spack/repos/builtin/packages/r-partykit/package.py b/var/spack/repos/builtin/packages/r-partykit/package.py new file mode 100644 index 0000000000..dff9099c07 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-partykit/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 RPartykit(Package): + """A toolkit with infrastructure for representing, summarizing, and + visualizing tree-structured regression and classification models. This + unified infrastructure can be used for reading/coercing tree models from + different sources ('rpart', 'RWeka', 'PMML') yielding objects that share + functionality for print()/plot()/predict() methods. Furthermore, new and + improved reimplementations of conditional inference trees (ctree()) and + model-based recursive partitioning (mob()) from the 'party' package are + provided based on the new infrastructure.""" + + homepage = "http://partykit.r-forge.r-project.org/partykit" + url = "https://cran.r-project.org/src/contrib/partykit_1.1-1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/partykit" + + version('1.1-1', '8fcb31d73ec1b8cd3bcd9789639a9277') + + extends('R') + + depends_on('r-survival', type=nolink) + depends_on('r-formula', type=nolink) + + 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-pbdzmq/package.py b/var/spack/repos/builtin/packages/r-pbdzmq/package.py new file mode 100644 index 0000000000..b5a9546124 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-pbdzmq/package.py @@ -0,0 +1,51 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + +from spack import * + + +class RPbdzmq(Package): + """'ZeroMQ' is a well-known library for high-performance asynchronous + messaging in scalable, distributed applications. This package provides + high level R wrapper functions to easily utilize 'ZeroMQ'. We mainly focus + on interactive client/server programming frameworks. For convenience, a + minimal 'ZeroMQ' library (4.1.0 rc1) is shipped with 'pbdZMQ', which can + be used if no system installation of 'ZeroMQ' is available. A few wrapper + functions compatible with 'rzmq' are also provided.""" + + homepage = "http://r-pbd.org/" + url = "https://cran.r-project.org/src/contrib/pbdZMQ_0.2-4.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/pbdZMQ" + + version('0.2-4', 'e5afb70199aa54d737ee7a0e26bde060') + + extends('R') + + depends_on('r-R6', type=nolink) + depends_on('zeromq') + + 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-pryr/package.py b/var/spack/repos/builtin/packages/r-pryr/package.py new file mode 100644 index 0000000000..acd502b536 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-pryr/package.py @@ -0,0 +1,46 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + +from spack import * + + +class RPryr(Package): + """Useful tools to pry back the covers of R and understand the language + at a deeper level.""" + + homepage = "https://github.com/hadley/pryr" + url = "https://cran.r-project.org/src/contrib/pryr_0.1.2.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/pryr" + + version('0.1.2', '66b597a762aa15a3b7037779522983b6') + + extends('R') + + depends_on('r-stringr', type=nolink) + depends_on('r-rcpp', type=nolink) + + 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-rbokeh/package.py b/var/spack/repos/builtin/packages/r-rbokeh/package.py new file mode 100644 index 0000000000..074c545534 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rbokeh/package.py @@ -0,0 +1,55 @@ +############################################################################## +# 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 RRbokeh(Package): + """R interface for creating plots in Bokeh. Bokeh by Continuum + Analytics.""" + + homepage = "https://hafen.github.io/rbokeh" + url = "https://cran.r-project.org/src/contrib/rbokeh_0.5.0.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/rbokeh" + + version('0.5.0', '4e14778c3fbd9286460ca28c68f57d10') + + extends('R') + + depends_on('r-htmlwidgets', type=nolink) + depends_on('r-maps', type=nolink) + depends_on('r-jsonlite', type=nolink) + depends_on('r-digest', type=nolink) + depends_on('r-hexbin', type=nolink) + depends_on('r-lazyeval', type=nolink) + depends_on('r-pryr', type=nolink) + depends_on('r-magrittr', type=nolink) + depends_on('r-ggplot2', type=nolink) + depends_on('r-scales', type=nolink) + depends_on('r-gistr', type=nolink) + + 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-repr/package.py b/var/spack/repos/builtin/packages/r-repr/package.py new file mode 100644 index 0000000000..2e1f6126f9 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-repr/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 RRepr(Package): + """String and binary representations of objects for several formats and + mime types.""" + + homepage = "https://github.com/IRkernel/repr" + url = "https://cran.r-project.org/src/contrib/repr_0.9.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/repr" + + version('0.9', 'db5ff74893063b492f684e42283070bd') + + 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-rinside/package.py b/var/spack/repos/builtin/packages/r-rinside/package.py new file mode 100644 index 0000000000..41af3a4392 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rinside/package.py @@ -0,0 +1,57 @@ +############################################################################## +# 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 RRinside(Package): + """C++ classes to embed R in C++ applications The 'RInside' packages makes + it easier to have "R inside" your C++ application by providing a C++ + wrapperclass providing the R interpreter. As R itself is embedded into + your application, a shared library build of R is required. This works on + Linux, OS X and even on Windows provided you use the same tools used to + build R itself. Numerous examples are provided in the eight subdirectories + of the examples/ directory of the installed package: standard, mpi (for + parallel computing) qt (showing how to embed 'RInside' inside a Qt GUI + application), wt (showing how to build a "web-application" using the Wt + toolkit), armadillo (for 'RInside' use with 'RcppArmadillo') and eigen (for + 'RInside' use with 'RcppEigen'). The example use GNUmakefile(s) with GNU + extensions, so a GNU make is required (and will use the GNUmakefile + automatically). Doxygen-generated documentation of the C++ classes is + available at the 'RInside' website as well.""" + + homepage = "http://dirk.eddelbuettel.com/code/rinside.html" + url = "https://cran.r-project.org/src/contrib/RInside_0.2.13.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/RInside" + + version('0.2.13', '2e3c35a7bd648e9bef98d0afcc02cf88') + + extends('R') + + depends_on('r-rcpp', type=nolink) + + 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-rmarkdown/package.py b/var/spack/repos/builtin/packages/r-rmarkdown/package.py new file mode 100644 index 0000000000..c379388314 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rmarkdown/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 RRmarkdown(Package): + """Convert R Markdown documents into a variety of formats.""" + + homepage = "http://rmarkdown.rstudio.com/" + url = "https://cran.r-project.org/src/contrib/rmarkdown_1.0.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/rmarkdown" + + version('1.0', '264aa6a59e9680109e38df8270e14c58') + + extends('R') + + depends_on('r-knitr', type=nolink) + depends_on('r-yaml', type=nolink) + depends_on('r-htmltools', type=nolink) + depends_on('r-catools', type=nolink) + depends_on('r-evaluate', type=nolink) + depends_on('r-base64enc', type=nolink) + depends_on('r-jsonlite', type=nolink) + + 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-rsnns/package.py b/var/spack/repos/builtin/packages/r-rsnns/package.py new file mode 100644 index 0000000000..7684792ba1 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rsnns/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 RRsnns(Package): + """The Stuttgart Neural Network Simulator (SNNS) is a library containing + many standard implementations of neural networks. This package wraps the + SNNS functionality to make it available from within R. Using the RSNNS + low-level interface, all of the algorithmic functionality and flexibility + of SNNS can be accessed. Furthermore, the package contains a convenient + high-level interface, so that the most common neural network topologies + and learning algorithms integrate seamlessly into R.""" + + homepage = "http://sci2s.ugr.es/dicits/software/RSNNS" + url = "https://cran.r-project.org/src/contrib/RSNNS_0.4-7.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/RSNNS" + + version('0.4-7', 'ade7736611c456effb5f72e0ce0a1e6f') + + extends('R') + + depends_on('r-rcpp', type=nolink) + + 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-rzmq/package.py b/var/spack/repos/builtin/packages/r-rzmq/package.py new file mode 100644 index 0000000000..472e706e72 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rzmq/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 RRzmq(Package): + """Interface to the ZeroMQ lightweight messaging kernel.""" + + homepage = "http://github.com/armstrtw/rzmq" + url = "https://cran.r-project.org/src/contrib/rzmq_0.7.7.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/rzmq" + + version('0.7.7', '8ba18fd1c222d1eb25bb622ccd2897e0') + + depends_on('zeromq') + + 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-testit/package.py b/var/spack/repos/builtin/packages/r-testit/package.py new file mode 100644 index 0000000000..a10b55d66c --- /dev/null +++ b/var/spack/repos/builtin/packages/r-testit/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 RTestit(Package): + """Provides two convenience functions assert() and test_pkg() to facilitate + testing R packages.""" + + homepage = "https://github.com/yihui/testit" + url = "https://cran.r-project.org/src/contrib/testit_0.5.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/testit" + + version('0.5', 'f206d3cbdc5174e353d2d05ba6a12e59') + + 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-uuid/package.py b/var/spack/repos/builtin/packages/r-uuid/package.py new file mode 100644 index 0000000000..97541bc3b8 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-uuid/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 RUuid(Package): + """Tools for generating and handling of UUIDs (Universally Unique + Identifiers).""" + + homepage = "http://www.rforge.net/uuid" + url = "https://cran.rstudio.com/src/contrib/uuid_0.1-2.tar.gz" + list_url = "https://cran.rstudio.com/src/contrib/Archive/uuid" + + version('0.1-2', 'f97d000c0b16bca455fb5bf2cd668ddf') + + 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/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py index 94a323ce90..58bbcd8383 100644 --- a/var/spack/repos/builtin/packages/scotch/package.py +++ b/var/spack/repos/builtin/packages/scotch/package.py @@ -85,16 +85,29 @@ class Scotch(Package): '-DIDXSIZE64' ] + if self.spec.satisfies('platform=darwin'): + cflags.extend([ + '-Drestrict=__restrict' + ]) + # Library Build Type # if '+shared' in self.spec: - makefile_inc.extend([ - # todo change for Darwin systems - 'LIB = .so', - 'CLIBFLAGS = -shared -fPIC', - 'RANLIB = echo', - 'AR = $(CC)', - 'ARFLAGS = -shared $(LDFLAGS) -o' - ]) + if self.spec.satisfies('platform=darwin'): + makefile_inc.extend([ + 'LIB = .dylib', + 'CLIBFLAGS = -dynamiclib -fPIC', + 'RANLIB = echo', + 'AR = $(CC)', + 'ARFLAGS = -dynamiclib $(LDFLAGS) -Wl,-install_name -Wl,%s/$(notdir $@) -undefined dynamic_lookup -o ' % prefix.lib # noqa + ]) + else: + makefile_inc.extend([ + 'LIB = .so', + 'CLIBFLAGS = -shared -fPIC', + 'RANLIB = echo', + 'AR = $(CC)', + 'ARFLAGS = -shared $(LDFLAGS) -o' + ]) cflags.append('-fPIC') else: makefile_inc.extend([ @@ -126,7 +139,11 @@ class Scotch(Package): ldflags.append('-L%s -lz' % (self.spec['zlib'].prefix.lib)) cflags.append('-DCOMMON_PTHREAD') - ldflags.append('-lm -lrt -pthread') + if self.spec.satisfies('platform=darwin'): + cflags.append('-DCOMMON_PTHREAD_BARRIER') + ldflags.append('-lm -pthread') + else: + ldflags.append('-lm -lrt -pthread') makefile_inc.append('LDFLAGS = %s' % ' '.join(ldflags)) diff --git a/var/spack/repos/builtin/packages/sowing/package.py b/var/spack/repos/builtin/packages/sowing/package.py new file mode 100644 index 0000000000..f7f6297488 --- /dev/null +++ b/var/spack/repos/builtin/packages/sowing/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 Sowing(Package): + """Sowing generates Fortran interfaces and documentation for PETSc + and MPICH. + """ + + homepage = "http://www.mcs.anl.gov/petsc/index.html" + url = "http://ftp.mcs.anl.gov/pub/petsc/externalpackages/sowing-1.1.23-p1.tar.gz" + + version('1.1.23-p1', '65aaf3ae2a4c0f30d532fec291702e16') + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix) + make('ALL', parallel=False) + make("install") diff --git a/var/spack/repos/builtin/packages/superlu/package.py b/var/spack/repos/builtin/packages/superlu/package.py index d9cff650b6..8e23a2a14e 100644 --- a/var/spack/repos/builtin/packages/superlu/package.py +++ b/var/spack/repos/builtin/packages/superlu/package.py @@ -23,6 +23,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +import glob +import os class Superlu(Package): @@ -34,21 +36,90 @@ class Superlu(Package): url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_5.2.1.tar.gz" version('5.2.1', '3a1a9bff20cb06b7d97c46d337504447') + version('4.3', 'b72c6309f25e9660133007b82621ba7c') + variant('fpic', default=False, + description='Build with position independent code') + + depends_on('cmake', when='@5.2.1:', type='build') depends_on('blas') + # CMake installation method + @when('@5.2.1:') def install(self, spec, prefix): cmake_args = [ - '-DCMAKE_POSITION_INDEPENDENT_CODE=ON', - # BLAS support '-Denable_blaslib=OFF', '-DBLAS_blas_LIBRARY={0}'.format(spec['blas'].blas_libs.joined()) ] + if '+fpic' in spec: + cmake_args.extend([ + '-DCMAKE_POSITION_INDEPENDENT_CODE=ON' + ]) + cmake_args.extend(std_cmake_args) with working_dir('spack-build', create=True): cmake('..', *cmake_args) - make() make('install') + + # Pre-cmake installation method + @when('@4.3') + def install(self, spec, prefix): + config = [] + + # Define make.inc file + config.extend([ + 'PLAT = _x86_64', + 'SuperLUroot = %s' % self.stage.source_path, + # 'SUPERLULIB = $(SuperLUroot)/lib/libsuperlu$(PLAT).a', + 'SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_{0}.a' \ + .format(self.spec.version), + 'BLASDEF = -DUSE_VENDOR_BLAS', + 'BLASLIB = {0}'.format(spec['blas'].blas_libs.ld_flags), + # or BLASLIB = -L/usr/lib64 -lblas + 'TMGLIB = libtmglib.a', + 'LIBS = $(SUPERLULIB) $(BLASLIB)', + 'ARCH = ar', + 'ARCHFLAGS = cr', + 'RANLIB = {0}'.format('ranlib' if which('ranlib') else 'echo'), + 'CC = {0}'.format(os.environ['CC']), + 'FORTRAN = {0}'.format(os.environ['FC']), + 'LOADER = {0}'.format(os.environ['CC']), + 'CDEFS = -DAdd_' + ]) + + if '+fpic' in spec: + config.extend([ + # Use these lines instead when pic_flag capability arrives + # 'CFLAGS = -O3 {0}'.format(self.compiler.pic_flag), + # 'NOOPTS = {0}'.format(self.compiler.pic_flag), + # 'FFLAGS = -O2 {0}'.format(self.compiler.pic_flag), + # 'LOADOPTS = {0}'.format(self.compiler.pic_flag) + 'CFLAGS = -O3 -fPIC', + 'NOOPTS = -fPIC', + 'FFLAGS = -O2 -fPIC', + 'LOADOPTS = -fPIC' + ]) + else: + config.extend([ + 'CFLAGS = -O3', + 'NOOPTS = ', + 'FFLAGS = -O2', + 'LOADOPTS = ' + ]) + + # Write configuration options to make.inc file + with open('make.inc', 'w') as inc: + for option in config: + inc.write('{0}\n'.format(option)) + + make(parallel=False) + + # Install manually + install_tree('lib', prefix.lib) + headers = glob.glob(join_path('SRC', '*.h')) + mkdir(prefix.include) + for h in headers: + install(h, prefix.include) diff --git a/var/spack/repos/builtin/packages/tetgen/package.py b/var/spack/repos/builtin/packages/tetgen/package.py index 7ac55a6785..6e5ed79c36 100644 --- a/var/spack/repos/builtin/packages/tetgen/package.py +++ b/var/spack/repos/builtin/packages/tetgen/package.py @@ -22,7 +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 glob class Tetgen(Package): @@ -33,13 +35,35 @@ class Tetgen(Package): """ homepage = "http://www.tetgen.org" - url = "http://www.tetgen.org/files/tetgen1.4.3.tar.gz" - version('1.4.3', 'd6a4bcdde2ac804f7ec66c29dcb63c18') - version('1.5.0', '3b9fd9cdec121e52527b0308f7aad5c1', - url='http://www.tetgen.org/1.5/src/tetgen1.5.0.tar.gz') + version('1.5.0', '3b9fd9cdec121e52527b0308f7aad5c1', url='http://www.tetgen.org/1.5/src/tetgen1.5.0.tar.gz') + version('1.4.3', 'd6a4bcdde2ac804f7ec66c29dcb63c18', url='http://www.tetgen.org/files/tetgen1.4.3.tar.gz') + + variant('debug', default=False, description='Builds the library in debug mode.') + variant('except', default=False, description='Replaces asserts with exceptions for better C++ compatibility.') + + patch('tetgen-1.5.0-free.patch', when='@1.5.0') + + def patch(self): + cflags = '-g -O0' if '+debug' in self.spec else '-g0 -O3' + + mff = FileFilter('makefile') + mff.filter(r'^(C(XX)?FLAGS\s*=)(.*)$', r'\1 {0}'.format(cflags)) + + if '+except' in self.spec: + hff = FileFilter('tetgen.h') + hff.filter(r'(\b)(throw)(\b)(.*);', r'\1assert_throw(false);') + hff.filter(r'^(#define\s*tetgenH\s*)$', r'\1{0}'.format("""\n +#include <stdexcept> + +inline void assert_throw(bool assertion) +{ + if(!assertion) + throw std::runtime_error("Tetgen encountered a problem (assert failed)!"); +}\n""")) - depends_on('cmake@2.8.7:', when='@1.5.0:', type='build') + sff = FileFilter(*(glob.glob('*.cxx'))) + sff.filter(r'(\b)(assert)(\b)', r'\1assert_throw\3') def install(self, spec, prefix): make('tetgen', 'tetlib') diff --git a/var/spack/repos/builtin/packages/tetgen/tetgen-1.5.0-free.patch b/var/spack/repos/builtin/packages/tetgen/tetgen-1.5.0-free.patch new file mode 100644 index 0000000000..009ccd834f --- /dev/null +++ b/var/spack/repos/builtin/packages/tetgen/tetgen-1.5.0-free.patch @@ -0,0 +1,49 @@ +diff --git a/tetgen.h b/tetgen.h +index 3196e03..2ff3138 100644 +--- a/tetgen.h ++++ b/tetgen.h +@@ -2206,6 +2206,44 @@ public: + if (highordertable != NULL) { + delete [] highordertable; + } ++ ++ bgm = NULL; ++ ++ points = NULL; ++ dummypoint = NULL; ++ ++ tetrahedrons = NULL; ++ ++ subfaces = NULL; ++ subsegs = NULL; ++ ++ tet2segpool = NULL; ++ tet2subpool = NULL; ++ ++ flippool = NULL; ++ unflipqueue = NULL; ++ ++ cavetetlist = NULL; ++ cavebdrylist = NULL; ++ caveoldtetlist = NULL; ++ cavetetvertlist = NULL; ++ ++ caveshlist = NULL; ++ caveshbdlist = NULL; ++ cavesegshlist = NULL; ++ cavetetshlist = NULL; ++ cavetetseglist = NULL; ++ caveencshlist = NULL; ++ caveencseglist = NULL; ++ ++ subsegstack = NULL; ++ subfacstack = NULL; ++ subvertstack = NULL; ++ ++ idx2facetlist = NULL; ++ facetverticeslist = NULL; ++ segmentendpointslist = NULL; ++ highordertable = NULL; + } + + ~tetgenmesh() diff --git a/var/spack/repos/builtin/packages/tk/package.py b/var/spack/repos/builtin/packages/tk/package.py index 894d3af6cc..12a7049e72 100644 --- a/var/spack/repos/builtin/packages/tk/package.py +++ b/var/spack/repos/builtin/packages/tk/package.py @@ -37,7 +37,10 @@ class Tk(Package): version('8.6.5', '11dbbd425c3e0201f20d6a51482ce6c4') version('8.6.3', '85ca4dbf4dcc19777fd456f6ee5d0221') + variant('X', default=True, description='Enable X11 support') + depends_on("tcl") + depends_on("libx11", when='+X') def url_for_version(self, version): base_url = "http://prdownloads.sourceforge.net/tcl" diff --git a/var/spack/repos/builtin/packages/yaml-cpp/package.py b/var/spack/repos/builtin/packages/yaml-cpp/package.py new file mode 100644 index 0000000000..0ffedb30cd --- /dev/null +++ b/var/spack/repos/builtin/packages/yaml-cpp/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 YamlCpp(Package): + """A YAML parser and emitter in C++""" + + homepage = "https://github.com/jbeder/yaml-cpp" + url = \ + "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.5.3.tar.gz" + + version('0.5.3', '4e47733d98266e46a1a73ae0a72954eb') + + variant('fpic', default=False, + description='Build with position independent code') + + depends_on('cmake', type='build') + + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + args = std_cmake_args + if '+fpic' in spec: + args += ['-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true'] + cmake('..', *args) + make() + make("install") |