summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/openfoam/package.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/openfoam/package.py b/var/spack/repos/builtin/packages/openfoam/package.py
index 126de81f64..b2ae17610e 100644
--- a/var/spack/repos/builtin/packages/openfoam/package.py
+++ b/var/spack/repos/builtin/packages/openfoam/package.py
@@ -405,10 +405,7 @@ class Openfoam(Package):
def setup_build_environment(self, env):
"""Sets the build environment (prior to unpacking the sources).
"""
- # Avoid the exception that occurs at runtime
- # when building with the Fujitsu compiler.
- if self.spec.satisfies('%fj'):
- env.set('FOAM_SIGFPE', 'false')
+ pass
def setup_run_environment(self, env):
"""Sets the run environment (post-installation).
@@ -549,6 +546,16 @@ class Openfoam(Package):
rcfile,
backup=False)
+ def configure_trapFpe_off(self):
+ """Disable trapFpe handling.
+ Seems to be needed for several clang-derivatives.
+ """
+ # Set 'trapFpe 0' in etc/controlDict
+ controlDict = 'etc/controlDict'
+ if os.path.exists(controlDict):
+ filter_file(r'trapFpe\s+\d+\s*;', 'trapFpe 0;',
+ controlDict, backup=False)
+
@when('@1812: %fj')
@run_before('configure')
def make_fujitsu_rules(self):
@@ -560,6 +567,7 @@ class Openfoam(Package):
arch_rules = 'wmake/rules/linuxARM64' # self.arch
src = arch_rules + 'Clang'
dst = arch_rules + 'Fujitsu' # self.compiler
+ self.configure_trapFpe_off() # LLVM may falsely trigger FPE
if os.path.exists(dst):
return