Skip to content

Cannot find omp.h and link libomp on macOS with -DWITH_OPENMP=ON #23092

@fengyuentau

Description

@fengyuentau

System Information

OpenCV version: 4.7.0
OS: macOS 13.0.1 on Apple M1
Compiler: Apple clang version 14.0.0 (clang-1400.0.29.202) Target: arm64-apple-darwin22.1.0

libomp is installed via brew.

Detailed description

modules/core/src/parallel.cpp:123:14: fatal error: 'omp.h' file not found
    #include <omp.h>

Steps to reproduce

git clone https://github.com/opencv/opencv.git && cd opencv
cmake -B build -DWITH_OPENMP=ON -DBUILD_ZLIB=OFF .
cmake --build build --target install -j 6

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions