Mac OS 11.5.2, cmake default compiler appleclang 12.0.5
Make keeps reporting errors after compiling
fatal error: 'omp.h' file not found
#include<omp.h>
The reason is that a.cpp file introduces OpenMP, OMP.H
It can be compiled successfully through G + +, but the make default clang compilation in MAcc is not successful. In other words, it cannot be compiled through cmake on Mac
Try to resolve:
Adding before the project line of cmake has no effect
SET(CMAKE_C_COMPILER "/usr/bin/gcc")
SET(CMAKE_CXX_COMPILER "/usr/bin/g++")
On the command line, the export cxx = “usr/bin/G + +” variable also has no effect
Solution
Brew install libomp
brew install libomp
Change the path corresponding to OMP. H where. CPP introduces OMP. H
#include</usr/local/opt/libomp/include/omp.h>
Read More:
- Mac Pyaudio Installation fatal error: ‘portaudio.h‘ file not found
- [Solved] Mac VS Code fatal error: ‘bits/stdc++.h‘ file not found
- [Solved] MAC Compile Error: fatal error: ‘endian.h‘ file not found
- [Solved] Android12 Error: fatal error: ‘mediadrm/ICrypto.h‘ file not found
- [Solved] fatal error C1083: Could Not Open Unable to open include file:“stdint.h”: No such file or directory
- [Solved] fatal error C1083: Cannot open included files: “stdafx.h”: No such file or directory
- [Solved] CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
- fatal error: libusb.h: No such file or directory [How to Solve]
- [Solved] ROS fatal error: alsa/asoundlib. h: There is no such directory or file
- [Solved] 1.fatal error: NvInfer.h: No such file or directory
- [Solved] MSYS2+ fatal error: zlib.h: There is no such file or directory
- [Solved] utils.c:33:18: fatal error: zlib.h: No such file or directory
- fatal error: libavutil/avconfig.h: No such file…
- [Solved] fatal error: bits/libc-header-start.h: No such file or directory
- Centos pip install uwsgi error: “fatal error: Python.h: No such file or directory”
- [Solved] Linux R Pack Error: cram/cram_io.c:61:10: fatal error: lzma.h: No such file or directory
- [Solved] src/delly.h:8:42: fatal error: boost/graph/adjacency_list.hpp: No such file or directory
- [Solved] OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
- Mac Error: sh: vue-cli-service: command not found