Skip to content

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

@portgasray

Description

@portgasray

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions