easyblock = 'CMakeMake'

name = "MUST"
version = "1.10.0-fiber-preview"

homepage = 'https://hpc.rwth-aachen.de/must/'
description = """MUST detects usage errors of the Message Passing Interface (MPI) and reports them
to the user. As MPI calls are complex and usage errors common, this functionality is extremely helpful
for application developers that want to develop correct MPI applications. This includes errors that
already manifest --segmentation faults or incorrect results -- as well as many errors that are not
visible to the application developer or do not manifest on a certain system or MPI implementation.
"""

toolchain = {'name': 'nvompi', 'version': '2022.07'}

source_urls = ['https://hpc.rwth-aachen.de/must/files/']
sources = ['%(name)s-v%(version)s.tar.gz']
patches = [
    'MUST-1.10.0-fiber-preview-tsan-module.patch',
    'MUST-1.10.0-fiber-preview-handle-shim.patch',
]
checksums = ['ddbcae9a7d09117470eb9a7cdddbf8772359b9892e24dc70ca9e49011342ffe3',
             '16d8a8abfe8ee947a15ee31d93bec917f14184e8680fc1ff3d727a2d4533d122',
	     '95146c044f27d19ec9b822a163e84d12eaf7edf7b2cee24dc1664026c6c0d161']
builddependencies = [
    ('CMake', '3.24.3'),
    ('Python', '3.10.4'),
]

dependencies = [
    #('Graphviz', '2.49.3'),
    ('libxml2', '2.9.13'),
    ('bzip2', '1.0.8'),
    ('Clang', '13.0.1', '-CUDA-11.7.0'),
]

# unset flags automatically set for nvc compiler by easybuild
preconfigopts = 'export CC=clang CXX=clang++ OMPI_CC=clang OMPI_CXX=clang++ CFLAGS="" CXXFLAGS="" FCFLAGS="" && '
configopts = ' -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TYPEART=OFF'
installopts  = 'all install-prebuilds'

sanity_check_paths = {
    'files': ["bin/mustrun", "include/mustConfig.h"],
    'dirs': [],
}

moduleclass = 'perf'
