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

Requesting help with "cmake -D WITH_OPENMP=ON CMAKE_BUILD_TYPE=RELEASE .." #1089

Open
jahyki opened this issue Jun 11, 2024 · 12 comments
Open

Comments

@jahyki
Copy link

jahyki commented Jun 11, 2024

Hello.
I am hoping to get some help with installation. I think this issue has been raised before and I have gone through previous posts and I still am having some difficulties. I am pretty new to this and I'd appreciate your help very much.

I have MacBook Pro 2023 Apple M3 running on Sonoma 14.3.1

I have followed the installation guide from here - https://github.com/TadasBaltrusaitis/OpenFace/wiki/Mac-Installation and have tried both options. But I get stuck at the same step, and that is during the build, epseciall with "cmake -D WITH_OPENMP=ON CMAKE_BUILD_TYPE=RELEASE .." in Option 1 and with "cmake -D CMAKE_BUILD_TYPE=RELEASE ..
" in Option 2 (I have followed all the steps in both options and have done deleted everything and started over twice).

This is what I get:

CMake Warning:
Ignoring extra path from command line:

"/Users/mq20174710/Documents/fea_tool-master/external_libs/openFace/OpenFace/build/CMAKE_BUILD_TYPE=RELEASE"

-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could not find OpenBLAS include, defaulting to using OpenFace vended ones
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
CMake Error at cmake/modules/FindOpenBLAS.cmake:103 (MESSAGE):
Could not find OpenBLAS
Call Stack (most recent call first):
CMakeLists.txt:16 (find_package)

-- Configuring incomplete, errors occurred!

So I basically get the same message in both options that it could not find OpenBLAS. I have even cloned the repository from here https://github.com/OpenMathLib/OpenBLAS and added it to my folder. But it still says it "Could not find OpenBLAS".

If you have any insights into what I can do, I would appreciate it very very much. Thank you very much for your time.

@brmarkus
Copy link

Would you have a chance to use Docker on your machine?
You could either use the pre-built Docker container or build it on your own machine (e.g. in case you want to change or add something).

I don't have a Mac (neither Intel-based nore M1/2/3/4).....

From the Wiki "https://github.com/TadasBaltrusaitis/OpenFace/wiki/Mac-Installation", can you run the steps from the script under "Option A" manually (not running the script, but call the commands from the script step by step manually) and show the output of the commands?
There is a comment at the top of the script (line 4) of "Option A", saying

run this script while being in the fea_tool directory

And then in line 16 it changes to an existing folder external_libs...
Are these two folders fea_tool and external_libs Apple-OS specific, or XCode-IDE specific...?
At least it sounds important to run the steps in that specific folder fea_tool...

(or run the steps from "Option B" manually and show the output of the commands)

@user4-33
Copy link

@jahyi Did you solved the issue except running it as a docker?
Having exact the same error...

@brmarkus
Copy link

With

epseciall with "cmake -D WITH_OPENMP=ON CMAKE_BUILD_TYPE=RELEASE .." in Option 1 and with "cmake -D CMAKE_BUILD_TYPE=RELEASE ..
" in Option 2

and

CMake Warning:
Ignoring extra path from command line:

Don't put a space between -D and the option (plus add -D to the other defines command line option), but do this:

cmake -DWITH_OPENMP=ON -DCMAKE_BUILD_TYPE=RELEASE ..

or

cmake -DCMAKE_BUILD_TYPE=RELEASE ..

@user4-33
Copy link

With cmake -DWITH_OPENMP=ON -DCMAKE_BUILD_TYPE=RELEASE .. I got

-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could not find OpenBLAS include, defaulting to using OpenFace vended ones
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
CMake Error at cmake/modules/FindOpenBLAS.cmake:103 (MESSAGE):
  Could not find OpenBLAS
Call Stack (most recent call first):
  CMakeLists.txt:16 (find_package)


-- Configuring incomplete, errors occurred!

and with cmake -DCMAKE_BUILD_TYPE=RELEASE .. I got

