Skip to content
Merged
31 changes: 26 additions & 5 deletions easybuild/easyblocks/s/superlu.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
EasyBuild support for building and installing the SuperLU library, implemented as an easyblock

@author: Xavier Besseron (University of Luxembourg)
@author: J. Sassmannshausen (ICL/UK)
"""

import os
Expand Down Expand Up @@ -61,7 +62,12 @@ 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')
# At least for version 5.3.0 the name has changed:
superlu_version = self.version
if LooseVersion(superlu_version) >= LooseVersion('5.3'):
self.cfg.update('configopts', '-Denable_internal_blaslib=OFF')
else:
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
Expand All @@ -72,6 +78,7 @@ def configure_step(self):
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'):
Expand All @@ -88,10 +95,24 @@ def configure_step(self):
self.cfg.update('configopts', '-DBLA_VENDOR="%s"' % toolchain_blas)

elif toolchain_blas == 'OpenBLAS':
# 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)
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
Expand Down