Skip to content

Commit

Permalink
make sure fcc is always called with -Nclang and enhance COMPILER_UNIQ…
Browse files Browse the repository at this point in the history
…UE_OPTION_MAP
  • Loading branch information
migueldiascosta committed May 21, 2021
1 parent 12f6d79 commit 2138971
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions easybuild/toolchains/compiler/fujitsu.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,30 @@ class FujitsuCompiler(Compiler):
COMPILER_MODULE_NAME = ['lang']
COMPILER_FAMILY = TC_CONSTANT_FUJITSU

COMPILER_CC = 'fcc'
COMPILER_CXX = 'FCC'
COMPILER_CC = 'fcc -Nclang'
COMPILER_CXX = 'FCC -Nclang'
COMPILER_F77 = 'frt'
COMPILER_F90 = 'frt'
COMPILER_FC = 'frt'

COMPILER_UNIQUE_OPTION_MAP = {
DEFAULT_OPT_LEVEL: 'Kfast',
DEFAULT_OPT_LEVEL: 'O2 -Kfast',
'lowopt': 'O1',
'noopt': 'O0',
'opt': 'O3 -Kfast',
'optarch': '', # Fujitsu compiler by default generates code for the arch it is running on
'openmp': 'Kopenmp',
'unroll': 'funroll-loops',
'strict': ['Kfp_precision'],
'precise': ['Kfp_precision'],
# 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'],
'vectorize': {False: 'KNOSVE', True: 'KSVE'},
# 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)
Expand All @@ -77,5 +84,5 @@ def _set_compiler_vars(self):
super(FujitsuCompiler, self)._set_compiler_vars()

# enable clang compatibility mode
self.variables.nappend('CFLAGS', ['Nclang'])
self.variables.nappend('CXXFLAGS', ['Nclang'])
# self.variables.nappend('CFLAGS', ['Nclang'])
# self.variables.nappend('CXXFLAGS', ['Nclang'])

0 comments on commit 2138971

Please sign in to comment.