easyblock = "ConfigureMake"

name = "MIGRATE-N"
version = "4.2.2a"

homepage = 'http://popgen.sc.fsu.edu/Migrate/Migrate-n.html'
description = """Migrate estimates effective population sizes and past migration rates
 between n population assuming a migration matrix model
 with asymmetric migration tates and different subpopulation sizes."""

toolchain = {'name': 'intel', 'version': '2015b'}

source_urls = [
    'http://popgen.sc.fsu.edu/currentversions/',
    'http://popgen.sc.fsu.edu/oldversions/%(version_major)s.x/%(version_major_minor)s',
    'http://popgen.sc.fsu.edu/oldversions/',
]
sources = ['migrate-%(version)s.src.tar.gz']

patches = [
    'migrate-%(version)s_icc.patch',
    'migrate-%(version)s_install.patch',
]

dependencies = [
    ('zlib', '1.2.8'),
]

configopts = '--enable-A4 "CC=$CC" STDCPLUS=-lstdc++ '
prebuildopts = 'make mpis && make clean && '

start_dir = 'src'

sanity_check_paths = {
    'files': ['bin/migrate-n', 'bin/migrate-n-mpi'],
    'dirs': []
}

moduleclass = 'bio'
