On 03/06/2019 01:18 AM, Kenneth Graunke wrote:
On Tuesday, March 5, 2019 10:20:10 PM PST Dave Airlie wrote:
On Wed, 6 Mar 2019 at 14:01, Brian Paul <bri...@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!

Yeah, doing a 'ninja install' with a few other tweaks to my script solves the issue. Thanks, Ken!


I'd like to point out that the Mesa doc page for Meson doesn't even mention 'ninja install' despite the title of the page being "Compilation and *Installation* using Meson"

Perhaps someone can fix that. It would also be helpful to have a few concrete examples of meson/ninja commands for common configurations.



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...

Yeah, that occurred to me too later. But when I don't specify static LLVM I get tons of undefined LLVM symbols:

[...]
src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_tgsi.c.o): In function `lp_build_action_set_dst_type': /home/projects/Mesa-gitlab/mesa/build-meson-dri/../src/gallium/auxiliary/gallivm/lp_bld_tgsi.c:94: undefined reference to `LLVMTypeOf' /home/projects/Mesa-gitlab/mesa/build-meson-dri/../src/gallium/auxiliary/gallivm/lp_bld_tgsi.c:91: undefined reference to `LLVMVoidTypeInContext'
[...]

I have LLVM 7.0 installed and see both static and dynamic libraries in my /usr/local/lib/

-Brian
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to