Skip to content

Commit 3493861

Browse files
committed
simplify FCC toolchain by using inheritance of new Toolchain._add_dependency_cpp_headers method
1 parent 079f202 commit 3493861

File tree

1 file changed

+6
-35
lines changed

1 file changed

+6
-35
lines changed

easybuild/toolchains/fcc.py

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -40,39 +40,10 @@ class FCC(FujitsuCompiler):
4040
OPTIONAL = False
4141

4242
# override in order to add an exception for the Fujitsu lang/tcsds module
43-
def _add_dependency_variables(self, names=None, cpp=None, ld=None):
44-
""" Add LDFLAGS and CPPFLAGS to the self.variables based on the dependencies
45-
names should be a list of strings containing the name of the dependency
43+
def _add_dependency_cpp_headers(self, dep_root, extra_dirs=None):
4644
"""
47-
cpp_paths = ['include']
48-
ld_paths = ['lib64', 'lib']
49-
50-
if cpp is not None:
51-
for p in cpp:
52-
if p not in cpp_paths:
53-
cpp_paths.append(p)
54-
if ld is not None:
55-
for p in ld:
56-
if p not in ld_paths:
57-
ld_paths.append(p)
58-
59-
if not names:
60-
deps = self.dependencies
61-
else:
62-
deps = [{'name': name} for name in names if name is not None]
63-
64-
# collect software install prefixes for dependencies
65-
roots = []
66-
for dep in deps:
67-
if dep.get('external_module', False):
68-
# for software names provided via external modules, install prefix may be unknown
69-
names = dep['external_module_metadata'].get('name', [])
70-
roots.extend([root for root in self.get_software_root(names) if root is not None])
71-
else:
72-
roots.extend(self.get_software_root(dep['name']))
73-
74-
for root in roots:
75-
# skip Fujitsu's 'lang/tcsds' module, including the top level include breaks vectorization in clang mode
76-
if 'tcsds' not in root:
77-
self.variables.append_subdirs("CPPFLAGS", root, subdirs=cpp_paths)
78-
self.variables.append_subdirs("LDFLAGS", root, subdirs=ld_paths)
45+
Append prepocessor paths for given dependency root directory
46+
"""
47+
# skip Fujitsu's 'lang/tcsds' module, including the top level include breaks vectorization in clang mode
48+
if "tcsds" not in dep_root:
49+
super()._add_dependency_cpp_headers(dep_root, extra_dirs=extra_dirs)

0 commit comments

Comments
 (0)