# IT4Innovations
# LK 2024

easyblock = 'EB_Score_minus_P'

name = 'Score-P'
version = '8.4'

homepage = 'https://www.score-p.org'
description = """
The Score-P measurement infrastructure is a highly scalable and easy-to-use
tool suite for profiling, event tracing, and online analysis of HPC
applications.
"""

toolchain = {'name': 'NVHPC', 'version': '24.3-CUDA-12.3.0'}

source_urls = ['http://perftools.pages.jsc.fz-juelich.de/cicd/scorep/tags/scorep-%(version)s']
sources = ['scorep-%(version)s.tar.gz']
checksums = [
    '7bbde9a0721d27cc6205baf13c1626833bcfbabb1f33b325a2d67976290f7f8a',  # scorep-8.4.tar.gz
]

builddependencies = [
    ('CUDA', '12.3.0', '', SYSTEM),
    ('CubeLib', '4.8.2'),
    ('CubeWriter', '4.8.2'),
    # Unwinding/sampling support (optional):
    ('libunwind', '1.6.2'),
]

dependencies = [
    # binutils is implicitly available via GCC toolchain
    ('OPARI2', '2.0.8'),
    ('OTF2', '3.0.3'),
    # Hardware counter support (optional):
    ('PAPI', '7.0.1'),
    ('OpenMPI', '4.1.6'),
]

configopts = '--enable-shared --with-machine-name=$SYSTEMNAME '
# Enable CUDA support
configopts += '--with-libOpenCL=$EBROOTCUDA/targets/x86_64-linux '
# Make OMPT default, if available
configopts += '--enable-default=ompt '

postinstallcmds = ['make installcheck']

sanity_check_paths = {
    'files': ['bin/scorep', 'include/scorep/SCOREP_User.h',
              ('lib/libscorep_adapter_mpi_event.a', 'lib64/libscorep_adapter_mpi_event.a'),
              ('lib/libscorep_adapter_mpi_event.%s' % SHLIB_EXT, 'lib64/libscorep_adapter_mpi_event.%s' % SHLIB_EXT)],
    'dirs': [],
}

# Ensure that local metric documentation is found by CubeGUI
modextrapaths = {'CUBE_DOCPATH': 'share/doc/scorep/profile'}

moduleclass = 'perf'
