easyblock = 'ConfigureMake'

name = 'beagle-lib'
version = '2.1.2'

homepage = 'https://github.com/beagle-dev/beagle-lib'
description = """
beagle-lib is a high-performance library that can perform the core
calculations at the heart of most Bayesian and Maximum Likelihood
phylogenetics packages.
"""

toolchain = {'name': 'goolf', 'version': '1.7.20'}

# https://github.com/beagle-dev/beagle-lib/archive/beagle_release_2_1_2.tar.gz
source_urls = ['https://github.com/beagle-dev/beagle-lib/archive/']
sources = ['beagle_release_%s.tar.gz' % version.replace('.', '_')]

dependencies = [('Java', '1.7.0_80', '', True)]

builddependencies = [('Autotools', '20150215', '', True)]

# parallel build does not work (to test)
parallel = 1

preconfigopts = "./autogen.sh && "

sanity_check_paths = {
    'files': ["include/libhmsbeagle-1/libhmsbeagle/%s" % includefile
              for includefile in ["beagle.h", "platform.h"]] +
             ["lib/libhmsbeagle%s.so" % libfile
              for libfile in ["-cpu", "-cpu-sse", "-jni", ""]],
    'dirs': []
}

moduleclass = 'numlib'
