Select Git revision
deployment.sh
-
Christian Boettcher authoredChristian Boettcher authored
OpenCV-4.7.0-gcccoremkl-11.3.0-2022.1.0-CUDA-12.0-contrib.eb 5.31 KiB
easyblock = 'CMakeMake'
name = 'OpenCV'
version = '4.7.0'
versionsuffix = '-CUDA-%(cudaver)s-contrib'
# the hash is version dependent! see 3rdparty/ippicv/ippicv.cmake
local_ippicv_hash = 'a56b6ac6f030c312b2dce17430eef13aed9af274'
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.
Includes extra modules for OpenCV from the contrib repository."""
toolchain = {'name': 'gcccoremkl', 'version': '11.3.0-2022.1.0'}
toolchainopts = {'pic': True, 'cstd': 'c++14', 'optarch': True}
sources = [
{
'source_urls': ['https://github.com/%(namelower)s/%(namelower)s/archive/'],
'download_filename': '%(version)s.zip',
'filename': SOURCELOWER_ZIP
},
{
'source_urls': ['https://github.com/%(namelower)s/opencv_contrib/archive/'],
'download_filename': '%(version)s.zip',
'filename': '%(namelower)s_contrib-%(version)s.zip'
},
{
'source_urls': ['https://raw.githubusercontent.com/opencv/opencv_3rdparty/%s/ippicv' % local_ippicv_hash],
'filename': 'ippicv_2020_lnx_intel64_20191018_general.tgz',
'extract_cmd': 'cp %s %(builddir)s'
},
]
checksums = [
'db6fb5e7dc76829d738fdbcdba11a810c66ca0a4752e531eaf3d793361e96de8', # opencv-4.7.0.zip
'ef001813ec39215593ce9deb3aec70a85278f57a0ed88b18f6f615265855436c', # opencv_contrib-4.7.0.zip
'08627fa5660d52d59309a572dd7db5b9c8aea234cfa5aee0942a1dd903554246', # ippicv_2020_lnx_intel64_20191018_general.tgz
]
builddependencies = [
('binutils', '2.38'),
('CMake', '3.23.1'),
]
dependencies = [
('Python', '3.10.4'),
('SciPy-bundle', '2022.05'), # for numpy
('zlib', '1.2.12'),
('FFmpeg', '4.4.2'),
('GStreamer', '1.20.2'),
('freetype', '2.12.1'),
('HarfBuzz', '4.2.1'),
('libjpeg-turbo', '2.1.3'),
('OpenJPEG', '2.5.0'),
('libpng', '1.6.37'),
('LibTIFF', '4.3.0'),
('libwebp', '1.2.4'),
('OpenEXR', '3.1.5'),
('JasPer', '2.0.33'),
('Java', '11', '', SYSTEM),
('ant', '1.10.13', '-Java-%(javaver)s', SYSTEM),
('GLib', '2.72.1'),
('GTK+', '3.24.34',),
('HDF5', '1.12.2', '-serial'), # needed by hdf from contrib
('protobuf', '3.19.6'),
('Eigen', '3.4.0'),
('CUDA', '11.7', '', SYSTEM),
('cuDNN', '8.6.0.163', '-CUDA-%(cudaver)s', SYSTEM),
('nvidia-Video_Codec_SDK', '11.1.5', '', SYSTEM),
('OpenGL', '2022a'),
]
configopts = "-D CMAKE_BUILD_TYPE=RELEASE "
configopts += '-D CMAKE_CXX_FLAGS="-Wdeprecated-declarations" '
configopts += "-D OPENCV_GENERATE_PKGCONFIG=ON "
configopts += "-D ENABLE_PRECOMPILED_HEADERS=OFF "
configopts += "-D BUILD_EXAMPLES=ON "
configopts += "-D INSTALL_PYTHON_EXAMPLES=ON "
configopts += "-D WITH_CUDA=ON "
configopts += "-D WITH_CUDNN=ON "
configopts += "-D WITH_CUBLAS=ON "
configopts += "-D WITH_CUFFT=ON "
configopts += "-D CUDA_ARCH_BIN='%(cuda_cc_space_sep)s' "
# configopts += "-D CUDA_ARCH_PTX='' "
configopts += "-D BUILD_CUDA_STUBS=ON "
configopts += "-D OPENCV_DNN_CUDA=ON "
configopts += "-D BUILD_opencv_cudacodec=ON "
configopts += "-D WITH_NVCUVID=ON "
configopts += "-D WITH_GSTREAMER=ON "
configopts += '-DOPENCV_EXTRA_MODULES_PATH=%(builddir)s/%(namelower)s_contrib-%(version)s/modules '
configopts += "-DProtobuf_INCLUDE_DIR=$EBROOTPROTOBUF/include "
configopts += "-DProtobuf_LIBRARY=$EBROOTPROTOBUF/lib64/libprotobuf.so "
configopts += "-DProtobuf_LITE_LIBRARY_RELEASE=$EBROOTPROTOBUF/lib64/libprotobuf-lite.so "
configopts += "-DProtobuf_PROTOC_LIBRARY_RELEASE=$EBROOTPROTOBUF/lib64/bprotoc.so "
configopts += "-DBUILD_PROTOBUF=OFF -DPROTOBUF_UPDATE_FILES=ON "
# XXXX in configurations is a bug fix in OpenCV because ocv_check_modules is not able to recognize freetype and harfbuzz
# ref: https://github.com/opencv/opencv/blob/6e8daaec0f46aaba9ea22e2afce47307b1dbff9f/cmake/OpenCVUtils.cmake#L861
configopts += " ".join([
"-DOPENCV_EXTRA_MODULES_PATH=%(builddir)s/%(namelower)s_contrib-%(version)s/modules",
"-DFREETYPE_FOUND=ON",
"-DFREETYPE_INCLUDE_DIRS=$EBROOTFREETYPE/include/freetype2/",
"-DFREETYPE_LIBRARIES=$EBROOTFREETYPE/lib64/libfreetype.so",
"-DFREETYPE_LINK_LIBRARIES=$EBROOTFREETYPE/lib64/libfreetype.so",
"-DFREETYPE_LINK_LIBRARIES_XXXXX=ON",
"-DHARFBUZZ_FOUND=ON",
"-DHARFBUZZ_INCLUDE_DIRS=$EBROOTHARFBUZZ/include/harfbuzz",
"-DHARFBUZZ_LIBRARIES=$EBROOTHARFBUZZ/lib64/libharfbuzz.so",
"-DHARFBUZZ_LINK_LIBRARIES=$EBROOTHARFBUZZ/lib64/libharfbuzz.so",
"-DHARFBUZZ_LINK_LIBRARIES_XXXXX=ON",
"-DBUILD_opencv_python2=OFF",
"-DCUDA_NVCC_FLAGS=--std=c++14",
])
enhance_sanity_check = True
local_contrib_libs = [
'aruco', 'bgsegm', 'bioinspired', 'ccalib', 'datasets', 'dnn_objdetect', 'dnn_superres', 'dpm', 'face', 'freetype',
'fuzzy', 'hdf', 'hfs', 'img_hash', 'line_descriptor', 'optflow', 'phase_unwrapping', 'plot', 'quality', 'reg',
'rgbd', 'saliency', 'shape', 'stereo', 'structured_light', 'superres', 'surface_matching', 'text', 'tracking',
'videostab', 'xfeatures2d', 'ximgproc', 'xobjdetect', 'xphoto'
]
sanity_check_paths = {
'files': ['lib64/libopencv_%s.%s' % (x, SHLIB_EXT) for x in local_contrib_libs],
'dirs': [],
}
moduleclass = 'vis'