From 730fbae463589816ffec55bc9db75949b8e68688 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 21 Apr 2021 22:17:08 +0200 Subject: [PATCH] Disable multithreaded version of zstd by default (#23167) * Disable multithreaded version of zstd by default * zstd pthreads by default again! but configurable, and turned off in GCC --- var/spack/repos/builtin/packages/gcc/package.py | 5 ++++- var/spack/repos/builtin/packages/zstd/package.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index c1f5393bf1..d584568b8b 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -122,7 +122,10 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage): depends_on('isl@0.15:0.20', when='@9:9.9 +graphite') depends_on('isl@0.15:', when='@10: +graphite') depends_on('zlib', when='@6:') - depends_on('zstd', when='@10:') + # GCC only tries to link with -lzstd but it requires + # -pthread too when linking against libzstd.a, so + # disable multithreading by default + depends_on('zstd ~multithread', when='@10:') depends_on('diffutils', type='build') depends_on('iconv', when='platform=darwin') depends_on('gnat', when='languages=ada') diff --git a/var/spack/repos/builtin/packages/zstd/package.py b/var/spack/repos/builtin/packages/zstd/package.py index 9a5d519faf..ca696279a7 100644 --- a/var/spack/repos/builtin/packages/zstd/package.py +++ b/var/spack/repos/builtin/packages/zstd/package.py @@ -39,6 +39,7 @@ class Zstd(CMakePackage): variant('zlib', default=False, description='Build programs with zlib support') variant('lzma', default=False, description='Build programs with lzma support') variant('lz4', default=False, description='Build programs with zlib support') + variant('multithread', default=True, description='Build with pthread support') conflicts('+zlib', when='~programs', msg="zlib requires programs to be built") conflicts('+lzma', when='~programs', msg="lzma requires programs to be built") @@ -53,5 +54,6 @@ def cmake_args(self): self.define_from_variant('ZSTD_BUILD_PROGRAMS', 'programs'), self.define_from_variant('ZSTD_BUILD_STATIC', 'static'), self.define_from_variant('ZSTD_BUILD_SHARED', 'shared'), - self.define_from_variant('ZSTD_LEGACY_SUPPORT', 'legacy') + self.define_from_variant('ZSTD_LEGACY_SUPPORT', 'legacy'), + self.define_from_variant('ZSTD_MULTITHREAD_SUPPORT', 'multithread') ]