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

use correct GTK+ version for OpenCV based on dependencies #2520

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion easybuild/easyblocks/o/opencv.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.config import build_option
from easybuild.tools.filetools import compute_checksum, copy
from easybuild.tools.modules import get_software_libdir, get_software_root
from easybuild.tools.modules import get_software_libdir, get_software_root, get_software_version
from easybuild.tools.systemtools import X86_64, get_cpu_architecture, get_cpu_features, get_shared_lib_ext
from easybuild.tools.toolchain.compiler import OPTARCH_GENERIC

Expand Down Expand Up @@ -149,6 +149,13 @@ def configure_step(self):
lib_path = os.path.join(dep_root, libdir, lib_file)
self.cfg.update('configopts', '-D%s_LIBRARY=%s' % (opt_name, lib_path))

# GTK+3 is used by default, use GTK+2 or none explicitely to avoid picking up a system GTK
if get_software_root('GTK+'):
if LooseVersion(get_software_version('GTK+')) < LooseVersion('3.0'):
self.cfg.update('configopts', '-DWITH_GTK_2_X=ON')
else:
self.cfg.update('configopts', '-DWITH_GTK=OFF')

# configure optimisation for CPU architecture
# see https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options
if self.toolchain.options.get('optarch') and 'CPU_BASELINE' not in self.cfg['configopts']:
Expand Down