# JH 2020

name = 'OpenCV'
version = '4.2.0'
versionsuffix = '-Py-3.7'

homepage = 'https://opencv.org/'
description = """OpenCV (Open Source Computer Vision Library) is an open source computer vision
 and machine learning software library. OpenCV was built to provide
 a common infrastructure for computer vision applications and to accelerate
 the use of machine perception in the commercial products."""

toolchain = {'name': 'intel', 'version': '2020a'} 
toolchainopts = {}

source_urls = [
    'https://github.com/opencv/opencv/archive/4.2.0',
    # the hash is version dependent! see 3rdparty/ippicv/ippicv.cmake
    'https://github.com/opencv/opencv_3rdparty/raw/ippicv/master_20191018/ippicv/',
]
sources = [
    SOURCELOWER_TAR_GZ,
    {'filename': 'ippicv_2020_lnx_intel64_20191018_general.tgz', 'extract_cmd': "cp %s %(builddir)s"},
]

patches = ['OpenCV-4.2.0_disable-AVX512-CascadeLake.patch']

builddependencies = [
    ('CMake', '3.16.2', '', True),
# compatibility test
#('slepc4py','3.12.0', '-Py-3.7', True),
#('petsc4py','3.12.0', '-Py-3.7', True),
#('VTK','8.2.0', '-intel-2020a-Py-3.7', True),
#('numba','0.48.0', '-intel-2020a-Py-3.7', True),
]

dependencies = [
    ('Py', '3.7', '', True),
    ('numpy', '1.18.1', versionsuffix, True),
    ('zlib', '1.2.11'),
    ('FFmpeg', '4.2.2'),
    ('libjpeg-turbo', '2.0.4'),
    ('libpng', '1.6.37'),
    ('LibTIFF', '4.1.0'),
    ('JasPer', '2.0.14'),
    ('Java', '13.0.1', '', True),
    ('ant', '1.10.7', '-Java-13.0.1', True),
    ('GLib', '2.64.0'),
    ('GTK+', '3.24.13'),
]

#configopts = "-DCPU_BASELINE=SSE3 -DCPU_BASELINE_DISABLE=AVX512-ICL,AVX512-CLX,AVX512-CNL,AVX512-KNM,AVX512-KNL"

moduleclass = 'vis'
