Skip to content
Snippets Groups Projects
Commit 7e4c6afd authored by Todd Gamblin's avatar Todd Gamblin Committed by GitHub
Browse files

Merge pull request #1412 from adamjstewart/features/cmake

Overhaul of CMake package and compression libraries
parents abd1546d eace0687
No related branches found
No related tags found
No related merge requests found
Showing
with 264 additions and 40 deletions
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)
...@@ -42,19 +42,28 @@ class Cmake(Package): ...@@ -42,19 +42,28 @@ class Cmake(Package):
version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f') version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f')
version('2.8.10.2', '097278785da7182ec0aea8769d06860c') version('2.8.10.2', '097278785da7182ec0aea8769d06860c')
variant('ncurses', default=True, variant('ownlibs', default=False, description='Use CMake-provided third-party libraries')
description='Enables the build of the ncurses gui') variant('qt', default=False, description='Enables the build of cmake-gui')
variant('openssl', default=True, variant('doc', default=False, description='Enables the generation of html and man page documentation')
description="Enables CMake's OpenSSL features") variant('openssl', default=True, description="Enables CMake's OpenSSL features")
variant('qt', default=False, description='Enables the build of cmake-gui') variant('ncurses', default=True, description='Enables the build of the ncurses gui')
variant('doc', default=False,
description='Enables the generation of html and man page docs') depends_on('curl', when='~ownlibs')
depends_on('expat', when='~ownlibs')
depends_on('ncurses', when='+ncurses') # depends_on('jsoncpp', when='~ownlibs') # circular dependency
depends_on('openssl', when='+openssl') depends_on('zlib', when='~ownlibs')
depends_on('qt', when='+qt') 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('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')
# 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): def url_for_version(self, version):
"""Handle CMake's version-based custom URLs.""" """Handle CMake's version-based custom URLs."""
...@@ -77,12 +86,25 @@ def install(self, spec, prefix): ...@@ -77,12 +86,25 @@ def install(self, spec, prefix):
# Consistency check # Consistency check
self.validate(spec) self.validate(spec)
# configure, build, install: options = [
options = ['--prefix=%s' % prefix] '--prefix={0}'.format(prefix),
options.append('--parallel=%s' % str(make_jobs)) '--parallel={0}'.format(make_jobs),
# 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: if '+qt' in spec:
options.append('--qt-gui') options.append('--qt-gui')
else:
options.append('--no-qt-gui')
if '+doc' in spec: if '+doc' in spec:
options.append('--sphinx-html') options.append('--sphinx-html')
...@@ -92,6 +114,10 @@ def install(self, spec, prefix): ...@@ -92,6 +114,10 @@ def install(self, spec, prefix):
options.append('--') options.append('--')
options.append('-DCMAKE_USE_OPENSSL=ON') options.append('-DCMAKE_USE_OPENSSL=ON')
configure(*options) bootstrap = Executable('./bootstrap')
bootstrap(*options)
make() make()
if self.run_tests:
make('test') # some tests fail, takes forever
make('install') make('install')
...@@ -28,15 +28,16 @@ ...@@ -28,15 +28,16 @@
class Expat(Package): class Expat(Package):
"""<eXpat/> is an XML parser library written in C""" """<eXpat/> is an XML parser library written in C"""
homepage = "http://expat.sourceforge.net/" 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') version('2.2.0', '2f47841c829facb346eb6e3fab5212e2',
url="http://downloads.sourceforge.net/project/expat/expat/2.2.0/expat-2.2.0.tar.bz2")
depends_on('cmake', type='build') 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): def install(self, spec, prefix):
configure('--prefix={0}'.format(prefix))
with working_dir('spack-build', create=True): make()
cmake('..', *std_cmake_args) if self.run_tests:
make() make('check')
make('install') make('install')
##############################################################################
# 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')
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()
if self.run_tests:
make('test') # Python needed to run tests
make('install')
...@@ -28,14 +28,30 @@ ...@@ -28,14 +28,30 @@
class Libarchive(Package): class Libarchive(Package):
"""libarchive: C library and command-line tools for reading and """libarchive: C library and command-line tools for reading and
writing tar, cpio, zip, ISO, and other archive formats.""" writing tar, cpio, zip, ISO, and other archive formats."""
homepage = "http://www.libarchive.org" homepage = "http://www.libarchive.org"
url = "http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz" 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.2', 'efad5a503f66329bb9d2f4308b5de98a')
version('3.1.1', '1f3d883daf7161a0065e42a15bbf168f') version('3.1.1', '1f3d883daf7161a0065e42a15bbf168f')
version('3.1.0', '095a287bb1fd687ab50c85955692bf3a') version('3.1.0', '095a287bb1fd687ab50c85955692bf3a')
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 install(self, spec, prefix):
configure("--prefix=%s" % prefix) configure('--prefix={0}'.format(prefix))
make() make()
make("install") if self.run_tests:
make('check') # cannot build test suite with Intel compilers
make('install')
...@@ -32,6 +32,7 @@ class Libxml2(Package): ...@@ -32,6 +32,7 @@ class Libxml2(Package):
homepage = "http://xmlsoft.org" homepage = "http://xmlsoft.org"
url = "http://xmlsoft.org/sources/libxml2-2.9.2.tar.gz" url = "http://xmlsoft.org/sources/libxml2-2.9.2.tar.gz"
version('2.9.4', 'ae249165c173b1ff386ee8ad676815f5')
version('2.9.2', '9e6a9aca9d155737868b3dc5fd82f788') version('2.9.2', '9e6a9aca9d155737868b3dc5fd82f788')
variant('python', default=False, description='Enable Python support') variant('python', default=False, description='Enable Python support')
...@@ -44,13 +45,16 @@ class Libxml2(Package): ...@@ -44,13 +45,16 @@ class Libxml2(Package):
def install(self, spec, prefix): def install(self, spec, prefix):
if '+python' in spec: if '+python' in spec:
python_args = ["--with-python=%s" % spec['python'].prefix, python_args = [
"--with-python-install-dir=%s" % site_packages_dir] '--with-python={0}'.format(spec['python'].prefix),
'--with-python-install-dir={0}'.format(site_packages_dir)
]
else: else:
python_args = ["--without-python"] python_args = ['--without-python']
configure("--prefix=%s" % prefix, configure('--prefix={0}'.format(prefix), *python_args)
*python_args)
make() make()
make("install") if self.run_tests:
make('check')
make('install')
##############################################################################
# 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()
if self.run_tests:
make('test') # requires valgrind to be installed
make('install', 'PREFIX={0}'.format(prefix))
##############################################################################
# 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()
if self.run_tests:
make('check') # one of the tests fails for me
make('install')
...@@ -45,5 +45,7 @@ def install(self, spec, prefix): ...@@ -45,5 +45,7 @@ def install(self, spec, prefix):
] ]
configure(*configure_args) configure(*configure_args)
make() make()
make('check') if self.run_tests:
make('check')
make('test') # more exhaustive test
make('install') make('install')
...@@ -29,14 +29,18 @@ class Nettle(Package): ...@@ -29,14 +29,18 @@ class Nettle(Package):
"""The Nettle package contains the low-level cryptographic library """The Nettle package contains the low-level cryptographic library
that is designed to fit easily in many contexts.""" 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" url = "http://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz"
version('3.2', 'afb15b4764ebf1b4e6d06c62bd4d29e4')
version('2.7', '2caa1bd667c35db71becb93c5d89737f') version('2.7', '2caa1bd667c35db71becb93c5d89737f')
depends_on('gmp') depends_on('gmp')
def install(self, spec, prefix): def install(self, spec, prefix):
configure("--prefix=%s" % prefix) configure('--prefix={0}'.format(prefix))
make() make()
make("install") if self.run_tests:
make('check')
make('install')
...@@ -37,6 +37,9 @@ class Xz(Package): ...@@ -37,6 +37,9 @@ class Xz(Package):
version('5.2.2', 'f90c9a0c8b259aee2234c4e0d7fd70af') version('5.2.2', 'f90c9a0c8b259aee2234c4e0d7fd70af')
def install(self, spec, prefix): def install(self, spec, prefix):
configure("--prefix=%s" % prefix) configure('--prefix={0}'.format(prefix))
make() make()
make("install") if self.run_tests:
make('check')
make('install')
...@@ -35,7 +35,9 @@ class Zlib(Package): ...@@ -35,7 +35,9 @@ class Zlib(Package):
version('1.2.8', '44d667c142d7cda120332623eab69f40') version('1.2.8', '44d667c142d7cda120332623eab69f40')
def install(self, spec, prefix): def install(self, spec, prefix):
configure("--prefix=%s" % prefix) configure('--prefix={0}'.format(prefix))
make() make()
make("install") if self.run_tests:
make('test')
make('install')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment