easyblock = 'CMakeMake'

name = 'ParallelIO'
version = '2.2.2a'

homepage = 'https://github.com/NCAR/ParallelIO'
description = """A high-level Parallel I/O Library for structured grid applications"""

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

sources = ['pio%s.tar.gz' % '_'.join(version.split('.'))]
source_urls = ['https://github.com/NCAR/ParallelIO/archive/']
checksums = ['052a03e8e3b5ac244dc53b397a9920af3066efffa216ea7f8e5e4ac73a8b8033']

separate_build_dir = True

dependencies = [
    ('PnetCDF', '1.8.1'),
    ('netCDF-Fortran', '4.4.4'),
]

builddependencies = [
    ('CMake', '3.8.2'),
]

preconfigopts = "NETCDF_C=$EBROOTNETCDF NETCDF_F=$EBROOTNETCDFMINFORTRAN "
configopts = "-DPIO_ENABLE_TIMING=OFF "

sanity_check_paths = {
    'files': ['lib/libpiof.a', 'include/pio.mod'],
    'dirs': [],
}

modextravars = {
    'PIO': '%(installdir)s'
}

moduleclass = 'data'
