OpenFace – a state-of-the art tool intended for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation.
Other
6.86k
stars
1.84k
forks
source link
Encounter problem about Threads::Threads while compiling #965
Describe the bug
Encounter target "Threads::Threads" not found while compiling with command cmake -D CMAKE_CXX_COMPILER=g++-8 -D CMAKE_C_COMPILER=gcc-8 -D CMAKE_BUILD_TYPE=RELEASE ..
To Reproduce
Steps to reproduce (after installing dlib, OpenCV, OpenBLAS, Boost, g++-8, cmake):
cd OpenFace
mkdir build
cd build
sudo cmake -D CMAKE_CXX_COMPILER=g++-8 -D CMAKE_C_COMPILER=gcc-8 -D CMAKE_BUILD_TYPE=RELEASE ..
Errors:
-- Found OpenBLAS libraries: /usr/lib/x86_64-linux-gnu/libopenblas.so
-- Found OpenBLAS include: /usr/include/x86_64-linux-gnu
OpenBLAS information:
OpenBLAS_LIBRARIES: /usr/lib/x86_64-linux-gnu/libopenblas.so
OpenBLAS_INCLUDE: /usr/include/x86_64-linux-gnu
OpenCV information:
OpenCV_INCLUDE_DIRS: /usr/local/include/opencv4
OpenCV_LIBRARIES: opencv_core;opencv_imgproc;opencv_calib3d;opencv_highgui;opencv_objdetect
OpenCV_LIBRARY_DIRS:
Boost information:
Boost_VERSION: 106501
Boost_INCLUDE_DIRS: /usr/include
Boost_LIBRARIES: /usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_system.so
Boost_LIBRARY_DIRS: /usr/lib/x86_64-linux-gnu
dlib information:
dlib version: 19.13.0
-- Standalone mode detected; Enabling configuration/targets export.
-- Configuring done
CMake Error at lib/local/LandmarkDetector/CMakeLists.txt:40 (add_library):
Target "LandmarkDetector" links to target "Threads::Threads" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at lib/local/FaceAnalyser/CMakeLists.txt:30 (add_library):
Target "FaceAnalyser" links to target "Threads::Threads" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at lib/local/GazeAnalyser/CMakeLists.txt:15 (add_library):
Target "GazeAnalyser" links to target "Threads::Threads" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at lib/local/Utilities/CMakeLists.txt:26 (add_library):
Target "Utilities" links to target "Threads::Threads" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at exe/FaceLandmarkImg/CMakeLists.txt:4 (add_executable):
Target "FaceLandmarkImg" links to target "Threads::Threads" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at exe/FaceLandmarkVid/CMakeLists.txt:4 (add_executable):
Target "FaceLandmarkVid" links to target "Threads::Threads" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at exe/FaceLandmarkVidMulti/CMakeLists.txt:4 (add_executable):
Target "FaceLandmarkVidMulti" links to target "Threads::Threads" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
CMake Error at exe/FeatureExtraction/CMakeLists.txt:4 (add_executable):
Target "FeatureExtraction" links to target "Threads::Threads" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
Desktop (please complete the following information):
OS: Ubuntu
Version 18.04.5 LTS (GNU/Linux 5.4.0-72-generic x86_64)
Compiler
g++-8 (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
cmake version 3.20.2
GNU Make 4.1
GNU ld (GNU Binutils for Ubuntu) 2.30
CUDA: Version 10.0.130 (NVIDIA Tesla K40c)
Additional context
I have searched for the possible existing solutions laboriously with key words like "cmake", "Threads::Threads", "target not found" and "-lThreads::Threads". The problem may be resulted from something with CUDA_LIBRARIES, but I find all following strategies not working:
Upgrade or Downgrade CMake (I have tested 1.12, 1.17, 1.20). (I find possibly relevant commit Cmake Commit)
Set flag -pthread for g++-8 by adding option -E env CXXFLAGS="-pthread".
Ignore errors and continue still by calling make, but receive error messages /usr/bin/ld cannot find -lThreads::Threads.
Describe the bug Encounter
target "Threads::Threads" not found
while compiling with commandcmake -D CMAKE_CXX_COMPILER=g++-8 -D CMAKE_C_COMPILER=gcc-8 -D CMAKE_BUILD_TYPE=RELEASE ..
To Reproduce Steps to reproduce (after installing
dlib
,OpenCV
,OpenBLAS
,Boost
,g++-8
,cmake
):Errors:
Expected behavior Generate build files successfully.
Desktop (please complete the following information):
Additional context I have searched for the possible existing solutions laboriously with key words like "cmake", "Threads::Threads", "target not found" and "-lThreads::Threads". The problem may be resulted from something with CUDA_LIBRARIES, but I find all following strategies not working:
-pthread
forg++-8
by adding option-E env CXXFLAGS="-pthread"
.make
, but receive error messages/usr/bin/ld cannot find -lThreads::Threads
.