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

only build OpenCV with IPP support on x86_64 systems #2056

Merged
merged 3 commits into from
Jul 4, 2020
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
41 changes: 22 additions & 19 deletions easybuild/easyblocks/o/opencv.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
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.systemtools import get_cpu_features, get_shared_lib_ext
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 @@ -68,24 +68,27 @@ def prepare_step(self, *args, **kwargs):

self.pylibdir = det_pylibdir()

ippicv_tgz = glob.glob(os.path.join(self.builddir, 'ippicv*.tgz'))
if ippicv_tgz:
if len(ippicv_tgz) == 1:
# copy ippicv tarball in the right place
# expected location is 3rdparty/ippicv/downloads/linux-<md5sum>/
ippicv_tgz = ippicv_tgz[0]
ippicv_tgz_md5 = compute_checksum(ippicv_tgz, checksum_type='md5')
target_subdir = os.path.join('3rdparty', 'ippicv', 'downloads', 'linux-%s' % ippicv_tgz_md5)
copy([ippicv_tgz], os.path.join(self.cfg['start_dir'], target_subdir))

self.cfg.update('configopts', '-DWITH_IPP=ON')

# for recent OpenCV 3.x versions (and newer), we must also specify the download location
# to prevent that the ippicv tarball is re-downloaded
if LooseVersion(self.version) >= LooseVersion('3.4.4'):
self.cfg.update('configopts', '-DOPENCV_DOWNLOAD_PATH=%s' % self.builddir)
else:
raise EasyBuildError("Found multiple ippicv*.tgz source tarballs in %s: %s", self.builddir, ippicv_tgz)
if get_cpu_architecture() == X86_64:
# IPP are Intel's Integrated Performance Primitives - so only make sense on X86_64
ippicv_tgz = glob.glob(os.path.join(self.builddir, 'ippicv*.tgz'))
if ippicv_tgz:
if len(ippicv_tgz) == 1:
# copy ippicv tarball in the right place
# expected location is 3rdparty/ippicv/downloads/linux-<md5sum>/
ippicv_tgz = ippicv_tgz[0]
ippicv_tgz_md5 = compute_checksum(ippicv_tgz, checksum_type='md5')
target_subdir = os.path.join('3rdparty', 'ippicv', 'downloads', 'linux-%s' % ippicv_tgz_md5)
copy([ippicv_tgz], os.path.join(self.cfg['start_dir'], target_subdir))

self.cfg.update('configopts', '-DWITH_IPP=ON')

# for recent OpenCV 3.x versions (and newer), we must also specify the download location
# to prevent that the ippicv tarball is re-downloaded
if LooseVersion(self.version) >= LooseVersion('3.4.4'):
self.cfg.update('configopts', '-DOPENCV_DOWNLOAD_PATH=%s' % self.builddir)
else:
raise EasyBuildError("Found multiple ippicv*.tgz source tarballs in %s: %s",
self.builddir, ippicv_tgz)

def configure_step(self):
"""Custom configuration procedure for OpenCV."""
Expand Down