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.97k stars 1.85k forks source link

Make Error MacOS Catalina #871

Closed shanjng closed 4 years ago

shanjng commented 4 years ago

Describe the bug Make has 2 errors, without errors from: mkdir build \ cd build \ cmake -D CMAKE_BUILD_TYPE=RELEASE ..

but there is an error with running make.

To Reproduce

Expected behavior

Desktop (please complete the following information):

Additional Context After I run the brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/c26fb7c3c547836f4217f34bafdd0eb67e4440a6/Formula/opencv.rb I still get the following when I run brew info opencv? Still says 4.3 (bottled):

opencv: stable 4.3.0 (bottled) Open source computer vision library https://opencv.org/ /usr/local/Cellar/opencv/4.1.2 (753 files, 228.2MB) * Poured from bottle on 2020-05-13 at 11:39:07 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/opencv.rb ==> Dependencies Build: cmake ✔, pkg-config ✘ Required: ceres-solver ✔, eigen ✔, ffmpeg ✔, glog ✔, harfbuzz ✔, jpeg ✔, libpng ✔, libtiff ✔, numpy ✔, openblas ✔, openexr ✔, protobuf ✔, python@3.8 ✔, tbb ✔, webp ✔ ==> Analytics install: 14,986 (30 days), 48,071 (90 days), 183,708 (365 days) install-on-request: 13,871 (30 days), 43,702 (90 days), 165,851 (365 days) build-error: 0 (30 days)

Actual Error Message This is after running make (error messages at end):

