From eac95c866ab16983b0d1a5c00c64e895b3a6df3c Mon Sep 17 00:00:00 2001 From: iarspider Date: Mon, 1 Feb 2021 20:18:04 +0100 Subject: [PATCH] FastJet: add optional patch to make random generator thread-local (#21395) --- .../builtin/packages/fastjet/atlas.patch | 22 +++++++++++++++++++ .../repos/builtin/packages/fastjet/package.py | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 var/spack/repos/builtin/packages/fastjet/atlas.patch 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 _random_checkpoint; +- static BasicRandom _random_generator; ++ thread_local static BasicRandom _random_generator; + //mutable BasicRandom _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 GhostedAreaSpec::_random_generator; ++thread_local BasicRandom 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"]