Open lpsinger opened 3 weeks ago
If the compiler is identifying itself as an Apple compiler (ie, if Apple
is in the output of clang --version
), then Meson considers OpenMP unsupported. See: https://github.com/mesonbuild/meson/issues/7435 for more information.
Indeed, it does:
$ clang-mp-18 --version
clang version 18.1.4
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-18/bin
That looks like we're incorrectly identifying a "vanilla" clang as an "apple" clang. The latter of which really means "the Clang Apple ships with XCode", so we should fix our detection code to detect that as a vanilla clang and then OpenMP should just work.
edit: Strangly though we look for "Apple"
(Case sensitive) in the output, and the output you have is reporting "apple"
, so OpenMP should just work
Describe the bug Meson fails to detect OpenMP with Clang from MacPorts.
To Reproduce
Install MacPorts.
Install the MacPorts version of Clang by running
sudo port install clang-18
.Place the following in the file
meson.build
:Configure the project, and observe the failure:
Here is the log file: meson-log.txt
The check that is failing is a test compilation of the following
testfile.c
, compiled with the commandclang-mp-18 testfile.c -E -P -P -O0 -Werror=implicit-function-declaration
, i.e., without the command line option-fopenmp
:This test would have succeeded if Meson had added the flag
-fopenmp
; in some compilers such as this one, omp.h is not findable unless the command-line flag-fopenmp
is present.Expected behavior Meson should add the
-fopenmp
flag when doing this test, and the test should succeed.system parameters
meson --version
1.4.0ninja --version
if it's a Ninja build 1.11.1.git.kitware.jobserver-1