# IT4Innovations
# LK 2022

easyblock = 'ConfigureMake'

name = 'UCX'
version = '1.11.2'

homepage = 'https://www.openucx.org/'
description = """Unified Communication X
An open-source production grade communication framework for data centric
and high-performance applications
"""

toolchain = {'name': 'GCCcore', 'version': '11.2.0'}
toolchainopts = {'pic': True}

source_urls = ['https://github.com/openucx/ucx/releases/download/v%(version)s']
sources = ['%(namelower)s-%(version)s.tar.gz']
patches = [
    'UCX-1.10.0-dynamic_modules.patch',
    'UCX-1.11.2-missing_header.patch',
]
checksums = [
    'deebf86a5344fc2bd9e55449f88c650c4514928592807c9bc6fe4190e516c6df',  # ucx-1.11.2.tar.gz
    '3098c91f2aadc5f148466a2e8756769ad5e99f9515d8cfb6ad8a5712e7433408',  # UCX-1.10.0-dynamic_modules.patch
    'fa9052a33da5c8e94bc7df0e5fe6ce3baf613310842ae1ab9ed4ef2d49666c01',  # UCX-1.11.2-missing_header.patch
]

builddependencies = [
    ('binutils', '2.37'),
    ('Autotools', '20210726'),
    ('pkg-config', '0.29.2'),
]

osdependencies = [OS_PKG_IBVERBS_DEV]

dependencies = [
    ('zlib', '1.2.11'),
    ('numactl', '2.0.14'),
]

configure_cmd = "contrib/configure-release"

configopts = '--enable-optimizations --enable-cma --enable-mt --with-verbs '
configopts += '--without-java --disable-doxygen-doc '

buildopts = 'V=1'

sanity_check_paths = {
    'files': ['bin/ucx_info', 'bin/ucx_perftest', 'bin/ucx_read_profile'],
    'dirs': ['include', 'lib', 'share']
}

sanity_check_commands = ["ucx_info -d"]

moduleclass = 'lib'
