4

I'm trying to follow the instructions on OpenMP®/Clang to enable openmp in Xcode. But Add a new user-defined setting CC with the value /usr/local/bin/clang-omp confuses me. I tried to change the Build Settings->Build Options-> Compilers for C/C++/Objective-C to /usr/local/bin/clang-omp++, but I got Unsupported Compiler error.

Please help, thanks ahead.

Juneyee
  • 389
  • 2
  • 6
  • 15
  • 1
    I think this SO could help you http://stackoverflow.com/questions/33668323/clang-omp-in-xcode-under-el-capitan – Brian Dolan Dec 13 '15 at 19:31
  • Follow this solution https://stackoverflow.com/questions/44380459/is-openmp-available-in-high-sierra-llvm/47230419#47230419 – Alexey Bataev Mar 30 '18 at 17:23

1 Answers1

1

You should be able to set some user build settings to choose your compiler. You can set special build settings from the command line using the following syntax.

xcodebuild build FOO=bla

Disclaimer: some of those build settings are undocumented (afaik). Use at your own risk.

Here are a few build settings that I found useful to inject C flags:

  • OTHER_CFLAGS
  • OTHER_CPLUSPLUSFLAGS

or to replace the compiler(s) and linker(s):

  • CC
  • CPLUSPLUS
  • LD
  • LDPLUSPLUS
  • LIBTOOL

The same approach works to control the "analyze" action:

  • CLANG_ANALYZER_EXEC
  • CLANG_ANALYZER_OTHER_FLAGS

Sourced from cfe-dev mailing list