# IT$innovations
# LK 2022

easyblock                 = 'CMakeMake'

name = 'rocm-cuda2hip'
version = '4.3.1'

homepage = 'https://github.com/ROCm-Developer-Tools/HIPIFY'
description = "ROCm-HIPIFY : Tools to translate CUDA source code into portable HIP C++ automatically."

toolchain = {'name': 'gcccuda', 'version': '2020b'}

sources = ['https://github.com/ROCm-Developer-Tools/HIPIFY/archive/refs/tags/rocm-4.3.1.tar.gz']

builddependencies = [
   ('CMake', '3.20.1')
]

dependencies = [
   ('Clang', '11.0.1'),
   ('cuDNN', '8.2.1.32', '-CUDA-11.3.1', True),
]

postinstallcmds = [
   'cp -a %(installdir)s/hipify-clang %(installdir)s/bin/rocm-cuda2hip',
   'ln  %(installdir)s/bin/rocm-cuda2hip  %(installdir)s/bin/hipify-clang',
   'ln  %(installdir)s/bin/rocm-cuda2hip  %(installdir)s/bin/ROCm-HIPIFY' 
]

sanity_check_commands = [('hipify-clang', '--version')]

sanity_check_paths = {
    'files': ['bin/%(namelower)s'],
    'dirs': ['include', 'lib']
}

moduleclass = 'devel'
