# IT4Innovations 2020
# LK

easyblock = 'ConfigureMake'

name = 'UCX'
version = '1.8.1'

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': 'GCC', 'version': '9.3.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.8.0_fix-undefined-symbol.patch',
]

builddependencies = [
    ('pkg-config', '0.29.2', '', True),
]

osdependencies = [('libibverbs-dev', 'libibverbs-devel', 'rdma-core-devel')]

dependencies = [
    ('numactl', '2.0.12'),
]

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

buildopts = 'V=1'

sanity_check_commands = ["ucx_info -d"]

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

moduleclass = 'lib'