I need to have a C compiler with openmp
support. I installed gcc49
via Homebrew but still the configure script of the library I like to install (nfft
) complains: You don't seem to have a C compiler with OpenMP support installed which is required for threaded NFFT.
I have the Command Line Tools installed (as this is requested by installing Homebrew). gcc -v
delivers Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
. So it points to the version in Xcode and seems not to support openmp. On the other hand, gcc49 should support openmp. How do I now get this to work?
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
C compiler with openmp support on Mavericks via Homebrew
gcchomebrew
Best Answer
You called the Xcode gcc which is gcc 4.2 iirc. To use your Homebrew gcc just run gcc-49 and to compile with OpenMP support append -fopenmp.
Example with g++ for C++11:
This should give you insight about gcc and show that it's just a symlink to Xcode's llvm.
You could just change the symlink to your new gcc-49, but you should be careful, as this might break other things for you.
If gcc-49 isn't available for you, you still have to add Homebrew to PATH.
To permanently add this to your PATH, add these lines to your ~/.bashrc . If you use a different shell, you need to find the right file for it (~/.zshrc for zsh i.e.)
Invoke 'brew doctor' to see if Homebrew is set up correctly.