Scanning dependencies of target LandmarkDetector [ 2%] Building CXX object lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/src/CCNF_patch_expert.cpp.o In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35: In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/include/stdafx.h:19: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/core.hpp:48: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core.hpp:54: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/base.hpp:58: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/cvstd.hpp:62: /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace using ::signbit; ~~^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:318:9: error: no member named 'fpclassify' in the global namespace using ::fpclassify; ~~^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:319:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'? using ::isfinite; ~~^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/math.h:749:12: note: 'finite' declared here extern int finite(double) ^ In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35: In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/include/stdafx.h:19: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/core.hpp:48: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core.hpp:54: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/base.hpp:58: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/cvstd.hpp:62: /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:320:9: error: no member named 'isinf' in the global namespace using ::isinf; ~~^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:321:9: error: no member named 'isnan' in the global namespace using ::isnan; ~~^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:322:9: error: no member named 'isnormal' in the global namespace using ::isnormal; ~~^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:323:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'? using ::isgreater; ^~ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:731:29: note: '::std::greater' declared here struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool> ^ In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35: In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/include/stdafx.h:19: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/core.hpp:48: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core.hpp:54: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/base.hpp:58: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/cvstd.hpp:62: /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:324:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'? using ::isgreaterequal; ^~ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:760:29: note: '::std::greater_equal' declared here struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool> ^ In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35: In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/include/stdafx.h:19: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/core.hpp:48: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core.hpp:54: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/base.hpp:58: In file included from /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/cvstd.hpp:62: /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:325:9: error: no member named 'isless' in the global namespace using ::isless; ~~^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:326:9: error: no member named 'islessequal' in the global namespace using ::islessequal; ~~^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:327:9: error: no member named 'islessgreater' in the global namespace using ::islessgreater; ~~^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:328:9: error: no member named 'isunordered' in the global namespace using ::isunordered; ~~^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:329:9: error: no member named 'isunordered' in the global namespace using ::isunordered; ~~^ In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35: In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/include/stdafx.h:27: In file included from /usr/local/include/dlib/image_processing/frontal_face_detector.h:7: In file included from /usr/local/include/dlib/image_processing/../image_processing/object_detector.h:7: In file included from /usr/local/include/dlib/image_processing/../geometry.h:10: In file included from /usr/local/include/dlib/image_processing/../geometry/point_transforms.h:9: In file included from /usr/local/include/dlib/image_processing/../geometry/../matrix/../optimization/../matrix.h:11: In file included from /usr/local/include/dlib/image_processing/../matrix/matrix_la.h:9: /usr/local/include/dlib/image_processing/../geometry/../matrix/../optimization/optimization_line_search.h:218:31: error: expected unqualified-id if (temp == 0 || std::fpclassify(temp) == FP_SUBNORMAL) ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/math.h:127:5: note: expanded from macro 'fpclassify' ( sizeof(x) == sizeof(float) ? __fpclassifyf((float)(x)) \ ^ In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35: In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/include/stdafx.h:28: In file included from /usr/local/include/dlib/opencv.h:10: /usr/local/include/dlib/image_processing/../opencv/cv_image.h:37:22: error: no viable conversion from 'const cv::Mat' to 'IplImage' (aka '_IplImage') IplImage temp = img; ^ ~~~ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/types_c.h:327:1: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const cv::Mat' to 'const _IplImage &' for 1st argument _IplImage ^ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/types_c.h:327:1: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const cv::Mat' to '_IplImage &&' for 1st argument /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/mat.hpp:1642:28: note: candidate template ignored: could not match 'vector<type-parameter-0-0, allocator >' against '_IplImage' template operator std::vector<_Tp>() const; ^ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/mat.hpp:1643:35: note: candidate template ignored: could not match 'Vec<type-parameter-0-0, cn>' against '_IplImage' template<typename _Tp, int n> operator Vec<_Tp, n>() const; ^ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/mat.hpp:1644:42: note: candidate template ignored: could not match 'Matx<type-parameter-0-0, m, n>' against '_IplImage' template<typename _Tp, int m, int n> operator Matx<_Tp, m, n>() const; ^ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/mat.hpp:1646:45: note: candidate template ignored: could not match 'array<type-parameter-0-0, _Size>' against '_IplImage' template<typename _Tp, std::size_t _Nm> operator std::array<_Tp, _Nm>() const; ^ In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35: In file included from /Users/userName/Documents/Coding/Research/OpenFace/lib/local/LandmarkDetector/include/stdafx.h:28: In file included from /usr/local/include/dlib/opencv.h:10: /usr/local/include/dlib/image_processing/../opencv/cv_image.h:136:22: error: no viable conversion from 'const cv::Mat' to 'IplImage' (aka '_IplImage') IplImage temp = img; ^ ~~~ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/types_c.h:327:1: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const cv::Mat' to 'const _IplImage &' for 1st argument _IplImage ^ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/types_c.h:327:1: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const cv::Mat' to '_IplImage &&' for 1st argument /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/mat.hpp:1642:28: note: candidate template ignored: could not match 'vector<type-parameter-0-0, allocator >' against '_IplImage' template operator std::vector<_Tp>() const; ^ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/mat.hpp:1643:35: note: candidate template ignored: could not match 'Vec<type-parameter-0-0, cn>' against '_IplImage' template<typename _Tp, int n> operator Vec<_Tp, n>() const; ^ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/mat.hpp:1644:42: note: candidate template ignored: could not match 'Matx<type-parameter-0-0, m, n>' against '_IplImage' template<typename _Tp, int m, int n> operator Matx<_Tp, m, n>() const; ^ /usr/local/Cellar/opencv/4.3.0/include/opencv4/opencv2/core/mat.hpp:1646:45: note: candidate template ignored: could not match 'array<type-parameter-0-0, _Size>' against '_IplImage' template<typename _Tp, std::size_t _Nm> operator std::array<_Tp, _Nm>() const; ^ 16 errors generated. make[2]: [lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/src/CCNF_patch_expert.cpp.o] Error 1 make[1]: [lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/all] Error 2 make: *** [all] Error 2

Question I've looked at a lot of the other issues, so I'm not sure where to go. I believe this has to do with OpenCV. Any help would be appreciated, thank you!

TommasoGhilardi commented 4 years ago

Cancel On Wed, 13 May 2020, 17:57 shan jiang, notifications@github.com wrote:

Describe the bug Make has 2 errors, without errors from: mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE ..

but there is an error with running make.

To Reproduce

Expected behavior

  • build to run without errors so i can go onto the build/bin/FaceLandmarkVid -device 0 command

Desktop (please complete the following information):

  • OS: MacOS Catalina
  • Version: 10.15.4
  • Compiler: gcc

Additional Context After I run the brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/c26fb7c3c547836f4217f34bafdd0eb67e4440a6/Formula/opencv.rb I still get the following when I run brew info opencv? Still says 4.3 (bottled):

opencv: stable 4.3.0 (bottled) Open source computer vision library https://opencv.org/ /usr/local/Cellar/opencv/4.1.2 (753 files, 228.2MB) * Poured from bottle on 2020-05-13 at 11:39:07 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/opencv.rb ==> Dependencies Build: cmake ✔, pkg-config ✘ Required: ceres-solver ✔, eigen ✔, ffmpeg ✔, glog ✔, harfbuzz ✔, jpeg ✔, libpng ✔, libtiff ✔, numpy ✔, openblas ✔, openexr ✔, protobuf ✔, python@3.8 ✔, tbb ✔, webp ✔ ==> Analytics install: 14,986 (30 days), 48,071 (90 days), 183,708 (365 days) install-on-request: 13,871 (30 days), 43,702 (90 days), 165,851 (365 days) build-error: 0 (30 days)

