-
Notifications
You must be signed in to change notification settings - Fork 211
add toolchain definition for Fujitsu ARM toolchain #3677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d8cacd
add toolchain definition for fujitsu toolchain
migueldiascosta 12f6d79
code cleanup
migueldiascosta 2138971
make sure fcc is always called with -Nclang and enhance COMPILER_UNIQ…
migueldiascosta fc3c24e
use more conservative optimization levels
migueldiascosta f4f26c2
make sure linalg lib and include dirs are not set by easybuild, compi…
migueldiascosta c095190
create FCC subtoolchain for Fujitsu Compiler only, move FujitsuSSL fr…
migueldiascosta 558487e
fix typo in comment
migueldiascosta 63cea59
make sure the top level fujitsu library dir is found by the rpath wra…
migueldiascosta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
## | ||
# Copyright 2014-2021 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), | ||
# Flemish Research Foundation (FWO) (http://www.fwo.be/en) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# https://github.com/easybuilders/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
Support for the Fujitsu compiler drivers (aka fcc, frt). | ||
|
||
The basic concept is the same as for the Cray Programming Environment. | ||
|
||
:author: Miguel Dias Costa (National University of Singapore) | ||
""" | ||
import os | ||
|
||
import easybuild.tools.environment as env | ||
import easybuild.tools.systemtools as systemtools | ||
from easybuild.tools.toolchain.compiler import Compiler, DEFAULT_OPT_LEVEL | ||
|
||
TC_CONSTANT_FUJITSU = 'Fujitsu' | ||
TC_CONSTANT_MODULE_NAME = 'lang' | ||
TC_CONSTANT_MODULE_VAR = 'FJSVXTCLANGA' | ||
|
||
|
||
class FujitsuCompiler(Compiler): | ||
"""Generic support for using Fujitsu compiler drivers.""" | ||
TOOLCHAIN_FAMILY = TC_CONSTANT_FUJITSU | ||
|
||
COMPILER_MODULE_NAME = [TC_CONSTANT_MODULE_NAME] | ||
COMPILER_FAMILY = TC_CONSTANT_FUJITSU | ||
|
||
# make sure fcc is always called in clang compatibility mode | ||
COMPILER_CC = 'fcc -Nclang' | ||
COMPILER_CXX = 'FCC -Nclang' | ||
|
||
COMPILER_F77 = 'frt' | ||
COMPILER_F90 = 'frt' | ||
COMPILER_FC = 'frt' | ||
|
||
COMPILER_UNIQUE_OPTION_MAP = { | ||
DEFAULT_OPT_LEVEL: 'O2', | ||
'lowopt': 'O1', | ||
'noopt': 'O0', | ||
'opt': 'Kfast', # -O3 -Keval,fast_matmul,fp_contract,fp_relaxed,fz,ilfunc,mfunc,omitfp,simd_packed_promotion | ||
'optarch': '', # Fujitsu compiler by default generates code for the arch it is running on | ||
'openmp': 'Kopenmp', | ||
'unroll': 'funroll-loops', | ||
# apparently the -Kfp_precision flag doesn't work in clang mode, will need to look into these later | ||
# also at strict vs precise and loose vs veryloose | ||
'strict': ['Knoeval,nofast_matmul,nofp_contract,nofp_relaxed,noilfunc'], # ['Kfp_precision'], | ||
'precise': ['Knoeval,nofast_matmul,nofp_contract,nofp_relaxed,noilfunc'], # ['Kfp_precision'], | ||
'defaultprec': [], | ||
'loose': ['Kfp_relaxed'], | ||
'veryloose': ['Kfp_relaxed'], | ||
# apparently the -K[NO]SVE flags don't work in clang mode | ||
# SVE is enabled by default, -Knosimd seems to disable it | ||
'vectorize': {False: 'Knosimd', True: ''}, | ||
} | ||
|
||
# used when 'optarch' toolchain option is enabled (and --optarch is not specified) | ||
COMPILER_OPTIMAL_ARCHITECTURE_OPTION = { | ||
# -march=archi[+features]. At least on Fugaku, these are set by default (-march=armv8.3-a+sve and -mcpu=a64fx) | ||
(systemtools.AARCH64, systemtools.ARM): '', | ||
} | ||
|
||
# used with --optarch=GENERIC | ||
COMPILER_GENERIC_OPTION = { | ||
(systemtools.AARCH64, systemtools.ARM): '-mcpu=generic -mtune=generic', | ||
} | ||
|
||
def prepare(self, *args, **kwargs): | ||
super(FujitsuCompiler, self).prepare(*args, **kwargs) | ||
|
||
# make sure the fujitsu module libraries are found (and added to rpath by wrapper) | ||
libdir = os.path.join(os.getenv(TC_CONSTANT_MODULE_VAR), 'lib64') | ||
self.log.debug("Adding %s to $LIBRARY_PATH" % libdir) | ||
env.setvar('LIBRARY_PATH', os.pathsep.join([os.getenv('LIBRARY_PATH'), libdir])) | ||
|
||
def _set_compiler_vars(self): | ||
super(FujitsuCompiler, self)._set_compiler_vars() | ||
|
||
# enable clang compatibility mode | ||
# moved to compiler constants to make sure it is always used | ||
# self.variables.nappend('CFLAGS', ['Nclang']) | ||
# self.variables.nappend('CXXFLAGS', ['Nclang']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
## | ||
# Copyright 2012-2021 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), | ||
# Flemish Research Foundation (FWO) (http://www.fwo.be/en) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# https://github.com/easybuilders/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
EasyBuild support for Fujitsu Compiler toolchain. | ||
|
||
:author: Miguel Dias Costa (National University of Singapore) | ||
""" | ||
from easybuild.toolchains.compiler.fujitsu import FujitsuCompiler | ||
from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME | ||
|
||
|
||
class FCC(FujitsuCompiler): | ||
"""Compiler toolchain with Fujitsu Compiler.""" | ||
NAME = 'FCC' | ||
SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME | ||
OPTIONAL = False | ||
|
||
# override in order to add an exception for the Fujitsu lang/tcsds module | ||
def _add_dependency_variables(self, names=None, cpp=None, ld=None): | ||
""" Add LDFLAGS and CPPFLAGS to the self.variables based on the dependencies | ||
names should be a list of strings containing the name of the dependency | ||
""" | ||
cpp_paths = ['include'] | ||
ld_paths = ['lib'] | ||
if not self.options.get('32bit', None): | ||
ld_paths.insert(0, 'lib64') | ||
|
||
if cpp is not None: | ||
for p in cpp: | ||
if p not in cpp_paths: | ||
cpp_paths.append(p) | ||
if ld is not None: | ||
for p in ld: | ||
if p not in ld_paths: | ||
ld_paths.append(p) | ||
|
||
if not names: | ||
deps = self.dependencies | ||
else: | ||
deps = [{'name': name} for name in names if name is not None] | ||
|
||
# collect software install prefixes for dependencies | ||
roots = [] | ||
for dep in deps: | ||
if dep.get('external_module', False): | ||
# for software names provided via external modules, install prefix may be unknown | ||
names = dep['external_module_metadata'].get('name', []) | ||
roots.extend([root for root in self.get_software_root(names) if root is not None]) | ||
else: | ||
roots.extend(self.get_software_root(dep['name'])) | ||
|
||
for root in roots: | ||
# skip Fujitsu's 'lang/tcsds' module, including the top level include breaks vectorization in clang mode | ||
if 'tcsds' not in root: | ||
self.variables.append_subdirs("CPPFLAGS", root, subdirs=cpp_paths) | ||
self.variables.append_subdirs("LDFLAGS", root, subdirs=ld_paths) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## | ||
# Copyright 2012-2021 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), | ||
# Flemish Research Foundation (FWO) (http://www.fwo.be/en) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# https://github.com/easybuilders/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
EasyBuild support for ffmpi compiler toolchain (includes Fujitsu Compiler and MPI). | ||
|
||
:author: Miguel Dias Costa (National University of Singapore) | ||
""" | ||
from easybuild.toolchains.fcc import FCC | ||
from easybuild.toolchains.mpi.fujitsumpi import FujitsuMPI | ||
|
||
|
||
class Ffmpi(FCC, FujitsuMPI): | ||
"""Compiler toolchain with Fujitsu Compiler and MPI.""" | ||
NAME = 'ffmpi' | ||
SUBTOOLCHAIN = FCC.NAME | ||
COMPILER_MODULE_NAME = [FCC.NAME] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## | ||
# Copyright 2012-2021 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), | ||
# Flemish Research Foundation (FWO) (http://www.fwo.be/en) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# https://github.com/easybuilders/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
Support for Fujitsu FFTW as toolchain FFT library. | ||
|
||
:author: Miguel Dias Costa (National University of Singapore) | ||
""" | ||
from easybuild.toolchains.fft.fftw import Fftw | ||
|
||
|
||
class FujitsuFFTW(Fftw): | ||
"""Fujitsu FFTW FFT library""" | ||
|
||
FFT_MODULE_NAME = ['FFTW3-sve'] | ||
FFTW_API_VERSION = '3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## | ||
# Copyright 2014-2021 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), | ||
# Flemish Research Foundation (FWO) (http://www.fwo.be/en) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# https://github.com/easybuilders/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
Fujitsu toolchain: Fujitsu compilers and MPI + Fujitsu SSL2 and Fujitsu FFTW | ||
|
||
:author: Miguel Dias Costa (National University of Singapore) | ||
""" | ||
from easybuild.toolchains.ffmpi import Ffmpi | ||
from easybuild.toolchains.fft.fujitsufftw import FujitsuFFTW | ||
from easybuild.toolchains.linalg.fujitsussl import FujitsuSSL | ||
|
||
|
||
class Fujitsu(Ffmpi, FujitsuFFTW, FujitsuSSL): | ||
"""Compiler toolchain for Fujitsu.""" | ||
NAME = 'Fujitsu' | ||
SUBTOOLCHAIN = Ffmpi.NAME | ||
COMPILER_MODULE_NAME = [] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.