Skip to content

Commit 36c4ff6

Browse files
committed
Add MPI & Math sub-toolchains (rfbf, rfoss, rompi)
Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
1 parent 210a2ec commit 36c4ff6

3 files changed

Lines changed: 198 additions & 0 deletions

File tree

easybuild/toolchains/rfbf.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
##
2+
# Copyright 2021-2026 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 gfbf compiler toolchain (includes GCC, FlexiBLAS and FFTW)
27+
28+
Authors:
29+
30+
* Kenneth Hoste (Ghent University)
31+
* Bart Oldeman (McGill University, Calcul Quebec, Compute Canada)
32+
* Davide Grassano (CECAM EPFL)
33+
* Jan Reuter (jan@zyten.de)
34+
35+
"""
36+
37+
from easybuild.toolchains.rocm_compilers import ROCmCompilersToolchain
38+
from easybuild.toolchains.fft.fftw import Fftw
39+
from easybuild.toolchains.linalg.flexiblas import FlexiBLAS
40+
41+
42+
class Rfbf(ROCmCompilersToolchain, FlexiBLAS, Fftw):
43+
"""Compiler toolchain with ROCm-LLVM, FlexiBLAS and FFTW."""
44+
NAME = 'rfbf'
45+
SUBTOOLCHAIN = ROCmCompilersToolchain.NAME
46+
OPTIONAL = True

easybuild/toolchains/rfoss.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
##
2+
# Copyright 2013-2026 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 foss compiler toolchain (includes ROCm-LLVM, OpenMPI, OpenBLAS, LAPACK, ScaLAPACK and FFTW).
27+
28+
Authors:
29+
30+
* Kenneth Hoste (Ghent University)
31+
* Davide Grassano (CECAM EPFL)
32+
* Jan Reuter (jan@zyten.de)
33+
34+
"""
35+
from easybuild.toolchains.rompi import Rompi
36+
from easybuild.toolchains.rfbf import Rfbf
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+
from easybuild.tools import LooseVersion
41+
42+
43+
class RFoss(Rompi, FlexiBLAS, ScaLAPACK, Fftw):
44+
"""Compiler toolchain with ROCm-LLVM, OpenMPI, FlexiBLAS, ScaLAPACK and FFTW."""
45+
NAME = 'lfoss'
46+
SUBTOOLCHAIN = [
47+
Rompi.NAME,
48+
Rfbf.NAME
49+
]
50+
51+
def __init__(self, *args, **kwargs):
52+
"""Toolchain constructor."""
53+
super(RFoss, self).__init__(*args, **kwargs)
54+
55+
# need to transform a version like '2018b' with something that is safe to compare with '2019'
56+
# comparing subversions that include letters causes TypeErrors in Python 3
57+
# 'a' is assumed to be equivalent with '.01' (January), and 'b' with '.07' (June) (good enough for this purpose)
58+
version = self.version.replace('a', '.01').replace('b', '.07')
59+
60+
self.looseversion = LooseVersion(version)
61+
62+
constants = ('BLAS_MODULE_NAME', 'BLAS_LIB', 'BLAS_LIB_MT', 'BLAS_FAMILY',
63+
'LAPACK_MODULE_NAME', 'LAPACK_IS_BLAS', 'LAPACK_FAMILY')
64+
65+
for constant in constants:
66+
setattr(self, constant, getattr(FlexiBLAS, constant))
67+
68+
def banned_linked_shared_libs(self):
69+
"""
70+
List of shared libraries (names, file names, paths) which are
71+
not allowed to be linked in any installed binary/library.
72+
"""
73+
res = []
74+
res.extend(Rompi.banned_linked_shared_libs(self))
75+
res.extend(FlexiBLAS.banned_linked_shared_libs(self))
76+
res.extend(ScaLAPACK.banned_linked_shared_libs(self))
77+
res.extend(Fftw.banned_linked_shared_libs(self))
78+
79+
return res
80+
81+
def is_deprecated(self):
82+
"""Return whether or not this toolchain is deprecated."""
83+
84+
# lfoss toolchains older than 2023b should not exist (need GCC >= 13)
85+
if self.looseversion < LooseVersion('2023'):
86+
deprecated = True
87+
else:
88+
deprecated = False
89+
90+
return deprecated

easybuild/toolchains/rompi.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
##
2+
# Copyright 2012-2026 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 lompi compiler toolchain (includes LLVM and OpenMPI).
27+
28+
Authors:
29+
30+
* Kenneth Hoste (Ghent University)
31+
* Davide Grassano (CECAM EPFL)
32+
* Jan Reuter (jan@zyten.de)
33+
34+
"""
35+
from easybuild.tools import LooseVersion
36+
import re
37+
38+
from easybuild.toolchains.rocm_compilers import ROCmCompilersToolchain
39+
from easybuild.toolchains.mpi.openmpi import OpenMPI
40+
41+
42+
class Rompi(ROCmCompilersToolchain, OpenMPI):
43+
"""Compiler toolchain with ROCm-LLVM and OpenMPI."""
44+
NAME = 'rompi'
45+
SUBTOOLCHAIN = ROCmCompilersToolchain.NAME
46+
47+
def is_deprecated(self):
48+
"""Return whether or not this toolchain is deprecated."""
49+
# need to transform a version like '2018b' with something that is safe to compare with '2019'
50+
# comparing subversions that include letters causes TypeErrors in Python 3
51+
# 'a' is assumed to be equivalent with '.01' (January), and 'b' with '.07' (June) (good enough for this purpose)
52+
version = self.version.replace('a', '.01').replace('b', '.07')
53+
54+
deprecated = False
55+
56+
# make sure a non-symbolic version (e.g., 'system') is used before making comparisons using LooseVersion
57+
if re.match('^[0-9]', version):
58+
# rompi toolchains older than 2023b should not exist (need GCC >= 13)
59+
if LooseVersion(version) < LooseVersion('2023'):
60+
deprecated = True
61+
62+
return deprecated

0 commit comments

Comments
 (0)