Use Homebrew LLVM over Xcode I'm trying to compile an algorithm package received by someone else. Basically all I need to do is run a bash script and everything will be compiled automatically. Now upon executing the script, I get a lot of errors, such as:

clang: error: unsupported option '-fopenmp'


My understanding is that the Apple LLVM does not support OpenMPI, so what I did is install the newest gcc version by installing LLVM (version 4.0) through Homebrew. I tried to add this to my bash profile by adding the following (found on the web – my apologies, this isn't my home terrain):

# export PATH=/usr/local/opt/llvm/bin:$PATH
# export CPLUS_INCLUDE_PATH=$(llvm-config --includedir):$CPLUS_INCLUDE_PATH 
# export LD_LIBRARY_PATH=$(llvm-config --libdir):$LD_LIBRARY_PATH 


But this unfortunately didn't do the trick. I get the same errors, and I found out my computer still uses clang:

$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


Does anybody know what to do? I can't use another installer by specifying the version, since it's a long bash script, and I wouldn't know what to change where.
You change the script - or better use a build system makefile, cmake, waf etc to have the full path to the C++ compiler and not rely on the $PATH.

Alternatively see of the package has been ported to Homebrew and use that or if only to fink or MAcPorts see how they changed the script.

Lastly make the build as a Homebrew formula making use of Homebrew's own build tools