Skip to content

Commit c7eb1c6

Browse files
authored
Merge pull request #1 from Thyre/exp-LLVMtoolchain
Add MPICH toolchains & fix toolchain options not showing up correctly.
2 parents 41d47bf + 8ebac9a commit c7eb1c6

3 files changed

Lines changed: 97 additions & 13 deletions

File tree

easybuild/toolchains/compiler/llvm.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444

4545
class LLVM(Compiler):
4646
"""Compiler toolchain with LLVM compilers (clang/flang)."""
47-
# NAME = 'LLVMcore'
48-
# COMPILER_MODULE_NAME = [NAME]
4947
COMPILER_FAMILY = TC_CONSTANT_LLVM
5048
SUBTOOLCHAIN = SYSTEM_TOOLCHAIN_NAME
5149

@@ -79,10 +77,8 @@ class LLVM(Compiler):
7977
'lld_undefined_version': (True, "-Wl,--undefined-version - Allow unused version in version script"),
8078
'no_unused_args': (
8179
True,
82-
(
83-
"-Wno-unused-command-line-argument - Avoid some failures in CMake correctly recognizing "
84-
"feature due to linker warnings"
85-
)
80+
"-Wno-unused-command-line-argument - Avoid some failures in CMake correctly recognizing "
81+
"feature due to linker warnings"
8682
),
8783
'no_int_conversion_error': (
8884
True,
@@ -130,18 +126,21 @@ class LLVM(Compiler):
130126
'no_int_conversion_error': ['-Wno-error=int-conversion'],
131127
}
132128

133-
COMPILER_OPTIONS = [
134-
'lld_undefined_version',
135-
]
129+
# Ensure that compiler options only appear once, so that arguments do not appear multiple times when compiling.
130+
COMPILER_OPTIONS = Compiler.COMPILER_OPTIONS
131+
COMPILER_OPTIONS += ['lld_undefined_version']
132+
COMPILER_OPTIONS = list(set(COMPILER_OPTIONS))
136133

137134
# Options only available for Clang compiler
138-
COMPILER_C_OPTIONS = [
135+
COMPILER_C_UNIQUE_OPTIONS = Compiler.COMPILER_C_UNIQUE_OPTIONS
136+
COMPILER_C_UNIQUE_OPTIONS += [
139137
'no_unused_args',
140138
'no_int_conversion_error'
141139
]
140+
COMPILER_C_UNIQUE_OPTIONS = list(set(COMPILER_C_UNIQUE_OPTIONS))
142141

143142
# Options only available for Flang compiler
144-
COMPILER_F_OPTIONS = []
143+
COMPILER_F_UNIQUE_OPTIONS = Compiler.COMPILER_F_UNIQUE_OPTIONS
145144

146145
# used when 'optarch' toolchain option is enabled (and --optarch is not specified)
147146
COMPILER_OPTIMAL_ARCHITECTURE_OPTION = {
@@ -150,6 +149,7 @@ class LLVM(Compiler):
150149
(systemtools.X86_64, systemtools.AMD): '-march=native',
151150
(systemtools.X86_64, systemtools.INTEL): '-march=native',
152151
}
152+
153153
# used with --optarch=GENERIC
154154
COMPILER_GENERIC_OPTION = {
155155
(systemtools.RISCV64, systemtools.RISCV): '-march=rv64gc -mabi=lp64d', # default for -mabi is system-dependent
@@ -159,12 +159,10 @@ class LLVM(Compiler):
159159

160160
COMPILER_CC = 'clang'
161161
COMPILER_CXX = 'clang++'
162-
COMPILER_C_UNIQUE_OPTIONS = []
163162

164163
COMPILER_F77 = 'flang'
165164
COMPILER_F90 = 'flang'
166165
COMPILER_FC = 'flang'
167-
COMPILER_F_UNIQUE_OPTIONS = []
168166

169167
LIB_MULTITHREAD = ['pthread']
170168
LIB_MATH = ['m']

easybuild/toolchains/lmpflf.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
##
2+
# Copyright 2013-2025 Ghent University
3+
#
4+
# This file is triple-licensed under GPLv2 (see below), MIT, and
5+
# BSD three-clause licenses.
6+
#
7+
# This file is part of EasyBuild,
8+
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
9+
# with support of Ghent University (http://ugent.be/hpc),
10+
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
11+
# Flemish Research Foundation (FWO) (http://www.fwo.be/en)
12+
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
13+
#
14+
# https://github.com/easybuilders/easybuild
15+
#
16+
# EasyBuild is free software: you can redistribute it and/or modify
17+
# it under the terms of the GNU General Public License as published by
18+
# the Free Software Foundation v2.
19+
#
20+
# EasyBuild is distributed in the hope that it will be useful,
21+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
# GNU General Public License for more details.
24+
#
25+
# You should have received a copy of the GNU General Public License
26+
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
27+
##
28+
"""
29+
EasyBuild support for lmpflf compiler toolchain (includes LLVM, MPICH, FlexiBLAS, LAPACK, ScaLAPACK and FFTW).
30+
31+
Authors:
32+
33+
* Jan Reuter (JSC)
34+
"""
35+
from easybuild.toolchains.lmpich import Lmpich
36+
from easybuild.toolchains.lfbf import Lfbf
37+
from easybuild.toolchains.fft.fftw import Fftw
38+
from easybuild.toolchains.linalg.flexiblas import FlexiBLAS
39+
from easybuild.toolchains.linalg.scalapack import ScaLAPACK
40+
41+
42+
class Lmpflf(Lmpich, FlexiBLAS, ScaLAPACK, Fftw):
43+
"""Compiler toolchain with LLVM, MPICH, FlexiBLAS, ScaLAPACK and FFTW."""
44+
NAME = 'lmpflf'
45+
SUBTOOLCHAIN = [Lmpich.NAME, Lfbf.NAME]

easybuild/toolchains/lmpich.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
##
2+
# Copyright 2012-2025 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 gmpich compiler toolchain (includes GCC and MPICH).
27+
28+
Authors:
29+
30+
* Kenneth Hoste (Ghent University)
31+
* Jan Andre Reuter (JSC)
32+
"""
33+
34+
from easybuild.toolchains.llvm import LLVMtc
35+
from easybuild.toolchains.mpi.mpich import Mpich
36+
37+
38+
class Lmpich(LLVMtc, Mpich):
39+
"""Compiler toolchain with LLVM and MPICH."""
40+
NAME = 'lmpich'
41+
SUBTOOLCHAIN = LLVMtc.NAME

0 commit comments

Comments
 (0)