diff --git a/var/spack/repos/builtin/packages/openfoam/package.py b/var/spack/repos/builtin/packages/openfoam/package.py index 126de81f642..b2ae17610e4 100644 --- a/var/spack/repos/builtin/packages/openfoam/package.py +++ b/var/spack/repos/builtin/packages/openfoam/package.py @@ -405,10 +405,7 @@ def setup_minimal_environment(self, env): 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 @@ def patch(self): 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 @@ def make_fujitsu_rules(self): 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