I like to use openmp in a c++ project using Xcode as IDE. Unfortunately, Apple's Clang compiler does not support openmp (see here), so I installed clang-omp. I exactly followed the instructions given on that website to use it within Xcode, but I get the error message can't exec '/usr/local/bin/clang++-omp' (No such file or directory)
. I tried to compile the simple example given on their website via terminal and I got it to work when I compile it via clang-omp++ -fopenmp file.cpp
. For me it looks like Xcode should search for /usr/local/bin/clang-omp++
(which exists in contrast to /usr/local/bin/clang++-omp
). After making a symlink as suggested in the comments I get another error message: library not found for -liomp5
. How can I fix this?
In case anyone else is trying to get clang-omp under Xcode to work, the correct way is (following the official instructions):
brew install clang-omp
/usr/local/bin/clang-omp
under the project's build settings-fopenmp
to Other C Flags under the project's build settings/usr/local/include
to Header Search Paths under the project's build settings/usr/local/lib
to Library Search Paths under the project's build settingsNo
under the project's build settings/usr/local/lib/libiomp5.dylib
to Link Binary With Libraries under the project's build phasessudo ln -s /usr/local/bin/clang-omp++ /usr/local/bin/clang++-omp
using the terminal#include <libiomp/omp.h>
to be able to use openmp in your projectIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With