# IT4Innovations 2023
# JK
easyblock = 'ConfigureMake'

name = 'UCX'
version = '1.13.1'

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': '12.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.13.1-dynamic_modules.patch',
    'UCX-1.13.1_fix-undeclared-PTR.patch',
]
checksums = [
    {'ucx-1.13.1.tar.gz': '2c4a2f96c700e3705e185c2846a710691b6e800e8aec11fd4b3e47bcc3990548'},
    {'UCX-1.13.1-dynamic_modules.patch': '00874687bd90b795fff61aaa183f6c6bea2210aa1003b28f23d9ebf7066f8782'},
    {'UCX-1.13.1_fix-undeclared-PTR.patch': 'ef22c29604552ad3223f2a6bac352f30023cc5cf68f786abfdc4ad7c04189a76'},
]

builddependencies = [
    ('binutils', '2.39'),
    ('Autotools', '20220317'),
    ('pkgconf', '1.9.3'),
]

osdependencies = [OS_PKG_IBVERBS_DEV]

dependencies = [
    ('zlib', '1.2.12'),
    ('numactl', '2.0.16'),
]

configure_cmd = "contrib/configure-release"

configopts = '--enable-optimizations --enable-cma --enable-mt --with-verbs '
configopts += '--without-java --without-go --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'
