easyblock = 'ConfigureMake'

name = 'NCO'
version = "4.4.7"
versionsuffix = "-Python-2.7.10"

homepage = 'http://nco.sourceforge.net/'
description = """The NCO toolkit manipulates and analyzes data stored in netCDF-accessible
 formats, including DAP, HDF4, and HDF5. It exploits the geophysical
 expressivity of many CF (Climate & Forecast) metadata conventions,
 the flexible description of physical dimensions translated by UDUnits,
 the network transparency of OPeNDAP, the storage features
 (e.g., compression, chunking, groups) of HDF (the Hierarchical Data Format),
 and many powerful mathematical and statistical
 algorithms of GSL (the GNU Scientific Library)."""

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

source_urls = [SOURCEFORGE_SOURCE]
sources = [SOURCELOWER_TAR_GZ]

builddependencies = [
    ('Bison', '3.0.4'),
    ('flex', '2.5.39'),
]

dependencies = [
    ('ANTLR', '2.7.7', versionsuffix),
    ('libdap', '3.14.0', versionsuffix),
    ('GSL', '1.16'),
    ('UDUNITS', '2.2.19'),
    ('netCDF', '4.3.2'),
    ('netcdf4-python', '1.1.8', versionsuffix),
    ('scipy', '0.16.1', versionsuffix),
]

sanity_check_paths = {
    'files': ['bin/nc%s' % x for x in ('ap', 'ap2', 'atted', 'bo', 'diff', 'ea', 'ecat', 'es',
                                       'flint', 'ks', 'pdq', 'ra', 'rcat', 'rename', 'wa')] +
             ['lib/libnco.a', 'lib/libnco.%s' % SHLIB_EXT, 'lib/libnco_c++.a', 'lib/libnco_c++.%s' % SHLIB_EXT],
    'dirs': ['include'],
}

moduleclass = 'tools'
