#adapted by PERMON team

easyblock = 'MakeCp'

name = 'LIBSVM'
version = '3.22'

homepage = 'http://www.csie.ntu.edu.tw/~cjlin/libsvm/'
description = """LIBSVM is an integrated software for support vector classification, (C-SVC, nu-SVC), regression
 (epsilon-SVR, nu-SVR) and distribution estimation (one-class SVM). It supports multi-class classification."""

toolchain = {'name': 'intel', 'version': '2017a'}

source_urls = [homepage]
sources = [SOURCELOWER_TAR_GZ]

dependencies = [('Qt', '4.8.6', '', True)]

buildopts = ' && cd svm-toy/qt && make MOC=$EBROOTQT/bin/moc '
buildopts += 'CFLAGS="$CFLAGS -I$EBROOTQT/include -I$EBROOTQT/include/QtGui -lQtGui -lQtCore" && cd -'

files_to_copy = [(['svm-*'], 'bin'), 'tools']

sanity_check_paths = {
    'files': ['bin/svm-%s' % x for x in ['predict', 'scale', 'train']] + ['bin/svm-toy/qt/svm-toy'],
    'dirs': ['bin/svm-toy', 'tools'],
}

modextrapaths = {
    'PATH': ['bin', 'bin/svm-toy/qt'],
}

moduleclass = 'numlib'