*Actual Error Message This is after running make:

Scanning dependencies of target openpose_lib [ 12%] Creating directories for 'openpose_lib' [ 25%] No download step for 'openpose_lib' [ 37%] No patch step for 'openpose_lib'

[ 50%] No update step for 'openpose_lib' [ 62%] Performing configure step for 'openpose_lib' -- The C compiler identification is AppleClang 11.0.3.11030032 -- The CXX compiler identification is AppleClang 11.0.3.11030032 -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- Check for working C compiler: /Library/Developer/CommandLineTools/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: /Library/Developer/CommandLineTools/usr/bin/c++ -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Warning (dev) at cmake/Misc.cmake:32 (set): implicitly converting 'BOOLEAN' to 'STRING' type. Call Stack (most recent call first): CMakeLists.txt:25 (include) This warning is for project developers. Use -Wno-dev to suppress it.

-- Found Boost: /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version "1.72.0", minimum required is "1.54") found components: system thread filesystem -- Found Threads: TRUE -- Found GFlags: /usr/local/include -- Found gflags (include: /usr/local/include, library: /usr/local/lib/libgflags.dylib) -- Found Glog: /usr/local/include -- Found glog (include: /usr/local/include, library: /usr/local/lib/libglog.dylib) -- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found version "3.11.4") -- Found PROTOBUF Compiler: /usr/local/bin/protoc -- HDF5: Using hdf5 compiler wrapper to determine C configuration -- HDF5: Using hdf5 compiler wrapper to determine CXX configuration -- Found HDF5: /usr/local/Cellar/hdf5/1.12.0/lib/libhdf5_cpp.dylib;/usr/local/Cellar/hdf5/1.12.0/lib/libhdf5.dylib;/usr/local/opt/szip/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib (found version "1.12.0") found components: HL -- -- CUDA is disabled. Building without it... CMake Error at /Applications/CMake.app/Contents/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message): Could NOT find vecLib (missing: vecLib_INCLUDE_DIR) Call Stack (most recent call first): /Applications/CMake.app/Contents/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE) cmake/Modules/FindvecLib.cmake:24 (find_package_handle_standard_args) cmake/Dependencies.cmake:135 (find_package) CMakeLists.txt:49 (include)

-- Configuring incomplete, errors occurred! See also "/Users//Documents/Coding/Research/openpose/build/caffe/src/openpose_lib-build/CMakeFiles/CMakeOutput.log". make[2]: [caffe/src/openpose_lib-stamp/openpose_lib-configure] Error 1 make[1]: [CMakeFiles/openpose_lib.dir/all] Error 2 make: *** [all] Error 2

Question I've looked at a lot of the other issues, so I'm not sure where to go. I believe this has to do with OpenCV. Any help would be appreciated, thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/TadasBaltrusaitis/OpenFace/issues/871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEYMXGC7XV7FKF3W43V5MDRRK7NBANCNFSM4M74A32A .

LXH-TK commented 4 years ago

I got the same problem when make the project. (macOS Catalina) Here is the output of cmake -D CMAKE_BUILD_TYPE=RELEASE ..:

[userName@TKdeMacBook-Air build ]$ cmake -D CMAKE_BUILD_TYPE=RELEASE ..
-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- 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
-- Found OpenBLAS libraries: /usr/local/opt/openblas/lib/libopenblas.dylib
-- Found OpenBLAS include: /usr/local/opt/openblas/include
OpenBLAS information:
  OpenBLAS_LIBRARIES: /usr/local/opt/openblas/lib/libopenblas.dylib
  OpenBLAS_INCLUDE: /usr/local/opt/openblas/include
-- Found OpenCV: /usr/local/Cellar/opencv/4.3.0 (found suitable version "4.3.0", minimum required is "4.0") found components: core imgproc calib3d highgui objdetect
OpenCV information:
  OpenCV_INCLUDE_DIRS: /usr/local/Cellar/opencv/4.3.0/include/opencv4
  OpenCV_LIBRARIES: opencv_core;opencv_imgproc;opencv_calib3d;opencv_highgui;opencv_objdetect
  OpenCV_LIBRARY_DIRS:
