Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with build on MacOS #980

Open
biancacap opened this issue Jul 2, 2021 · 16 comments
Open

Issue with build on MacOS #980

biancacap opened this issue Jul 2, 2021 · 16 comments

Comments

@biancacap
Copy link

When I do "make" within the build directory I get many errors:

biancacaproni@Biancas-Air build % make
Consolidate compiler generated 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/biancacaproni/openface/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35:
In file included from /Users/biancacaproni/openface/lib/local/LandmarkDetector/include/stdafx.h:19:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core/core.hpp:48:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core.hpp:53:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core/base.hpp:58:
In file included from /usr/local/Cellar/opencv/4.5.2_4/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;
~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:749:12: note: 'finite' declared here
extern int finite(double)
^
In file included from /Users/biancacaproni/openface/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35:
In file included from /Users/biancacaproni/openface/lib/local/LandmarkDetector/include/stdafx.h:19:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core/core.hpp:48:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core.hpp:53:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core/base.hpp:58:
In file included from /usr/local/Cellar/opencv/4.5.2_4/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/biancacaproni/openface/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35:
In file included from /Users/biancacaproni/openface/lib/local/LandmarkDetector/include/stdafx.h:19:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core/core.hpp:48:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core.hpp:53:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core/base.hpp:58:
In file included from /usr/local/Cellar/opencv/4.5.2_4/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/biancacaproni/openface/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35:
In file included from /Users/biancacaproni/openface/lib/local/LandmarkDetector/include/stdafx.h:19:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core/core.hpp:48:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core.hpp:53:
In file included from /usr/local/Cellar/opencv/4.5.2_4/include/opencv4/opencv2/core/base.hpp:58:
In file included from /usr/local/Cellar/opencv/4.5.2_4/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/biancacaproni/openface/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35:
In file included from /Users/biancacaproni/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)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:127:5: note: expanded from macro 'fpclassify'
( sizeof(x) == sizeof(float) ? __fpclassifyf((float)(x))
^
14 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


My MacBook Air runs on MacOS Catalina Version 10.15.7.

I am unable to download Command Line Tools for XCode. I think that is part of the issue, but I thought I should still be able to use OpenFace. How do I get around this?

@biancacap biancacap changed the title Issue with build Issue with build on MacOS Jul 2, 2021
@ThomasJanssoone
Copy link

As part of my research, I designed a tool to help extract features on video, with openFace among others.

We wrote a small script to install it on OSX. You can find it here. Please feel free to use (and don't hesitate to tell me if there is any issue with it)

Best,

@TadasBaltrusaitis
Copy link
Owner

Awesome, thanks! I included this in the wiki instructions if you don't mind.

@ThomasJanssoone
Copy link

ThomasJanssoone commented Jul 17, 2021 via email

@ravikiranrao
Copy link

Does this work for M1 Macs?

@bahadirbk
Copy link

@TadasBaltrusaitis I need to use openface tool for my project. I have installed and ran it successfully on Ubuntu before but now I need to use it on Mac OS. I did what @ThomasJanssoone suggested to install in on mac but I' m having an issue while building it. I have M1 Mac so the architecture is arm64 here. I've shared the error below. Please help me guys! Thanks. Also, have u managed to run it on M1 macs by any chance @ravikiranrao ?

When I do 'make' after 'cmake' in the build folder, I got this error:

objc[52417]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x210af7678) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10aee82c8). One of the two will be used. Which one is undefined.
objc[52417]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x210af76c8) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10aee8318). One of the two will be used. Which one is undefined.
Consolidate compiler generated dependencies of target LandmarkDetector
[ 34%] Built target LandmarkDetector
Consolidate compiler generated dependencies of target FaceAnalyser
[ 54%] Built target FaceAnalyser
Consolidate compiler generated dependencies of target GazeAnalyser
[ 59%] Built target GazeAnalyser
Consolidate compiler generated dependencies of target Utilities
[ 81%] Built target Utilities
Consolidate compiler generated dependencies of target FaceLandmarkImg
[ 84%] Linking CXX executable ../../bin/FaceLandmarkImg
Undefined symbols for architecture arm64:
"__gfortran_concat_string", referenced from:
dgesvd in libopenblas.a(dgesvd.f.o)
dormbr in libopenblas.a(dormbr.f.o)
dormlq in libopenblas.a(dormlq.f.o)
dormqr in libopenblas.a(dormqr.f.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/FaceLandmarkImg] Error 1
make[1]: *** [exe/FaceLandmarkImg/CMakeFiles/FaceLandmarkImg.dir/all] Error 2
make: *** [all] Error 2

@ThomasJanssoone
Copy link

ThomasJanssoone commented Mar 2, 2022

Do you use the command
cmake -D WITH_OPENMP=ON CMAKE_BUILD_TYPE=RELEASE .. ?

@bahadirbk
Copy link

@ThomasJanssoone yes I did the exact same thing that you've shared in the script.

@ThomasJanssoone
Copy link

it might come from incompatibilty between former openBlas and M1 chip

Can you try port install OpenBLAS +native and then redo the whole cmake install ?

@bahadirbk
Copy link

bahadirbk commented Mar 2, 2022

@ThomasJanssoone I have installed it with homebrew rather than macports and I've tried to do "brew install OpenBLAS +native" so it could not find "+native" command. What command should I run?

@ravikiranrao
Copy link

