|
| 1 | +## |
| 2 | +# Copyright 2012-2021 Ghent University |
| 3 | +# |
| 4 | +# This file is part of EasyBuild, |
| 5 | +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), |
| 6 | +# with support of Ghent University (http://ugent.be/hpc), |
| 7 | +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), |
| 8 | +# Flemish Research Foundation (FWO) (http://www.fwo.be/en) |
| 9 | +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). |
| 10 | +# |
| 11 | +# https://github.com/easybuilders/easybuild |
| 12 | +# |
| 13 | +# EasyBuild is free software: you can redistribute it and/or modify |
| 14 | +# it under the terms of the GNU General Public License as published by |
| 15 | +# the Free Software Foundation v2. |
| 16 | +# |
| 17 | +# EasyBuild is distributed in the hope that it will be useful, |
| 18 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | +# GNU General Public License for more details. |
| 21 | +# |
| 22 | +# You should have received a copy of the GNU General Public License |
| 23 | +# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. |
| 24 | +## |
| 25 | +""" |
| 26 | +EasyBuild support for Fujitsu Compiler toolchain. |
| 27 | +
|
| 28 | +:author: Miguel Dias Costa (National University of Singapore) |
| 29 | +""" |
| 30 | +from easybuild.toolchains.compiler.fujitsu import FujitsuCompiler |
| 31 | +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME |
| 32 | + |
| 33 | + |
| 34 | +class FCC(FujitsuCompiler): |
| 35 | + """Compiler toolchain with Fujitsu Compiler.""" |
| 36 | + NAME = 'FCC' |
| 37 | + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME |
| 38 | + OPTIONAL = False |
| 39 | + |
| 40 | + # override in order to add an exception for the Fujitsu lang/tcsds module |
| 41 | + def _add_dependency_variables(self, names=None, cpp=None, ld=None): |
| 42 | + """ Add LDFLAGS and CPPFLAGS to the self.variables based on the dependencies |
| 43 | + names should be a list of strings containing the name of the dependency |
| 44 | + """ |
| 45 | + cpp_paths = ['include'] |
| 46 | + ld_paths = ['lib'] |
| 47 | + if not self.options.get('32bit', None): |
| 48 | + ld_paths.insert(0, 'lib64') |
| 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) |
0 commit comments