I can build my project by using
#include "/usr/local/Cellar/libiomp/20150401/include/libiomp/omp.h" and also set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fopenmp")in the CMakeLists.txt
but what should I do to just #include <omp.h>?
When I brew list, I have clang-omp, libivmp, gcc installed. I found that omp.h by using locate omp.h.
And my gcc -v prints:
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.4.0/5.1.0/lto-wrapper Target: x86_64-apple-darwin14.4.0 Configured with: ../gcc-5.1.0/configure --enable-languages=c++,fortran Thread model: posix gcc version 5.1.0 (GCC) Thanks in advance.
omp.his added automatically when-fopenmpis specified. As far as I see, you want to link against the Intel OpenMP runtime which provides a compatibility layer with libgomp API. You should be able to simply use-fopenmpand#include <omp.h>at compile time and then link against IOMP without the-fopenmpflag (if GCC is also used as linker).