##
# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
#
# Copyright:: Copyright 2012-2013 The Cyprus Institute
# Authors::   Thekla Loizou <t.loizou@cyi.ac.cy>, Andreas Panteli <a.panteli@cyi.ac.cy>,
# License::   MIT/GPL
#
##
easyblock = 'MakeCp'

name = 'PLINK'
version = '1.07'

homepage = 'http://zzz.bwh.harvard.edu/plink/'
description = "plink-1.07-src: Whole-genome association analysis toolset"

toolchain = {'name': 'ictce', 'version': '5.3.0'}
toolchainopts = {'openmp': True}

sources = ['%(namelower)s-%(version)s-src.zip']
source_urls = ['http://zzz.bwh.harvard.edu/plink/dist/']

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

buildopts = 'CXX_UNIX="$CXX $CXXFLAGS" WITH_R_PLUGINS=1 WITH_WEBCHECK="" WITH_ZLIB=1'
buildopts += ' WITH_LAPACK=1 FORCE_DYNAMIC=1 LIB_LAPACK=$BLAS_LAPACK_LIB_DIR/libmkl_lapack.a'

files_to_copy = [
    (["plink", "gPLINK.jar"], 'bin'),
    "test.map",
    "test.ped",
    "COPYING.txt",
    "README.txt",
]

sanity_check_paths = {
    'files': ["bin/plink", "bin/gPLINK.jar", "test.map", "test.ped", "COPYING.txt", "README.txt"],
    'dirs': [],
}

moduleclass = 'bio'
