Reputation: 21
I compiled the dlib c++ code on macOS.This is the result when I type cmake
build cmake ..
-- The C compiler identification is AppleClang 7.3.0.7030029
-- The CXX compiler identification is AppleClang 7.3.0.7030029
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building a C++11 test project to see if your compiler supports C++11
-- ********** Your compiler failed to build a C++11 project. C++11 is required to use all parts of dlib! **********
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- C++11 activated (compiler doesn't have full C++11 support).
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Looking for png_create_read_struct
-- Looking for png_create_read_struct - found
-- Looking for jpeg_read_header
-- Looking for jpeg_read_header - found
-- Searching for BLAS and LAPACK
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.1")
-- Checking for module 'cblas'
-- No package 'cblas' found
-- Checking for module 'lapack'
-- No package 'lapack' found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Found Intel MKL BLAS/LAPACK library
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
-- *** Dlib CUDA support requires C++11 but your compiler doesn't support it. ***
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/fengshaozhe/Applications/dlib-19.4/examples/build
It seemed work well for me.Then I did
cmake --build . --config Release
It looked like everything is done.But when I tried to run the example like this
./face_landmark_detection_ex
I got this error.
dyld: Library not loaded: libmkl_rt.dylib
Referenced from: /Users/fengshaozhe/Applications/dlib-19.4/examples/build/./face_landmark_detection_ex
Reason: image not found
[1] 70386 trace trap ./face_landmark_detection_ex
Could someone help me please?
Upvotes: 1
Views: 1161
Reputation: 21
I solved this problem by upgrade the cmake. Last cmake version is 3.5, and the current cmake version is 3.8. But I don't exactly know why upgrading cmake can solve this problem. Could someone tell me the reason?
Upvotes: 1