enhance SuperLU easyblock to support building on top of FlexiBLAS and be compatible with SuperLU v5.3#2722
Conversation
def configure_step(self):
"""
Set the CMake options for SuperLU
"""
# Make sure not to build the slow BLAS library included in the package
self.cfg.update('configopts', '-Denable_blaslib=OFF')
# Set the BLAS library to use
# For this, use the BLA_VENDOR option from the FindBLAS module of CMake
# Check for all possible values at https://cmake.org/cmake/help/latest/module/FindBLAS.html
toolchain_blas_list = self.toolchain.definition().get('BLAS', None)
if toolchain_blas_list is None:
# This toolchain has no BLAS library
raise EasyBuildError("No BLAS library found in the toolchain")
toolchain_blas = toolchain_blas_list[0]
cmake_version = get_software_version('cmake')
if toolchain_blas == 'imkl':
imkl_version = get_software_version('imkl')
if LooseVersion(imkl_version) >= LooseVersion('10'):
# 'Intel10_64lp' -> For Intel mkl v10 64 bit,lp thread model, lp64 model
# It should work for Intel MKL 10 and above, as long as the library names stay the same
# SuperLU requires thread, 'Intel10_64lp_seq' will not work!
self.cfg.update('configopts', '-DBLA_VENDOR="Intel10_64lp"')
else:
# 'Intel' -> For older versions of mkl 32 and 64 bit
self.cfg.update('configopts', '-DBLA_VENDOR="Intel"')
elif toolchain_blas in ['ACML', 'ATLAS']:
self.cfg.update('configopts', '-DBLA_VENDOR="%s"' % toolchain_blas)
elif toolchain_blas == 'OpenBLAS':
if LooseVersion(cmake_version) >= LooseVersion('3.6'):
self.cfg.update('configopts', '-DBLA_VENDOR="%s"' % toolchain_blas)
else:
# Unfortunately, OpenBLAS is not recognized by FindBLAS from CMake,
# we have to specify the OpenBLAS library manually
openblas_lib = os.path.join(get_software_root('OpenBLAS'), get_software_libdir('OpenBLAS'), "libopenblas.a")
self.cfg.update('configopts', '-DBLAS_LIBRARIES="%s;-pthread"' % openblas_lib)
elif toolchain_blas == 'FlexiBLAS':
if LooseVersion(cmake_version) >= LooseVersion('3.19'):
self.cfg.update('configopts', '-DBLA_VENDOR="%s"' % toolchain_blas)
else:
# Unfortunately, FlexiBLAS is not recognized by FindBLAS from CMake,
# we have to specify the FlexiBLAS library manually
flexiblas_lib = os.path.join(get_software_root('FlexiBLAS'), get_software_libdir('FlexiBLAS'),
"libflexiblas.so")
self.cfg.update('configopts', '-DBLAS_LIBRARIES="%s;-pthread"' % flexiblas_lib)
else:
# This BLAS library is not supported yet
raise EasyBuildError("BLAS library '%s' is not supported yet", toolchain_blas)
super(EB_SuperLU, self).configure_step() |
|
@sassy-crick You need to ok my suggestions above to update the PR (and get the tests to pass) |
Co-authored-by: ocaisa <alan.ocais@cecam.org>
Co-authored-by: ocaisa <alan.ocais@cecam.org>
Co-authored-by: ocaisa <alan.ocais@cecam.org>
|
We might need to think about whether the change from |
Reverted `extra_vars['build_shared_libs'][0] = True` back to the original `extra_vars['build_shared_libs'][0] = False`
|
Test report by @ocaisa Overview of tested easyconfigs (in order)
Build succeeded for 2 out of 2 (2 easyconfigs in total) |
Co-authored-by: ocaisa <alan.ocais@cecam.org>
Co-authored-by: ocaisa <alan.ocais@cecam.org>
Co-authored-by: ocaisa <alan.ocais@cecam.org>
|
Thanks for your help! I am sure one day I understand Python! :-) |
|
Test report by @ocaisa Overview of tested easyconfigs (in order)
Build succeeded for 2 out of 2 (2 easyconfigs in total) |
ocaisa
left a comment
There was a problem hiding this comment.
Tested with FlexiBLAS, OpenBLAS and MKL
(created using
eb --new-pr)