Dima Pasechnik wrote:
> Apple lies to us here!
> I have "Apple clang version 17.0.0 (clang-1700.6.3.2)" on the latest version
> of Intel macOS
>
> % uname -a
> Darwin OUCL13243.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19
> 22:00:10 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_X86_64 x86_64
>
> % cc -v
> Apple clang version 17.0.0 (clang-1700.6.3.2)
> Target: x86_64-apple-darwin24.6.0
> Thread model: posix
> InstalledDir:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
>
> and "cc -help" reports that "-fopenmp" is an option,
>
> % cc --help | grep "fopenmp "
> -fopenmp Parse OpenMP pragmas and generate parallel code.
>
>
> yet it does not work:
>
> % cat foo.c
> #include <stdio.h>
>
> % cc -c foo.c -fopenmp
> clang: error: unsupported option '-fopenmp'
Similarly for me. My test program actually exercises OpenMP functionality:
$ cat foo.c
#include <omp.h>
int main (void) { return omp_get_num_threads (); }
and I see that the option, while accepted, has no effect:
$ cc -v
Apple clang version 17.0.0 (clang-1700.6.3.2)
Target: arm64-apple-darwin25.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$ cc --help | grep "fopenmp "
-fopenmp Parse OpenMP pragmas and generate parallel code.
$ cc -fopenmp foo.c
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
$ cc -Xpreprocessor -fopenmp foo.c
foo.c:1:10: fatal error: 'omp.h' file not found
1 | #include <omp.h>
| ^~~~~~~
1 error generated.
$ cc -Xclang -fopenmp foo.c
foo.c:1:10: fatal error: 'omp.h' file not found
1 | #include <omp.h>
| ^~~~~~~
1 error generated.
> % cc -c foo.c -Xclang -fopenmp # this is OK
> % cc -c foo.c -Xpreprocessor -fopenmp # OK too
And what if you take my foo.c? Do you get a link error? Do you have to add
"-lomp" by hand?
Bruno