# IT4Innovations 2020
# LK

name = 'OpenBLAS'
version = '0.3.5'

homepage = 'http://xianyi.github.com/OpenBLAS/'
description = "OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version."

toolchain = {'name': 'GCC', 'version': '8.3.0-2.32'}
# need to build with -fno-tree-vectorize due to asm constraint bugs in OpenBLAS<0.3.6
# cfr. https://github.com/easybuilders/easybuild-easyconfigs/issues/7180
toolchainopts = {'vectorize': False}

source_urls = [
    # order matters, trying to download the large.tgz/timing.tgz LAPACK tarballs from GitHub causes trouble
    'http://www.netlib.org/lapack/timing/',
    'https://github.com/xianyi/OpenBLAS/archive/',
]
sources = ['v%(version)s.tar.gz']
patches = [
    ('large.tgz', '.'),
    ('timing.tgz', '.'),
    '%(name)s-%(version)s_disable_AVX512_dgemm_kernel.patch',
]
checksums = [
    '0950c14bd77c90a6427e26210d6dab422271bc86f9fc69126725833ecdaa0e85',  # v0.3.5.tar.gz
    'f328d88b7fa97722f271d7d0cfea1c220e0f8e5ed5ff01d8ef1eb51d6f4243a1',  # large.tgz
    '999c65f8ea8bd4eac7f1c7f3463d4946917afd20a997807300fe35d70122f3af',  # timing.tgz
    # OpenBLAS-0.3.5_disable_AVX512_dgemm_kernel.patch
    '56d5034869ebd7b63c7af23eadd0935280d4d57ac3b0d35956c64015a3103da9',
]

# extensive testing can be enabled by uncommenting the line below
# runtest = 'PATH=.:$PATH lapack-timing'

moduleclass = 'numlib'
