From dbe8967bd82116e8e354437db6894ef3994ba238 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Thu, 5 May 2022 22:24:38 +0200 Subject: [PATCH 1/2] make Amber easyblock aware of FlexiBLAS --- easybuild/easyblocks/a/amber.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/a/amber.py b/easybuild/easyblocks/a/amber.py index 1c77c10696..2801a297b6 100644 --- a/easybuild/easyblocks/a/amber.py +++ b/easybuild/easyblocks/a/amber.py @@ -141,6 +141,17 @@ def configure_step(self): if self.toolchain.options.get('openmp', None): self.cfg.update('configopts', '-DOPENMP=TRUE') + # note: for Amber 20, a patch is required to fix the CMake scripts so they're aware of FlexiBLAS: + # - cmake/patched-cmake-modules/FindBLASFixed.cmake + # - cmake/patched-cmake-modules/FindLAPACKFixed.cmake + flexiblas_root = get_software_root('FlexiBLAS') + if flexiblas_root: + self.cfg.update('configopts', '-DBLA_VENDOR=FlexiBLAS') + else: + openblas_root = get_software_root('OpenBLAS') + if openblas_root: + self.cfg.update('configopts', '-DBLA_VENDOR=OpenBLAS') + cudaroot = get_software_root('CUDA') if cudaroot: self.with_cuda = True @@ -213,10 +224,11 @@ def configuremake_install_step(self): # define environment variables for MPI, BLAS/LAPACK & dependencies mklroot = get_software_root('imkl') - openblasroot = get_software_root('OpenBLAS') + flexiblas_root = get_software_root('FlexiBLAS') + openblas_root = get_software_root('OpenBLAS') if mklroot: env.setvar('MKL_HOME', os.getenv('MKLROOT')) - elif openblasroot: + elif flexiblas_root or openblas_root: lapack = os.getenv('LIBLAPACK') if lapack is None: raise EasyBuildError("LIBLAPACK (from OpenBLAS) not found in environment.") From effecb7c1960e95197c38fac51d543da945b8709 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Thu, 25 Aug 2022 15:03:50 +0200 Subject: [PATCH 2/2] fix remark w.r.t. error message in Amber easyblock when $LIBLAPACK is not defined when using OpenBLAS or FlexiBLAS --- easybuild/easyblocks/a/amber.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/a/amber.py b/easybuild/easyblocks/a/amber.py index 2801a297b6..d646b36b5c 100644 --- a/easybuild/easyblocks/a/amber.py +++ b/easybuild/easyblocks/a/amber.py @@ -231,7 +231,7 @@ def configuremake_install_step(self): elif flexiblas_root or openblas_root: lapack = os.getenv('LIBLAPACK') if lapack is None: - raise EasyBuildError("LIBLAPACK (from OpenBLAS) not found in environment.") + raise EasyBuildError("$LIBLAPACK for OpenBLAS or FlexiBLAS not defined in build environment!") else: env.setvar('GOTO', lapack)