easyblock = 'ConfigureMake'

name = 'Octave'
version = '4.0.3'

homepage = 'http://www.gnu.org/software/octave/'
description = """GNU Octave is a high-level interpreted language, primarily intended for numerical computations."""

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

source_urls = [GNU_SOURCE]
sources = [SOURCELOWER_TAR_GZ]

patches = ['%(name)s-%(version)s_intel.patch']

builddependencies = [
    ('Bison', '3.0.4'),
    ('flex', '2.6.0'),
    ('Autotools', '20150215'),
    ('libtool', '2.4.6'),
    ('gperf', '3.0.4'),
]

dependencies = [
    ('X11', '20160819'),
    ('PCRE', '8.39'),
    ('ncurses', '6.0'),
    ('libreadline', '6.3'),
    ('arpack-ng', '3.4.0'),
    ('cURL', '7.49.1'),
    ('FLTK', '1.3.3'),
    ('fontconfig', '2.12.1'),
    ('freetype', '2.6.5'),
    ('GLPK', '4.60'),
    ('GL2PS', '1.3.9'),
    ('gnuplot', '5.0.5'),
    ('Java', '1.8.0_112', '', True),
    ('zlib', '1.2.8'),
    ('Mesa', '12.0.2'),
    ('libGLU', '9.0.0'),
    ('Qhull', '2015.2'),
    ('Qt', '4.8.7'),
    ('HDF5', '1.8.17', '-serial'),
    ('qrupdate', '1.1.2'),
    ('SuiteSparse', '4.5.3', '-METIS-5.1.0'),
    ('GraphicsMagick', '1.3.25'),
    ('FFTW', '3.3.5'),
]

configopts = 'MOC=$EBROOTQT/bin/moc '
configopts += 'UIC=$EBROOTQT/bin/uic '
configopts += 'RCC=$EBROOTQT/bin/rcc '
configopts += 'LRELEASE=$EBROOTQT/bin/lrelease '
configopts += '--with-blas="$LIBBLAS" --with-lapack="$LIBLAPACK" --disable-docs '

sanity_check_paths = {
    'files': ['bin/octave'],
    'dirs': []
}

sanity_check_commands = [('octave', '--eval "1+2"')]

moduleclass = 'math'
