summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/fastjet
diff options
context:
space:
mode:
authoriarspider <iarspider@gmail.com>2021-02-01 20:18:04 +0100
committerGitHub <noreply@github.com>2021-02-01 11:18:04 -0800
commiteac95c866ab16983b0d1a5c00c64e895b3a6df3c (patch)
tree69f6513c0729f0f21ccca2ef95397fc5e4c17c3c /var/spack/repos/builtin/packages/fastjet
parentb597cbe1c0c1b9058a8f72e2222d1f550c671a95 (diff)
downloadspack-eac95c866ab16983b0d1a5c00c64e895b3a6df3c.tar.gz
spack-eac95c866ab16983b0d1a5c00c64e895b3a6df3c.tar.bz2
spack-eac95c866ab16983b0d1a5c00c64e895b3a6df3c.tar.xz
spack-eac95c866ab16983b0d1a5c00c64e895b3a6df3c.zip
FastJet: add optional patch to make random generator thread-local (#21395)
Diffstat (limited to 'var/spack/repos/builtin/packages/fastjet')
-rw-r--r--var/spack/repos/builtin/packages/fastjet/atlas.patch22
-rw-r--r--var/spack/repos/builtin/packages/fastjet/package.py3
2 files changed, 25 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/fastjet/atlas.patch b/var/spack/repos/builtin/packages/fastjet/atlas.patch
new file mode 100644
index 0000000000..66b9cc1d1f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/fastjet/atlas.patch
@@ -0,0 +1,22 @@
+--- include/fastjet/GhostedAreaSpec.hh.orig 2020-06-03 13:15:12.952183980 +0200
++++ include/fastjet/GhostedAreaSpec.hh 2020-06-03 13:16:00.676275264 +0200
+@@ -232,7 +232,7 @@
+
+
+ std::vector<int> _random_checkpoint;
+- static BasicRandom<double> _random_generator;
++ thread_local static BasicRandom<double> _random_generator;
+ //mutable BasicRandom<double> _random_generator;
+
+ static LimitedWarning _warn_fj2_placement_deprecated;
+--- src/GhostedAreaSpec.cc.orig 2020-06-04 11:37:41.196758510 +0200
++++ src/GhostedAreaSpec.cc 2020-06-04 11:38:07.499240761 +0200
+@@ -37,7 +37,7 @@
+
+ FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
+
+-BasicRandom<double> GhostedAreaSpec::_random_generator;
++thread_local BasicRandom<double> GhostedAreaSpec::_random_generator;
+ LimitedWarning GhostedAreaSpec::_warn_fj2_placement_deprecated;
+
+ /// explicit constructor
diff --git a/var/spack/repos/builtin/packages/fastjet/package.py b/var/spack/repos/builtin/packages/fastjet/package.py
index b6aec4d8e8..ea2bb05c3e 100644
--- a/var/spack/repos/builtin/packages/fastjet/package.py
+++ b/var/spack/repos/builtin/packages/fastjet/package.py
@@ -52,6 +52,9 @@ class Fastjet(AutotoolsPackage):
variant('shared', default=True, description='Builds a shared version of the library')
variant('auto-ptr', default=False, description='Use auto_ptr')
+ variant('atlas', default=False, description='Patch to make random generator thread_local')
+
+ patch('atlas.patch', when='+atlas')
def configure_args(self):
extra_args = ["--enable-allplugins"]