-- Could not find OpenBLAS include, defaulting to using OpenFace vended ones
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
CMake Error at cmake/modules/FindOpenBLAS.cmake:103 (MESSAGE):
  Could not find OpenBLAS
Call Stack (most recent call first):
  CMakeLists.txt:16 (find_package)


-- Configuring incomplete, errors occurred!

I followed the steps from option A, but I don't get further than the first cmake command...

@brmarkus
Copy link

Has the line brew install openblas from the script succeeded?

What happens if you call it again?

I don't have experience with MAC-OS... however, under Linux, I needed to install openblas-dev (calling sudo apt-get install libopenblas-dev under my Ubuntu environment) to get the cmake- and header-files... Is there a similar concept in Mac-OS?

@user4-33
Copy link

Yes it has.

When calling again I get

Warning: openblas 0.3.27 is already installed and up-to-date.
To reinstall 0.3.27, run:
  brew reinstall openblas

Before trying to build this application, I managed to build some others in the past – even when not being familiar with cmake...

It seems like cmake has some troubles to find the exact location of openblas, but I do not know how to solve that...

@brmarkus
Copy link

Do you know how to check where brew has installed openblas?

In other Github issues the following was mentioned:

cmake -DWITH_OPENMP=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_PREFIX_PATH=/usr/local/opt/openblas ..
or
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_PREFIX_PATH=/usr/local/opt/openblas ..

but that only works if it got installed under /usr/local/opt/openblas.

@user4-33
Copy link

user4-33 commented Jul 15, 2024

With brew --prefix openblas I could find the path: /opt/homebrew/opt/openblas and tried both versions.

In every case I still get

-- Could not find OpenBLAS include, defaulting to using OpenFace vended ones
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
CMake Error at cmake/modules/FindOpenBLAS.cmake:103 (MESSAGE):
  Could not find OpenBLAS
Call Stack (most recent call first):
  CMakeLists.txt:16 (find_package)


-- Configuring incomplete, errors occurred!

I'm not sure if it helps to edit the FindOpenBLAS.cmake file in the cmake directory?

@brmarkus
Copy link

I'm not sure if it helps to edit the FindOpenBLAS.cmake file in the cmake directory?

Yes, sure - at least compare what FindOpenBLAS.cmake is searching for and what you can find under /opt/homebrew/opt/openblas/.

Do you see a f77blas.h and a library openblas?

Hmm, in FindOpenBLAS.cmake is a colorful collection of any sort of base paths, inconsistently making use of environment variables like OpenBLAS and OpenBLAS_HOME.
Have you already tried these?

@user4-33
Copy link

I can find f77blas.h under /opt/homebrew/opt/openblas/include.

When navigating to /opt/homebrew/opt/openblas/ there is

Changelog.txt		LICENSE			include
INSTALL_RECEIPT.json	README.md		lib

When executing ls -R here, there is

ls -R
Changelog.txt		LICENSE			include
INSTALL_RECEIPT.json	README.md		lib

./include:
cblas.h			lapacke.h		lapacke_utils.h
f77blas.h		lapacke_config.h	openblas_config.h
lapack.h		lapacke_mangling.h

./lib:
cmake				libopenblas.dylib
libblas.dylib			libopenblasp-r0.3.27.a
liblapack.dylib			libopenblasp-r0.3.27.dylib
libopenblas.0.dylib		pkgconfig
libopenblas.a

./lib/cmake:
openblas

./lib/cmake/openblas:
OpenBLASConfig.cmake		OpenBLASConfigVersion.cmake

./lib/pkgconfig:
openblas.pc

Not sure what you mean if there is library openblas?

How can I try to use the variables OpenBLAS and OpenBLAS_HOME as you mentioned?

@brmarkus
Copy link

I can find f77blas.h under /opt/homebrew/opt/openblas/include.
Perfect, that is the required header-file (plus other, additional header-files) for the compiler.

./lib:
cmake libopenblas.dylib
libblas.dylib libopenblasp-r0.3.27.a
liblapack.dylib libopenblasp-r0.3.27.dylib
libopenblas.0.dylib pkgconfig
libopenblas.a

