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

MKLINC-NOTFOUND or MKLLIB-NOTFOUND are not found #327

Closed
portgasray opened this issue Nov 20, 2019 · 7 comments
Closed

MKLINC-NOTFOUND or MKLLIB-NOTFOUND are not found #327

portgasray opened this issue Nov 20, 2019 · 7 comments

Comments

@portgasray
Copy link

Env:

  • version: 2019_R3
  • ubuntu 18.04

I met this error when building inference engine after cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DGEMM=MKL -DMKLROOT=/usr/local/lib/mklml -DENABLE_MKL_DNN=ON -DENABLE_CLDNN=ON ..
I already updated the submodule and performed install_dependencies.sh.

Here is the output (part)

-- [CACHE COMMAND]: /usr/bin/cmake -E copy_if_different /home/lab001/workspace/github-repo/dldt/inference-engine/thirdparty/clDNN/kernel_selector/core/cache/cache.json /home/lab001/workspace/github-repo/dldt/inference-engine/bin/intel64/Release/lib/
-- Performing Test HAS_MAYBE_UNINITIALIZED
-- Performing Test HAS_MAYBE_UNINITIALIZED - Success
-- Found Git: /usr/bin/git (found version "2.17.1") 
-- Detecting Intel(R) MKL: trying mklml_gnu
CMake Error at thirdparty/mkldnn.cmake:62 (message):
  MKLINC-NOTFOUND or MKLLIB-NOTFOUND are not found
Call Stack (most recent call first):
  thirdparty/mkldnn.cmake:139 (detect_mkl)
  thirdparty/CMakeLists.txt:61 (include)

and CMakeError.log

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/lab001/workspace/github-repo/dldt/inference-engine/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_7c2f1/fast"
/usr/bin/make -f CMakeFiles/cmTC_7c2f1.dir/build.make CMakeFiles/cmTC_7c2f1.dir/build
make[1]: Entering directory '/home/lab001/workspace/github-repo/dldt/inference-engine/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_7c2f1.dir/CheckSymbolExists.c.o
/usr/bin/cc   -fPIE -fPIC -Wformat -Wformat-security -fstack-protector-strong  -fPIE   -o CMakeFiles/cmTC_7c2f1.dir/CheckSymbolExists.c.o   -c /home/lab001/workspace/github-repo/dldt/inference-engine/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_7c2f1
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7c2f1.dir/link.txt --verbose=1
/usr/bin/cc   -fPIE -fPIC -Wformat -Wformat-security -fstack-protector-strong    -pie -z noexecstack -z relro -z now  CMakeFiles/cmTC_7c2f1.dir/CheckSymbolExists.c.o  -o cmTC_7c2f1 
CMakeFiles/cmTC_7c2f1.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_7c2f1.dir/build.make:97: recipe for target 'cmTC_7c2f1' failed
make[1]: *** [cmTC_7c2f1] Error 1
make[1]: Leaving directory '/home/lab001/workspace/github-repo/dldt/inference-engine/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_7c2f1/fast' failed
make: *** [cmTC_7c2f1/fast] Error 2

File /home/lab001/workspace/github-repo/dldt/inference-engine/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/lab001/workspace/github-repo/dldt/inference-engine/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_30d32/fast"
/usr/bin/make -f CMakeFiles/cmTC_30d32.dir/build.make CMakeFiles/cmTC_30d32.dir/build
make[1]: Entering directory '/home/lab001/workspace/github-repo/dldt/inference-engine/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_30d32.dir/CheckFunctionExists.c.o
/usr/bin/cc   -fPIE -fPIC -Wformat -Wformat-security -fstack-protector-strong -DCHECK_FUNCTION_EXISTS=pthread_create -fPIE   -o CMakeFiles/cmTC_30d32.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.10/Modules/CheckFunctionExists.c
Linking C executable cmTC_30d32
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_30d32.dir/link.txt --verbose=1
/usr/bin/cc   -fPIE -fPIC -Wformat -Wformat-security -fstack-protector-strong -DCHECK_FUNCTION_EXISTS=pthread_create   -pie -z noexecstack -z relro -z now  CMakeFiles/cmTC_30d32.dir/CheckFunctionExists.c.o  -o cmTC_30d32 -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_30d32.dir/build.make:97: recipe for target 'cmTC_30d32' failed
make[1]: *** [cmTC_30d32] Error 1
make[1]: Leaving directory '/home/lab001/workspace/github-repo/dldt/inference-engine/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_30d32/fast' failed
make: *** [cmTC_30d32/fast] Error 2
@asuhov
Copy link
Contributor

asuhov commented Nov 20, 2019

Hello, cmake searches for libmklml_gnu.so and libmklml_intel.so libraries in the /lib folder.
Could you check if these files are present in the /usr/local/lib/mklml/lib folder?

@portgasray
Copy link
Author

Hello, cmake searches for libmklml_gnu.so and libmklml_intel.so libraries in the /lib folder.
Could you check if these files are present in the /usr/local/lib/mklml/lib folder?

there is no /usr/local/lib/mklml/lib or /usr/local/lib/mklml

@asuhov
Copy link
Contributor

asuhov commented Nov 21, 2019

You specified this path in the cmake command: -DMKLROOT=/usr/local/lib/mklml

To build the inference engine with MKL, please download MKL package at https://github.com/intel/mkl-dnn/releases/download/v0.19/mklml_lnx_2019.0.5.20190502.tgz and specify a path to unpacked MKL with the include and lib folders in the -DMKLROOT parameter.

@portgasray
Copy link
Author

thank you, I had already passed compiling dldt!

@asuhov asuhov closed this as completed Nov 22, 2019
@portgasray
Copy link
Author

I remembered that I used the official install_gui , then passed!

@GlockPL
Copy link

GlockPL commented Mar 27, 2020

I have similar issue but on windows. I'm trying to build the lib with this command:
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DGEMM=MKL -DENABLE_MKL_DNN=ON -DMKLROOT=../dnnl_win_1.2.0_cpu_tbb ..
where ../dnnl_win_1.2.0_cpu_tbb is a folder which contains 1.2.0 version of mkl-dnn with include and lib dir both present.

@Liujingxiu23
Copy link

@portgasray I meet the same problem as you, but I confused how you solve the problem?

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

No branches or pull requests

4 participants