# IT4Innovations
# LK 2024

easyblock = 'ConfigureMake'

name = 'UCX-ROCM'
version = '1.16.0'
versionsuffix = '-rocm'

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

This module adds the UCX CUDA support.
"""

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

source_urls = ['https://github.com/openucx/ucx/releases/download/v%(version)s']
sources = [{'filename': 'ucx-%(version)s.tar.gz', 'alt_location': 'UCX'}]
#patches = ['%(name)s-1.11.0_link_against_existing_UCX_libs.patch']
checksums = [
    ('f73770d3b583c91aba5fb07557e655ead0786e057018bfe42f0ebe8716e9d28c',
     '4b202087076bc1c98f9249144f0c277a8ea88ad4ca6f404f94baa9cb3aebda6d'),  
    {'UCX-CUDA-1.11.0_link_against_existing_UCX_libs.patch':
     '457187fa020e526609ba91e7750c9941d57bd57d60d6eed317b40ad8824aca93'},
]

builddependencies = [
    ('binutils', '2.42'),
    ('Autotools', '20231222'),
    ('pkgconf', '2.2.0'),
]

dependencies = [
    ('zlib', '1.3.1'),
    ('UCX', '1.16.0', '-rocm'),
]

configopts = '--with-rocm=/opt/rocm --without-knem --enable-optimizations --enable-cma --enable-mt --with-verbs '
configopts += '--without-java --without-go --disable-doxygen-doc '

sanity_check_paths = {
    'files': [],
    'dirs': ['bin', 'include'],
}

moduleclass = 'lib'
