- Install clang-omp using homebrew:
brew install clang-omp
- Create a new Xcode project.
- Under Build Settings
- add a new user-defined setting CC with the value
/usr/local/bin/clang-omp
- Add
-fopenmp
to Other C Flags - Add
/usr/local/include
to Header Search Paths - Set Enable Modules (C and Objective-C) to
No
- add a new user-defined setting CC with the value
- Under Build Phases
- Add
/usr/local/lib/libiomp5.dylib
to Link Binary With Libraries
- Add
Done.
You can now #include <libiomp/omp.h>
and start using #pragma omp ...
in your source code.