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': 'foss', 'version': '2017a'}

# 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('.', '_')]
checksums = ['82ff13f4e7d7bffab6352e4551dfa13afabf82bff54ea5761d1fc1e78341d7de']

dependencies = [('Java', '1.8.0_144', '', True)]

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

# 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'
