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 install lightgbm and xgboost Error [How to Solve]
- [Solved] CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
- Cmake Error The C compiler identification is GNU 7.5.0 — The CXX compiler identification is unknown
- [Solved] VScode Error: find_package(catkin) failed
- [Solved] error adding symbols: File in wrong format collect2: error: ld returned 1 exit status
- [Solved] Compilation error: dereferencing pointer to incomplete type…
- [How to Fix]Unable to find the requested Boost libraries
- [Solved] Failed to find glog – Could not find glog include directory, set…
- [Solved] ESP32 Error: error: expected initializer before ‘__result_use_check‘
- [Solved] A-LOAM Ceres Compile Error: error: ‘integer_sequence’ is not a member of ‘std‘
- [Solved] error: external/googletest/googletest: MODULE.TARGET.STATIC_LIBRARIES.libgtest already defined
- How to Solve Brew install golangci-lint Error
- Clion new method shows undefined reference to solution
- [Solved] Pip install icu failed: Command “python setup.py egg_info” failed with error code 1 in
- Error 2 error c2491: XX: definition of dllimport static data member is not allowed
- [Solved] OpenGL PowerVR SDK Compiling Error: Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)
- How to Solve Ceres library Error when compiling A-LOAM
- [Solved] error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows,
- launch file Run Error: Resourcenotfound: XXX [How to Solve]
- Cmake Setting Support C++11 This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options