-- Found X11: /usr/X11R6/include
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
X11 information:
  X11_INCLUDE_DIR: /usr/X11R6/include
  X11_LIBRARIES: /usr/X11R6/lib/libSM.dylib;/usr/X11R6/lib/libICE.dylib;/usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib
  X11_LIBRARY_DIRS:
-- Found Boost: /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version "1.72.0", minimum required is "1.5.9") found components: filesystem system
Boost information:
  Boost_VERSION: 1.72.0
  Boost_INCLUDE_DIRS: /usr/local/include
  Boost_LIBRARIES: Boost::filesystem;Boost::system
  Boost_LIBRARY_DIRS: /usr/local/lib
dlib information:
  dlib version: 19.19.0
-- Standalone mode detected; Enabling configuration/targets export.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/userName/Downloads/OpenFace-master/build

I have tried OpenCV4.1.2 before but it got the same problem. Any help would be appreciated. Thank you!

LXH-TK commented 4 years ago

@shanjng Dear, I solved this problem by uninstalling my Xcode. I think the problem lies in the compiler. I checked the include <> paths, before uninstalling Xcode, the include <> paths were from /Application/Xcode/... after uninstalling Xcode it shows:

[userName@TKdeMacBook-Air ~ ]$ gcc -Wp,-v -E -
clang -cc1 version 11.0.3 (clang-1103.0.32.59) default target x86_64-apple-darwin19.4.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
 /Library/Developer/CommandLineTools/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.

You may run gcc -Wp,-v -E - to see some differences.


To make a contrast, below is the output of cmake -D CMAKE_BUILD_TYPE=RELEASE ...:

[userName@TKdeMacBook-Air build ]$ cmake -D CMAKE_BUILD_TYPE=RELEASE ..
-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/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: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenBLAS libraries: /usr/local/opt/openblas/lib/libopenblas.dylib
-- Found OpenBLAS include: /usr/local/opt/openblas/include
OpenBLAS information:
  OpenBLAS_LIBRARIES: /usr/local/opt/openblas/lib/libopenblas.dylib
  OpenBLAS_INCLUDE: /usr/local/opt/openblas/include
-- Found OpenCV: /usr/local/Cellar/opencv/4.3.0 (found suitable version "4.3.0", minimum required is "4.0") found components: core imgproc calib3d highgui objdetect
OpenCV information:
  OpenCV_INCLUDE_DIRS: /usr/local/Cellar/opencv/4.3.0/include/opencv4
  OpenCV_LIBRARIES: opencv_core;opencv_imgproc;opencv_calib3d;opencv_highgui;opencv_objdetect
  OpenCV_LIBRARY_DIRS:
-- Found Boost: /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version "1.72.0", minimum required is "1.5.9") found components: filesystem system
Boost information:
  Boost_VERSION: 1.72.0
  Boost_INCLUDE_DIRS: /usr/local/include
  Boost_LIBRARIES: Boost::filesystem;Boost::system
  Boost_LIBRARY_DIRS: /usr/local/lib
dlib information:
  dlib version: 19.19.0
-- Standalone mode detected; Enabling configuration/targets export.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/userName/Downloads/OpenFace-master/build

Hope it will be helpful.

shanjng commented 4 years ago

@LXH-TK Thank you for your response. When running gcc -Wp,-v -E - I actually get the following without uninstalling XCode:

clang -cc1 version 11.0.3 (clang-1103.0.32.59) default target x86_64-apple-darwin19.4.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
 /Library/Developer/CommandLineTools/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.

So, I actually get the same thing as you did after uninstalling without having to uninstall. I may still try uninstalling. When you uninstalled Xcode, did you then reinstall it when you ran cmake -D CMAKE_BUILD_TYPE=RELEASE ... in your above post? And to uninstall did you simply delete XCode in the Applications folder?

It seems like our cmake -D CMAKE_BUILD_TYPE=RELEASE .. output is also quite different as well. I have no messages about "compiler identification" nor anything under "OpenCV_LIBRARY_DIRS:" as you do!:

-- Found OpenBLAS libraries: /usr/local/opt/openblas/lib/libopenblas.dylib
-- Found OpenBLAS include: /usr/local/opt/openblas/include
OpenBLAS information:
  OpenBLAS_LIBRARIES: /usr/local/opt/openblas/lib/libopenblas.dylib
  OpenBLAS_INCLUDE: /usr/local/opt/openblas/include
OpenCV information:
  OpenCV_INCLUDE_DIRS: /usr/local/Cellar/opencv/4.1.2/include/opencv4
  OpenCV_LIBRARIES: opencv_core;opencv_imgproc;opencv_calib3d;opencv_highgui;opencv_objdetect
  OpenCV_LIBRARY_DIRS: 
