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

Linking against Intel-OpenMP #12766

Open
mratsim opened this issue Oct 7, 2018 · 3 comments
Open

Linking against Intel-OpenMP #12766

mratsim opened this issue Oct 7, 2018 · 3 comments

Comments

@mratsim
Copy link

mratsim commented Oct 7, 2018

System information (version)
  • OpenCV => master - #a9c8a52
  • Operating System / Platform => Linux
  • Compiler => GCC 7 + NVCC
Detailed description

Currently OpenCV cannot be linked easily to Intel OpenMP by passing -liomp5 -lpthread -L<icc_dir>/lib as mentioned in Intel User Guide - using the OpenMP Libraries due to CMake.

Also following limitations in the current MKL-DNN with TBB, both Intel MKL and MKL-DNN are built with OpenMP on my system.

As I'm linking OpenCV to MKL for the BLAS and LAPACK functionalities, it's probably best to also use OpenMP for OpenCV.

Following the recommendation of MKL-DNN I'm trying to link against Intel OpenMP but I'm stuck.

Steps to reproduce
  • Install Intel MKL
  • Install MKL-DNN
  • Try to build OpenCV with WITH_OPENMP=ON
  • Check the parallel lib during cmake config, it will be pthread
@alalek
Copy link
Member

alalek commented Oct 8, 2018

What MKL version is used?

@mratsim
Copy link
Author

mratsim commented Oct 8, 2018

MKL 2018.3.222 downloaded and installed with this script: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=intel-parallel-studio-xe#n64

@mratsim
Copy link
Author

mratsim commented Oct 8, 2018

I think #12771 should have been kept open while this one should be closed.

Especially due to point 4

  1. Where is MKL used? As mentioned here MKL_WITH_TBB failed to found the latest TBB 2018 on Windows #11383, BLAS library are not needed anymore for DNN in OpenCV 3.3 but I would expect that LAPACK functionality is still needed given that the option WITH_LAPACK is still there but even the PCA is not using LAPACK for either SVD or covariance matrix + eigenvecs computation. Checking the linked libraries/dependencies yields "Unused shared library":

If MKL is not needed we can just remove BLAS and LAPACK related options from the cmake scripts. Though being able to choose the OpenMP implementation still remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants