|
| 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 |
0 commit comments