warning: ignoring '#pragma omp parallel' [-Wunknown-pragmas]
The code uses OpenMP but the compiler was not told to enable it, so the code runs single-threaded.
ignoring '#pragma omp parallel'unknown pragma ompundefined reference to `omp_get_thread_num'unsupported option -fopenmp Meaning
Without -fopenmp pragmas are ignored silently except for this warning. Link errors for omp_get_thread_num also appear.
Common causes
-fopenmpmissing at compile or link- Apple Clang has no built-in OpenMP
- MSVC needs
/openmp - CMake target not linked with
OpenMP::OpenMP_CXX
⚡ Quick fix
- Add
-fopenmpto compile and link flags - Use CMake
find_package(OpenMP) - On macOS install
libompand use-Xpreprocessor -fopenmp -lomp
Detailed fix by platform
CMake
find_package(OpenMP REQUIRED)andtarget_link_libraries(app OpenMP::OpenMP_CXX)
macOS
brew install libomp
How to diagnose
- Flag — -fopenmp used?
- Compiler — Apple Clang?
- Link — libomp/libgomp?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- C compiler cannot create executables configure: error: C compiler cannot create executables / no acceptable C compiler found in $PATH
- clang: error: unsupported option '-fopenmp' macOS: clang: error: unsupported option '-fopenmp' (OpenMP with Apple Clang)
- Could not find a package configuration file CMake Error: Could not find a package configuration file provided by "Foo" (requested version 1.2)
Most viewed in C/C++
- Bus error C/C++: Bus error (core dumped) — SIGBUS from misaligned access or a bad memory-mapped file
- AddressSanitizer: heap-buffer-overflow C/C++: ==ERROR: AddressSanitizer: heap-buffer-overflow on address — READ/WRITE of size N
- AddressSanitizer: heap-use-after-free C/C++: ==ERROR: AddressSanitizer: heap-use-after-free on address — memory used after delete/free
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 2 Dec 2026