[Mesa-dev] dumb meson questions

Kenneth Graunke kenneth at whitecape.org
Wed Mar 6 08:18:54 UTC 2019


On Tuesday, March 5, 2019 10:20:10 PM PST Dave Airlie wrote:
> On Wed, 6 Mar 2019 at 14:01, Brian Paul <brianp at vmware.com> wrote:
> > I guess I don't fully understand a few things about the new meson build.
> >
> > 1. I'm trying to build the gallium VMware driver with this:
> >
> > export BUILD_DIR=build-meson-dri
> >
> > mkdir "${BUILD_DIR}"
> >
> > meson -Dshared-llvm=false \
> >           -Dplatforms=x11,drm \
> >           -Dgallium-drivers=svga \
> >           -Dvulkan-drivers= \
> >           "${BUILD_DIR}"
> >
> > ninja -C "${BUILD_DIR}"
> >
> > When it's done, there is no vmwgfx_dri.so driver file. So libGL
> > complains that it can't find the svga driver (nor swrast).  I must be
> > missing something.
> 
> I don't think meson got the install in place stuff carried over, so I
> think everyone does --prefix= somewhere
> and that should create the vmwgfx_dri.so which will be a link to the
> libgallium_dri.so you've found.

Right.  Running 'ninja' and 'ninja install' together, for the entire
project, is still faster than the old 'make' system (at least with an
SSD)...so we didn't bother with the custom lib/ symlinks.

I wrote a wrapper script for ninja that makes it easy to work with
multiple build trees, can also automatically 'ninja install', and
which can be run from anywhere in your git repository:

https://cgit.freedesktop.org/~kwg/nj/plain/nj

In my setup, I do:

$ mkdir -p build/debug/install
$ meson --buildtype=debug --prefix=$PWD/build/debug/install \
  -Ddri-drivers=i965 -Dgallium-drivers=iris -Dvulkan-drivers=intel \
  -Dglvnd=true -Dtools=intel,nir,glsl,intel-ui build/debug

$ mkdir -p build/release/install
$ CFLAGS='-O3 -g -fno-omit-frame-pointer -march=native' \
  CXXFLAGS='-O3 -g -fno-omit-frame-pointer -march=native' \
  meson --buildtype=release --prefix=$PWD/build/release/install \
  -Ddri-drivers=i965 -Dvulkan-drivers=intel -Dgallium-drivers=iris \
  -Dglvnd=true build/release

Then,

$ nj

from anywhere in your Mesa repo will build and install the build/debug
tree.  Or to use the build/release tree:

$ nj release
$ nj release clean

You can simply point LD_LIBRARY_PATH at mesa/build/debug/install/lib to
use your newly built Mesa (instead of pointing it at the old mesa/lib).

For simpler projects, nj also works with a single 'build' directory
(with no subdirectories), and it can also do in-tree builds if you're
using CMake (say for Piglit).

Hope this helps!

> > 2. When the build completes I see that there's a libgallium_dri.so file
> > that's HUGE:
> >
> > $ ls -l build-meson-dri/src/gallium/targets/dri/libgallium_dri.so
> >
> > -rwxr-xr-x 1 brianp users 726507584 Mar  5 20:47
> > build-meson-dri/src/gallium/targets/dri/libgallium_dri.so*
> >
> >
> > 726MB seems a bit excessive.  The libvdpau_gallium.so and
> > libxatracker.so libraries are also about that size.  What's the story there?
> 
> meson build debug by default, I expect you've gotten a bunch of that.
> 
> Dave.

I suspect it also has to do with static LLVM.  Mine is only 49M with
debugging symbols...

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190306/69617dba/attachment.sig>


More information about the mesa-dev mailing list