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

fatal error: 'opencv2/core/version.hpp' file not found (Apple M1) #591

Closed
yujie-tao opened this issue May 24, 2022 · 2 comments · Fixed by #592
Closed

fatal error: 'opencv2/core/version.hpp' file not found (Apple M1) #591

yujie-tao opened this issue May 24, 2022 · 2 comments · Fixed by #592
Labels
host:macos Issue that occurs when host OS is macOS type:build/install Cannot build/install the plugin

Comments

@yujie-tao
Copy link

Plugin Version or Commit ID

V0.10.0

Unity Version

2021.3.3.f1

Your Host OS

Apple M1 MacOS Monterey

Target Platform

UnityEditor, Mac Standalone

[Windows Only] Visual Studio C++ and Windows SDK Version

No response

[Linux Only] GCC/G++ and GLIBC Version

No response

[Android Only] Android Build Tools and NDK Version

No response

[iOS Only] XCode Version

No response

Command Sequences

python build.py build --desktop cpu -vv

Log

external/com_google_mediapipe/mediapipe/framework/port/opencv_core_inc.h:18:10: fatal error: 'opencv2/core/version.hpp' file not found
#include <opencv2/core/version.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error in child process '/usr/bin/xcrun'. 1
Target //mediapipe_api:mediapipe_desktop failed to build
INFO: Elapsed time: 2.086s, Critical Path: 1.03s
INFO: 156 processes: 132 internal, 24 darwin-sandbox.
FAILED: Build did NOT complete successfully
Traceback (most recent call last):
File "/Users/yujiet/Desktop/Microsoft/MediaPipeUnityPlugin/build.py", line 450, in
Argument().command().run()
File "/Users/yujiet/Desktop/Microsoft/MediaPipeUnityPlugin/build.py", line 138, in run
self._run_command(self._build_desktop_commands())
File "/Users/yujiet/Desktop/Microsoft/MediaPipeUnityPlugin/build.py", line 54, in _run_command
return subprocess.run(' '.join(command_list), check=True, shell=shell)
File "/opt/homebrew/Cellar/[email protected]/3.9.13/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'bazel build -c opt --verbose_failures --define MEDIAPIPE_DISABLE_GPU=1 --@opencv//:switch=local //mediapipe_api:mediapipe_desktop' returned non-zero exit status 1.

Additional Context

I am trying to build the package on M1 laptop but keep getting this error. The OpenCV was installed under the /opt/homebrew/opt/opencv@3.

@yujie-tao yujie-tao added the type:build/install Cannot build/install the plugin label May 24, 2022
@homuler
Copy link
Owner

homuler commented May 25, 2022

Thank you for reporting the issue.
This is fixed by #592.
You can also work around this issue by linking OpenCV statically (python build.py build --desktop cpu --opencv cmake -vv).

@yujie-tao
Copy link
Author

Thanks for the swift fix! It works now.

@homuler homuler added the host:macos Issue that occurs when host OS is macOS label May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host:macos Issue that occurs when host OS is macOS type:build/install Cannot build/install the plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants