summaryrefslogtreecommitdiff
path: root/var/spack/repos/tutorial/packages
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2022-07-30 15:19:18 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2022-07-31 13:29:20 -0700
commitf52f6e99dbf1131886a80112b8c79dfc414afb7c (patch)
tree05cb7d64b2395922f2f24683da49f472075be12c /var/spack/repos/tutorial/packages
parent549ba1ed32372c67fc57271cde3797d58b7dec6e (diff)
downloadspack-f52f6e99dbf1131886a80112b8c79dfc414afb7c.tar.gz
spack-f52f6e99dbf1131886a80112b8c79dfc414afb7c.tar.bz2
spack-f52f6e99dbf1131886a80112b8c79dfc414afb7c.tar.xz
spack-f52f6e99dbf1131886a80112b8c79dfc414afb7c.zip
black: reformat entire repository with black
Diffstat (limited to 'var/spack/repos/tutorial/packages')
-rw-r--r--var/spack/repos/tutorial/packages/armadillo/package.py40
-rw-r--r--var/spack/repos/tutorial/packages/elpa/package.py57
-rw-r--r--var/spack/repos/tutorial/packages/hdf5/package.py504
-rw-r--r--var/spack/repos/tutorial/packages/mpich/package.py146
-rw-r--r--var/spack/repos/tutorial/packages/netlib-lapack/package.py179
5 files changed, 483 insertions, 443 deletions
diff --git a/var/spack/repos/tutorial/packages/armadillo/package.py b/var/spack/repos/tutorial/packages/armadillo/package.py
index 7913ce354b..781271fd60 100644
--- a/var/spack/repos/tutorial/packages/armadillo/package.py
+++ b/var/spack/repos/tutorial/packages/armadillo/package.py
@@ -15,23 +15,23 @@ class Armadillo(CMakePackage):
homepage = "http://arma.sourceforge.net/"
url = "http://sourceforge.net/projects/arma/files/armadillo-7.200.1.tar.xz"
- version('8.100.1', 'd9762d6f097e0451d0cfadfbda295e7c')
- version('7.950.1', 'c06eb38b12cae49cab0ce05f96147147')
- version('7.900.1', '5ef71763bd429a3d481499878351f3be')
- version('7.500.0', '7d316fdf3c3c7ea92b64704180ae315d')
- version('7.200.2', 'b21585372d67a8876117fd515d8cf0a2')
- version('7.200.1', 'ed86d6df0058979e107502e1fe3e469e')
+ version("8.100.1", "d9762d6f097e0451d0cfadfbda295e7c")
+ version("7.950.1", "c06eb38b12cae49cab0ce05f96147147")
+ version("7.900.1", "5ef71763bd429a3d481499878351f3be")
+ version("7.500.0", "7d316fdf3c3c7ea92b64704180ae315d")
+ version("7.200.2", "b21585372d67a8876117fd515d8cf0a2")
+ version("7.200.1", "ed86d6df0058979e107502e1fe3e469e")
- variant('hdf5', default=False, description='Include HDF5 support')
+ variant("hdf5", default=False, description="Include HDF5 support")
- depends_on('cmake@2.8.12:', type='build')
- depends_on('arpack-ng') # old arpack causes undefined symbols
- depends_on('blas')
- depends_on('lapack')
- depends_on('superlu@5.2:')
- depends_on('hdf5', when='+hdf5')
+ depends_on("cmake@2.8.12:", type="build")
+ depends_on("arpack-ng") # old arpack causes undefined symbols
+ depends_on("blas")
+ depends_on("lapack")
+ depends_on("superlu@5.2:")
+ depends_on("hdf5", when="+hdf5")
- patch('undef_linux.patch', when='platform=linux')
+ patch("undef_linux.patch", when="platform=linux")
def cmake_args(self):
spec = self.spec
@@ -49,14 +49,14 @@ class Armadillo(CMakePackage):
return [
# ARPACK support
- '-DARPACK_LIBRARY={0}'.format('FIXME: arpack-ng'),
+ "-DARPACK_LIBRARY={0}".format("FIXME: arpack-ng"),
# BLAS support
- '-DBLAS_LIBRARY={0}'.format('FIXME: blas'),
+ "-DBLAS_LIBRARY={0}".format("FIXME: blas"),
# LAPACK support
- '-DLAPACK_LIBRARY={0}'.format('FIXME: lapack'),
+ "-DLAPACK_LIBRARY={0}".format("FIXME: lapack"),
# SuperLU support
- '-DSuperLU_INCLUDE_DIR={0}'.format(spec['superlu'].prefix.include),
- '-DSuperLU_LIBRARY={0}'.format('FIXME: superlu'),
+ "-DSuperLU_INCLUDE_DIR={0}".format(spec["superlu"].prefix.include),
+ "-DSuperLU_LIBRARY={0}".format("FIXME: superlu"),
# HDF5 support
- '-DDETECT_HDF5={0}'.format('ON' if '+hdf5' in spec else 'OFF')
+ "-DDETECT_HDF5={0}".format("ON" if "+hdf5" in spec else "OFF"),
]
diff --git a/var/spack/repos/tutorial/packages/elpa/package.py b/var/spack/repos/tutorial/packages/elpa/package.py
index 2fad884a88..d502390f0f 100644
--- a/var/spack/repos/tutorial/packages/elpa/package.py
+++ b/var/spack/repos/tutorial/packages/elpa/package.py
@@ -9,40 +9,38 @@ from spack.package import *
class Elpa(AutotoolsPackage):
"""Eigenvalue solvers for Petaflop-Applications (ELPA)"""
- homepage = 'http://elpa.mpcdf.mpg.de/'
- url = 'http://elpa.mpcdf.mpg.de/elpa-2015.11.001.tar.gz'
+ homepage = "http://elpa.mpcdf.mpg.de/"
+ url = "http://elpa.mpcdf.mpg.de/elpa-2015.11.001.tar.gz"
- version('2018.05.001.rc1', 'ccd77bd8036988ee624f43c04992bcdd')
- version('2017.11.001', '4a437be40cc966efb07aaab84c20cd6e', preferred=True)
- version('2017.05.003', '7c8e5e58cafab212badaf4216695700f')
- version('2017.05.002', 'd0abc1ac1f493f93bf5e30ec8ab155dc')
- version('2016.11.001.pre', '5656fd066cf0dcd071dbcaf20a639b37')
- version('2016.05.004', 'c0dd3a53055536fc3a2a221e78d8b376')
- version('2016.05.003', '88a9f3f3bfb63e16509dd1be089dcf2c')
- version('2015.11.001', 'de0f35b7ee7c971fd0dca35c900b87e6')
+ version("2018.05.001.rc1", "ccd77bd8036988ee624f43c04992bcdd")
+ version("2017.11.001", "4a437be40cc966efb07aaab84c20cd6e", preferred=True)
+ version("2017.05.003", "7c8e5e58cafab212badaf4216695700f")
+ version("2017.05.002", "d0abc1ac1f493f93bf5e30ec8ab155dc")
+ version("2016.11.001.pre", "5656fd066cf0dcd071dbcaf20a639b37")
+ version("2016.05.004", "c0dd3a53055536fc3a2a221e78d8b376")
+ version("2016.05.003", "88a9f3f3bfb63e16509dd1be089dcf2c")
+ version("2015.11.001", "de0f35b7ee7c971fd0dca35c900b87e6")
- variant('openmp', default=False, description='Activates OpenMP support')
- variant('optflags', default=True, description='Build with optimization flags')
+ variant("openmp", default=False, description="Activates OpenMP support")
+ variant("optflags", default=True, description="Build with optimization flags")
- depends_on('mpi')
- depends_on('blas')
- depends_on('lapack')
- depends_on('scalapack')
+ depends_on("mpi")
+ depends_on("blas")
+ depends_on("lapack")
+ depends_on("scalapack")
def url_for_version(self, version):
- t = 'http://elpa.mpcdf.mpg.de/html/Releases/{0}/elpa-{0}.tar.gz'
- if version < Version('2016.05.003'):
- t = 'http://elpa.mpcdf.mpg.de/elpa-{0}.tar.gz'
+ t = "http://elpa.mpcdf.mpg.de/html/Releases/{0}/elpa-{0}.tar.gz"
+ if version < Version("2016.05.003"):
+ t = "http://elpa.mpcdf.mpg.de/elpa-{0}.tar.gz"
return t.format(str(version))
@property
def libs(self):
- libname = 'libelpa_openmp' if '+openmp' in self.spec else 'libelpa'
- return find_libraries(
- libname, root=self.prefix, shared=True, recursive=True
- )
+ libname = "libelpa_openmp" if "+openmp" in self.spec else "libelpa"
+ return find_libraries(libname, root=self.prefix, shared=True, recursive=True)
- build_directory = 'spack-build'
+ build_directory = "spack-build"
def setup_run_environment(self, env):
# TUTORIAL: set the following environment variables:
@@ -65,11 +63,8 @@ class Elpa(AutotoolsPackage):
# https://src.fedoraproject.org/cgit/rpms/elpa.git/
# https://packages.qa.debian.org/e/elpa.html
options = []
- if '+optflags' in self.spec:
- options.extend([
- 'FCFLAGS=-O2 -ffree-line-length-none',
- 'CFLAGS=-O2'
- ])
- if '+openmp' in self.spec:
- options.append('--enable-openmp')
+ if "+optflags" in self.spec:
+ options.extend(["FCFLAGS=-O2 -ffree-line-length-none", "CFLAGS=-O2"])
+ if "+openmp" in self.spec:
+ options.append("--enable-openmp")
return options
diff --git a/var/spack/repos/tutorial/packages/hdf5/package.py b/var/spack/repos/tutorial/packages/hdf5/package.py
index 733b549efe..ea09fb3c49 100644
--- a/var/spack/repos/tutorial/packages/hdf5/package.py
+++ b/var/spack/repos/tutorial/packages/hdf5/package.py
@@ -19,94 +19,106 @@ class Hdf5(CMakePackage):
"""
homepage = "https://portal.hdfgroup.org"
- url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.7/src/hdf5-1.10.7.tar.gz"
+ url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.7/src/hdf5-1.10.7.tar.gz"
list_url = "https://support.hdfgroup.org/ftp/HDF5/releases"
list_depth = 3
- git = "https://github.com/HDFGroup/hdf5.git"
- maintainers = ['lrknox', 'brtnfld', 'byrnHDF', 'ChristopherHogan', 'epourmal',
- 'gheber', 'hyoklee', 'lkurz', 'soumagne']
+ git = "https://github.com/HDFGroup/hdf5.git"
+ maintainers = [
+ "lrknox",
+ "brtnfld",
+ "byrnHDF",
+ "ChristopherHogan",
+ "epourmal",
+ "gheber",
+ "hyoklee",
+ "lkurz",
+ "soumagne",
+ ]
test_requires_compiler = True
# The 'develop' version is renamed so that we could uninstall (or patch) it
# without affecting other develop version.
- version('develop-1.13', branch='develop')
- version('develop-1.12', branch='hdf5_1_12')
- version('develop-1.10', branch='hdf5_1_10')
- version('develop-1.8', branch='hdf5_1_8')
+ version("develop-1.13", branch="develop")
+ version("develop-1.12", branch="hdf5_1_12")
+ version("develop-1.10", branch="hdf5_1_10")
+ version("develop-1.8", branch="hdf5_1_8")
- version('1.12.1', sha256='79c66ff67e666665369396e9c90b32e238e501f345afd2234186bfb8331081ca')
- version('1.12.0', sha256='a62dcb276658cb78e6795dd29bf926ed7a9bc4edf6e77025cd2c689a8f97c17a')
+ version("1.12.1", sha256="79c66ff67e666665369396e9c90b32e238e501f345afd2234186bfb8331081ca")
+ version("1.12.0", sha256="a62dcb276658cb78e6795dd29bf926ed7a9bc4edf6e77025cd2c689a8f97c17a")
# HDF5 1.12 broke API compatibility, so we currently prefer the latest
# 1.10 release. packages that want later versions of HDF5 should specify,
# e.g., depends_on("hdf5@1.12:") to get 1.12 or higher.
- version('1.10.7', sha256='7a1a0a54371275ce2dfc5cd093775bb025c365846512961e7e5ceaecb437ef15', preferred=True)
- version('1.10.6', sha256='5f9a3ee85db4ea1d3b1fa9159352aebc2af72732fc2f58c96a3f0768dba0e9aa')
- version('1.10.5', sha256='6d4ce8bf902a97b050f6f491f4268634e252a63dadd6656a1a9be5b7b7726fa8')
- version('1.10.4', sha256='8f60dc4dd6ab5fcd23c750d1dc5bca3d0453bdce5c8cdaf0a4a61a9d1122adb2')
- version('1.10.3', sha256='b600d7c914cfa80ae127cd1a1539981213fee9994ac22ebec9e3845e951d9b39')
- version('1.10.2', sha256='bfec1be8c366965a99812cf02ddc97e4b708c1754fccba5414d4adccdc073866')
- version('1.10.1', sha256='048a9d149fb99aaa1680a712963f5a78e9c43b588d0e79d55e06760ec377c172')
- version('1.10.0-patch1', sha256='6e78cfe32a10e6e0629393cdfddf6cfa536571efdaf85f08e35326e1b4e9eff0')
- version('1.10.0', sha256='81f6201aba5c30dced5dcd62f5d5477a2790fd5850e02ac514ca8bf3e2bb375a')
-
- version('1.8.22', sha256='8406d96d9355ef8961d2739fb8fd5474ad4cdf52f3cfac657733defd9709bfaa')
- version('1.8.21', sha256='87d8c82eba5cf766d97cd06c054f4639c1049c4adeaa3a79f77f8bd374f80f37')
- version('1.8.19', sha256='a4335849f19fae88c264fd0df046bc321a78c536b2548fc508627a790564dc38')
- version('1.8.18', sha256='cdb195ad8d9e6782acf24b2488061289f615628c2ccda8457b0a0c3fb7a8a063')
- version('1.8.17', sha256='d9cda297ee76ade9881c4208987939250d397bae6252d0ccb66fa7d24d67e263')
- version('1.8.16', sha256='ed17178abd9928a7237f30370189ba767b9e39e0db45917c2ac4665eb9cb4771')
- version('1.8.15', sha256='4e963216b7d32469596bc1321a8c3f6e0c278dcbbdb7be6414c63c081b34c275')
- version('1.8.14', sha256='1dbefeeef7f591897c632b2b090db96bb8d35ad035beaa36bc39cb2bc67e0639')
- version('1.8.13', sha256='82f6b38eec103b4fccfbf14892786e0c27a8135d3252d8601cf5bf20066d38c1')
- version('1.8.12', sha256='b5cccea850096962b5fd9e96f22c4f47d2379224bb41130d9bc038bb6c37dfcb')
- version('1.8.10', sha256='4813b79c5fb8701a625b9924b8203bc7154a77f9b826ad4e034144b4056a160a')
-
- variant('shared', default=True,
- description='Builds a shared version of the library')
-
- variant('hl', default=False, description='Enable the high-level library')
- variant('cxx', default=False, description='Enable C++ support')
- variant('fortran', default=False, description='Enable Fortran support')
- variant('java', default=False, description='Enable Java support')
- variant('threadsafe', default=False,
- description='Enable thread-safe capabilities')
- variant('tools', default=True, description='Enable building tools')
- variant('mpi', default=True, description='Enable MPI support')
- variant('szip', default=False, description='Enable szip support')
+ version(
+ "1.10.7",
+ sha256="7a1a0a54371275ce2dfc5cd093775bb025c365846512961e7e5ceaecb437ef15",
+ preferred=True,
+ )
+ version("1.10.6", sha256="5f9a3ee85db4ea1d3b1fa9159352aebc2af72732fc2f58c96a3f0768dba0e9aa")
+ version("1.10.5", sha256="6d4ce8bf902a97b050f6f491f4268634e252a63dadd6656a1a9be5b7b7726fa8")
+ version("1.10.4", sha256="8f60dc4dd6ab5fcd23c750d1dc5bca3d0453bdce5c8cdaf0a4a61a9d1122adb2")
+ version("1.10.3", sha256="b600d7c914cfa80ae127cd1a1539981213fee9994ac22ebec9e3845e951d9b39")
+ version("1.10.2", sha256="bfec1be8c366965a99812cf02ddc97e4b708c1754fccba5414d4adccdc073866")
+ version("1.10.1", sha256="048a9d149fb99aaa1680a712963f5a78e9c43b588d0e79d55e06760ec377c172")
+ version(
+ "1.10.0-patch1", sha256="6e78cfe32a10e6e0629393cdfddf6cfa536571efdaf85f08e35326e1b4e9eff0"
+ )
+ version("1.10.0", sha256="81f6201aba5c30dced5dcd62f5d5477a2790fd5850e02ac514ca8bf3e2bb375a")
+
+ version("1.8.22", sha256="8406d96d9355ef8961d2739fb8fd5474ad4cdf52f3cfac657733defd9709bfaa")
+ version("1.8.21", sha256="87d8c82eba5cf766d97cd06c054f4639c1049c4adeaa3a79f77f8bd374f80f37")
+ version("1.8.19", sha256="a4335849f19fae88c264fd0df046bc321a78c536b2548fc508627a790564dc38")
+ version("1.8.18", sha256="cdb195ad8d9e6782acf24b2488061289f615628c2ccda8457b0a0c3fb7a8a063")
+ version("1.8.17", sha256="d9cda297ee76ade9881c4208987939250d397bae6252d0ccb66fa7d24d67e263")
+ version("1.8.16", sha256="ed17178abd9928a7237f30370189ba767b9e39e0db45917c2ac4665eb9cb4771")
+ version("1.8.15", sha256="4e963216b7d32469596bc1321a8c3f6e0c278dcbbdb7be6414c63c081b34c275")
+ version("1.8.14", sha256="1dbefeeef7f591897c632b2b090db96bb8d35ad035beaa36bc39cb2bc67e0639")
+ version("1.8.13", sha256="82f6b38eec103b4fccfbf14892786e0c27a8135d3252d8601cf5bf20066d38c1")
+ version("1.8.12", sha256="b5cccea850096962b5fd9e96f22c4f47d2379224bb41130d9bc038bb6c37dfcb")
+ version("1.8.10", sha256="4813b79c5fb8701a625b9924b8203bc7154a77f9b826ad4e034144b4056a160a")
+
+ variant("shared", default=True, description="Builds a shared version of the library")
+
+ variant("hl", default=False, description="Enable the high-level library")
+ variant("cxx", default=False, description="Enable C++ support")
+ variant("fortran", default=False, description="Enable Fortran support")
+ variant("java", default=False, description="Enable Java support")
+ variant("threadsafe", default=False, description="Enable thread-safe capabilities")
+ variant("tools", default=True, description="Enable building tools")
+ variant("mpi", default=True, description="Enable MPI support")
+ variant("szip", default=False, description="Enable szip support")
# Build HDF5 with API compatibility.
- variant('api', default='default',
- description='Choose api compatibility for earlier version',
- values=('default', 'v114', 'v112', 'v110', 'v18', 'v16'),
- multi=False)
-
- depends_on('cmake@3.12:', type='build')
-
- depends_on('mpi', when='+mpi')
- depends_on('java', type=('build', 'run'), when='+java')
+ variant(
+ "api",
+ default="default",
+ description="Choose api compatibility for earlier version",
+ values=("default", "v114", "v112", "v110", "v18", "v16"),
+ multi=False,
+ )
+
+ depends_on("cmake@3.12:", type="build")
+
+ depends_on("mpi", when="+mpi")
+ depends_on("java", type=("build", "run"), when="+java")
# numactl does not currently build on darwin
- if sys.platform != 'darwin':
- depends_on('numactl', when='+mpi+fortran')
- depends_on('szip', when='+szip')
- depends_on('zlib@1.1.2:')
+ if sys.platform != "darwin":
+ depends_on("numactl", when="+mpi+fortran")
+ depends_on("szip", when="+szip")
+ depends_on("zlib@1.1.2:")
# The compiler wrappers (h5cc, h5fc, etc.) run 'pkg-config'.
- depends_on('pkgconfig', type='run')
+ depends_on("pkgconfig", type="run")
- conflicts('api=v114', when='@1.6.0:1.12',
- msg='v114 is not compatible with this release')
- conflicts('api=v112', when='@1.6.0:1.10',
- msg='v112 is not compatible with this release')
- conflicts('api=v110', when='@1.6.0:1.8',
- msg='v110 is not compatible with this release')
- conflicts('api=v18', when='@1.6.0:1.6',
- msg='v18 is not compatible with this release')
+ conflicts("api=v114", when="@1.6.0:1.12", msg="v114 is not compatible with this release")
+ conflicts("api=v112", when="@1.6.0:1.10", msg="v112 is not compatible with this release")
+ conflicts("api=v110", when="@1.6.0:1.8", msg="v110 is not compatible with this release")
+ conflicts("api=v18", when="@1.6.0:1.6", msg="v18 is not compatible with this release")
# The Java wrappers and associated libhdf5_java library
# were first available in 1.10
- conflicts('+java', when='@:1.9')
+ conflicts("+java", when="@:1.9")
# The Java wrappers cannot be built without shared libs.
- conflicts('+java', when='~shared')
+ conflicts("+java", when="~shared")
# There are several officially unsupported combinations of the features:
# 1. Thread safety is not guaranteed via high-level C-API but in some cases
@@ -128,8 +140,7 @@ class Hdf5(CMakePackage):
# There are known build failures with intel@18.0.1. This issue is
# discussed and patch is provided at
# https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/747951.
- patch('h5f90global-mult-obj-same-equivalence-same-common-block.patch',
- when='@1.10.1%intel@18')
+ patch("h5f90global-mult-obj-same-equivalence-same-common-block.patch", when="@1.10.1%intel@18")
# Turn line comments into block comments to conform with pre-C99 language
# standards. Versions of hdf5 after 1.8.10 don't require this patch,
@@ -141,23 +152,31 @@ class Hdf5(CMakePackage):
# pre-C99 code is restricted to just five lines of line comments in
# three src files, this patch accomplishes the simple task of patching the
# three src files and leaves the hdf5 build system alone.
- patch('pre-c99-comments.patch', when='@1.8.10')
+ patch("pre-c99-comments.patch", when="@1.8.10")
# There are build errors with GCC 8, see
# https://forum.hdfgroup.org/t/1-10-2-h5detect-compile-error-gcc-8-1-0-on-centos-7-2-solved/4441
- patch('https://salsa.debian.org/debian-gis-team/hdf5/raw/bf94804af5f80f662cad80a5527535b3c6537df6/debian/patches/gcc-8.patch',
- sha256='57cee5ff1992b4098eda079815c36fc2da9b10e00a9056df054f2384c4fc7523',
- when='@1.10.2%gcc@8:')
+ patch(
+ "https://salsa.debian.org/debian-gis-team/hdf5/raw/bf94804af5f80f662cad80a5527535b3c6537df6/debian/patches/gcc-8.patch",
+ sha256="57cee5ff1992b4098eda079815c36fc2da9b10e00a9056df054f2384c4fc7523",
+ when="@1.10.2%gcc@8:",
+ )
# Disable MPI C++ interface when C++ is disabled, otherwise downstream
# libraries fail to link; see https://github.com/spack/spack/issues/12586
- patch('h5public-skip-mpicxx.patch', when='@1.8.10:1.8.21,1.10.0:1.10.5+mpi~cxx',
- sha256='b61e2f058964ad85be6ee5ecea10080bf79e73f83ff88d1fa4b602d00209da9c')
+ patch(
+ "h5public-skip-mpicxx.patch",
+ when="@1.8.10:1.8.21,1.10.0:1.10.5+mpi~cxx",
+ sha256="b61e2f058964ad85be6ee5ecea10080bf79e73f83ff88d1fa4b602d00209da9c",
+ )
# Fixes BOZ literal constant error when compiled with GCC 10.
# The issue is described here: https://github.com/spack/spack/issues/18625
- patch('hdf5_1.8_gcc10.patch', when='@:1.8.21',
- sha256='0e20187cda3980a4fdff410da92358b63de7ebef2df1d7a425371af78e50f666')
+ patch(
+ "hdf5_1.8_gcc10.patch",
+ when="@:1.8.21",
+ sha256="0e20187cda3980a4fdff410da92358b63de7ebef2df1d7a425371af78e50f666",
+ )
# The argument 'buf_size' of the C function 'h5fget_file_image_c' is
# declared as intent(in) though it is modified by the invocation. As a
@@ -165,51 +184,54 @@ class Hdf5(CMakePackage):
# optimization to cause an error.
def patch(self):
filter_file(
- 'INTEGER(SIZE_T), INTENT(IN) :: buf_size',
- 'INTEGER(SIZE_T), INTENT(OUT) :: buf_size',
- 'fortran/src/H5Fff.F90',
- string=True, ignore_absent=True)
+ "INTEGER(SIZE_T), INTENT(IN) :: buf_size",
+ "INTEGER(SIZE_T), INTENT(OUT) :: buf_size",
+ "fortran/src/H5Fff.F90",
+ string=True,
+ ignore_absent=True,
+ )
filter_file(
- 'INTEGER(SIZE_T), INTENT(IN) :: buf_size',
- 'INTEGER(SIZE_T), INTENT(OUT) :: buf_size',
- 'fortran/src/H5Fff_F03.f90',
- string=True, ignore_absent=True)
+ "INTEGER(SIZE_T), INTENT(IN) :: buf_size",
+ "INTEGER(SIZE_T), INTENT(OUT) :: buf_size",
+ "fortran/src/H5Fff_F03.f90",
+ string=True,
+ ignore_absent=True,
+ )
# The parallel compiler wrappers (i.e. h5pcc, h5pfc, etc.) reference MPI
# compiler wrappers and do not need to be changed.
- filter_compiler_wrappers('h5cc', 'h5hlcc',
- 'h5fc', 'h5hlfc',
- 'h5c++', 'h5hlc++',
- relative_root='bin')
+ filter_compiler_wrappers(
+ "h5cc", "h5hlcc", "h5fc", "h5hlfc", "h5c++", "h5hlc++", relative_root="bin"
+ )
def url_for_version(self, version):
- url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-{0}/hdf5-{1}/src/hdf5-{1}.tar.gz"
+ url = (
+ "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-{0}/hdf5-{1}/src/hdf5-{1}.tar.gz"
+ )
return url.format(version.up_to(2), version)
def flag_handler(self, name, flags):
cmake_flags = []
if name == "cflags":
- if self.spec.satisfies('%gcc') \
- or self.spec.satisfies('%clang'):
+ if self.spec.satisfies("%gcc") or self.spec.satisfies("%clang"):
# Quiet warnings/errors about implicit declaration of functions
# in C99:
cmake_flags.append("-Wno-implicit-function-declaration")
# Note that this flag will cause an error if building %nvhpc.
- if self.spec.satisfies('@:1.8.12~shared'):
+ if self.spec.satisfies("@:1.8.12~shared"):
# More recent versions set CMAKE_POSITION_INDEPENDENT_CODE to
# True and build with PIC flags.
cmake_flags.append(self.compiler.cc_pic_flag)
- elif name == 'cxxflags':
- if self.spec.satisfies('@:1.8.12+cxx~shared'):
+ elif name == "cxxflags":
+ if self.spec.satisfies("@:1.8.12+cxx~shared"):
cmake_flags.append(self.compiler.cxx_pic_flag)
elif name == "fflags":
- if self.spec.satisfies('@:1.8.12+fortran~shared'):
+ if self.spec.satisfies("@:1.8.12+fortran~shared"):
cmake_flags.append(self.compiler.fc_pic_flag)
elif name == "ldlibs":
- if '+fortran %fj' in self.spec:
- cmake_flags.extend(['-lfj90i', '-lfj90f',
- '-lfjsrcinfo', '-lelf'])
+ if "+fortran %fj" in self.spec:
+ cmake_flags.extend(["-lfj90i", "-lfj90f", "-lfjsrcinfo", "-lelf"])
return flags, None, (cmake_flags or None)
@@ -226,13 +248,13 @@ class Hdf5(CMakePackage):
"""
query_parameters = self.spec.last_query.extra_parameters
- shared = '+shared' in self.spec
+ shared = "+shared" in self.spec
# This map contains a translation from query_parameters
# to the libraries needed
query2libraries = {
- tuple(): ['libhdf5'],
- ('cxx', 'fortran', 'hl', 'java'): [
+ tuple(): ["libhdf5"],
+ ("cxx", "fortran", "hl", "java"): [
# When installed with Autotools, the basename of the real
# library file implementing the High-level Fortran interface is
# 'libhdf5hl_fortran'. Starting versions 1.8.22, 1.10.5 and
@@ -253,122 +275,119 @@ class Hdf5(CMakePackage):
# packages that could benefit from it would be those that
# hardcode the library name in their building systems. Such
# packages should simply be patched.
- 'libhdf5_hl_fortran',
- 'libhdf5_hl_f90cstub',
- 'libhdf5_hl_cpp',
- 'libhdf5_hl',
- 'libhdf5_fortran',
- 'libhdf5_f90cstub',
- 'libhdf5_java',
- 'libhdf5',
+ "libhdf5_hl_fortran",
+ "libhdf5_hl_f90cstub",
+ "libhdf5_hl_cpp",
+ "libhdf5_hl",
+ "libhdf5_fortran",
+ "libhdf5_f90cstub",
+ "libhdf5_java",
+ "libhdf5",
+ ],
+ ("cxx", "hl"): [
+ "libhdf5_hl_cpp",
+ "libhdf5_hl",
+ "libhdf5",
],
- ('cxx', 'hl'): [
- 'libhdf5_hl_cpp',
- 'libhdf5_hl',
- 'libhdf5',
+ ("fortran", "hl"): [
+ "libhdf5_hl_fortran",
+ "libhdf5_hl_f90cstub",
+ "libhdf5_hl",
+ "libhdf5_fortran",
+ "libhdf5_f90cstub",
+ "libhdf5",
],
- ('fortran', 'hl'): [
- 'libhdf5_hl_fortran',
- 'libhdf5_hl_f90cstub',
- 'libhdf5_hl',
- 'libhdf5_fortran',
- 'libhdf5_f90cstub',
- 'libhdf5',
+ ("hl",): [
+ "libhdf5_hl",
+ "libhdf5",
],
- ('hl',): [
- 'libhdf5_hl',
- 'libhdf5',
+ ("cxx", "fortran"): [
+ "libhdf5_fortran",
+ "libhdf5_f90cstub",
+ "libhdf5_cpp",
+ "libhdf5",
],
- ('cxx', 'fortran'): [
- 'libhdf5_fortran',
- 'libhdf5_f90cstub',
- 'libhdf5_cpp',
- 'libhdf5',
+ ("cxx",): [
+ "libhdf5_cpp",
+ "libhdf5",
],
- ('cxx',): [
- 'libhdf5_cpp',
- 'libhdf5',
+ ("fortran",): [
+ "libhdf5_fortran",
+ "libhdf5_f90cstub",
+ "libhdf5",
],
- ('fortran',): [
- 'libhdf5_fortran',
- 'libhdf5_f90cstub',
- 'libhdf5',
+ ("java",): [
+ "libhdf5_java",
+ "libhdf5",
],
- ('java',): [
- 'libhdf5_java',
- 'libhdf5',
- ]
}
# Turn the query into the appropriate key
key = tuple(sorted(query_parameters))
libraries = query2libraries[key]
- return find_libraries(
- libraries, root=self.prefix, shared=shared, recursive=True
- )
+ return find_libraries(libraries, root=self.prefix, shared=shared, recursive=True)
- @when('@:1.8.21,1.10.0:1.10.5+szip')
+ @when("@:1.8.21,1.10.0:1.10.5+szip")
def setup_build_environment(self, env):
- env.set('SZIP_INSTALL', self.spec['szip'].prefix)
+ env.set("SZIP_INSTALL", self.spec["szip"].prefix)
- @run_before('cmake')
+ @run_before("cmake")
def fortran_check(self):
- if '+fortran' in self.spec and not self.compiler.fc:
- msg = 'cannot build a Fortran variant without a Fortran compiler'
+ if "+fortran" in self.spec and not self.compiler.fc:
+ msg = "cannot build a Fortran variant without a Fortran compiler"
raise RuntimeError(msg)
def cmake_args(self):
spec = self.spec
- if spec.satisfies('@:1.8.15+shared'):
- tty.warn('hdf5@:1.8.15+shared does not produce static libraries')
+ if spec.satisfies("@:1.8.15+shared"):
+ tty.warn("hdf5@:1.8.15+shared does not produce static libraries")
args = [
# Always enable this option. This does not actually enable any
# features: it only *allows* the user to specify certain
# combinations of other arguments.
- self.define('ALLOW_UNSUPPORTED', True),
+ self.define("ALLOW_UNSUPPORTED", True),
# Speed-up the building by skipping the examples:
- self.define('HDF5_BUILD_EXAMPLES', False),
+ self.define("HDF5_BUILD_EXAMPLES", False),
self.define(
- 'BUILD_TESTING',
+ "BUILD_TESTING",
self.run_tests or
# Version 1.8.22 fails to build the tools when shared libraries
# are enabled but the tests are disabled.
- spec.satisfies('@1.8.22+shared+tools')),
- self.define('HDF5_ENABLE_Z_LIB_SUPPORT', True),
- self.define_from_variant('HDF5_ENABLE_SZIP_SUPPORT', 'szip'),
- self.define_from_variant('HDF5_ENABLE_SZIP_ENCODING', 'szip'),
- self.define_from_variant('BUILD_SHARED_LIBS', 'shared'),
- self.define('ONLY_SHARED_LIBS', False),
- self.define_from_variant('HDF5_ENABLE_PARALLEL', 'mpi'),
- self.define_from_variant('HDF5_ENABLE_THREADSAFE', 'threadsafe'),
- self.define_from_variant('HDF5_BUILD_HL_LIB', 'hl'),
- self.define_from_variant('HDF5_BUILD_CPP_LIB', 'cxx'),
- self.define_from_variant('HDF5_BUILD_FORTRAN', 'fortran'),
- self.define_from_variant('HDF5_BUILD_JAVA', 'java'),
- self.define_from_variant('HDF5_BUILD_TOOLS', 'tools')
+ spec.satisfies("@1.8.22+shared+tools"),
+ ),
+ self.define("HDF5_ENABLE_Z_LIB_SUPPORT", True),
+ self.define_from_variant("HDF5_ENABLE_SZIP_SUPPORT", "szip"),
+ self.define_from_variant("HDF5_ENABLE_SZIP_ENCODING", "szip"),
+ self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
+ self.define("ONLY_SHARED_LIBS", False),
+ self.define_from_variant("HDF5_ENABLE_PARALLEL", "mpi"),
+ self.define_from_variant("HDF5_ENABLE_THREADSAFE", "threadsafe"),
+ self.define_from_variant("HDF5_BUILD_HL_LIB", "hl"),
+ self.define_from_variant("HDF5_BUILD_CPP_LIB", "cxx"),
+ self.define_from_variant("HDF5_BUILD_FORTRAN", "fortran"),
+ self.define_from_variant("HDF5_BUILD_JAVA", "java"),
+ self.define_from_variant("HDF5_BUILD_TOOLS", "tools"),
]
- api = spec.variants['api'].value
- if api != 'default':
- args.append(self.define('DEFAULT_API_VERSION', api))
+ api = spec.variants["api"].value
+ if api != "default":
+ args.append(self.define("DEFAULT_API_VERSION", api))
- if '+mpi' in spec:
- args.append(self.define('CMAKE_C_COMPILER', spec['mpi'].mpicc))
+ if "+mpi" in spec:
+ args.append(self.define("CMAKE_C_COMPILER", spec["mpi"].mpicc))
- if '+cxx' in self.spec:
- args.append(self.define('CMAKE_CXX_COMPILER',
- spec['mpi'].mpicxx))
+ if "+cxx" in self.spec:
+ args.append(self.define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx))
- if '+fortran' in self.spec:
- args.append(self.define('CMAKE_Fortran_COMPILER',
- spec['mpi'].mpifc))
+ if "+fortran" in self.spec:
+ args.append(self.define("CMAKE_Fortran_COMPILER", spec["mpi"].mpifc))
return args
- @run_after('install')
+ @run_after("install")
def ensure_parallel_compiler_wrappers(self):
# When installed with Autotools and starting at least version 1.8.10,
# the package produces C compiler wrapper called either 'h5cc' (when MPI
@@ -379,26 +398,24 @@ class Hdf5(CMakePackage):
# support is enabled and the file is identical to 'h5cc'. Here, we make
# sure that 'h5pcc' is available when MPI support is enabled (only for
# versions that generate 'h5cc').
- if self.spec.satisfies('@1.8.21:1.8.22,1.10.2:1.10.7,1.12.0+mpi'):
+ if self.spec.satisfies("@1.8.21:1.8.22,1.10.2:1.10.7,1.12.0+mpi"):
with working_dir(self.prefix.bin):
# No try/except here, fix the condition above instead:
- symlink('h5cc', 'h5pcc')
+ symlink("h5cc", "h5pcc")
# The same as for 'h5pcc'. However, the CMake installation produces the
# Fortran compiler wrapper called 'h5fc' only starting versions 1.8.22,
# 1.10.6 and 1.12.0. The current develop versions do not produce 'h5pfc'
# at all. Here, we make sure that 'h5pfc' is available when Fortran and
# MPI support are enabled (only for versions that generate 'h5fc').
- if self.spec.satisfies('@1.8.22:1.8,'
- '1.10.6:1.10,'
- '1.12.0:1.12,'
- 'develop:'
- '+fortran+mpi'):
+ if self.spec.satisfies(
+ "@1.8.22:1.8," "1.10.6:1.10," "1.12.0:1.12," "develop:" "+fortran+mpi"
+ ):
with working_dir(self.prefix.bin):
# No try/except here, fix the condition above instead:
- symlink('h5fc', 'h5pfc')
+ symlink("h5fc", "h5pfc")
- @run_after('install')
+ @run_after("install")
def fix_package_config(self):
# We need to fix the pkg-config files, which are also used by the
# compiler wrappers. The files are created starting versions 1.8.21,
@@ -413,7 +430,7 @@ class Hdf5(CMakePackage):
# that each <name>-<version>.pc file is symlinked by <name>.pc and all
# references to <name>-<version> packages in the original files are
# replaced with references to <name> packages.
- pc_files = find(self.prefix.lib.pkgconfig, 'hdf5*.pc', recursive=False)
+ pc_files = find(self.prefix.lib.pkgconfig, "hdf5*.pc", recursive=False)
if not pc_files:
# This also tells us that the pkgconfig directory does not exist.
@@ -421,20 +438,23 @@ class Hdf5(CMakePackage):
# Replace versioned references in all pkg-config files:
filter_file(
- r'(Requires(?:\.private)?:.*)(hdf5[^\s,]*)(?:-[^\s,]*)(.*)',
- r'\1\2\3', *pc_files, backup=False)
+ r"(Requires(?:\.private)?:.*)(hdf5[^\s,]*)(?:-[^\s,]*)(.*)",
+ r"\1\2\3",
+ *pc_files,
+ backup=False
+ )
# Create non-versioned symlinks to the versioned pkg-config files:
with working_dir(self.prefix.lib.pkgconfig):
for f in pc_files:
src_filename = os.path.basename(f)
- version_sep_idx = src_filename.find('-')
+ version_sep_idx = src_filename.find("-")
if version_sep_idx > -1:
- tgt_filename = src_filename[:version_sep_idx] + '.pc'
+ tgt_filename = src_filename[:version_sep_idx] + ".pc"
if not os.path.exists(tgt_filename):
symlink(src_filename, tgt_filename)
- @run_after('install')
+ @run_after("install")
@on_package_attributes(run_tests=True)
def check_install(self):
self._check_install()
@@ -460,18 +480,19 @@ int main(int argc, char **argv) {
"""
expected = """\
HDF5 version {version} {version}
-""".format(version=str(spec.version.up_to(3)))
- with open("check.c", 'w') as f:
+""".format(
+ version=str(spec.version.up_to(3))
+ )
+ with open("check.c", "w") as f:
f.write(source)
- if '+mpi' in spec:
- cc = Executable(spec['mpi'].mpicc)
+ if "+mpi" in spec:
+ cc = Executable(spec["mpi"].mpicc)
else:
cc = Executable(self.compiler.cc)
- cc(*(['-c', "check.c"] + spec['hdf5'].headers.cpp_flags.split()))
- cc(*(['-o', "check",
- "check.o"] + spec['hdf5'].libs.ld_flags.split()))
+ cc(*(["-c", "check.c"] + spec["hdf5"].headers.cpp_flags.split()))
+ cc(*(["-o", "check", "check.o"] + spec["hdf5"].libs.ld_flags.split()))
try:
- check = Executable('./check')
+ check = Executable("./check")
output = check(output=str)
except ProcessError:
output = ""
@@ -479,55 +500,74 @@ HDF5 version {version} {version}
if not success:
print("Produced output does not match expected output.")
print("Expected output:")
- print('-' * 80)
+ print("-" * 80)
print(expected)
- print('-' * 80)
+ print("-" * 80)
print("Produced output:")
- print('-' * 80)
+ print("-" * 80)
print(output)
- print('-' * 80)
+ print("-" * 80)
raise RuntimeError("HDF5 install check failed")
shutil.rmtree(checkdir)
def _test_check_versions(self):
"""Perform version checks on selected installed package binaries."""
- spec_vers_str = 'Version {0}'.format(self.spec.version)
+ spec_vers_str = "Version {0}".format(self.spec.version)
exes = [
- 'h5copy', 'h5diff', 'h5dump', 'h5format_convert', 'h5ls',
- 'h5mkgrp', 'h5repack', 'h5stat', 'h5unjam',
+ "h5copy",
+ "h5diff",
+ "h5dump",
+ "h5format_convert",
+ "h5ls",
+ "h5mkgrp",
+ "h5repack",
+ "h5stat",
+ "h5unjam",
]
- use_short_opt = ['h52gif', 'h5repart', 'h5unjam']
+ use_short_opt = ["h52gif", "h5repart", "h5unjam"]
for exe in exes:
- reason = 'test: ensuring version of {0} is {1}' \
- .format(exe, spec_vers_str)
- option = '-V' if exe in use_short_opt else '--version'
- self.run_test(exe, option, spec_vers_str, installed=True,
- purpose=reason, skip_missing=True)
+ reason = "test: ensuring version of {0} is {1}".format(exe, spec_vers_str)
+ option = "-V" if exe in use_short_opt else "--version"
+ self.run_test(
+ exe, option, spec_vers_str, installed=True, purpose=reason, skip_missing=True
+ )
def _test_example(self):
"""This test performs copy, dump, and diff on an example hdf5 file."""
test_data_dir = self.test_suite.current_test_data_dir
- filename = 'spack.h5'
+ filename = "spack.h5"
h5_file = test_data_dir.join(filename)
- reason = 'test: ensuring h5dump produces expected output'
- expected = get_escaped_text_output(test_data_dir.join('dump.out'))
- self.run_test('h5dump', filename, expected, installed=True,
- purpose=reason, skip_missing=True,
- work_dir=test_data_dir)
-
- reason = 'test: ensuring h5copy runs'
- options = ['-i', h5_file, '-s', 'Spack', '-o', 'test.h5', '-d',
- 'Spack']
- self.run_test('h5copy', options, [], installed=True,
- purpose=reason, skip_missing=True, work_dir='.')
-
- reason = ('test: ensuring h5diff shows no differences between orig and'
- ' copy')
- self.run_test('h5diff', [h5_file, 'test.h5'], [], installed=True,
- purpose=reason, skip_missing=True, work_dir='.')
+ reason = "test: ensuring h5dump produces expected output"
+ expected = get_escaped_text_output(test_data_dir.join("dump.out"))
+ self.run_test(
+ "h5dump",
+ filename,
+ expected,
+ installed=True,
+ purpose=reason,
+ skip_missing=True,
+ work_dir=test_data_dir,
+ )
+
+ reason = "test: ensuring h5copy runs"
+ options = ["-i", h5_file, "-s", "Spack", "-o", "test.h5", "-d", "Spack"]
+ self.run_test(
+ "h5copy", options, [], installed=True, purpose=reason, skip_missing=True, work_dir="."
+ )
+
+ reason = "test: ensuring h5diff shows no differences between orig and" " copy"
+ self.run_test(
+ "h5diff",
+ [h5_file, "test.h5"],
+ [],
+ installed=True,
+ purpose=reason,
+ skip_missing=True,
+ work_dir=".",
+ )
def test(self):
"""Perform smoke tests on the installed package."""
diff --git a/var/spack/repos/tutorial/packages/mpich/package.py b/var/spack/repos/tutorial/packages/mpich/package.py
index 1e372528a4..ae1b00961d 100644
--- a/var/spack/repos/tutorial/packages/mpich/package.py
+++ b/var/spack/repos/tutorial/packages/mpich/package.py
@@ -13,67 +13,65 @@ class Mpich(AutotoolsPackage):
the Message Passing Interface (MPI) standard."""
homepage = "http://www.mpich.org"
- url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz"
- git = "https://github.com/pmodels/mpich.git"
+ url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz"
+ git = "https://github.com/pmodels/mpich.git"
list_url = "http://www.mpich.org/static/downloads/"
list_depth = 1
- version('develop', submodules=True)
- version('3.2.1', 'e175452f4d61646a52c73031683fc375')
- version('3.2', 'f414cfa77099cd1fa1a5ae4e22db508a')
- version('3.1.4', '2ab544607986486562e076b83937bba2')
- version('3.1.3', '93cb17f91ac758cbf9174ecb03563778')
- version('3.1.2', '7fbf4b81dcb74b07ae85939d1ceee7f1')
- version('3.1.1', '40dc408b1e03cc36d80209baaa2d32b7')
- version('3.1', '5643dd176499bfb7d25079aaff25f2ec')
- version('3.0.4', '9c5d5d4fe1e17dd12153f40bc5b6dbc0')
-
- variant('hydra', default=True, description='Build the hydra process manager')
- variant('pmi', default=True, description='Build with PMI support')
- variant('romio', default=True, description='Enable ROMIO MPI I/O implementation')
- variant('verbs', default=False, description='Build support for OpenFabrics verbs.')
+ version("develop", submodules=True)
+ version("3.2.1", "e175452f4d61646a52c73031683fc375")
+ version("3.2", "f414cfa77099cd1fa1a5ae4e22db508a")
+ version("3.1.4", "2ab544607986486562e076b83937bba2")
+ version("3.1.3", "93cb17f91ac758cbf9174ecb03563778")
+ version("3.1.2", "7fbf4b81dcb74b07ae85939d1ceee7f1")
+ version("3.1.1", "40dc408b1e03cc36d80209baaa2d32b7")
+ version("3.1", "5643dd176499bfb7d25079aaff25f2ec")
+ version("3.0.4", "9c5d5d4fe1e17dd12153f40bc5b6dbc0")
+
+ variant("hydra", default=True, description="Build the hydra process manager")
+ variant("pmi", default=True, description="Build with PMI support")
+ variant("romio", default=True, description="Enable ROMIO MPI I/O implementation")
+ variant("verbs", default=False, description="Build support for OpenFabrics verbs.")
variant(
- 'device',
- default='ch3',
- description='''Abstract Device Interface (ADI)
-implementation. The ch4 device is currently in experimental state''',
- values=('ch3', 'ch4'),
- multi=False
+ "device",
+ default="ch3",
+ description="""Abstract Device Interface (ADI)
+implementation. The ch4 device is currently in experimental state""",
+ values=("ch3", "ch4"),
+ multi=False,
)
variant(
- 'netmod',
- default='tcp',
- description='''Network module. Only single netmod builds are
+ "netmod",
+ default="tcp",
+ description="""Network module. Only single netmod builds are
supported. For ch3 device configurations, this presumes the
ch3:nemesis communication channel. ch3:sock is not supported by this
-spack package at this time.''',
- values=('tcp', 'mxm', 'ofi', 'ucx'),
- multi=False
+spack package at this time.""",
+ values=("tcp", "mxm", "ofi", "ucx"),
+ multi=False,
)
- provides('mpi')
- provides('mpi@:3.0', when='@3:')
- provides('mpi@:1.3', when='@1:')
+ provides("mpi")
+ provides("mpi@:3.0", when="@3:")
+ provides("mpi@:1.3", when="@1:")
- filter_compiler_wrappers(
- 'mpicc', 'mpicxx', 'mpif77', 'mpif90', 'mpifort', relative_root='bin'
- )
+ filter_compiler_wrappers("mpicc", "mpicxx", "mpif77", "mpif90", "mpifort", relative_root="bin")
# fix MPI_Barrier segmentation fault
# see https://lists.mpich.org/pipermail/discuss/2016-May/004764.html
# and https://lists.mpich.org/pipermail/discuss/2016-June/004768.html
- patch('mpich32_clang.patch', when='@3.2:3.2.0%clang')
+ patch("mpich32_clang.patch", when="@3.2:3.2.0%clang")
- depends_on('findutils', type='build')
+ depends_on("findutils", type="build")
- depends_on('libfabric', when='netmod=ofi')
+ depends_on("libfabric", when="netmod=ofi")
- conflicts('device=ch4', when='@:3.2')
- conflicts('netmod=ofi', when='@:3.1.4')
- conflicts('netmod=ucx', when='device=ch3')
- conflicts('netmod=mxm', when='device=ch4')
- conflicts('netmod=mxm', when='@:3.1.3')
- conflicts('netmod=tcp', when='device=ch4')
+ conflicts("device=ch4", when="@:3.2")
+ conflicts("netmod=ofi", when="@:3.1.4")
+ conflicts("netmod=ucx", when="device=ch3")
+ conflicts("netmod=mxm", when="device=ch4")
+ conflicts("netmod=mxm", when="@:3.1.3")
+ conflicts("netmod=tcp", when="device=ch4")
def setup_dependent_build_environment(self, env, dependent_spec):
# TUTORIAL: set the following variables for dependents:
@@ -90,20 +88,20 @@ spack package at this time.''',
pass
def setup_dependent_package(self, module, dependent_spec):
- if 'platform=cray' in self.spec:
+ if "platform=cray" in self.spec:
self.spec.mpicc = spack_cc
self.spec.mpicxx = spack_cxx
self.spec.mpifc = spack_fc
self.spec.mpif77 = spack_f77
else:
- self.spec.mpicc = join_path(self.prefix.bin, 'mpicc')
- self.spec.mpicxx = join_path(self.prefix.bin, 'mpic++')
- self.spec.mpifc = join_path(self.prefix.bin, 'mpif90')
- self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77')
+ self.spec.mpicc = join_path(self.prefix.bin, "mpicc")
+ self.spec.mpicxx = join_path(self.prefix.bin, "mpic++")
+ self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
+ self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicxx_shared_libs = [
- join_path(self.prefix.lib, 'libmpicxx.{0}'.format(dso_suffix)),
- join_path(self.prefix.lib, 'libmpi.{0}'.format(dso_suffix))
+ join_path(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
+ join_path(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),
]
def autoreconf(self, spec, prefix):
@@ -112,44 +110,42 @@ spack package at this time.''',
if os.path.exists(self.configure_abs_path):
return
# Else bootstrap with autotools
- bash = which('bash')
- bash('./autogen.sh')
+ bash = which("bash")
+ bash("./autogen.sh")
- @run_before('autoreconf')
+ @run_before("autoreconf")
def die_without_fortran(self):
# Until we can pass variants such as +fortran through virtual
# dependencies depends_on('mpi'), require Fortran compiler to
# avoid delayed build errors in dependents.
if (self.compiler.f77 is None) or (self.compiler.fc is None):
- raise InstallError(
- 'Mpich requires both C and Fortran compilers!'
- )
+ raise InstallError("Mpich requires both C and Fortran compilers!")
def configure_args(self):
spec = self.spec
config_args = [
- '--enable-shared',
- '--with-pm={0}'.format('hydra' if '+hydra' in spec else 'no'),
- '--with-pmi={0}'.format('yes' if '+pmi' in spec else 'no'),
- '--{0}-romio'.format('enable' if '+romio' in spec else 'disable'),
- '--{0}-ibverbs'.format('with' if '+verbs' in spec else 'without')
+ "--enable-shared",
+ "--with-pm={0}".format("hydra" if "+hydra" in spec else "no"),
+ "--with-pmi={0}".format("yes" if "+pmi" in spec else "no"),
+ "--{0}-romio".format("enable" if "+romio" in spec else "disable"),
+ "--{0}-ibverbs".format("with" if "+verbs" in spec else "without"),
]
# setup device configuration
- device_config = ''
- if 'device=ch4' in spec:
- device_config = '--with-device=ch4:'
- elif 'device=ch3' in spec:
- device_config = '--with-device=ch3:nemesis:'
-
- if 'netmod=ucx' in spec:
- device_config += 'ucx'
- elif 'netmod=ofi' in spec:
- device_config += 'ofi'
- elif 'netmod=mxm' in spec:
- device_config += 'mxm'
- elif 'netmod=tcp' in spec:
- device_config += 'tcp'
+ device_config = ""
+ if "device=ch4" in spec:
+ device_config = "--with-device=ch4:"
+ elif "device=ch3" in spec:
+ device_config = "--with-device=ch3:nemesis:"
+
+ if "netmod=ucx" in spec:
+ device_config += "ucx"
+ elif "netmod=ofi" in spec:
+ device_config += "ofi"
+ elif "netmod=mxm" in spec:
+ device_config += "mxm"
+ elif "netmod=tcp" in spec:
+ device_config += "tcp"
config_args.append(device_config)
diff --git a/var/spack/repos/tutorial/packages/netlib-lapack/package.py b/var/spack/repos/tutorial/packages/netlib-lapack/package.py
index 01c987aafd..e5bdba132b 100644
--- a/var/spack/repos/tutorial/packages/netlib-lapack/package.py
+++ b/var/spack/repos/tutorial/packages/netlib-lapack/package.py
@@ -14,50 +14,51 @@ class NetlibLapack(CMakePackage):
package that has found extensive use in the scientific community.
"""
+
homepage = "http://www.netlib.org/lapack/"
url = "http://www.netlib.org/lapack/lapack-3.5.0.tgz"
- version('3.8.0', '96591affdbf58c450d45c1daa540dbd2',
- url='http://www.netlib.org/lapack/lapack-3.8.0.tar.gz')
- version('3.7.1', 'dcdeeed73de152c4643ccc5b1aeb453c')
- version('3.7.0', '697bb8d67c7d336a0f339cc9dd0fa72f')
- version('3.6.1', '421b2cb72e15f237e144428f9c460ee0')
- version('3.6.0', 'f2f6c67134e851fe189bb3ca1fbb5101')
- version('3.5.0', 'b1d3e3e425b2e44a06760ff173104bdf')
- version('3.4.2', '61bf1a8a4469d4bdb7604f5897179478')
- version('3.4.1', '44c3869c38c8335c2b9c2a8bb276eb55')
- version('3.4.0', '02d5706ec03ba885fc246e5fa10d8c70')
- version('3.3.1', 'd0d533ec9a5b74933c2a1e84eedc58b4')
-
- variant('shared', default=True, description="Build shared library version")
- variant('external-blas', default=False,
- description='Build lapack with an external blas')
-
- variant('lapacke', default=True,
- description='Activates the build of the LAPACKE C interface')
- variant('xblas', default=False,
- description='Builds extended precision routines using XBLAS')
-
- patch('ibm-xl.patch', when='@3.7: %xl')
- patch('ibm-xl.patch', when='@3.7: %xl_r')
+ version(
+ "3.8.0",
+ "96591affdbf58c450d45c1daa540dbd2",
+ url="http://www.netlib.org/lapack/lapack-3.8.0.tar.gz",
+ )
+ version("3.7.1", "dcdeeed73de152c4643ccc5b1aeb453c")
+ version("3.7.0", "697bb8d67c7d336a0f339cc9dd0fa72f")
+ version("3.6.1", "421b2cb72e15f237e144428f9c460ee0")
+ version("3.6.0", "f2f6c67134e851fe189bb3ca1fbb5101")
+ version("3.5.0", "b1d3e3e425b2e44a06760ff173104bdf")
+ version("3.4.2", "61bf1a8a4469d4bdb7604f5897179478")
+ version("3.4.1", "44c3869c38c8335c2b9c2a8bb276eb55")
+ version("3.4.0", "02d5706ec03ba885fc246e5fa10d8c70")
+ version("3.3.1", "d0d533ec9a5b74933c2a1e84eedc58b4")
+
+ variant("shared", default=True, description="Build shared library version")
+ variant("external-blas", default=False, description="Build lapack with an external blas")
+
+ variant("lapacke", default=True, description="Activates the build of the LAPACKE C interface")
+ variant("xblas", default=False, description="Builds extended precision routines using XBLAS")
+
+ patch("ibm-xl.patch", when="@3.7: %xl")
+ patch("ibm-xl.patch", when="@3.7: %xl_r")
# https://github.com/Reference-LAPACK/lapack/issues/228
# TODO: update 'when' once the version of lapack
# containing the fix is released and added to Spack.
- patch('undefined_declarations.patch', when='@3.8.0:')
+ patch("undefined_declarations.patch", when="@3.8.0:")
# https://github.com/Reference-LAPACK/lapack/pull/268
# TODO: update 'when' once the version of lapack
# containing the fix is released and added to Spack.
- patch('testing.patch', when='@3.7.0:')
+ patch("testing.patch", when="@3.7.0:")
# virtual dependency
- provides('blas', when='~external-blas')
- provides('lapack')
+ provides("blas", when="~external-blas")
+ provides("lapack")
- depends_on('blas', when='+external-blas')
- depends_on('netlib-xblas+fortran+plain_blas', when='+xblas')
- depends_on('python@2.7:', type='test')
+ depends_on("blas", when="+external-blas")
+ depends_on("netlib-xblas+fortran+plain_blas", when="+xblas")
+ depends_on("python@2.7:", type="test")
# We need to run every phase twice in order to get static and shared
# versions of the libraries. When ~shared, we run the default
@@ -73,34 +74,34 @@ class NetlibLapack(CMakePackage):
def patch(self):
# Fix cblas CMakeLists.txt -- has wrong case for subdirectory name.
- if self.spec.satisfies('@3.6.0:'):
+ if self.spec.satisfies("@3.6.0:"):
filter_file(
- '${CMAKE_CURRENT_SOURCE_DIR}/CMAKE/',
- '${CMAKE_CURRENT_SOURCE_DIR}/cmake/',
- 'CBLAS/CMakeLists.txt', string=True)
+ "${CMAKE_CURRENT_SOURCE_DIR}/CMAKE/",
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/",
+ "CBLAS/CMakeLists.txt",
+ string=True,
+ )
@property
def blas_libs(self):
- shared = True if '+shared' in self.spec else False
+ shared = True if "+shared" in self.spec else False
query_parameters = self.spec.last_query.extra_parameters
query2libraries = {
- tuple(): ['libblas'],
- ('c', 'fortran'): [
- 'libcblas',
- 'libblas',
+ tuple(): ["libblas"],
+ ("c", "fortran"): [
+ "libcblas",
+ "libblas",
+ ],
+ ("c",): [
+ "libcblas",
],
- ('c',): [
- 'libcblas',
+ ("fortran",): [
+ "libblas",
],
- ('fortran',): [
- 'libblas',
- ]
}
key = tuple(sorted(query_parameters))
libraries = query2libraries[key]
- return find_libraries(
- libraries, root=self.prefix, shared=shared, recursive=True
- )
+ return find_libraries(libraries, root=self.prefix, shared=shared, recursive=True)
# TUTORIAL: add a proper `lapack_lib` property, along the lines
# of the `blas_lib` property above. The library that provides
@@ -109,78 +110,86 @@ class NetlibLapack(CMakePackage):
@property
def headers(self):
include_dir = self.spec.prefix.include
- cblas_h = join_path(include_dir, 'cblas.h')
- lapacke_h = join_path(include_dir, 'lapacke.h')
+ cblas_h = join_path(include_dir, "cblas.h")
+ lapacke_h = join_path(include_dir, "lapacke.h")
return HeaderList([cblas_h, lapacke_h])
@property
def build_directory(self):
- return join_path(self.stage.source_path,
- 'spack-build-shared' if self._building_shared
- else 'spack-build-static')
+ return join_path(
+ self.stage.source_path,
+ "spack-build-shared" if self._building_shared else "spack-build-static",
+ )
def cmake_args(self):
- args = ['-DBUILD_SHARED_LIBS:BOOL=' +
- ('ON' if self._building_shared else 'OFF')]
+ args = ["-DBUILD_SHARED_LIBS:BOOL=" + ("ON" if self._building_shared else "OFF")]
- if self.spec.satisfies('+lapacke'):
- args.extend(['-DLAPACKE:BOOL=ON', '-DLAPACKE_WITH_TMG:BOOL=ON'])
+ if self.spec.satisfies("+lapacke"):
+ args.extend(["-DLAPACKE:BOOL=ON", "-DLAPACKE_WITH_TMG:BOOL=ON"])
else:
- args.extend(['-DLAPACKE:BOOL=OFF', '-DLAPACKE_WITH_TMG:BOOL=OFF'])
+ args.extend(["-DLAPACKE:BOOL=OFF", "-DLAPACKE_WITH_TMG:BOOL=OFF"])
- if self.spec.satisfies('@3.6.0:'):
- args.append('-DCBLAS=ON') # always build CBLAS
+ if self.spec.satisfies("@3.6.0:"):
+ args.append("-DCBLAS=ON") # always build CBLAS
- if self.spec.satisfies('%intel'):
+ if self.spec.satisfies("%intel"):
# Intel compiler finds serious syntax issues when trying to
# build CBLAS and LapackE
- args.extend(['-DCBLAS=OFF', '-DLAPACKE:BOOL=OFF'])
+ args.extend(["-DCBLAS=OFF", "-DLAPACKE:BOOL=OFF"])
- if self.spec.satisfies('%xl') or self.spec.satisfies('%xl_r'):
+ if self.spec.satisfies("%xl") or self.spec.satisfies("%xl_r"):
# use F77 compiler if IBM XL
- args.extend(['-DCMAKE_Fortran_COMPILER=' + self.compiler.f77,
- '-DCMAKE_Fortran_FLAGS=' +
- (' '.join(self.spec.compiler_flags['fflags'])) +
- " -O3 -qnohot"])
+ args.extend(
+ [
+ "-DCMAKE_Fortran_COMPILER=" + self.compiler.f77,
+ "-DCMAKE_Fortran_FLAGS="
+ + (" ".join(self.spec.compiler_flags["fflags"]))
+ + " -O3 -qnohot",
+ ]
+ )
# deprecated routines are commonly needed by, for example, suitesparse
# Note that OpenBLAS spack is built with deprecated routines
- args.append('-DBUILD_DEPRECATED:BOOL=ON')
-
- if self.spec.satisfies('+external-blas'):
- args.extend(['-DUSE_OPTIMIZED_BLAS:BOOL=ON',
- '-DBLAS_LIBRARIES:PATH=' +
- self.spec['blas'].libs.joined(';')])
-
- if self.spec.satisfies('+xblas'):
- args.extend(['-DXBLAS_INCLUDE_DIR=' +
- self.spec['netlib-xblas'].prefix.include,
- '-DXBLAS_LIBRARY=' +
- self.spec['netlib-xblas'].libs.joined(';')])
-
- args.append('-DBUILD_TESTING:BOOL=' +
- ('ON' if self.run_tests else 'OFF'))
+ args.append("-DBUILD_DEPRECATED:BOOL=ON")
+
+ if self.spec.satisfies("+external-blas"):
+ args.extend(
+ [
+ "-DUSE_OPTIMIZED_BLAS:BOOL=ON",
+ "-DBLAS_LIBRARIES:PATH=" + self.spec["blas"].libs.joined(";"),
+ ]
+ )
+
+ if self.spec.satisfies("+xblas"):
+ args.extend(
+ [
+ "-DXBLAS_INCLUDE_DIR=" + self.spec["netlib-xblas"].prefix.include,
+ "-DXBLAS_LIBRARY=" + self.spec["netlib-xblas"].libs.joined(";"),
+ ]
+ )
+
+ args.append("-DBUILD_TESTING:BOOL=" + ("ON" if self.run_tests else "OFF"))
return args
# Build, install, and check both static and shared versions of the
# libraries when +shared
- @when('+shared')
+ @when("+shared")
def cmake(self, spec, prefix):
for self._building_shared in (False, True):
super(NetlibLapack, self).cmake(spec, prefix)
- @when('+shared')
+ @when("+shared")
def build(self, spec, prefix):
for self._building_shared in (False, True):
super(NetlibLapack, self).build(spec, prefix)
- @when('+shared')
+ @when("+shared")
def install(self, spec, prefix):
for self._building_shared in (False, True):
super(NetlibLapack, self).install(spec, prefix)
- @when('+shared')
+ @when("+shared")
def check(self):
for self._building_shared in (False, True):
super(NetlibLapack, self).check()