summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth R. Johnson <johnsonsr@ornl.gov>2024-03-15 14:22:08 -0400
committerGitHub <noreply@github.com>2024-03-15 12:22:08 -0600
commit968ad02473b12f6305cc1fe19f2a0d706f171154 (patch)
tree79db35ad9761ded198f7d7494a06e6c263b6f566
parentb93882804f537f308930a86e771ca97781b45bfd (diff)
downloadspack-968ad02473b12f6305cc1fe19f2a0d706f171154.tar.gz
spack-968ad02473b12f6305cc1fe19f2a0d706f171154.tar.bz2
spack-968ad02473b12f6305cc1fe19f2a0d706f171154.tar.xz
spack-968ad02473b12f6305cc1fe19f2a0d706f171154.zip
geant4: patch old versions to work on new compiler/ubuntu (#43212)
* geant4: patch old version for %clang@15 * Backport ascii-V10-07-03 * Apply to all compilers, but only for 10.5-10.6
-rw-r--r--var/spack/repos/builtin/packages/geant4/geant4-10.6.patch98
-rw-r--r--var/spack/repos/builtin/packages/geant4/package.py3
2 files changed, 101 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/geant4/geant4-10.6.patch b/var/spack/repos/builtin/packages/geant4/geant4-10.6.patch
new file mode 100644
index 0000000000..81e8be34ff
--- /dev/null
+++ b/var/spack/repos/builtin/packages/geant4/geant4-10.6.patch
@@ -0,0 +1,98 @@
+From b19a720a77d6661662f5dd440d9bb7fb6dadd9fb Mon Sep 17 00:00:00 2001
+From: Seth R Johnson <johnsonsr@ornl.gov>
+Date: Wed, 13 Mar 2024 14:43:37 -0400
+Subject: [PATCH] Backport ascii-V10-07-03
+
+---
+ .../persistency/ascii/src/G4tgrEvaluator.cc | 72 +++++++++----------
+ 1 file changed, 36 insertions(+), 36 deletions(-)
+
+diff --git a/source/persistency/ascii/src/G4tgrEvaluator.cc b/source/persistency/ascii/src/G4tgrEvaluator.cc
+index 9447ede9910..f20f3ca3404 100644
+--- a/source/persistency/ascii/src/G4tgrEvaluator.cc
++++ b/source/persistency/ascii/src/G4tgrEvaluator.cc
+@@ -63,45 +63,45 @@ void G4tgrEvaluator::print_error( G4int estatus ) const
+ }
+ }
+
+-G4double fsin( G4double arg ){ return std::sin(arg); }
+-G4double fcos( G4double arg ){ return std::cos(arg); }
+-G4double ftan( G4double arg ){ return std::tan(arg); }
+-G4double fasin( G4double arg ){ return std::asin(arg); }
+-G4double facos( G4double arg ){ return std::acos(arg); }
+-G4double fatan( G4double arg ){ return std::atan(arg); }
+-G4double fatan2( G4double arg1, G4double arg2 ){ return std::atan2(arg1,arg2); }
+-G4double fsinh( G4double arg ){ return std::sinh(arg); }
+-G4double fcosh( G4double arg ){ return std::cosh(arg); }
+-G4double ftanh( G4double arg ){ return std::tanh(arg); }
+-// G4double fasinh( G4double arg ){ return std::asinh(arg); }
+-// G4double facosh( G4double arg ){ return std::acosh(arg); }
+-// G4double fatanh( G4double arg ){ return std::atanh(arg); }
+-G4double fsqrt( G4double arg ){ return std::sqrt(arg); }
+-G4double fexp( G4double arg ){ return std::exp(arg); }
+-G4double flog( G4double arg ){ return std::log(arg); }
+-G4double flog10( G4double arg ){ return std::log10(arg); }
+-G4double fpow( G4double arg1, G4double arg2 ){ return std::pow(arg1,arg2); }
++G4double fltsin( G4double arg ){ return std::sin(arg); }
++G4double fltcos( G4double arg ){ return std::cos(arg); }
++G4double flttan( G4double arg ){ return std::tan(arg); }
++G4double fltasin( G4double arg ){ return std::asin(arg); }
++G4double fltacos( G4double arg ){ return std::acos(arg); }
++G4double fltatan( G4double arg ){ return std::atan(arg); }
++G4double fltatan2( G4double arg1, G4double arg2 ){ return std::atan2(arg1,arg2); }
++G4double fltsinh( G4double arg ){ return std::sinh(arg); }
++G4double fltcosh( G4double arg ){ return std::cosh(arg); }
++G4double flttanh( G4double arg ){ return std::tanh(arg); }
++// G4double fltasinh( G4double arg ){ return std::asinh(arg); }
++// G4double fltacosh( G4double arg ){ return std::acosh(arg); }
++// G4double fltatanh( G4double arg ){ return std::atanh(arg); }
++G4double fltsqrt( G4double arg ){ return std::sqrt(arg); }
++G4double fltexp( G4double arg ){ return std::exp(arg); }
++G4double fltlog( G4double arg ){ return std::log(arg); }
++G4double fltlog10( G4double arg ){ return std::log10(arg); }
++G4double fltpow( G4double arg1, G4double arg2 ){ return std::pow(arg1,arg2); }
+
+
+ //--------------------------------------------------------------------
+ void G4tgrEvaluator::AddCommonFunctions()
+ {
+- setFunction("sin", (*fsin));
+- setFunction("cos", (*fcos));
+- setFunction("tan", (*ftan));
+- setFunction("asin", (*fasin));
+- setFunction("acos", (*facos));
+- setFunction("atan", (*fatan));
+- setFunction("atan2", (*fatan2));
+- setFunction("sinh", (*fsinh));
+- setFunction("cosh", (*fcosh));
+- setFunction("tanh", (*ftanh));
+-// setFunction("asinh", (*fasinh));
+-// setFunction("acosh", (*facosh));
+-// setFunction("atanh", (*fatanh));
+- setFunction("sqrt", (*fsqrt));
+- setFunction("exp", (*fexp));
+- setFunction("log", (*flog));
+- setFunction("log10", (*flog10));
+- setFunction("pow", (*fpow));
++ setFunction("sin", (*fltsin));
++ setFunction("cos", (*fltcos));
++ setFunction("tan", (*flttan));
++ setFunction("asin", (*fltasin));
++ setFunction("acos", (*fltacos));
++ setFunction("atan", (*fltatan));
++ setFunction("atan2", (*fltatan2));
++ setFunction("sinh", (*fltsinh));
++ setFunction("cosh", (*fltcosh));
++ setFunction("tanh", (*flttanh));
++// setFunction("asinh", (*fltasinh));
++// setFunction("acosh", (*fltacosh));
++// setFunction("atanh", (*fltatanh));
++ setFunction("sqrt", (*fltsqrt));
++ setFunction("exp", (*fltexp));
++ setFunction("log", (*fltlog));
++ setFunction("log10", (*fltlog10));
++ setFunction("pow", (*fltpow));
+ }
+--
+2.43.0
+
diff --git a/var/spack/repos/builtin/packages/geant4/package.py b/var/spack/repos/builtin/packages/geant4/package.py
index c17322d34e..b6d1400422 100644
--- a/var/spack/repos/builtin/packages/geant4/package.py
+++ b/var/spack/repos/builtin/packages/geant4/package.py
@@ -160,6 +160,9 @@ class Geant4(CMakePackage):
# As released, 10.03.03 has issues with respect to using external
# CLHEP.
patch("CLHEP-10.03.03.patch", level=1, when="@10.3")
+ # Build failure on clang 15, ubuntu 22: see Geant4 problem report #2444
+ # fixed by ascii-V10-07-03
+ patch("geant4-10.6.patch", level=1, when="@10.5:10.6")
# These patches can be applied independent of the cxxstd value?
patch("cxx17.patch", when="@10.3 cxxstd=17")
patch("cxx17_geant4_10_0.patch", level=1, when="@10.4.0 cxxstd=17")