These are the libraries (static library and dynamic libraries plus symbolic links for more/less detailed version schema information),

Not sure what you mean if there is library openblas?
These files are the libraries for the linker (static or dynamic linkage).

./lib/cmake/openblas:
OpenBLASConfig.cmake OpenBLASConfigVersion.cmake
./lib/pkgconfig:
openblas.pc

These could very much ease the cmake file - but would require more manual changes.

How can I try to use the variables OpenBLAS and OpenBLAS_HOME as you mentioned?

According to a quick googling it looks like you could set/export ENV variables the same way under MAC-OS as under Linux:

Enter the following line: export VARIABLE_NAME= Note: Replace VARIABLE_NAME with the name of your variable and with its value (if has spaces in it, wrap it in ").

So you could try this:

export OpenBLAS_HOME=/opt/homebrew/opt/openblas
cmake -DWITH_OPENMP=ON -DCMAKE_BUILD_TYPE=RELEASE  ..

or

export OpenBLAS_HOME=/opt/homebrew/opt/openblas
cmake -DCMAKE_BUILD_TYPE=RELEASE  ..

@user4-33
Copy link

user4-33 commented Jul 16, 2024

I see!

Okay, so with the first option I got:

-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenBLAS libraries: /opt/homebrew/opt/openblas/lib/libopenblas.dylib
-- Found OpenBLAS include: /opt/homebrew/opt/openblas/include
OpenBLAS information:
  OpenBLAS_LIBRARIES: /opt/homebrew/opt/openblas/lib/libopenblas.dylib
  OpenBLAS_INCLUDE: /opt/homebrew/opt/openblas/include
CMake Error at CMakeLists.txt:32 (find_package):
  By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OpenCV", but
  CMake did not find one.

  Could not find a package configuration file provided by "OpenCV" (requested
  version 4.0) with any of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake

  Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
  "OpenCV_DIR" to a directory containing one of the above files.  If "OpenCV"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!

So I did brew install opencv, retried and got

-- Found OpenBLAS libraries: /opt/homebrew/opt/openblas/lib/libopenblas.dylib
-- Found OpenBLAS include: /opt/homebrew/opt/openblas/include
OpenBLAS information:
  OpenBLAS_LIBRARIES: /opt/homebrew/opt/openblas/lib/libopenblas.dylib
  OpenBLAS_INCLUDE: /opt/homebrew/opt/openblas/include
-- Found OpenCV: /opt/homebrew/Cellar/opencv/4.10.0 (found suitable version "4.10.0", minimum required is "4.0") found components: core imgproc calib3d highgui objdetect
OpenCV information:
  OpenCV_INCLUDE_DIRS: /opt/homebrew/Cellar/opencv/4.10.0/include/opencv4
  OpenCV_LIBRARIES: opencv_core;opencv_imgproc;opencv_calib3d;opencv_highgui;opencv_objdetect
  OpenCV_LIBRARY_DIRS: 
CMake Warning (dev) at CMakeLists.txt:42 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /opt/anaconda3/lib/cmake/Boost-1.82.0/BoostConfig.cmake (found suitable version "1.82.0", minimum required is "1.5.9") found components: filesystem system
Boost information:
  Boost_VERSION: 1.82.0
  Boost_INCLUDE_DIRS: /opt/anaconda3/include
  Boost_LIBRARIES: Boost::filesystem;Boost::system
  Boost_LIBRARY_DIRS: /opt/anaconda3/lib
dlib information:
  dlib version: 19.24.4
-- Standalone mode detected; Enabling configuration/targets export.
-- Configuring done (0.1s)
-- Generating done (0.4s)
-- Build files have been written to: /Users/myName/Nextcloud/Applications/OpenFace/build

So it seems it has worked!

After successfully running, make I got some more warnings about some deprecated functions, but I hope I don't have to worry about that too much...

Anyways – thank you so much!!

(After that, when executing build/bin/FaceLandmarkVid -device 0 in the OpenFace root dir, I needed to brew install ffmpeg@6, retried and it worked!)

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

3 participants