diff options
author | Guilherme Amadio <amadio@gentoo.org> | 2020-11-18 17:40:02 +0100 |
---|---|---|
committer | Guilherme Amadio <amadio@gentoo.org> | 2020-11-18 17:47:23 +0100 |
commit | 803b6b6c292eaf58bed226d51e087abf1f35fd59 (patch) | |
tree | 7aeb6cc8619daf9ef9e8e210ff39b431fd852a12 /sci-physics/clhep | |
parent | dev-python/botocore: Remove old (diff) | |
download | gentoo-803b6b6c292eaf58bed226d51e087abf1f35fd59.tar.gz gentoo-803b6b6c292eaf58bed226d51e087abf1f35fd59.tar.bz2 gentoo-803b6b6c292eaf58bed226d51e087abf1f35fd59.zip |
sci-physics/clhep: fix bug 657966
Closes: https://bugs.gentoo.org/657966
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Guilherme Amadio <amadio@gentoo.org>
Diffstat (limited to 'sci-physics/clhep')
-rw-r--r-- | sci-physics/clhep/clhep-2.4.1.3-r1.ebuild | 2 | ||||
-rw-r--r-- | sci-physics/clhep/clhep-2.4.4.0.ebuild | 2 | ||||
-rw-r--r-- | sci-physics/clhep/files/clhep-fix-testThreaded.patch | 90 |
3 files changed, 94 insertions, 0 deletions
diff --git a/sci-physics/clhep/clhep-2.4.1.3-r1.ebuild b/sci-physics/clhep/clhep-2.4.1.3-r1.ebuild index cfc4c3b20e1d..59a7053f2144 100644 --- a/sci-physics/clhep/clhep-2.4.1.3-r1.ebuild +++ b/sci-physics/clhep/clhep-2.4.1.3-r1.ebuild @@ -26,6 +26,8 @@ BDEPEND=" ) " +PATCHES=( "${FILESDIR}"/clhep-fix-testThreaded.patch ) + S="${WORKDIR}/${PV}/CLHEP" src_prepare() { diff --git a/sci-physics/clhep/clhep-2.4.4.0.ebuild b/sci-physics/clhep/clhep-2.4.4.0.ebuild index 6195dd380616..3d785fcc1662 100644 --- a/sci-physics/clhep/clhep-2.4.4.0.ebuild +++ b/sci-physics/clhep/clhep-2.4.4.0.ebuild @@ -26,6 +26,8 @@ BDEPEND=" ) " +PATCHES=( "${FILESDIR}"/clhep-fix-testThreaded.patch ) + S="${WORKDIR}/${PV}/CLHEP" src_prepare() { diff --git a/sci-physics/clhep/files/clhep-fix-testThreaded.patch b/sci-physics/clhep/files/clhep-fix-testThreaded.patch new file mode 100644 index 000000000000..58010dc726da --- /dev/null +++ b/sci-physics/clhep/files/clhep-fix-testThreaded.patch @@ -0,0 +1,90 @@ +From 849f0250076ac3cce672e925c232bd6b96a018e0 Mon Sep 17 00:00:00 2001 +From: Guilherme Amadio <amadio@cern.ch> +Date: Wed, 18 Nov 2020 17:33:17 +0100 +Subject: [PATCH] Fix testThreaded on x86 + +--- + Random/test/testThreaded.cc | 53 ++++++++++++++++++++++++++----------- + 1 file changed, 38 insertions(+), 15 deletions(-) + +diff --git a/Random/test/testThreaded.cc b/Random/test/testThreaded.cc +index a835ce19..0a6352c3 100644 +--- a/Random/test/testThreaded.cc ++++ b/Random/test/testThreaded.cc +@@ -65,23 +65,38 @@ void testRandGauss(std::vector<double> const& reference, bool& result) { + + result = true; + ++ std::vector<double> v; ++ v.push_back(dist.fire()); ++ v.push_back(dist.fire()); ++ v.push_back(dist.fire()); ++ v.push_back(dist.fire()); ++ v.push_back(dist.fire()); ++ + // Just a sanity check first. The fire method reproduces + // itself. +- if (reference[0] != dist.fire() || +- reference[1] != dist.fire() || +- reference[2] != dist.fire() || +- reference[3] != dist.fire() || +- reference[4] != dist.fire()) { ++ if (reference[0] != v[0] || ++ reference[1] != v[1] || ++ reference[2] != v[2] || ++ reference[3] != v[3] || ++ reference[4] != v[4]) { + result = false; + } + + // check the shoot method where we pass in an engine + CLHEP::HepJamesRandom engine1(seedL1); +- if (reference[0] != CLHEP::RandGauss::shoot(&engine1) || +- reference[1] != CLHEP::RandGauss::shoot(&engine1) || +- reference[2] != CLHEP::RandGauss::shoot(&engine1) || +- reference[3] != CLHEP::RandGauss::shoot(&engine1) || +- reference[4] != CLHEP::RandGauss::shoot(&engine1)) { ++ ++ v.clear(); ++ v.push_back(CLHEP::RandGauss::shoot(&engine1)); ++ v.push_back(CLHEP::RandGauss::shoot(&engine1)); ++ v.push_back(CLHEP::RandGauss::shoot(&engine1)); ++ v.push_back(CLHEP::RandGauss::shoot(&engine1)); ++ v.push_back(CLHEP::RandGauss::shoot(&engine1)); ++ ++ if (reference[0] != v[0] || ++ reference[1] != v[1] || ++ reference[2] != v[2] || ++ reference[3] != v[3] || ++ reference[4] != v[4]) { + result = false; + } + +@@ -93,11 +108,19 @@ void testRandGauss(std::vector<double> const& reference, bool& result) { + // setFlag causes it to not use the cached value + // and generate a new pair of random numbers + CLHEP::RandGauss::setFlag(false); +- if (reference[0] != CLHEP::RandGauss::shoot() || +- reference[1] != CLHEP::RandGauss::shoot() || +- reference[2] != CLHEP::RandGauss::shoot() || +- reference[3] != CLHEP::RandGauss::shoot() || +- reference[4] != CLHEP::RandGauss::shoot()) { ++ ++ v.clear(); ++ v.push_back(CLHEP::RandGauss::shoot()); ++ v.push_back(CLHEP::RandGauss::shoot()); ++ v.push_back(CLHEP::RandGauss::shoot()); ++ v.push_back(CLHEP::RandGauss::shoot()); ++ v.push_back(CLHEP::RandGauss::shoot()); ++ ++ if (reference[0] != v[0] || ++ reference[1] != v[1] || ++ reference[2] != v[2] || ++ reference[3] != v[3] || ++ reference[4] != v[4]) { + result = false; + } + CLHEP::HepRandom::setTheEngine(savedEngine); +-- +2.29.2 + |