# IT4Innovations
# LK 2022

easyblock = 'ConfigureMake'

name = 'UCX'
version = '1.11.2'
versionsuffix= '-CUDA-11.6.0'

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

toolchain = {'name': 'NVHPC', 'version': '22.2'}
toolchainopts = {'pic': True}

source_urls = ['https://github.com/openucx/ucx/releases/download/v%(version)s']
sources = ['%(namelower)s-%(version)s.tar.gz']
#patches = ['%(name)s-%(version)s.patch']

builddependencies = [
    ('binutils', '2.35'),
    ('Autotools', '20200321'),
    ('pkg-config', '0.29.2'),
]

osdependencies = [OS_PKG_IBVERBS_DEV]

dependencies = [
    ('numactl', '2.0.13'),
    ('CUDAcore', '11.6.0', '', True),
]

configure_cmd = "contrib/configure-release"

configopts = '--enable-optimizations --enable-cma --enable-mt --with-verbs --with-gdrcopy=$EBROOTGDRCOPY '
configopts += '--without-java --disable-doxygen-doc --with-cuda=$EBROOTCUDACORE '

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'
