Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{vis}[foss/2018a] opencv_contrib v3.4.1 #6441

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,100 @@
easyblock = 'CMakeMake'

name = 'opencv_contrib'
version = '3.4.1'
versionsuffix = '-Python-%(pyver)s'

homepage = 'http://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': 'foss', 'version': '2018a'}

source_urls = [
'https://github.com/Itseez/opencv/archive/',
# The Hash is version dependent! see 3rdparty/ippicv/downloader.cmake
'https://raw.githubusercontent.com/Itseez/opencv_3rdparty/dfe3162c237af211e98b8960018b564bc209261d/ippicv',
'https://github.com/opencv/',
]
sources = [
'%(version)s.zip',
{'filename': 'ippicv_2017u3_lnx_intel64_general_20170822.tgz', 'extract_cmd': "cp %s %(builddir)s"},
# Make sure eb downloads the opencv_contrib source instead of twice the OpenCV source
{'download_filename': 'opencv_contrib/archive/%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ},
]
checksums = [
'24bda432eaace9e992322dcc3d30144cefa5314c2424d4aa02e5fe3fa9dd17bd', # 3.4.1.zip
# ippicv_2017u3_lnx_intel64_general_20170822.tgz
'9a4b14a24d31768c3ead0720f27d55dcf80723b5ba1cd8903bed1fd69f1b9e2e',
'298c69ee006d7675e1ff9d371ba8b0d9e7e88374bb7ba0f9d0789851d352ec6e', # opencv_contrib-3.4.1.tar.gz
]

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

dependencies = [
('Python', '3.6.4'),
('zlib', '1.2.11'),
('FFmpeg', '3.4.2'),
('libjpeg-turbo', '1.5.3'),
('libpng', '1.6.34'),
('LibTIFF', '4.0.9'),
('JasPer', '2.0.14'),
('Java', '1.8.0_162', '', True),
('ant', '1.10.1', '-Java-%(javaver)s', True),
('GLib', '2.54.3'),
('GTK+', '2.24.32'),
]

separate_build_dir = True

preconfigopts = 'export IPPROOT=$EBROOTICC/ipp && '

# The destination directory is "linux-<MD5>" see 3rdparty/ippicv/downloader.cmake
ippicv_dir = '3rdparty/ippicv/downloads/linux-4e0352ce96473837b1d671ce87f17359/'
preconfigopts = "mkdir -p %s && cp -a ../*.tgz %s && " % (ippicv_dir, ippicv_dir)

configopts = '-DCMAKE_BUILD_TYPE=RELEASE '
configopts += '-DBUILD_PYTHON_SUPPORT=ON '
configopts += '-DPYTHON_PACKAGES_PATH=%(installdir)s/lib/python%(pyshortver)s/site-packages '
configopts += '-DBUILD_NEW_PYTHON_SUPPORT=ON '
configopts += '-DZLIB_LIBRARY=$EBROOTZLIB/lib/libz.%s ' % SHLIB_EXT
configopts += '-DZLIB_INCLUDE_DIR=$EBROOTZLIB/include '
configopts += '-DTIFF_LIBRARY=$EBROOTLIBTIFF/lib/libtiff.%s ' % SHLIB_EXT
configopts += '-DTIFF_INCLUDE_DIR=$EBROOTLIBTIFF/include '
configopts += '-DPNG_LIBRARY=$EBROOTLIBPNG/lib/libpng.%s ' % SHLIB_EXT
configopts += '-DPNG_INCLUDE_DIR=$EBROOTLIBPNG/include '
configopts += '-DJPEG_LIBRARY=$EBROOTLIBJPEGMINTURBO/lib/libjpeg.%s ' % SHLIB_EXT
configopts += '-DJPEG_INCLUDE_DIR=$EBROOTLIBJPEGMINTURBO/include '
configopts += '-DJASPER_LIBRARY=$EBROOTJASPER/lib/libjasper.a '
configopts += '-DJASPER_INCLUDE_DIR=$EBROOTJASPER/include '
configopts += '-DWITH_IPP=ON '
# If you do not want fat binary, set the BASELINE to the target CPU, and uncomment the CPU-DISPATCH line
# (some) possible CPU targets are SSE3 SSE4_2 AVX AVX2 AVX_512SKX
configopts += '-DCPU_BASELINE=SSE3 '
# configopts += '-DCPU_DISPATCH=NONE '
configopts += '-DWITH_CUDA=OFF '
configopts += '-DOPENCV_EXTRA_MODULES_PATH="../%(name)s-%(version)s/modules" '

postinstallcmds = ["cp 3rdparty/ippicv/ippicv_lnx/lib/intel64/libippicv.* %(installdir)s/lib"]

sanity_check_paths = {
'files': ['lib64/libopencv_core.%s' % SHLIB_EXT, 'lib/libippicv.a'] +
['bin/opencv_%s' % x for x in ['annotation', 'createsamples', 'traincascade', 'interactive-calibration',
'version', 'visualisation', 'waldboost_detector']],
'dirs': ['include', 'lib/python%(pyshortver)s/site-packages']
}
sanity_check_commands = [
"python -c 'import cv2'",
"python -c 'import cv2.ximgproc'",
]

modextrapaths = {
'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages',
'CLASSPATH': 'share/OpenCV/java',
}

moduleclass = 'vis'