# IT4Innovations 2020

easyblock = "CMakeMake"

name = 'SuperLU_DIST'
version = '6.3.0'

homepage = 'https://github.com/xiaoyeli/superlu_dist'
description = """SuperLU_DIST contains a set of subroutines to solve a sparse linear system A*X=B. It uses Gaussian elimination with static pivoting (GESP). Static pivoting is a technique that combines the numerical stability of partial pivoting with the scalability of Cholesky (no pivoting), to run accurately and efficiently on large numbers of processors.

SuperLU_DIST is a parallel extension to the serial SuperLU library. It is targeted for the distributed memory parallel machines. SuperLU_DIST is implemented in ANSI C, and MPI for communications. Currently, the LU factorization and triangular solution routines, which are the most time-consuming part of the solution process, are parallelized. The other routines, such as static pivoting and column preordering for sparsity are performed sequentially. This "alpha" release contains double-precision real and double-precision complex data types."""

toolchain = {'name': 'gompi', 'version': '2019b'}

source_urls = ['https://github.com/xiaoyeli/superlu_dist/archive/']
sources = ['v%(version)s.tar.gz']

# CMake > 3 required. CMake >= 3.4 recommended
builddependencies = [('CMake', '3.16.2', '', True)]

dependencies = [
    ('ParMETIS', '4.0.3'),
    ('mkl', '2020.0.166', '', True),
]

separate_build_dir = True

configopts = '-DTPL_PARMETIS_INCLUDE_DIRS="${EBROOTPARMETIS}/include" -DTPL_PARMETIS_LIBRARIES="${EBROOTPARMETIS}/lib/libparmetis.a" '
configopts += '-DTPL_BLAS_LIBRARIES="$EBROOTMKL/compilers_and_libraries_2020.0.166/linux/mkl/lib/intel64/libmkl_intel_lp64.so;$EBROOTMKL/compilers_and_libraries_2020.0.166/linux/mkl/lib/intel64/libmkl_core.so;$EBROOTMKL/compilers_and_libraries_2020.0.166/linux/mkl/lib/intel64/libmkl_gnu_thread.so;"'

sanity_check_paths = {
    'files': ['lib64/libsuperlu_dist.so'],
    'dirs': ['include', 'lib64'],
}

moduleclass = 'lib'