@TadasBaltrusaitis I need to use openface tool for my project. I have installed and ran it successfully on Ubuntu before but now I need to use it on Mac OS. I did what @ThomasJanssoone suggested to install in on mac but I' m having an issue while building it. I have M1 Mac so the architecture is arm64 here. I've shared the error below. Please help me guys! Thanks. Also, have u managed to run it on M1 macs by any chance @ravikiranrao ?

When I do 'make' after 'cmake' in the build folder, I got this error:

objc[52417]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x210af7678) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10aee82c8). One of the two will be used. Which one is undefined. objc[52417]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x210af76c8) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10aee8318). One of the two will be used. Which one is undefined. Consolidate compiler generated dependencies of target LandmarkDetector [ 34%] Built target LandmarkDetector Consolidate compiler generated dependencies of target FaceAnalyser [ 54%] Built target FaceAnalyser Consolidate compiler generated dependencies of target GazeAnalyser [ 59%] Built target GazeAnalyser Consolidate compiler generated dependencies of target Utilities [ 81%] Built target Utilities Consolidate compiler generated dependencies of target FaceLandmarkImg [ 84%] Linking CXX executable ../../bin/FaceLandmarkImg Undefined symbols for architecture arm64: "__gfortran_concat_string", referenced from: dgesvd in libopenblas.a(dgesvd.f.o) dormbr in libopenblas.a(dormbr.f.o) dormlq in libopenblas.a(dormlq.f.o) dormqr in libopenblas.a(dormqr.f.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [bin/FaceLandmarkImg] Error 1 make[1]: *** [exe/FaceLandmarkImg/CMakeFiles/FaceLandmarkImg.dir/all] Error 2 make: *** [all] Error 2

No, I could not run on Mac M1. Moved on from that, sorry.

@ThomasJanssoone
Copy link

ThomasJanssoone commented Mar 22, 2022 via email

@AnnahGrace01
Copy link

Hi there,

When I run the script on my mac (M1 pro, Ventura 13.0.1), I get the followin error:

`cd: no such file or directory: external_libs
mkdir: openFace: File exists
fatal: destination path 'OpenFace' already exists and is not an empty directory.
mkdir: build: File exists
CMake Warning:
Ignoring extra path from command line:

".."

CMake Error: The source directory "/Users/annahmccurry/openFace/OpenFace/build/CMAKE_BUILD_TYPE=RELEASE" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.
bash: download_models.sh: No such file or directory
zsh: no matches found: lib/local/LandmarkDetector/model/patch_experts/*.dat`

I tried running port install OpenBLAS +native, but zsh: command not found: port.

Any help would be great. I am very new to working with computers, please forgive me if the problem is obvious.

@moritzwurm
Copy link

Hi, thank you for your amazing work!

I tried to install openFace, but I too get an error during the building. Any help would be greatly appreciated!

In short, the error is:
error: no
viable conversion from 'const cv::Mat' to 'IplImage' (aka '_IplImage')

I am working with a macbook pro 2019, 1.7 GHz Quad-Core Intel Core i7, Ventura 13.2.1 (22D68)

Here is the full error message:

moritz@Moritzs-MacBook-Pro-2020 build % cmake -D WITH_OPENMP=ON CMAKE_BUILD_TYPE=RELEASE ..
CMake Warning:
Ignoring extra path from command line:

"/Users/moritz/work/openFace/OpenFace/build/CMAKE_BUILD_TYPE=RELEASE"

-- 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.7.0_3/include/opencv4
OpenCV_LIBRARIES: opencv_core;opencv_imgproc;opencv_calib3d;opencv_highgui;opencv_objdetect
OpenCV_LIBRARY_DIRS:
Boost information:
Boost_VERSION: 1.81.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 (1.3s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/moritz/work/openFace/OpenFace/build
moritz@Moritzs-MacBook-Pro-2020 build % make
[ 2%] Building CXX object lib/local/LandmarkDetector/CMakeFiles/LandmarkDetector.dir/src/CCNF_patch_expert.cpp.o
In file included from /Users/moritz/work/openFace/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35:
In file included from /Users/moritz/work/openFace/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.7.0_3/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.7.0_3/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.7.0_3/include/opencv4/opencv2/core/mat.hpp:1661: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.7.0_3/include/opencv4/opencv2/core/mat.hpp:1662: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.7.0_3/include/opencv4/opencv2/core/mat.hpp:1663: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.7.0_3/include/opencv4/opencv2/core/mat.hpp:1665: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/moritz/work/openFace/OpenFace/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp:35:
In file included from /Users/moritz/work/openFace/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.7.0_3/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.7.0_3/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.7.0_3/include/opencv4/opencv2/core/mat.hpp:1661: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.7.0_3/include/opencv4/opencv2/core/mat.hpp:1662: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.7.0_3/include/opencv4/opencv2/core/mat.hpp:1663: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.7.0_3/include/opencv4/opencv2/core/mat.hpp:1665: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;
^
2 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

@nyotis
Copy link

nyotis commented Aug 9, 2023

Hi,

I am trying to install the software on a Mac OS Monterey Intel (v. 12.6.8) via Homebrew as described https://github.com/TadasBaltrusaitis/OpenFace/wiki/Mac-installation

brew install gcc --HEAD seems to hang for a couple of minutes...

Anyone facing similar trouble?
Cheers

Nikos

@nyotis
Copy link

nyotis commented Aug 10, 2023

same issue here

#1024

@nyotis
Copy link

nyotis commented Aug 14, 2023

On my machine Mac OS Monterey (12.6.8) I have built successfully by omitting the --HEAD flat from GCC - besides Clang is picked up as the C/C++ compiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants