From 58d770406062de9f72bc470c30f5b0ac4b841438 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 29 Jul 2016 16:49:46 -0500 Subject: [PATCH 1/7] Overhaul of compression libraries --- .../repos/builtin/packages/expat/package.py | 16 +++--- .../repos/builtin/packages/jsoncpp/package.py | 50 +++++++++++++++++++ .../repos/builtin/packages/libxml2/package.py | 2 + .../repos/builtin/packages/lz4/package.py | 44 ++++++++++++++++ .../repos/builtin/packages/lzo/package.py | 1 + .../repos/builtin/packages/nettle/package.py | 4 +- .../repos/builtin/packages/xz/package.py | 1 + .../repos/builtin/packages/zlib/package.py | 1 + 8 files changed, 110 insertions(+), 9 deletions(-) create mode 100644 var/spack/repos/builtin/packages/jsoncpp/package.py create mode 100644 var/spack/repos/builtin/packages/lz4/package.py diff --git a/var/spack/repos/builtin/packages/expat/package.py b/var/spack/repos/builtin/packages/expat/package.py index 7d0fdae1d44..7e56bddd159 100644 --- a/var/spack/repos/builtin/packages/expat/package.py +++ b/var/spack/repos/builtin/packages/expat/package.py @@ -28,15 +28,15 @@ class Expat(Package): """ is an XML parser library written in C""" homepage = "http://expat.sourceforge.net/" - url = "http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz" - version('2.1.0', 'dd7dab7a5fea97d2a6a43f511449b7cd') - - depends_on('cmake', type='build') + version('2.2.0', '2f47841c829facb346eb6e3fab5212e2', + url="http://downloads.sourceforge.net/project/expat/expat/2.2.0/expat-2.2.0.tar.bz2") + version('2.1.0', 'dd7dab7a5fea97d2a6a43f511449b7cd', + url="http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz") def install(self, spec, prefix): + configure('--prefix={0}'.format(prefix)) - with working_dir('spack-build', create=True): - cmake('..', *std_cmake_args) - make() - make('install') + make() + make('check') + make('install') diff --git a/var/spack/repos/builtin/packages/jsoncpp/package.py b/var/spack/repos/builtin/packages/jsoncpp/package.py new file mode 100644 index 00000000000..6eb4e93b5cb --- /dev/null +++ b/var/spack/repos/builtin/packages/jsoncpp/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 Jsoncpp(Package): + """JsonCpp is a C++ library that allows manipulating JSON values, + including serialization and deserialization to and from strings. + It can also preserve existing comment in unserialization/serialization + steps, making it a convenient format to store user input files.""" + + homepage = "https://github.com/open-source-parsers/jsoncpp" + url = "https://github.com/open-source-parsers/jsoncpp/archive/1.7.3.tar.gz" + + version('1.7.3', 'aff6bfb5b81d9a28785429faa45839c5') + + # Avoid circular dependency + #depends_on('cmake~jsoncpp', type='build') + depends_on('cmake', type='build') + # depends_on('python', type='test') + + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + cmake('..', '-DBUILD_SHARED_LIBS=ON', *std_cmake_args) + + make() + # make('test') # Python needed to run tests + make('install') diff --git a/var/spack/repos/builtin/packages/libxml2/package.py b/var/spack/repos/builtin/packages/libxml2/package.py index 0f4810fa8aa..214a0278052 100644 --- a/var/spack/repos/builtin/packages/libxml2/package.py +++ b/var/spack/repos/builtin/packages/libxml2/package.py @@ -32,6 +32,7 @@ class Libxml2(Package): homepage = "http://xmlsoft.org" url = "http://xmlsoft.org/sources/libxml2-2.9.2.tar.gz" + version('2.9.4', 'ae249165c173b1ff386ee8ad676815f5') version('2.9.2', '9e6a9aca9d155737868b3dc5fd82f788') variant('python', default=False, description='Enable Python support') @@ -53,4 +54,5 @@ def install(self, spec, prefix): *python_args) make() + make("check") make("install") diff --git a/var/spack/repos/builtin/packages/lz4/package.py b/var/spack/repos/builtin/packages/lz4/package.py new file mode 100644 index 00000000000..89356a607ca --- /dev/null +++ b/var/spack/repos/builtin/packages/lz4/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 Lz4(Package): + """LZ4 is lossless compression algorithm, providing compression speed + at 400 MB/s per core, scalable with multi-cores CPU. It also features + an extremely fast decoder, with speed in multiple GB/s per core, + typically reaching RAM speed limits on multi-core systems.""" + + homepage = "http://cyan4973.github.io/lz4/" + url = "https://github.com/Cyan4973/lz4/archive/r131.tar.gz" + + version('131', '42b09fab42331da9d3fb33bd5c560de9') + + # depends_on('valgrind', type='test') + + def install(self, spec, prefix): + make() + # make('test') # requires valgrind to be installed + make('install', 'PREFIX={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/lzo/package.py b/var/spack/repos/builtin/packages/lzo/package.py index 0961bbb58c1..7702186cbda 100644 --- a/var/spack/repos/builtin/packages/lzo/package.py +++ b/var/spack/repos/builtin/packages/lzo/package.py @@ -46,4 +46,5 @@ def install(self, spec, prefix): configure(*configure_args) make() make('check') + make('test') # more exhaustive test make('install') diff --git a/var/spack/repos/builtin/packages/nettle/package.py b/var/spack/repos/builtin/packages/nettle/package.py index 02e9ef5f1e1..52644fa8a4f 100644 --- a/var/spack/repos/builtin/packages/nettle/package.py +++ b/var/spack/repos/builtin/packages/nettle/package.py @@ -29,9 +29,10 @@ class Nettle(Package): """The Nettle package contains the low-level cryptographic library that is designed to fit easily in many contexts.""" - homepage = "http://www.example.com" + homepage = "https://www.lysator.liu.se/~nisse/nettle/" url = "http://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz" + version('3.2', 'afb15b4764ebf1b4e6d06c62bd4d29e4') version('2.7', '2caa1bd667c35db71becb93c5d89737f') depends_on('gmp') @@ -39,4 +40,5 @@ class Nettle(Package): def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() + make("check") make("install") diff --git a/var/spack/repos/builtin/packages/xz/package.py b/var/spack/repos/builtin/packages/xz/package.py index a8ab959a629..5b46e838ed7 100644 --- a/var/spack/repos/builtin/packages/xz/package.py +++ b/var/spack/repos/builtin/packages/xz/package.py @@ -39,4 +39,5 @@ class Xz(Package): def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() + make("check") make("install") diff --git a/var/spack/repos/builtin/packages/zlib/package.py b/var/spack/repos/builtin/packages/zlib/package.py index 6d799fb05ab..7145b78d634 100644 --- a/var/spack/repos/builtin/packages/zlib/package.py +++ b/var/spack/repos/builtin/packages/zlib/package.py @@ -38,4 +38,5 @@ def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() + make("test") make("install") From ee5e20dae3034032d166bd5361811530397a503e Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 1 Aug 2016 11:18:48 -0500 Subject: [PATCH 2/7] Add dependencies to libarchive and cmake --- .../repos/builtin/packages/cmake/package.py | 83 +++++++++++++++---- .../repos/builtin/packages/jsoncpp/package.py | 2 - .../builtin/packages/libarchive/package.py | 43 +++++++++- .../repos/builtin/packages/lzma/package.py | 48 +++++++++++ 4 files changed, 159 insertions(+), 17 deletions(-) create mode 100644 var/spack/repos/builtin/packages/lzma/package.py diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index 90a7c20d19a..7789d67f884 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -31,6 +31,7 @@ class Cmake(Package): homepage = 'https://www.cmake.org' url = 'https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz' + version('3.6.1', 'd6dd661380adacdb12f41b926ec99545') version('3.6.0', 'aa40fbecf49d99c083415c2411d12db9') version('3.5.2', '701386a1b5ec95f8d1075ecf96383e02') version('3.5.1', 'ca051f4a66375c89d1a524e726da0296') @@ -41,19 +42,30 @@ class Cmake(Package): version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f') version('2.8.10.2', '097278785da7182ec0aea8769d06860c') - variant('ncurses', default=True, - description='Enables the build of the ncurses gui') - variant('openssl', default=True, - description="Enables CMake's OpenSSL features") - variant('qt', default=False, description='Enables the build of cmake-gui') - variant('doc', default=False, - description='Enables the generation of html and man page docs') + variant('curl', default=True, description='Build external curl library') + variant('expat', default=True, description='Build external expat library') + # variant('jsoncpp', default=True, description='Build external jsoncpp library') + variant('zlib', default=True, description='Build external zlib library') + variant('bzip2', default=True, description='Build external bzip2 library') + variant('xz', default=True, description='Build external lzma library') + variant('archive', default=True, description='Build external archive library') + variant('qt', default=False, description='Enables the build of cmake-gui') + variant('doc', default=False, description='Enables the generation of html and man page documentation') + variant('openssl', default=True, description="Enables CMake's OpenSSL features") + variant('ncurses', default=True, description='Enables the build of the ncurses gui') - depends_on('ncurses', when='+ncurses') - depends_on('openssl', when='+openssl') - depends_on('qt', when='+qt') + depends_on('curl', when='+curl') + depends_on('expat', when='+expat') + # depends_on('jsoncpp', when='+jsoncpp') # circular dependency + depends_on('zlib', when='+zlib') + depends_on('bzip2', when='+bzip2') + depends_on('xz', when='+xz') + depends_on('libarchive', when='+archive') + depends_on('qt', when='+qt') depends_on('python@2.7.11:', when='+doc', type='build') - depends_on('py-sphinx', when='+doc', type='build') + depends_on('py-sphinx', when='+doc', type='build') + depends_on('openssl', when='+openssl') + depends_on('ncurses', when='+ncurses') def url_for_version(self, version): """Handle CMake's version-based custom URLs.""" @@ -77,11 +89,51 @@ def install(self, spec, prefix): self.validate(spec) # configure, build, install: - options = ['--prefix=%s' % prefix] - options.append('--parallel=%s' % str(make_jobs)) + options = [ + '--prefix={0}'.format(prefix), + '--parallel={0}'.format(make_jobs) + ] + + if '+curl' in spec: + options.append('--system-curl') + else: + options.append('--no-system-curl') + + if '+expat' in spec: + options.append('--system-expat') + else: + options.append('--no-system-expat') + + # if '+jsoncpp' in spec: + # options.append('--system-jsoncpp') + # else: + # options.append('--no-system-jsoncpp') + options.append('--no-system-jsoncpp') + + if '+zlib' in spec: + options.append('--system-zlib') + else: + options.append('--no-system-zlib') + + if '+bzip2' in spec: + options.append('--system-bzip2') + else: + options.append('--no-system-bzip2') + + if '+xz' in spec: + options.append('--system-liblzma') + else: + options.append('--no-system-liblzma') + + if '+archive' in spec: + options.append('--system-libarchive') + else: + options.append('--no-system-libarchive') if '+qt' in spec: options.append('--qt-gui') + else: + options.append('--no-qt-gui') if '+doc' in spec: options.append('--sphinx-html') @@ -91,6 +143,9 @@ def install(self, spec, prefix): options.append('--') options.append('-DCMAKE_USE_OPENSSL=ON') - configure(*options) + bootstrap = Executable('./bootstrap') + bootstrap(*options) + make() + make('test') make('install') diff --git a/var/spack/repos/builtin/packages/jsoncpp/package.py b/var/spack/repos/builtin/packages/jsoncpp/package.py index 6eb4e93b5cb..77f18cb6ab4 100644 --- a/var/spack/repos/builtin/packages/jsoncpp/package.py +++ b/var/spack/repos/builtin/packages/jsoncpp/package.py @@ -36,8 +36,6 @@ class Jsoncpp(Package): version('1.7.3', 'aff6bfb5b81d9a28785429faa45839c5') - # Avoid circular dependency - #depends_on('cmake~jsoncpp', type='build') depends_on('cmake', type='build') # depends_on('python', type='test') diff --git a/var/spack/repos/builtin/packages/libarchive/package.py b/var/spack/repos/builtin/packages/libarchive/package.py index 0cf3932957e..db8f4e00653 100644 --- a/var/spack/repos/builtin/packages/libarchive/package.py +++ b/var/spack/repos/builtin/packages/libarchive/package.py @@ -31,11 +31,52 @@ class Libarchive(Package): homepage = "http://www.libarchive.org" url = "http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz" + version('3.2.1', 'afa257047d1941a565216edbf0171e72') version('3.1.2', 'efad5a503f66329bb9d2f4308b5de98a') version('3.1.1', '1f3d883daf7161a0065e42a15bbf168f') version('3.1.0', '095a287bb1fd687ab50c85955692bf3a') + variant('zlib', default=True, description='Build support for gzip through zlib') + variant('bzip2', default=True, description='Build support for bzip2 through bz2lib') + variant('lzma', default=True, description='Build support for lzma through lzmadec') + variant('lz4', default=True, description='Build support for lz4 through liblz4') + variant('xz', default=True, description='Build support for xz through lzma') + variant('lzo', default=True, description='Build support for lzop through liblzo2') + variant('nettle', default=True, description='Build with crypto support from Nettle') + variant('openssl', default=True, description='Build support for mtree and xar hashes through openssl') + variant('libxml2', default=True, description='Build support for xar through libxml2') + variant('expat', default=True, description='Build support for xar through expat') + + depends_on('zlib', when='+zlib') + depends_on('bzip2', when='+bzip2') + depends_on('lzma', when='+lzma') + depends_on('lz4', when='+lz4') + depends_on('xz', when='+xz') + depends_on('lzo', when='+lzo') + depends_on('nettle', when='+nettle') + depends_on('openssl', when='+openssl') + depends_on('libxml2', when='+libxml2') + depends_on('expat', when='+expat') + def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + def variant_to_bool(variant): + return 'with' if variant in spec else 'without' + + config_args = [ + '--prefix={0}'.format(prefix), + '--{0}-zlib'.format(variant_to_bool('+zlib')), + '--{0}-bz2lib'.format(variant_to_bool('+bzip2')), + '--{0}-lzmadec'.format(variant_to_bool('+lzma')), + '--{0}-lz4'.format(variant_to_bool('+lz4')), + '--{0}-lzma'.format(variant_to_bool('+xz')), + '--{0}-lzo2'.format(variant_to_bool('+lzo')), + '--{0}-nettle'.format(variant_to_bool('+nettle')), + '--{0}-openssl'.format(variant_to_bool('+openssl')), + '--{0}-xml2'.format(variant_to_bool('+libxml2')), + '--{0}-expat'.format(variant_to_bool('+expat')) + ] + + configure(*config_args) make() + make("check") make("install") diff --git a/var/spack/repos/builtin/packages/lzma/package.py b/var/spack/repos/builtin/packages/lzma/package.py new file mode 100644 index 00000000000..f363569930c --- /dev/null +++ b/var/spack/repos/builtin/packages/lzma/package.py @@ -0,0 +1,48 @@ +############################################################################## +# 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 Lzma(Package): + """LZMA Utils are legacy data compression software with high compression + ratio. LZMA Utils are no longer developed, although critical bugs may be + fixed as long as fixing them doesn't require huge changes to the code. + + Users of LZMA Utils should move to XZ Utils. XZ Utils support the legacy + .lzma format used by LZMA Utils, and can also emulate the command line + tools of LZMA Utils. This should make transition from LZMA Utils to XZ + Utils relatively easy.""" + + homepage = "http://tukaani.org/lzma/" + url = "http://tukaani.org/lzma/lzma-4.32.7.tar.gz" + + version('4.32.7', '2a748b77a2f8c3cbc322dbd0b4c9d06a') + + def install(self, spec, prefix): + configure('--prefix={0}'.format(prefix)) + + make() + make('check') + make('install') From 534e1cbf1b1f11ce37e216e2ebf48d623846120b Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 1 Aug 2016 12:23:39 -0500 Subject: [PATCH 3/7] Some tests don't pass with Intel compilers --- .../repos/builtin/packages/cmake/package.py | 50 +++++-------------- .../builtin/packages/libarchive/package.py | 2 +- 2 files changed, 13 insertions(+), 39 deletions(-) diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index 7789d67f884..da94de8dd75 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -88,48 +88,22 @@ def install(self, spec, prefix): # Consistency check self.validate(spec) + def variant_to_bool(variant): + return 'system' if variant in spec else 'no-system' + # configure, build, install: options = [ '--prefix={0}'.format(prefix), - '--parallel={0}'.format(make_jobs) + '--parallel={0}'.format(make_jobs), + '--{0}-curl'.format(variant_to_bool('+curl')), + '--{0}-expat'.format(variant_to_bool('+expat')), + '--{0}-jsoncpp'.format(variant_to_bool('+jsoncpp')), + '--{0}-zlib'.format(variant_to_bool('+zlib')), + '--{0}-bzip2'.format(variant_to_bool('+bzip2')), + '--{0}-liblzma'.format(variant_to_bool('+xz')), + '--{0}-libarchive'.format(variant_to_bool('+archive')) ] - if '+curl' in spec: - options.append('--system-curl') - else: - options.append('--no-system-curl') - - if '+expat' in spec: - options.append('--system-expat') - else: - options.append('--no-system-expat') - - # if '+jsoncpp' in spec: - # options.append('--system-jsoncpp') - # else: - # options.append('--no-system-jsoncpp') - options.append('--no-system-jsoncpp') - - if '+zlib' in spec: - options.append('--system-zlib') - else: - options.append('--no-system-zlib') - - if '+bzip2' in spec: - options.append('--system-bzip2') - else: - options.append('--no-system-bzip2') - - if '+xz' in spec: - options.append('--system-liblzma') - else: - options.append('--no-system-liblzma') - - if '+archive' in spec: - options.append('--system-libarchive') - else: - options.append('--no-system-libarchive') - if '+qt' in spec: options.append('--qt-gui') else: @@ -147,5 +121,5 @@ def install(self, spec, prefix): bootstrap(*options) make() - make('test') + # make('test') # some tests fail, takes forever make('install') diff --git a/var/spack/repos/builtin/packages/libarchive/package.py b/var/spack/repos/builtin/packages/libarchive/package.py index db8f4e00653..2397075d42b 100644 --- a/var/spack/repos/builtin/packages/libarchive/package.py +++ b/var/spack/repos/builtin/packages/libarchive/package.py @@ -78,5 +78,5 @@ def variant_to_bool(variant): configure(*config_args) make() - make("check") + # make("check") # cannot build test suite with Intel compilers make("install") From 5fc20487e488c2306b36d83e2188554aebae4b31 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 1 Aug 2016 12:37:36 -0500 Subject: [PATCH 4/7] Flake8 and formatting changes --- var/spack/repos/builtin/packages/cmake/package.py | 4 ++-- .../repos/builtin/packages/libarchive/package.py | 5 +++-- .../repos/builtin/packages/libxml2/package.py | 15 ++++++++------- .../repos/builtin/packages/nettle/package.py | 7 ++++--- var/spack/repos/builtin/packages/xz/package.py | 7 ++++--- var/spack/repos/builtin/packages/zlib/package.py | 6 +++--- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index da94de8dd75..d8b4eefff44 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -44,7 +44,7 @@ class Cmake(Package): variant('curl', default=True, description='Build external curl library') variant('expat', default=True, description='Build external expat library') - # variant('jsoncpp', default=True, description='Build external jsoncpp library') + # variant('jsoncpp', default=True, description='Build external jsoncpp library') # NOQA: ignore=E501 variant('zlib', default=True, description='Build external zlib library') variant('bzip2', default=True, description='Build external bzip2 library') variant('xz', default=True, description='Build external lzma library') @@ -88,7 +88,7 @@ def install(self, spec, prefix): # Consistency check self.validate(spec) - def variant_to_bool(variant): + def variant_to_bool(variant): return 'system' if variant in spec else 'no-system' # configure, build, install: diff --git a/var/spack/repos/builtin/packages/libarchive/package.py b/var/spack/repos/builtin/packages/libarchive/package.py index 2397075d42b..387af47b26c 100644 --- a/var/spack/repos/builtin/packages/libarchive/package.py +++ b/var/spack/repos/builtin/packages/libarchive/package.py @@ -77,6 +77,7 @@ def variant_to_bool(variant): ] configure(*config_args) + make() - # make("check") # cannot build test suite with Intel compilers - make("install") + # make('check') # cannot build test suite with Intel compilers + make('install') diff --git a/var/spack/repos/builtin/packages/libxml2/package.py b/var/spack/repos/builtin/packages/libxml2/package.py index 214a0278052..6b25097bcd6 100644 --- a/var/spack/repos/builtin/packages/libxml2/package.py +++ b/var/spack/repos/builtin/packages/libxml2/package.py @@ -45,14 +45,15 @@ class Libxml2(Package): def install(self, spec, prefix): if '+python' in spec: - python_args = ["--with-python=%s" % spec['python'].prefix, - "--with-python-install-dir=%s" % site_packages_dir] + python_args = [ + '--with-python={0}'.format(spec['python'].prefix), + '--with-python-install-dir={0}'.format(site_packages_dir) + ] else: - python_args = ["--without-python"] + python_args = ['--without-python'] - configure("--prefix=%s" % prefix, - *python_args) + configure('--prefix={0}'.format(prefix), *python_args) make() - make("check") - make("install") + make('check') + make('install') diff --git a/var/spack/repos/builtin/packages/nettle/package.py b/var/spack/repos/builtin/packages/nettle/package.py index 52644fa8a4f..bf494236051 100644 --- a/var/spack/repos/builtin/packages/nettle/package.py +++ b/var/spack/repos/builtin/packages/nettle/package.py @@ -38,7 +38,8 @@ class Nettle(Package): depends_on('gmp') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure('--prefix={0}'.format(prefix)) + make() - make("check") - make("install") + make('check') + make('install') diff --git a/var/spack/repos/builtin/packages/xz/package.py b/var/spack/repos/builtin/packages/xz/package.py index 5b46e838ed7..815d8985041 100644 --- a/var/spack/repos/builtin/packages/xz/package.py +++ b/var/spack/repos/builtin/packages/xz/package.py @@ -37,7 +37,8 @@ class Xz(Package): version('5.2.2', 'f90c9a0c8b259aee2234c4e0d7fd70af') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure('--prefix={0}'.format(prefix)) + make() - make("check") - make("install") + make('check') + make('install') diff --git a/var/spack/repos/builtin/packages/zlib/package.py b/var/spack/repos/builtin/packages/zlib/package.py index 7145b78d634..8834a058043 100644 --- a/var/spack/repos/builtin/packages/zlib/package.py +++ b/var/spack/repos/builtin/packages/zlib/package.py @@ -35,8 +35,8 @@ class Zlib(Package): version('1.2.8', '44d667c142d7cda120332623eab69f40') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure('--prefix={0}'.format(prefix)) make() - make("test") - make("install") + make('test') + make('install') From b47357d73c66c3ae9f2a5fa6bcba011b14f1d162 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 4 Aug 2016 15:07:43 -0500 Subject: [PATCH 5/7] Add patch for Intel compilers --- .../packages/cmake/intel-c-gnu11.patch | 23 +++++++++++++++++++ .../repos/builtin/packages/cmake/package.py | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 var/spack/repos/builtin/packages/cmake/intel-c-gnu11.patch diff --git a/var/spack/repos/builtin/packages/cmake/intel-c-gnu11.patch b/var/spack/repos/builtin/packages/cmake/intel-c-gnu11.patch new file mode 100644 index 00000000000..afe6f871ec8 --- /dev/null +++ b/var/spack/repos/builtin/packages/cmake/intel-c-gnu11.patch @@ -0,0 +1,23 @@ +diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake +index eb9602a..edca154 100644 +--- a/Modules/Compiler/Intel-C.cmake ++++ b/Modules/Compiler/Intel-C.cmake +@@ -16,14 +16,14 @@ endif() + + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) + set(CMAKE_C11_STANDARD_COMPILE_OPTION "${_std}=c11") +- set(CMAKE_C11_EXTENSION_COMPILE_OPTION "${_std}=c11") ++ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "${_std}=gnu11") + endif() + +-if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) ++if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0) + set(CMAKE_C90_STANDARD_COMPILE_OPTION "${_std}=c89") +- set(CMAKE_C90_EXTENSION_COMPILE_OPTION "${_std}=c89") ++ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "${_std}=gnu89") + set(CMAKE_C99_STANDARD_COMPILE_OPTION "${_std}=c99") +- set(CMAKE_C99_EXTENSION_COMPILE_OPTION "${_std}=c99") ++ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "${_std}=gnu99") + endif() + + if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index d8b4eefff44..4e2c37993c4 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -67,6 +67,10 @@ class Cmake(Package): depends_on('openssl', when='+openssl') depends_on('ncurses', when='+ncurses') + # Cannot build with Intel, should be fixed in 3.6.2 + # https://gitlab.kitware.com/cmake/cmake/issues/16226 + patch('intel-c-gnu11.patch', when='@3.6.0:3.6.1') + def url_for_version(self, version): """Handle CMake's version-based custom URLs.""" return 'https://cmake.org/files/v%s/cmake-%s.tar.gz' % ( From 70bb1f1707b5f6ce8a0c79a2cf51a8f27b9dc67f Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 24 Aug 2016 14:39:05 -0500 Subject: [PATCH 6/7] Reduce number of variants, just use system or no-system libs --- .../repos/builtin/packages/cmake/package.py | 43 +++++++--------- .../builtin/packages/libarchive/package.py | 51 +++++-------------- 2 files changed, 30 insertions(+), 64 deletions(-) diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index 4e2c37993c4..19b9b45d176 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -42,25 +42,19 @@ class Cmake(Package): version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f') version('2.8.10.2', '097278785da7182ec0aea8769d06860c') - variant('curl', default=True, description='Build external curl library') - variant('expat', default=True, description='Build external expat library') - # variant('jsoncpp', default=True, description='Build external jsoncpp library') # NOQA: ignore=E501 - variant('zlib', default=True, description='Build external zlib library') - variant('bzip2', default=True, description='Build external bzip2 library') - variant('xz', default=True, description='Build external lzma library') - variant('archive', default=True, description='Build external archive library') + variant('ownlibs', default=False, description='Use CMake-provided third-party libraries') variant('qt', default=False, description='Enables the build of cmake-gui') variant('doc', default=False, description='Enables the generation of html and man page documentation') variant('openssl', default=True, description="Enables CMake's OpenSSL features") variant('ncurses', default=True, description='Enables the build of the ncurses gui') - depends_on('curl', when='+curl') - depends_on('expat', when='+expat') - # depends_on('jsoncpp', when='+jsoncpp') # circular dependency - depends_on('zlib', when='+zlib') - depends_on('bzip2', when='+bzip2') - depends_on('xz', when='+xz') - depends_on('libarchive', when='+archive') + depends_on('curl', when='~ownlibs') + depends_on('expat', when='~ownlibs') + # depends_on('jsoncpp', when='~ownlibs') # circular dependency + depends_on('zlib', when='~ownlibs') + depends_on('bzip2', when='~ownlibs') + depends_on('xz', when='~ownlibs') + depends_on('libarchive', when='~ownlibs') depends_on('qt', when='+qt') depends_on('python@2.7.11:', when='+doc', type='build') depends_on('py-sphinx', when='+doc', type='build') @@ -92,22 +86,21 @@ def install(self, spec, prefix): # Consistency check self.validate(spec) - def variant_to_bool(variant): - return 'system' if variant in spec else 'no-system' - - # configure, build, install: options = [ '--prefix={0}'.format(prefix), '--parallel={0}'.format(make_jobs), - '--{0}-curl'.format(variant_to_bool('+curl')), - '--{0}-expat'.format(variant_to_bool('+expat')), - '--{0}-jsoncpp'.format(variant_to_bool('+jsoncpp')), - '--{0}-zlib'.format(variant_to_bool('+zlib')), - '--{0}-bzip2'.format(variant_to_bool('+bzip2')), - '--{0}-liblzma'.format(variant_to_bool('+xz')), - '--{0}-libarchive'.format(variant_to_bool('+archive')) + # jsoncpp requires CMake to build + # use CMake-provided library to avoid circular dependency + '--no-system-jsoncpp' ] + if '+ownlibs' in spec: + # Build and link to the CMake-provided third-party libraries + options.append('--no-system-libs') + else: + # Build and link to the Spack-installed third-party libraries + options.append('--system-libs') + if '+qt' in spec: options.append('--qt-gui') else: diff --git a/var/spack/repos/builtin/packages/libarchive/package.py b/var/spack/repos/builtin/packages/libarchive/package.py index 387af47b26c..62785638752 100644 --- a/var/spack/repos/builtin/packages/libarchive/package.py +++ b/var/spack/repos/builtin/packages/libarchive/package.py @@ -28,6 +28,7 @@ class Libarchive(Package): """libarchive: C library and command-line tools for reading and writing tar, cpio, zip, ISO, and other archive formats.""" + homepage = "http://www.libarchive.org" url = "http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz" @@ -36,47 +37,19 @@ class Libarchive(Package): version('3.1.1', '1f3d883daf7161a0065e42a15bbf168f') version('3.1.0', '095a287bb1fd687ab50c85955692bf3a') - variant('zlib', default=True, description='Build support for gzip through zlib') - variant('bzip2', default=True, description='Build support for bzip2 through bz2lib') - variant('lzma', default=True, description='Build support for lzma through lzmadec') - variant('lz4', default=True, description='Build support for lz4 through liblz4') - variant('xz', default=True, description='Build support for xz through lzma') - variant('lzo', default=True, description='Build support for lzop through liblzo2') - variant('nettle', default=True, description='Build with crypto support from Nettle') - variant('openssl', default=True, description='Build support for mtree and xar hashes through openssl') - variant('libxml2', default=True, description='Build support for xar through libxml2') - variant('expat', default=True, description='Build support for xar through expat') - - depends_on('zlib', when='+zlib') - depends_on('bzip2', when='+bzip2') - depends_on('lzma', when='+lzma') - depends_on('lz4', when='+lz4') - depends_on('xz', when='+xz') - depends_on('lzo', when='+lzo') - depends_on('nettle', when='+nettle') - depends_on('openssl', when='+openssl') - depends_on('libxml2', when='+libxml2') - depends_on('expat', when='+expat') + depends_on('zlib') + depends_on('bzip2') + depends_on('lzma') + depends_on('lz4') + depends_on('xz') + depends_on('lzo') + depends_on('nettle') + depends_on('openssl') + depends_on('libxml2') + depends_on('expat') def install(self, spec, prefix): - def variant_to_bool(variant): - return 'with' if variant in spec else 'without' - - config_args = [ - '--prefix={0}'.format(prefix), - '--{0}-zlib'.format(variant_to_bool('+zlib')), - '--{0}-bz2lib'.format(variant_to_bool('+bzip2')), - '--{0}-lzmadec'.format(variant_to_bool('+lzma')), - '--{0}-lz4'.format(variant_to_bool('+lz4')), - '--{0}-lzma'.format(variant_to_bool('+xz')), - '--{0}-lzo2'.format(variant_to_bool('+lzo')), - '--{0}-nettle'.format(variant_to_bool('+nettle')), - '--{0}-openssl'.format(variant_to_bool('+openssl')), - '--{0}-xml2'.format(variant_to_bool('+libxml2')), - '--{0}-expat'.format(variant_to_bool('+expat')) - ] - - configure(*config_args) + configure('--prefix={0}'.format(prefix)) make() # make('check') # cannot build test suite with Intel compilers From eace068788956fbceb240f41949af54fa62db82c Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 24 Aug 2016 15:21:23 -0500 Subject: [PATCH 7/7] Use self.run_tests for make check --- var/spack/repos/builtin/packages/cmake/package.py | 3 ++- var/spack/repos/builtin/packages/expat/package.py | 3 ++- var/spack/repos/builtin/packages/jsoncpp/package.py | 3 ++- var/spack/repos/builtin/packages/libarchive/package.py | 3 ++- var/spack/repos/builtin/packages/libxml2/package.py | 3 ++- var/spack/repos/builtin/packages/lz4/package.py | 3 ++- var/spack/repos/builtin/packages/lzma/package.py | 3 ++- var/spack/repos/builtin/packages/lzo/package.py | 5 +++-- var/spack/repos/builtin/packages/nettle/package.py | 3 ++- var/spack/repos/builtin/packages/xz/package.py | 3 ++- var/spack/repos/builtin/packages/zlib/package.py | 3 ++- 11 files changed, 23 insertions(+), 12 deletions(-) diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index 19b9b45d176..0c16adcef70 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -118,5 +118,6 @@ def install(self, spec, prefix): bootstrap(*options) make() - # make('test') # some tests fail, takes forever + if self.run_tests: + make('test') # some tests fail, takes forever make('install') diff --git a/var/spack/repos/builtin/packages/expat/package.py b/var/spack/repos/builtin/packages/expat/package.py index 7e56bddd159..0262bf1e3f8 100644 --- a/var/spack/repos/builtin/packages/expat/package.py +++ b/var/spack/repos/builtin/packages/expat/package.py @@ -38,5 +38,6 @@ def install(self, spec, prefix): configure('--prefix={0}'.format(prefix)) make() - make('check') + if self.run_tests: + make('check') make('install') diff --git a/var/spack/repos/builtin/packages/jsoncpp/package.py b/var/spack/repos/builtin/packages/jsoncpp/package.py index 77f18cb6ab4..5169b338eed 100644 --- a/var/spack/repos/builtin/packages/jsoncpp/package.py +++ b/var/spack/repos/builtin/packages/jsoncpp/package.py @@ -44,5 +44,6 @@ def install(self, spec, prefix): cmake('..', '-DBUILD_SHARED_LIBS=ON', *std_cmake_args) make() - # make('test') # Python needed to run tests + if self.run_tests: + make('test') # Python needed to run tests make('install') diff --git a/var/spack/repos/builtin/packages/libarchive/package.py b/var/spack/repos/builtin/packages/libarchive/package.py index 62785638752..e439bf894ff 100644 --- a/var/spack/repos/builtin/packages/libarchive/package.py +++ b/var/spack/repos/builtin/packages/libarchive/package.py @@ -52,5 +52,6 @@ def install(self, spec, prefix): configure('--prefix={0}'.format(prefix)) make() - # make('check') # cannot build test suite with Intel compilers + if self.run_tests: + make('check') # cannot build test suite with Intel compilers make('install') diff --git a/var/spack/repos/builtin/packages/libxml2/package.py b/var/spack/repos/builtin/packages/libxml2/package.py index 6b25097bcd6..0b55fe4d305 100644 --- a/var/spack/repos/builtin/packages/libxml2/package.py +++ b/var/spack/repos/builtin/packages/libxml2/package.py @@ -55,5 +55,6 @@ def install(self, spec, prefix): configure('--prefix={0}'.format(prefix), *python_args) make() - make('check') + if self.run_tests: + make('check') make('install') diff --git a/var/spack/repos/builtin/packages/lz4/package.py b/var/spack/repos/builtin/packages/lz4/package.py index 89356a607ca..de7e566e709 100644 --- a/var/spack/repos/builtin/packages/lz4/package.py +++ b/var/spack/repos/builtin/packages/lz4/package.py @@ -40,5 +40,6 @@ class Lz4(Package): def install(self, spec, prefix): make() - # make('test') # requires valgrind to be installed + if self.run_tests: + make('test') # requires valgrind to be installed make('install', 'PREFIX={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/lzma/package.py b/var/spack/repos/builtin/packages/lzma/package.py index f363569930c..23d697ffe8c 100644 --- a/var/spack/repos/builtin/packages/lzma/package.py +++ b/var/spack/repos/builtin/packages/lzma/package.py @@ -44,5 +44,6 @@ def install(self, spec, prefix): configure('--prefix={0}'.format(prefix)) make() - make('check') + if self.run_tests: + make('check') # one of the tests fails for me make('install') diff --git a/var/spack/repos/builtin/packages/lzo/package.py b/var/spack/repos/builtin/packages/lzo/package.py index 7702186cbda..172e57d0cde 100644 --- a/var/spack/repos/builtin/packages/lzo/package.py +++ b/var/spack/repos/builtin/packages/lzo/package.py @@ -45,6 +45,7 @@ def install(self, spec, prefix): ] configure(*configure_args) make() - make('check') - make('test') # more exhaustive test + if self.run_tests: + make('check') + make('test') # more exhaustive test make('install') diff --git a/var/spack/repos/builtin/packages/nettle/package.py b/var/spack/repos/builtin/packages/nettle/package.py index bf494236051..b4c873a8a18 100644 --- a/var/spack/repos/builtin/packages/nettle/package.py +++ b/var/spack/repos/builtin/packages/nettle/package.py @@ -41,5 +41,6 @@ def install(self, spec, prefix): configure('--prefix={0}'.format(prefix)) make() - make('check') + if self.run_tests: + make('check') make('install') diff --git a/var/spack/repos/builtin/packages/xz/package.py b/var/spack/repos/builtin/packages/xz/package.py index 815d8985041..8b0609f50e1 100644 --- a/var/spack/repos/builtin/packages/xz/package.py +++ b/var/spack/repos/builtin/packages/xz/package.py @@ -40,5 +40,6 @@ def install(self, spec, prefix): configure('--prefix={0}'.format(prefix)) make() - make('check') + if self.run_tests: + make('check') make('install') diff --git a/var/spack/repos/builtin/packages/zlib/package.py b/var/spack/repos/builtin/packages/zlib/package.py index 8834a058043..6f4d8a5bb8e 100644 --- a/var/spack/repos/builtin/packages/zlib/package.py +++ b/var/spack/repos/builtin/packages/zlib/package.py @@ -38,5 +38,6 @@ def install(self, spec, prefix): configure('--prefix={0}'.format(prefix)) make() - make('test') + if self.run_tests: + make('test') make('install')