# IT4Innovations 2021

easyblock = 'Tarball'

name = 'Blender'
version = '2.83.18'

homepage = 'https://www.blender.org/'
description = """Blender is the free and open source 3D creation suite. It supports
 the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering,
 compositing and motion tracking, even video editing and game creation."""

toolchain = {'name': 'GCC', 'version': '10.3.0'}

source_urls = ['https://ftp.nluug.nl/pub/graphics/blender/release/Blender2.83/']
sources = ['blender-%(version)s-linux-x64.tar.xz']
checksums = ['e3a6ef3eb5f83746c8b7a90a6eadc663faf8f28b263dd2ded4b985fdc9c6b1ca']

postinstallcmds = [
	'ml CUDAcore;"nvcc" -arch=sm_80 --cubin "%(installdir)s/2.83/scripts/addons/cycles/source/kernel/kernels/cuda/kernel.cu" -o "%(installdir)s/2.83/scripts/addons/cycles/lib/kernel_sm_80.cubin" -m64 --ptxas-options="-v" --use_fast_math -DNVCC -I"%(installdir)s/2.83/scripts/addons/cycles/source"',
	'ml CUDAcore;"nvcc" -arch=sm_80 --cubin "%(installdir)s/2.83/scripts/addons/cycles/source/kernel/kernels/cuda/filter.cu" -o "%(installdir)s/2.83/scripts/addons/cycles/lib/filter_sm_80.cubin" -m64 --ptxas-options="-v" --use_fast_math -DNVCC -I"%(installdir)s/2.83/scripts/addons/cycles/source"',
	'find %(installdir)s -executable -exec chmod +x {} \;',
]

modextrapaths = {'PATH': ''}

sanity_check_paths = {
    'files': ["blender"],
    'dirs': []
}

moduleclass = 'vis'
