[MacPorts] #71852: mesa @24.3.2_0+llvm+universal: meson.build:1811:2: ERROR: Problem encountered: llvmpipe requires LLVM and is enabled, but LLVM is disabled.
MacPorts
noreply at macports.org
Sat Jan 18 01:55:50 UTC 2025
#71852: mesa @24.3.2_0+llvm+universal: meson.build:1811:2: ERROR: Problem
encountered: llvmpipe requires LLVM and is enabled, but LLVM is disabled.
------------------------------+----------------------
Reporter: isolated-matrix | Owner: jeremyhu
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.10.5
Resolution: | Keywords:
Port: mesa |
------------------------------+----------------------
Comment (by kencu):
Although building mesa +llvm as +universal is possible:
{{{
% port -v installed mesa
The following ports are currently installed:
mesa @24.3.2_0+llvm+universal (active) requested_variants='+universal'
platform='darwin 24' archs='arm64 x86_64' date='2025-01-17T17:48:32-0800'
}}}
it will take some work to automate it into a Portfile mechanism.
The problem here relates to the way that meson builds software when cross-
building.
When meson is building llvm, it uses it's internal "config-tool" mechanism
to query llvm-config for information about the installed llvm. The
Portfile has been modified to allow this mechanism to find the llvm-config
for the desired version of llvm here:
{{{
set llvm_ver 19
depends_lib-append port:llvm-${llvm_ver}
# for llvm-config
configure.env-append
PATH=${prefix}/libexec/llvm-${llvm_ver}/bin:$env(PATH)
}}}
but when cross building for the non-native arch, meson will not use this
file. It wants a specific file for the cross-built architecture.
What you are meant to do is generate a crossfile for each arch, add the
tools to that.
So to build mesa +universal, I manually added the path to the llvm-config
to the cross files:
{{{
% port contents py313-meson | grep cross
/opt/local/share/py313-meson/meson/cross/arm64-darwin
/opt/local/share/py313-meson/meson/cross/i386-darwin
/opt/local/share/py313-meson/meson/cross/ppc-darwin
/opt/local/share/py313-meson/meson/cross/ppc64-darwin
/opt/local/share/py313-meson/meson/cross/x86_64-darwin
}}}
{{{
[binaries]
pkgconfig = '/opt/local/bin/pkg-config'
cmake = '/opt/local/bin/cmake'
llvm-config = '/opt/local/bin/llvm-config-mp-19'
}}}
but -- these cross files are installed once, when meson is built and
installed.
I'm not sure at the moment how to add entries to these crossfiles "on the
fly" such that we could specify a desired version of llvm to be used for
any different build that uses this mechanism.
Have to think about how to do that, I guess....
--
Ticket URL: <https://trac.macports.org/ticket/71852#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list