From cb93efdb75097e506c5c490c9a18bf30b5f982c5 Mon Sep 17 00:00:00 2001 From: crivella Date: Thu, 13 Feb 2025 10:33:21 +0100 Subject: [PATCH 01/11] WIP: LLVM toolchain --- easybuild/toolchains/compiler/clang.py | 7 +- easybuild/toolchains/compiler/flang.py | 121 +++++++++++++++++++++++++ easybuild/toolchains/lfbf.py | 44 +++++++++ easybuild/toolchains/lfoss.py | 100 ++++++++++++++++++++ easybuild/toolchains/llvm.py | 72 +++++++++++++++ easybuild/toolchains/lolf.py | 44 +++++++++ easybuild/toolchains/lompi.py | 60 ++++++++++++ 7 files changed, 446 insertions(+), 2 deletions(-) create mode 100644 easybuild/toolchains/compiler/flang.py create mode 100644 easybuild/toolchains/lfbf.py create mode 100644 easybuild/toolchains/lfoss.py create mode 100644 easybuild/toolchains/llvm.py create mode 100644 easybuild/toolchains/lolf.py create mode 100644 easybuild/toolchains/lompi.py diff --git a/easybuild/toolchains/compiler/clang.py b/easybuild/toolchains/compiler/clang.py index 4477454913..bd3ba67f90 100644 --- a/easybuild/toolchains/compiler/clang.py +++ b/easybuild/toolchains/compiler/clang.py @@ -34,7 +34,7 @@ """ import easybuild.tools.systemtools as systemtools -from easybuild.tools.toolchain.compiler import Compiler +from easybuild.tools.toolchain.compiler import Compiler, DEFAULT_OPT_LEVEL TC_CONSTANT_CLANG = "Clang" @@ -86,6 +86,7 @@ class Clang(Compiler): 'loose': ['-ffast-math', '-fno-unsafe-math-optimizations'], 'veryloose': ['-ffast-math'], 'vectorize': {False: '-fno-vectorize', True: '-fvectorize'}, + DEFAULT_OPT_LEVEL: ['-O2', '-ftree-vectorize'], } # used when 'optarch' toolchain option is enabled (and --optarch is not specified) @@ -104,7 +105,9 @@ class Clang(Compiler): COMPILER_CC = 'clang' COMPILER_CXX = 'clang++' - COMPILER_C_UNIQUE_OPTIONS = [] + COMPILER_C_UNIQUE_OPTIONS = [ + # 'lld_undefined_version' + ] LIB_MULTITHREAD = ['pthread'] LIB_MATH = ['m'] diff --git a/easybuild/toolchains/compiler/flang.py b/easybuild/toolchains/compiler/flang.py new file mode 100644 index 0000000000..358b764f41 --- /dev/null +++ b/easybuild/toolchains/compiler/flang.py @@ -0,0 +1,121 @@ +## +# Copyright 2013-2025 Ghent University +# +# This file is triple-licensed under GPLv2 (see below), MIT, and +# BSD three-clause licenses. +# +# 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 . +## +""" +Support for Flang as toolchain compiler. + +Authors: + +* Dmitri Gribenko (National Technical University of Ukraine "KPI") +* Davide Grassano (CECAM EPFL) +""" + +import easybuild.tools.systemtools as systemtools +from easybuild.tools.toolchain.compiler import Compiler, DEFAULT_OPT_LEVEL + + +TC_CONSTANT_FLANG = "Flang" + + +class Flang(Compiler): + """Clang compiler class""" + + COMPILER_MODULE_NAME = ['Flang'] + COMPILER_FAMILY = TC_CONSTANT_FLANG + + # Don't set COMPILER_FAMILY in this class because Clang does not have + # Fortran support, and thus it is not a complete compiler as far as + # EasyBuild is concerned. + + COMPILER_UNIQUE_OPTS = { + 'loop-vectorize': (False, "Loop vectorization"), + 'basic-block-vectorize': (False, "Basic block vectorization"), + } + COMPILER_UNIQUE_OPTION_MAP = { + 'unroll': '-funroll-loops', + 'loop-vectorize': ['-fvectorize'], + 'basic-block-vectorize': ['-fslp-vectorize'], + 'optarch': '', + # 'optarch': '-march=native', + # Clang's options do not map well onto these precision modes. The flags enable and disable certain classes of + # optimizations. + # + # -fassociative-math: allow re-association of operands in series of floating-point operations, violates the + # ISO C and C++ language standard by possibly changing computation result. + # -freciprocal-math: allow optimizations to use the reciprocal of an argument rather than perform division. + # -fsigned-zeros: do not allow optimizations to treat the sign of a zero argument or result as insignificant. + # -fhonor-infinities: disallow optimizations to assume that arguments and results are not +/- Infs. + # -fhonor-nans: disallow optimizations to assume that arguments and results are not +/- NaNs. + # -ffinite-math-only: allow optimizations for floating-point arithmetic that assume that arguments and results + # are not NaNs or +-Infs (equivalent to -fno-honor-nans -fno-honor-infinities) + # -funsafe-math-optimizations: allow unsafe math optimizations (implies -fassociative-math, -fno-signed-zeros, + # -freciprocal-math). + # -ffast-math: an umbrella flag that enables all optimizations listed above, provides preprocessor macro + # __FAST_MATH__. + # + # Using -fno-fast-math is equivalent to disabling all individual optimizations, see + # http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?view=markup (lines 2100 and following) + # + # 'strict', 'precise' and 'defaultprec' are all ISO C++ and IEEE complaint, but we explicitly specify details + # flags for strict and precise for robustness against future changes. + 'strict': ['-fno-fast-math'], + 'precise': ['-fno-unsafe-math-optimizations'], + 'defaultprec': [], + 'loose': ['-ffast-math', '-fno-unsafe-math-optimizations'], + 'veryloose': ['-ffast-math'], + 'vectorize': {False: '-fno-vectorize', True: '-fvectorize'}, + DEFAULT_OPT_LEVEL: ['-O2'], + } + + # # used when 'optarch' toolchain option is enabled (and --optarch is not specified) + # COMPILER_OPTIMAL_ARCHITECTURE_OPTION = { + # (systemtools.POWER, systemtools.POWER): '-mcpu=native', # no support for march=native on POWER + # (systemtools.POWER, systemtools.POWER_LE): '-mcpu=native', # no support for march=native on POWER + # # (systemtools.X86_64, systemtools.AMD): '-march=native', + # # (systemtools.X86_64, systemtools.INTEL): '-march=native', + # } + # # used with --optarch=GENERIC + # COMPILER_GENERIC_OPTION = { + # (systemtools.RISCV64, systemtools.RISCV): '-march=rv64gc -mabi=lp64d', # default for -mabi is system-dependent + # (systemtools.X86_64, systemtools.AMD): '-march=x86-64 -mtune=generic', + # (systemtools.X86_64, systemtools.INTEL): '-march=x86-64 -mtune=generic', + # } + + # COMPILER_CC = 'clang' + # COMPILER_CXX = 'clang++' + # COMPILER_C_UNIQUE_OPTIONS = [] + + COMPILER_F77 = 'flang-new' + COMPILER_F90 = 'flang-new' + COMPILER_FC = 'flang-new' + COMPILER_F_UNIQUE_OPTIONS = [ + # 'lld_undefined_version' + ] + COMPILER_F_UNIQUE_OPTIONS = [] + + LIB_MULTITHREAD = ['pthread'] + LIB_MATH = ['m'] diff --git a/easybuild/toolchains/lfbf.py b/easybuild/toolchains/lfbf.py new file mode 100644 index 0000000000..0c4fa89289 --- /dev/null +++ b/easybuild/toolchains/lfbf.py @@ -0,0 +1,44 @@ +## +# Copyright 2021-2025 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 . +## +""" +EasyBuild support for gfbf compiler toolchain (includes GCC, FlexiBLAS and FFTW) + +Authors: + +* Kenneth Hoste (Ghent University) +* Bart Oldeman (McGill University, Calcul Quebec, Compute Canada) +* Davide Grassano (CECAM EPFL) +""" + +from easybuild.toolchains.llvm import LLVMtc +from easybuild.toolchains.fft.fftw import Fftw +from easybuild.toolchains.linalg.flexiblas import FlexiBLAS + + +class Lfbf(LLVMtc, FlexiBLAS, Fftw): + """Compiler toolchain with GCC, FlexiBLAS and FFTW.""" + NAME = 'lfbf' + SUBTOOLCHAIN = LLVMtc.NAME + OPTIONAL = True diff --git a/easybuild/toolchains/lfoss.py b/easybuild/toolchains/lfoss.py new file mode 100644 index 0000000000..bd3c058961 --- /dev/null +++ b/easybuild/toolchains/lfoss.py @@ -0,0 +1,100 @@ +## +# Copyright 2013-2025 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 . +## +""" +EasyBuild support for foss compiler toolchain (includes GCC, OpenMPI, OpenBLAS, LAPACK, ScaLAPACK and FFTW). + +Authors: + +* Kenneth Hoste (Ghent University) +* Davide Grassano (CECAM EPFL) +""" +from easybuild.toolchains.lompi import Lompi +from easybuild.toolchains.lfbf import Lfbf +from easybuild.toolchains.lolf import Lolf +from easybuild.toolchains.fft.fftw import Fftw +from easybuild.toolchains.linalg.flexiblas import FlexiBLAS +from easybuild.toolchains.linalg.openblas import OpenBLAS +from easybuild.toolchains.linalg.scalapack import ScaLAPACK +from easybuild.tools import LooseVersion + + +class LFoss(Lompi, OpenBLAS, FlexiBLAS, ScaLAPACK, Fftw): + """Compiler toolchain with GCC, OpenMPI, OpenBLAS, ScaLAPACK and FFTW.""" + NAME = 'lfoss' + SUBTOOLCHAIN = [ + Lompi.NAME, + Lolf.NAME, + Lfbf.NAME + ] + + def __init__(self, *args, **kwargs): + """Toolchain constructor.""" + super(LFoss, self).__init__(*args, **kwargs) + + # need to transform a version like '2018b' with something that is safe to compare with '2019' + # comparing subversions that include letters causes TypeErrors in Python 3 + # 'a' is assumed to be equivalent with '.01' (January), and 'b' with '.07' (June) (good enough for this purpose) + version = self.version.replace('a', '.01').replace('b', '.07') + + self.looseversion = LooseVersion(version) + + constants = ('BLAS_MODULE_NAME', 'BLAS_LIB', 'BLAS_LIB_MT', 'BLAS_FAMILY', + 'LAPACK_MODULE_NAME', 'LAPACK_IS_BLAS', 'LAPACK_FAMILY') + + if self.looseversion > LooseVersion('2021.0'): + for constant in constants: + setattr(self, constant, getattr(FlexiBLAS, constant)) + else: + for constant in constants: + setattr(self, constant, getattr(OpenBLAS, constant)) + + def banned_linked_shared_libs(self): + """ + List of shared libraries (names, file names, paths) which are + not allowed to be linked in any installed binary/library. + """ + res = [] + res.extend(Lompi.banned_linked_shared_libs(self)) + + if self.looseversion >= LooseVersion('2021.0'): + res.extend(FlexiBLAS.banned_linked_shared_libs(self)) + else: + res.extend(OpenBLAS.banned_linked_shared_libs(self)) + + res.extend(ScaLAPACK.banned_linked_shared_libs(self)) + res.extend(Fftw.banned_linked_shared_libs(self)) + + return res + + def is_deprecated(self): + """Return whether or not this toolchain is deprecated.""" + + # foss toolchains older than foss/2019a are deprecated since EasyBuild v4.5.0; + if self.looseversion < LooseVersion('2019'): + deprecated = True + else: + deprecated = False + + return deprecated diff --git a/easybuild/toolchains/llvm.py b/easybuild/toolchains/llvm.py new file mode 100644 index 0000000000..3dd1c69c8b --- /dev/null +++ b/easybuild/toolchains/llvm.py @@ -0,0 +1,72 @@ +## +# Copyright 2013-2025 Ghent University +# +# This file is triple-licensed under GPLv2 (see below), MIT, and +# BSD three-clause licenses. +# +# 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 . +## +""" +EasyBuild support for Clang + Flang compiler toolchain. + +Authors: + +* Davide Grassano (CECAM EPFL) +""" +from easybuild.toolchains.compiler.clang import Clang +from easybuild.toolchains.compiler.flang import Flang +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME + + +TC_CONSTANT_LLVMTC = "LLVMtc" + + +class LLVMtc(Clang, Flang): + """Compiler toolchain with Clang and GFortran compilers.""" + NAME = 'LLVMtc' + COMPILER_MODULE_NAME = ['LLVMtc'] + COMPILER_FAMILY = TC_CONSTANT_LLVMTC + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME + + COMPILER_UNIQUE_OPTS = { + **Clang.COMPILER_UNIQUE_OPTS, + **Flang.COMPILER_UNIQUE_OPTS, + 'lld_undefined_version': (True, "-Wl,--undefined-version Allow unused version in version script"), # https://github.com/madler/zlib/issues/856 + 'no_unused_args': (True, "-Wno-unused-command-line-argument avoid some failures in CMake correctly recognizing feature due to linker warnings"), + } + + COMPILER_UNIQUE_OPTION_MAP = { + **Clang.COMPILER_UNIQUE_OPTION_MAP, + **Flang.COMPILER_UNIQUE_OPTION_MAP, + 'lld_undefined_version': ['-Wl,--undefined-version',], + 'no_unused_args': ['-Wno-unused-command-line-argument'], + } + + COMPILER_C_OPTIONS = [ + 'lld_undefined_version', + 'no_unused_args', + ] + + COMPILER_F_OPTIONS = [ + # 'lld_undefined_version', + # 'no_unused_args', + ] diff --git a/easybuild/toolchains/lolf.py b/easybuild/toolchains/lolf.py new file mode 100644 index 0000000000..a9509a6383 --- /dev/null +++ b/easybuild/toolchains/lolf.py @@ -0,0 +1,44 @@ +## +# Copyright 2013-2025 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 . +## +""" +EasyBuild support for golf compiler toolchain (includes GCC, OpenBLAS, LAPACK, and FFTW). + +Authors: + +* Kenneth Hoste (Ghent University) +* Bart Oldeman (McGill University, Calcul Quebec, Compute Canada) +* Davide Grassano (CECAM EPFL) +""" + +from easybuild.toolchains.llvm import LLVMtc +from easybuild.toolchains.fft.fftw import Fftw +from easybuild.toolchains.linalg.openblas import OpenBLAS + + +class Lolf(LLVMtc, OpenBLAS, Fftw): + """Compiler toolchain with LLVM, OpenBLAS, and FFTW.""" + NAME = 'lolf' + SUBTOOLCHAIN = LLVMtc.NAME + OPTIONAL = True diff --git a/easybuild/toolchains/lompi.py b/easybuild/toolchains/lompi.py new file mode 100644 index 0000000000..0b90443384 --- /dev/null +++ b/easybuild/toolchains/lompi.py @@ -0,0 +1,60 @@ +## +# Copyright 2012-2025 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 . +## +""" +EasyBuild support for lompi compiler toolchain (includes LLVM and OpenMPI). + +Authors: + +* Kenneth Hoste (Ghent University) +* Davide Grassano (CECAM EPFL) +""" +from easybuild.tools import LooseVersion +import re + +from easybuild.toolchains.llvm import LLVMtc +from easybuild.toolchains.mpi.openmpi import OpenMPI + + +class Lompi(LLVMtc, OpenMPI): + """Compiler toolchain with GCC and OpenMPI.""" + NAME = 'lompi' + SUBTOOLCHAIN = LLVMtc.NAME + + def is_deprecated(self): + """Return whether or not this toolchain is deprecated.""" + # need to transform a version like '2018b' with something that is safe to compare with '2019' + # comparing subversions that include letters causes TypeErrors in Python 3 + # 'a' is assumed to be equivalent with '.01' (January), and 'b' with '.07' (June) (good enough for this purpose) + version = self.version.replace('a', '.01').replace('b', '.07') + + deprecated = False + + # make sure a non-symbolic version (e.g., 'system') is used before making comparisons using LooseVersion + if re.match('^[0-9]', version): + # gompi toolchains older than gompi/2019a are deprecated since EasyBuild v4.5.0 + if LooseVersion(version) < LooseVersion('2019'): + deprecated = True + + return deprecated From 2b00e40408b9ef28a3b54d76f699f2a6abd84746 Mon Sep 17 00:00:00 2001 From: crivella Date: Thu, 22 May 2025 18:23:55 +0200 Subject: [PATCH 02/11] Improved for LLVM specific toolchain --- easybuild/toolchains/compiler/flang.py | 32 +++++++++++++------------- easybuild/toolchains/lfoss.py | 23 ++++++------------ easybuild/toolchains/llvm.py | 16 +++++++++---- easybuild/toolchains/lompi.py | 4 ++-- 4 files changed, 37 insertions(+), 38 deletions(-) diff --git a/easybuild/toolchains/compiler/flang.py b/easybuild/toolchains/compiler/flang.py index 358b764f41..f11bfbbb54 100644 --- a/easybuild/toolchains/compiler/flang.py +++ b/easybuild/toolchains/compiler/flang.py @@ -91,27 +91,27 @@ class Flang(Compiler): DEFAULT_OPT_LEVEL: ['-O2'], } - # # used when 'optarch' toolchain option is enabled (and --optarch is not specified) - # COMPILER_OPTIMAL_ARCHITECTURE_OPTION = { - # (systemtools.POWER, systemtools.POWER): '-mcpu=native', # no support for march=native on POWER - # (systemtools.POWER, systemtools.POWER_LE): '-mcpu=native', # no support for march=native on POWER - # # (systemtools.X86_64, systemtools.AMD): '-march=native', - # # (systemtools.X86_64, systemtools.INTEL): '-march=native', - # } - # # used with --optarch=GENERIC - # COMPILER_GENERIC_OPTION = { - # (systemtools.RISCV64, systemtools.RISCV): '-march=rv64gc -mabi=lp64d', # default for -mabi is system-dependent - # (systemtools.X86_64, systemtools.AMD): '-march=x86-64 -mtune=generic', - # (systemtools.X86_64, systemtools.INTEL): '-march=x86-64 -mtune=generic', - # } + # used when 'optarch' toolchain option is enabled (and --optarch is not specified) + COMPILER_OPTIMAL_ARCHITECTURE_OPTION = { + (systemtools.POWER, systemtools.POWER): '-mcpu=native', # no support for march=native on POWER + (systemtools.POWER, systemtools.POWER_LE): '-mcpu=native', # no support for march=native on POWER + (systemtools.X86_64, systemtools.AMD): '-march=native', + (systemtools.X86_64, systemtools.INTEL): '-march=native', + } + # used with --optarch=GENERIC + COMPILER_GENERIC_OPTION = { + (systemtools.RISCV64, systemtools.RISCV): '-march=rv64gc -mabi=lp64d', # default for -mabi is system-dependent + (systemtools.X86_64, systemtools.AMD): '-march=x86-64 -mtune=generic', + (systemtools.X86_64, systemtools.INTEL): '-march=x86-64 -mtune=generic', + } # COMPILER_CC = 'clang' # COMPILER_CXX = 'clang++' # COMPILER_C_UNIQUE_OPTIONS = [] - COMPILER_F77 = 'flang-new' - COMPILER_F90 = 'flang-new' - COMPILER_FC = 'flang-new' + COMPILER_F77 = 'flang' + COMPILER_F90 = 'flang' + COMPILER_FC = 'flang' COMPILER_F_UNIQUE_OPTIONS = [ # 'lld_undefined_version' ] diff --git a/easybuild/toolchains/lfoss.py b/easybuild/toolchains/lfoss.py index bd3c058961..6882f01335 100644 --- a/easybuild/toolchains/lfoss.py +++ b/easybuild/toolchains/lfoss.py @@ -40,8 +40,8 @@ from easybuild.tools import LooseVersion -class LFoss(Lompi, OpenBLAS, FlexiBLAS, ScaLAPACK, Fftw): - """Compiler toolchain with GCC, OpenMPI, OpenBLAS, ScaLAPACK and FFTW.""" +class LFoss(Lompi, FlexiBLAS, ScaLAPACK, Fftw): + """Compiler toolchain with GCC, OpenMPI, FlexiBLAS, ScaLAPACK and FFTW.""" NAME = 'lfoss' SUBTOOLCHAIN = [ Lompi.NAME, @@ -63,12 +63,8 @@ def __init__(self, *args, **kwargs): constants = ('BLAS_MODULE_NAME', 'BLAS_LIB', 'BLAS_LIB_MT', 'BLAS_FAMILY', 'LAPACK_MODULE_NAME', 'LAPACK_IS_BLAS', 'LAPACK_FAMILY') - if self.looseversion > LooseVersion('2021.0'): - for constant in constants: - setattr(self, constant, getattr(FlexiBLAS, constant)) - else: - for constant in constants: - setattr(self, constant, getattr(OpenBLAS, constant)) + for constant in constants: + setattr(self, constant, getattr(FlexiBLAS, constant)) def banned_linked_shared_libs(self): """ @@ -77,12 +73,7 @@ def banned_linked_shared_libs(self): """ res = [] res.extend(Lompi.banned_linked_shared_libs(self)) - - if self.looseversion >= LooseVersion('2021.0'): - res.extend(FlexiBLAS.banned_linked_shared_libs(self)) - else: - res.extend(OpenBLAS.banned_linked_shared_libs(self)) - + res.extend(FlexiBLAS.banned_linked_shared_libs(self)) res.extend(ScaLAPACK.banned_linked_shared_libs(self)) res.extend(Fftw.banned_linked_shared_libs(self)) @@ -91,8 +82,8 @@ def banned_linked_shared_libs(self): def is_deprecated(self): """Return whether or not this toolchain is deprecated.""" - # foss toolchains older than foss/2019a are deprecated since EasyBuild v4.5.0; - if self.looseversion < LooseVersion('2019'): + # lfoss toolchains older than 2023b should not exist (need GCC >= 13) + if self.looseversion < LooseVersion('2023'): deprecated = True else: deprecated = False diff --git a/easybuild/toolchains/llvm.py b/easybuild/toolchains/llvm.py index 3dd1c69c8b..7d80d6eaac 100644 --- a/easybuild/toolchains/llvm.py +++ b/easybuild/toolchains/llvm.py @@ -36,22 +36,29 @@ from easybuild.toolchains.compiler.flang import Flang from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME - +# Using `...tc` to distinguish toolchain from package TC_CONSTANT_LLVMTC = "LLVMtc" class LLVMtc(Clang, Flang): """Compiler toolchain with Clang and GFortran compilers.""" NAME = 'LLVMtc' - COMPILER_MODULE_NAME = ['LLVMtc'] + COMPILER_MODULE_NAME = [NAME] COMPILER_FAMILY = TC_CONSTANT_LLVMTC SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME COMPILER_UNIQUE_OPTS = { **Clang.COMPILER_UNIQUE_OPTS, **Flang.COMPILER_UNIQUE_OPTS, - 'lld_undefined_version': (True, "-Wl,--undefined-version Allow unused version in version script"), # https://github.com/madler/zlib/issues/856 - 'no_unused_args': (True, "-Wno-unused-command-line-argument avoid some failures in CMake correctly recognizing feature due to linker warnings"), + # https://github.com/madler/zlib/issues/856 + 'lld_undefined_version': (True, "-Wl,--undefined-version - Allow unused version in version script"), + 'no_unused_args': ( + True, + ( + "-Wno-unused-command-line-argument - Avoid some failures in CMake correctly recognizing " + "feature due to linker warnings" + ) + ), } COMPILER_UNIQUE_OPTION_MAP = { @@ -67,6 +74,7 @@ class LLVMtc(Clang, Flang): ] COMPILER_F_OPTIONS = [ + # These are not yet available in Flang # 'lld_undefined_version', # 'no_unused_args', ] diff --git a/easybuild/toolchains/lompi.py b/easybuild/toolchains/lompi.py index 0b90443384..ef9e647d61 100644 --- a/easybuild/toolchains/lompi.py +++ b/easybuild/toolchains/lompi.py @@ -53,8 +53,8 @@ def is_deprecated(self): # make sure a non-symbolic version (e.g., 'system') is used before making comparisons using LooseVersion if re.match('^[0-9]', version): - # gompi toolchains older than gompi/2019a are deprecated since EasyBuild v4.5.0 - if LooseVersion(version) < LooseVersion('2019'): + # lompi toolchains older than 2023b should not exist (need GCC >= 13) + if LooseVersion(version) < LooseVersion('2021'): deprecated = True return deprecated From 3e81a88724eea239e7919565786492e455bd7636 Mon Sep 17 00:00:00 2001 From: crivella Date: Mon, 26 May 2025 15:53:21 +0200 Subject: [PATCH 03/11] Added GCCcore as a subtoolchain --- easybuild/toolchains/llvm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/easybuild/toolchains/llvm.py b/easybuild/toolchains/llvm.py index 7d80d6eaac..c1f7c40154 100644 --- a/easybuild/toolchains/llvm.py +++ b/easybuild/toolchains/llvm.py @@ -32,6 +32,8 @@ * Davide Grassano (CECAM EPFL) """ + +from easybuild.toolchains.gcccore import GCCcore from easybuild.toolchains.compiler.clang import Clang from easybuild.toolchains.compiler.flang import Flang from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME @@ -45,7 +47,7 @@ class LLVMtc(Clang, Flang): NAME = 'LLVMtc' COMPILER_MODULE_NAME = [NAME] COMPILER_FAMILY = TC_CONSTANT_LLVMTC - SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME + SUBTOOLCHAIN = [GCCcore.NAME, SYSTEM_TOOLCHAIN_NAME] COMPILER_UNIQUE_OPTS = { **Clang.COMPILER_UNIQUE_OPTS, From 558c30c0759577aa1ff3f73014810231cedeebb8 Mon Sep 17 00:00:00 2001 From: crivella Date: Mon, 26 May 2025 15:56:18 +0200 Subject: [PATCH 04/11] Fix version --- easybuild/toolchains/lompi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/toolchains/lompi.py b/easybuild/toolchains/lompi.py index ef9e647d61..ed06cb3dd6 100644 --- a/easybuild/toolchains/lompi.py +++ b/easybuild/toolchains/lompi.py @@ -54,7 +54,7 @@ def is_deprecated(self): # make sure a non-symbolic version (e.g., 'system') is used before making comparisons using LooseVersion if re.match('^[0-9]', version): # lompi toolchains older than 2023b should not exist (need GCC >= 13) - if LooseVersion(version) < LooseVersion('2021'): + if LooseVersion(version) < LooseVersion('2023'): deprecated = True return deprecated From ae4fefc7192b9b6c038f74f953a320de2a85538f Mon Sep 17 00:00:00 2001 From: crivella Date: Tue, 27 May 2025 15:02:57 +0200 Subject: [PATCH 05/11] Revert changes to `clang.py` --- easybuild/toolchains/compiler/clang.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/easybuild/toolchains/compiler/clang.py b/easybuild/toolchains/compiler/clang.py index bd3ba67f90..4477454913 100644 --- a/easybuild/toolchains/compiler/clang.py +++ b/easybuild/toolchains/compiler/clang.py @@ -34,7 +34,7 @@ """ import easybuild.tools.systemtools as systemtools -from easybuild.tools.toolchain.compiler import Compiler, DEFAULT_OPT_LEVEL +from easybuild.tools.toolchain.compiler import Compiler TC_CONSTANT_CLANG = "Clang" @@ -86,7 +86,6 @@ class Clang(Compiler): 'loose': ['-ffast-math', '-fno-unsafe-math-optimizations'], 'veryloose': ['-ffast-math'], 'vectorize': {False: '-fno-vectorize', True: '-fvectorize'}, - DEFAULT_OPT_LEVEL: ['-O2', '-ftree-vectorize'], } # used when 'optarch' toolchain option is enabled (and --optarch is not specified) @@ -105,9 +104,7 @@ class Clang(Compiler): COMPILER_CC = 'clang' COMPILER_CXX = 'clang++' - COMPILER_C_UNIQUE_OPTIONS = [ - # 'lld_undefined_version' - ] + COMPILER_C_UNIQUE_OPTIONS = [] LIB_MULTITHREAD = ['pthread'] LIB_MATH = ['m'] From d9cf58c6e9dea0f039fa743e7559ddab2ea75012 Mon Sep 17 00:00:00 2001 From: crivella Date: Thu, 5 Jun 2025 14:19:10 +0200 Subject: [PATCH 06/11] Removed OpenBLAS dep from lfoss --- easybuild/toolchains/lfoss.py | 1 - 1 file changed, 1 deletion(-) diff --git a/easybuild/toolchains/lfoss.py b/easybuild/toolchains/lfoss.py index 6882f01335..0fbb4a3d3b 100644 --- a/easybuild/toolchains/lfoss.py +++ b/easybuild/toolchains/lfoss.py @@ -35,7 +35,6 @@ from easybuild.toolchains.lolf import Lolf from easybuild.toolchains.fft.fftw import Fftw from easybuild.toolchains.linalg.flexiblas import FlexiBLAS -from easybuild.toolchains.linalg.openblas import OpenBLAS from easybuild.toolchains.linalg.scalapack import ScaLAPACK from easybuild.tools import LooseVersion From db017b80ca49083cad14789ce229a07c77f8d4c1 Mon Sep 17 00:00:00 2001 From: crivella Date: Thu, 5 Jun 2025 15:37:58 +0200 Subject: [PATCH 07/11] Uue a unified `llvm.py` for the compiler and a new `llvm.py` for the toolchain --- .../toolchains/compiler/{flang.py => llvm.py} | 92 +++++++++++++++---- easybuild/toolchains/llvm.py | 45 +-------- 2 files changed, 80 insertions(+), 57 deletions(-) rename easybuild/toolchains/compiler/{flang.py => llvm.py} (61%) diff --git a/easybuild/toolchains/compiler/flang.py b/easybuild/toolchains/compiler/llvm.py similarity index 61% rename from easybuild/toolchains/compiler/flang.py rename to easybuild/toolchains/compiler/llvm.py index f11bfbbb54..b41e6c6261 100644 --- a/easybuild/toolchains/compiler/flang.py +++ b/easybuild/toolchains/compiler/llvm.py @@ -26,7 +26,7 @@ # along with EasyBuild. If not, see . ## """ -Support for Flang as toolchain compiler. +EasyBuild support for Clang + Flang compiler toolchain. Authors: @@ -34,27 +34,54 @@ * Davide Grassano (CECAM EPFL) """ +from easybuild.tools import LooseVersion import easybuild.tools.systemtools as systemtools from easybuild.tools.toolchain.compiler import Compiler, DEFAULT_OPT_LEVEL +from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME +TC_CONSTANT_LLVM = "LLVM" -TC_CONSTANT_FLANG = "Flang" +class LLVM(Compiler): + """Compiler toolchain with Clang and GFortran compilers.""" + # NAME = 'LLVMcore' + # COMPILER_MODULE_NAME = [NAME] + COMPILER_FAMILY = TC_CONSTANT_LLVM + SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME -class Flang(Compiler): - """Clang compiler class""" - - COMPILER_MODULE_NAME = ['Flang'] - COMPILER_FAMILY = TC_CONSTANT_FLANG + # List of flags that are supported by Clang but not yet by Flang and should be filtered out + # The element of the list are tuples with the following structure: + # (min_version, max_version, [list of flags]) + # Where min_version and max_version are strings representing a left-inclusive and right-exclusive version range, + # [min_version, max_version) respectively. + # This is used to specify general `clang`-accepted flags and remove them from `flang` compiler flags if + # not supported for a particular version of LLVM + FLANG_UNSUPPORTED_VARS = [ + ('19', '21', [ + '-fslp-vectorize', + '-fvectorize', + '-fno-vectorize', + '-fno-unsafe-math-optimizations', + ]) + ] - # Don't set COMPILER_FAMILY in this class because Clang does not have - # Fortran support, and thus it is not a complete compiler as far as - # EasyBuild is concerned. + FORTRAN_FLAGS = ['FCFLAGS', 'FFLAGS', 'F90FLAGS'] COMPILER_UNIQUE_OPTS = { 'loop-vectorize': (False, "Loop vectorization"), 'basic-block-vectorize': (False, "Basic block vectorization"), + + # https://github.com/madler/zlib/issues/856 + 'lld_undefined_version': (True, "-Wl,--undefined-version - Allow unused version in version script"), + 'no_unused_args': ( + True, + ( + "-Wno-unused-command-line-argument - Avoid some failures in CMake correctly recognizing " + "feature due to linker warnings" + ) + ), } + COMPILER_UNIQUE_OPTION_MAP = { 'unroll': '-funroll-loops', 'loop-vectorize': ['-fvectorize'], @@ -89,8 +116,23 @@ class Flang(Compiler): 'veryloose': ['-ffast-math'], 'vectorize': {False: '-fno-vectorize', True: '-fvectorize'}, DEFAULT_OPT_LEVEL: ['-O2'], + + 'lld_undefined_version': ['-Wl,--undefined-version',], + 'no_unused_args': ['-Wno-unused-command-line-argument'], } + COMPILER_OPTIONS = [ + 'lld_undefined_version', + ] + + # Options only available for Clang compiler + COMPILER_C_OPTIONS = [ + 'no_unused_args', + ] + + # Options only available for Flang compiler + COMPILER_F_OPTIONS = [] + # used when 'optarch' toolchain option is enabled (and --optarch is not specified) COMPILER_OPTIMAL_ARCHITECTURE_OPTION = { (systemtools.POWER, systemtools.POWER): '-mcpu=native', # no support for march=native on POWER @@ -105,17 +147,35 @@ class Flang(Compiler): (systemtools.X86_64, systemtools.INTEL): '-march=x86-64 -mtune=generic', } - # COMPILER_CC = 'clang' - # COMPILER_CXX = 'clang++' - # COMPILER_C_UNIQUE_OPTIONS = [] + COMPILER_CC = 'clang' + COMPILER_CXX = 'clang++' + COMPILER_C_UNIQUE_OPTIONS = [] COMPILER_F77 = 'flang' COMPILER_F90 = 'flang' COMPILER_FC = 'flang' - COMPILER_F_UNIQUE_OPTIONS = [ - # 'lld_undefined_version' - ] COMPILER_F_UNIQUE_OPTIONS = [] LIB_MULTITHREAD = ['pthread'] LIB_MATH = ['m'] + + def _set_compiler_flags(self): + super()._set_compiler_flags() + + unsupported_fortran_flags = None + for v_min, v_max, flags in self.FLANG_UNSUPPORTED_VARS: + if LooseVersion(self.version) >= LooseVersion(v_min) and LooseVersion(self.version) < LooseVersion(v_max): + unsupported_fortran_flags = flags + break + else: + self.log.debug("No unsupported flags found for LLVM version %s", self.version) + + if unsupported_fortran_flags is not None: + self.log.debug( + f"Ensuring usupported Fortran flags `{unsupported_fortran_flags}` are removed from variables" + ) + for key, lst in self.variables.items(): + if key not in self.FORTRAN_FLAGS: + continue + for item in lst: + item.try_remove(unsupported_fortran_flags) diff --git a/easybuild/toolchains/llvm.py b/easybuild/toolchains/llvm.py index c1f7c40154..65bee00afa 100644 --- a/easybuild/toolchains/llvm.py +++ b/easybuild/toolchains/llvm.py @@ -34,49 +34,12 @@ """ from easybuild.toolchains.gcccore import GCCcore -from easybuild.toolchains.compiler.clang import Clang -from easybuild.toolchains.compiler.flang import Flang +from easybuild.toolchains.compiler.llvm import LLVM from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME -# Using `...tc` to distinguish toolchain from package -TC_CONSTANT_LLVMTC = "LLVMtc" - -class LLVMtc(Clang, Flang): - """Compiler toolchain with Clang and GFortran compilers.""" - NAME = 'LLVMtc' +class LLVMtc(LLVM): + """Compiler toolchain with Clang and Flang compilers.""" + NAME = 'LLVMtc' # Using `...tc` to distinguish toolchain from package COMPILER_MODULE_NAME = [NAME] - COMPILER_FAMILY = TC_CONSTANT_LLVMTC SUBTOOLCHAIN = [GCCcore.NAME, SYSTEM_TOOLCHAIN_NAME] - - COMPILER_UNIQUE_OPTS = { - **Clang.COMPILER_UNIQUE_OPTS, - **Flang.COMPILER_UNIQUE_OPTS, - # https://github.com/madler/zlib/issues/856 - 'lld_undefined_version': (True, "-Wl,--undefined-version - Allow unused version in version script"), - 'no_unused_args': ( - True, - ( - "-Wno-unused-command-line-argument - Avoid some failures in CMake correctly recognizing " - "feature due to linker warnings" - ) - ), - } - - COMPILER_UNIQUE_OPTION_MAP = { - **Clang.COMPILER_UNIQUE_OPTION_MAP, - **Flang.COMPILER_UNIQUE_OPTION_MAP, - 'lld_undefined_version': ['-Wl,--undefined-version',], - 'no_unused_args': ['-Wno-unused-command-line-argument'], - } - - COMPILER_C_OPTIONS = [ - 'lld_undefined_version', - 'no_unused_args', - ] - - COMPILER_F_OPTIONS = [ - # These are not yet available in Flang - # 'lld_undefined_version', - # 'no_unused_args', - ] From e71f083b199000fa4f647e5a5b11f8a2ff4d0483 Mon Sep 17 00:00:00 2001 From: crivella Date: Thu, 5 Jun 2025 15:49:41 +0200 Subject: [PATCH 08/11] lint --- easybuild/toolchains/compiler/llvm.py | 4 ++-- easybuild/toolchains/lfoss.py | 2 +- easybuild/toolchains/llvm.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/easybuild/toolchains/compiler/llvm.py b/easybuild/toolchains/compiler/llvm.py index b41e6c6261..dc8cb25a93 100644 --- a/easybuild/toolchains/compiler/llvm.py +++ b/easybuild/toolchains/compiler/llvm.py @@ -26,7 +26,7 @@ # along with EasyBuild. If not, see . ## """ -EasyBuild support for Clang + Flang compiler toolchain. +EasyBuild support for Clang + Flang compiler toolchain. Authors: @@ -117,7 +117,7 @@ class LLVM(Compiler): 'vectorize': {False: '-fno-vectorize', True: '-fvectorize'}, DEFAULT_OPT_LEVEL: ['-O2'], - 'lld_undefined_version': ['-Wl,--undefined-version',], + 'lld_undefined_version': ['-Wl,--undefined-version'], 'no_unused_args': ['-Wno-unused-command-line-argument'], } diff --git a/easybuild/toolchains/lfoss.py b/easybuild/toolchains/lfoss.py index 0fbb4a3d3b..584c48c0b7 100644 --- a/easybuild/toolchains/lfoss.py +++ b/easybuild/toolchains/lfoss.py @@ -43,7 +43,7 @@ class LFoss(Lompi, FlexiBLAS, ScaLAPACK, Fftw): """Compiler toolchain with GCC, OpenMPI, FlexiBLAS, ScaLAPACK and FFTW.""" NAME = 'lfoss' SUBTOOLCHAIN = [ - Lompi.NAME, + Lompi.NAME, Lolf.NAME, Lfbf.NAME ] diff --git a/easybuild/toolchains/llvm.py b/easybuild/toolchains/llvm.py index 65bee00afa..ac1d5c8695 100644 --- a/easybuild/toolchains/llvm.py +++ b/easybuild/toolchains/llvm.py @@ -26,7 +26,7 @@ # along with EasyBuild. If not, see . ## """ -EasyBuild support for Clang + Flang compiler toolchain. +EasyBuild support for Clang + Flang compiler toolchain. Authors: From bb62f27df2d3873480b1afe1eba81d7c00db101a Mon Sep 17 00:00:00 2001 From: crivella Date: Wed, 11 Jun 2025 18:09:05 +0200 Subject: [PATCH 09/11] fix use a string that really should not match --- test/framework/easyconfigversion.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/framework/easyconfigversion.py b/test/framework/easyconfigversion.py index 59cf051a42..68c4aa1b07 100644 --- a/test/framework/easyconfigversion.py +++ b/test/framework/easyconfigversion.py @@ -190,9 +190,10 @@ def test_parser_toolchain_regex(self): self.assertEqual(tcversop.as_dict(), as_dict) # only accept known toolchain names + RANDOM_BIT = 'ShouldNotMatch___' fail_tests = [ - "x%s >= 1.2.3" % tc, - "%sx >= 1.2.3" % tc, + f"{RANDOM_BIT}{tc} >= 1.2.3", + f"{tc}{RANDOM_BIT} >= 1.2.3", "foo", ">= 1.2.3", ] @@ -205,6 +206,7 @@ def test_parser_toolchain_regex(self): def test_toolchain_versop_test(self): """Test the ToolchainVersionOperator test""" _, tcs = search_toolchain('') + RANDOM_BIT = 'ShouldNotMatch___' tc_names = [x.NAME for x in tcs] for tc in tc_names: # test all known toolchain names # test version expressions with optional version operator @@ -213,8 +215,8 @@ def test_toolchain_versop_test(self): (tc, '1.2.3', True), # version ok, name ok (tc, '1.2.4', True), # version ok, name ok (tc, '1.2.2', False), # version not ok, name ok - ('x' + tc, '1.2.3', False), # version ok, name not ok - ('x' + tc, '1.2.2', False), # version not ok, name not ok + (RANDOM_BIT + tc, '1.2.3', False), # version ok, name not ok + (RANDOM_BIT + tc, '1.2.2', False), # version not ok, name not ok )), ] for txt, subtests in tests: From 6351493aa2fc44353fda552d2fe3081fde6c911b Mon Sep 17 00:00:00 2001 From: crivella Date: Mon, 14 Jul 2025 17:04:50 +0200 Subject: [PATCH 10/11] Added `-Wno-error=int-conversion` as a default present parameter --- easybuild/toolchains/compiler/llvm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/easybuild/toolchains/compiler/llvm.py b/easybuild/toolchains/compiler/llvm.py index dc8cb25a93..8412ae7d99 100644 --- a/easybuild/toolchains/compiler/llvm.py +++ b/easybuild/toolchains/compiler/llvm.py @@ -80,6 +80,10 @@ class LLVM(Compiler): "feature due to linker warnings" ) ), + 'no_int_conversion_error': ( + True, + "-Wno-error=int-conversion - Avoid some failures that are normally ignored by GCC" + ), } COMPILER_UNIQUE_OPTION_MAP = { @@ -119,6 +123,7 @@ class LLVM(Compiler): 'lld_undefined_version': ['-Wl,--undefined-version'], 'no_unused_args': ['-Wno-unused-command-line-argument'], + 'no_int_conversion_error': ['-Wno-error=int-conversion'], } COMPILER_OPTIONS = [ @@ -128,6 +133,7 @@ class LLVM(Compiler): # Options only available for Clang compiler COMPILER_C_OPTIONS = [ 'no_unused_args', + 'no_int_conversion_error' ] # Options only available for Flang compiler From 7b14ab77662dbead8f4eb0e08d925373ed6135db Mon Sep 17 00:00:00 2001 From: crivella Date: Mon, 21 Jul 2025 23:39:39 +0200 Subject: [PATCH 11/11] Added known unsupported flag `math-errno` --- easybuild/toolchains/compiler/llvm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/toolchains/compiler/llvm.py b/easybuild/toolchains/compiler/llvm.py index 8412ae7d99..895b386791 100644 --- a/easybuild/toolchains/compiler/llvm.py +++ b/easybuild/toolchains/compiler/llvm.py @@ -58,9 +58,9 @@ class LLVM(Compiler): # not supported for a particular version of LLVM FLANG_UNSUPPORTED_VARS = [ ('19', '21', [ + '-fmath-errno', '-fno-math-errno', '-fslp-vectorize', - '-fvectorize', - '-fno-vectorize', + '-fvectorize', '-fno-vectorize', '-fno-unsafe-math-optimizations', ]) ]