easyblock = 'ConfigureMake'

name = 'Octave'
version = '3.8.2'

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

toolchain = {'name': 'gimkl', 'version': '2.11.5'}

source_urls = [GNU_SOURCE]
sources = [SOURCELOWER_TAR_GZ]

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

dependencies = [
    ('PCRE', '8.37'),
    ('ncurses', '5.9'),
    ('libreadline', '6.3'),
]

configopts = '--with-blas="-fopenmp $LIBBLAS_MT"'

# Because of missing man pages (non-standard location)
postinstallcmds = [
    'mkdir -p %(installdir)s/share/man/man1',
    'cp doc/interpreter/*.1 %(installdir)s/share/man/man1'
]
modextrapaths = {'MANPATH': 'share/man'}

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

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

moduleclass = 'math'