Boost information:
  Boost_VERSION: 1.72.0
  Boost_INCLUDE_DIRS: /usr/local/include
  Boost_LIBRARIES: Boost::filesystem;Boost::system
  Boost_LIBRARY_DIRS: /usr/local/lib
dlib information:
  dlib version: 19.19.0
-- Standalone mode detected; Enabling configuration/targets export.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/userName/Documents/Coding/Research/OpenFace/build`

Nevertheless, thank you for your help! I'm glad you figured out your issue. Mine has no mentions of compiler identification nor OpenCV_LIBRARY_DIRS, which is different from your output. If you could take a look at my output that'd be appreciated.

LXH-TK commented 4 years ago

@shanjng Dear,

I didn't reinstall Xcode when I ran cmake -D CMAKE_BUILD_TYPE=RELEASE .... To uninstall my Xcode I first deleted XCode in the Applications folder, then I delete its residues by App Cleaner & Uninstaller 6.7.1.

If it was not the first time your use cmake -D CMAKE_BUILD_TYPE=RELEASE .. command, I think you can delete your build directory and rerun the commands:

mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE ..

Then you may get compiler identification.

shanjng commented 4 years ago

@LXH-TK

Once uninstalling XCode I have the compiler identification messages now. However, my installed libraries from brew are breaking because Homebrew requires the command line tools of XCode. In the wiki it says to use the Command Line Tools too.

When I run cmake -D CMAKE_BUILD_TYPE=RELEASE .. I get:

CMake Error in lib/local/LandmarkDetector/CMakeLists.txt:
  Imported target "dlib::dlib" includes non-existent path

    "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

I think I need to have XCode. How did you come to the conclusion that deleting XCode would help?

shanjng commented 4 years ago

@LXH-TK Interestingly, I reinstalled XCode and ran brew install dlib instead of brew install --build-from-source dlib and the build command worked now! To note: I have cask cmake.

Are you getting any errors running build/bin/FaceLandmarkVid -device 0?:

dyld: Library not loaded: /usr/local/opt/ilmbase/lib/libImath-2_3.24.dylib
  Referenced from: /usr/local/opt/opencv/lib/libopencv_imgcodecs.4.1.dylib
  Reason: image not found
Abort trap: 6
LXH-TK commented 4 years ago

@shanjng I reinstalled Xcode and built the project just now but still got error messages when make. However, when I change Xcode's path of active developer directory and rebuild the project, it works!

[userName@TKdeMacBook-Air ~ ]$  xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
[userName@TKdeMacBook-Air ~ ]$ sudo xcode-select --switch /Library/Developer/CommandLineTools


build/bin/FaceLandmarkVid -device 0 worked for me. Did you download the models? And you may try to reinstall OpenCV. (OpenCV on my Mac is 4.3.)

LXH-TK commented 4 years ago

Here is my final solution.

macOS Catalina 10.15.4 & OpenCV 4.3.0 & Xcode 11.4.1 & CommandLineTools


If you want to run by make:

sudo xcode-select -s /Library/Developer/CommandLineTools

Then clean the build directory and rerun the commands in OpenFace/wiki.


If you want to compile/run in Xcode:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
cmake -G Xcode ..

If you get error like this:

CMake Error in lib/local/Utilities/CMakeLists.txt:
  Imported target "dlib::dlib" includes non-existent path

    "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

Run brew reinstall --build-from-source dlib. Then clean the build directory and rerun cmake -G Xcode .., you will get .xcodeproj file. If you get error like this in Xcode:

no member named 'signbit' in the global namespace
using ::signbit;

I fixed it by deleting CommandLineTools since the <math.h> included was from CommandLineTools but <cmath.h> included was from Xcode.


Have a nice day. 😃

shanjng commented 4 years ago

@LXH-TK Thank you for the help! I went with the /Library/Developer/CommandLineTools path for the XCode command line tools.

I encountered more errors but solved all of them! For all the dyld: Library not loaded: errors, I followed the instructions in #831 by downgrading the libraries I used for ilmbase, openexr, and openblas. I didn't have to run any of the install_name_tool commands. If anyone want to see my follow up for the openblas library error (or any library not loaded error) check #846.

Please like this comment if you felt it was helpful!

CriliasMiller commented 2 years ago
sudo xcode-select --switch /Library/Developer/CommandLineTools

Thank you very much!