Skip to content

Commit c095190

Browse files
create FCC subtoolchain for Fujitsu Compiler only, move FujitsuSSL from ffmpi to Fujitsu full toolchain
1 parent f4f26c2 commit c095190

File tree

4 files changed

+89
-8
lines changed

4 files changed

+89
-8
lines changed

easybuild/toolchains/compiler/fujitsu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class FujitsuCompiler(Compiler):
8585
def _set_compiler_vars(self):
8686
super(FujitsuCompiler, self)._set_compiler_vars()
8787

88-
# enable clang compatibility mode; moved to compiler constants to make sure it is always used
88+
# enable clang compatibility mode
89+
# moved to compiler constants to make sure it is always used
8990
# self.variables.nappend('CFLAGS', ['Nclang'])
9091
# self.variables.nappend('CXXFLAGS', ['Nclang'])

easybuild/toolchains/fcc.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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)

easybuild/toolchains/ffmpi.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
2424
##
2525
"""
26-
EasyBuild support for ffmpi compiler toolchain (includes Fujitsu Compiler, MPI and Scientific Libraries).
26+
EasyBuild support for ffmpi compiler toolchain (includes Fujitsu Compiler and MPI).
2727
2828
:author: Miguel Dias Costa (National University of Singapore)
2929
"""
30-
from easybuild.toolchains.compiler.fujitsu import FujitsuCompiler
31-
from easybuild.toolchains.linalg.fujitsussl import FujitsuSSL
30+
from easybuild.toolchains.fcc import FCC
3231
from easybuild.toolchains.mpi.fujitsumpi import FujitsuMPI
3332

3433

35-
class Ffmpi(FujitsuCompiler, FujitsuMPI, FujitsuSSL):
36-
"""Compiler toolchain with Fujitsu Compiler, MPI and Scientific Libraries."""
34+
class Ffmpi(FCC, FujitsuMPI):
35+
"""Compiler toolchain with Fujitsu Compiler and MPI."""
3736
NAME = 'ffmpi'
38-
SUBTOOLCHAIN = FujitsuCompiler.NAME
37+
SUBTOOLCHAIN = FCC.NAME
38+
COMPILER_MODULE_NAME = [FCC.NAME]

easybuild/toolchains/fujitsu.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929
"""
3030
from easybuild.toolchains.ffmpi import Ffmpi
3131
from easybuild.toolchains.fft.fujitsufftw import FujitsuFFTW
32+
from easybuild.toolchains.linalg.fujitsussl import FujitsuSSL
3233

3334

34-
class Fujitsu(Ffmpi, FujitsuFFTW):
35+
class Fujitsu(Ffmpi, FujitsuFFTW, FujitsuSSL):
3536
"""Compiler toolchain for Fujitsu."""
3637
NAME = 'Fujitsu'
3738
SUBTOOLCHAIN = Ffmpi.NAME
39+
COMPILER_MODULE_NAME = []

0 commit comments

Comments
 (0)