TadasBaltrusaitis / OpenFace

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

Closed RaymondJiangkw closed 2 years ago

RaymondJiangkw commented 3 years ago

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.

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:

TadasBaltrusaitis commented 3 years ago

I'm not sure if CUDA is causing an issue here, as OpenFace does not directly depend on CUDA. I wonder if it could be an issue with linking to TBB?

RaymondJiangkw commented 3 years ago

Thank you for providing cues! I will test it soon.