name = 'ESMF'
version = '8.3.0'

homepage = 'https://www.earthsystemcog.org/projects/esmf/'
description = """The Earth System Modeling Framework (ESMF) is a suite of software tools for developing
 high-performance, multi-component Earth science modeling applications."""

toolchain = {'name': 'foss', 'version': '2022b'}
toolchainopts = {'usempi': True, 'openmp': True, 'cstd': 'c++11', 'pic': True}

source_urls = ['https://github.com/esmf-org/esmf/archive/']
sources = ['v%(version)s.tar.gz']
patches = ['ESMF-6.1.1_libopts.patch']
checksums = [
    '0ff43ede83d1ac6beabd3d5e2a646f7574174b28a48d1b9f2c318a054ba268fd',  # v8.3.0.tar.gz
    '3851627f07c32a7da55d99072d619942bd3a1d9dd002e1557716158e7aacdaf4',  # ESMF-6.1.1_libopts.patch
]

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

dependencies = [
    ('netCDF', '4.9.0'),
    ('netCDF-Fortran', '4.6.0'),
    ('netCDF-C++4', '4.3.1'),
    ('libarchive', '3.6.1'),
]

# disable errors from GCC 10 on mismatches between actual and dummy argument lists (GCC 9 behaviour)
prebuildopts = 'ESMF_F90COMPILEOPTS="${ESMF_F90COMPILEOPTS} -fallow-argument-mismatch"'

buildopts = 'ESMF_NETCDF_INCLUDE=$EBROOTNETCDFMINFORTRAN/include '
buildopts += 'ESMF_NETCDF_LIBS="`nc-config --libs` `nf-config --flibs` `ncxx4-config --libs`"'

# too parallel causes the build to become really slow
maxparallel = 8

moduleclass = 'geo'
