summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomoki, Karatsu <49965247+t-karatsu@users.noreply.github.com>2020-12-27 21:41:37 +0900
committerGitHub <noreply@github.com>2020-12-27 13:41:37 +0100
commit95f63b506c0a497b2c2b9b17a42caeb092d35072 (patch)
treebfaa9bd8f1d0fb069a3449183c964378ff8cf8a3
parent0a241b241429f77b2f3ad9e3735d2cb4050686b9 (diff)
downloadspack-95f63b506c0a497b2c2b9b17a42caeb092d35072.tar.gz
spack-95f63b506c0a497b2c2b9b17a42caeb092d35072.tar.bz2
spack-95f63b506c0a497b2c2b9b17a42caeb092d35072.tar.xz
spack-95f63b506c0a497b2c2b9b17a42caeb092d35072.zip
openfoam: expand 'make_fujitsu_rules' process for Ver.1812. (#20468)
-rw-r--r--var/spack/repos/builtin/packages/openfoam/package.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/openfoam/package.py b/var/spack/repos/builtin/packages/openfoam/package.py
index 982cca7633..9ccb39577b 100644
--- a/var/spack/repos/builtin/packages/openfoam/package.py
+++ b/var/spack/repos/builtin/packages/openfoam/package.py
@@ -549,11 +549,11 @@ class Openfoam(Package):
rcfile,
backup=False)
- @when('@1906: %fj')
+ @when('@1812: %fj')
@run_before('configure')
def make_fujitsu_rules(self):
"""Create Fujitsu rules (clang variant) unless supplied upstream.
- Implemented for 1906 and later (older rules are too messy to edit).
+ Implemented for 1812 and later (older rules are too messy to edit).
Already included after 1912.
"""
general_rules = 'wmake/rules/General'
@@ -574,15 +574,22 @@ class Openfoam(Package):
tty.info('Add Fujitsu wmake rules')
copy_tree(src, dst)
- for cfg in ['c', 'c++', 'general']:
- rule = join_path(dst, cfg)
- filter_file('Clang', 'Fujitsu', rule, backup=False)
+ if self.spec.version >= Version('1906'):
+ for cfg in ['c', 'c++', 'general']:
+ rule = join_path(dst, cfg)
+ filter_file('Clang', 'Fujitsu', rule, backup=False)
+ else:
+ filter_file('clang', spack_cc, join_path(dst, 'c'),
+ backup=False, string=True)
+ filter_file('clang++', spack_cxx, join_path(dst, 'c++'),
+ backup=False, string=True)
src = join_path(general_rules, 'Clang')
dst = join_path(general_rules, 'Fujitsu') # self.compiler
copy_tree(src, dst)
- filter_file('clang', spack_cc, join_path(dst, 'c'),
- backup=False, string=True)
+ if self.spec.version >= Version('1906'):
+ filter_file('clang', spack_cc, join_path(dst, 'c'),
+ backup=False, string=True)
filter_file('clang++', spack_cxx, join_path(dst, 'c++'),
backup=False, string=True)