opencv: CMake Error at cmake/OpenCVCompilerOptimizations.cmake:611 - Compiler doesn't support baseline optimization flags
System Information
Python version: 3.11.2 OpenCV version: 4.x Mac version: Monterey 12.6 XCode version: 14.2
Detailed description
Have a React Native project integrating with OpenCV where the simulator isn’t working due to architecture difference. https://github.com/opencv/opencv/issues/21926
Then tried to follow the steps in: https://github.com/opencv/opencv/tree/4.x/platforms/ios https://github.com/opencv/opencv/tree/4.x/platforms/apple
But when trying to run: python opencv/platforms/apple/build_xcframework.py --out ./build_xcframework
Keep getting an error:
CMake Error at cmake/OpenCVCompilerOptimizations.cmake:611 (message):
Compiler doesn't support baseline optimization flags:
Call Stack (most recent call first):
cmake/OpenCVCompilerOptions.cmake:327 (ocv_compiler_optimization_options)
CMakeLists.txt:650 (include)
Steps to reproduce
git clone https://github.com/opencv/opencv.git
Then try to follow the steps in:
https://github.com/opencv/opencv/tree/4.x/platforms/ios
https://github.com/opencv/opencv/tree/4.x/platforms/apple
Issue submission checklist
- I report the issue, it’s not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 9
- Comments: 17
This solves the issues
I am facing the same error while trying to build the xcframework to support multiple architecture with this command:
The error is:
Removing the armv7 and armv7s target architectures and keeping only arm64 worked for me.
My setup: Apple clang version 14.0.3 (clang-1403.0.22.14.1) Target: x86_64-apple-darwin22.4.0 Thread model: posix