<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Did you build LLVM yourself.  In my experience, passing</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>        -DCMAKE_C_FLAGS="-g1 -fno-omit-frame-pointer" \<br>
</span>
<div>        -DCMAKE_CXX_FLAGS="-g1 -fno-omit-frame-pointer" \<br>
</div>
<span></span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
to cmake when building LLVM makes debugging info much smaller, without compromising the ability to get stack traces, etc.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jose</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> mesa-dev <mesa-dev-bounces@lists.freedesktop.org> on behalf of Brian Paul <brianp@vmware.com><br>
<b>Sent:</b> Wednesday, March 6, 2019 15:46<br>
<b>To:</b> Kenneth Graunke<br>
<b>Cc:</b> mesa-dev@lists.freedesktop.org<br>
<b>Subject:</b> Re: [Mesa-dev] dumb meson questions</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">On 03/06/2019 01:18 AM, Kenneth Graunke wrote:<br>
> On Tuesday, March 5, 2019 10:20:10 PM PST Dave Airlie wrote:<br>
>> On Wed, 6 Mar 2019 at 14:01, Brian Paul <brianp@vmware.com> wrote:<br>
>>> I guess I don't fully understand a few things about the new meson build.<br>
>>><br>
>>> 1. I'm trying to build the gallium VMware driver with this:<br>
>>><br>
>>> export BUILD_DIR=build-meson-dri<br>
>>><br>
>>> mkdir "${BUILD_DIR}"<br>
>>><br>
>>> meson -Dshared-llvm=false \<br>
>>>            -Dplatforms=x11,drm \<br>
>>>            -Dgallium-drivers=svga \<br>
>>>            -Dvulkan-drivers= \<br>
>>>            "${BUILD_DIR}"<br>
>>><br>
>>> ninja -C "${BUILD_DIR}"<br>
>>><br>
>>> When it's done, there is no vmwgfx_dri.so driver file. So libGL<br>
>>> complains that it can't find the svga driver (nor swrast).  I must be<br>
>>> missing something.<br>
>><br>
>> I don't think meson got the install in place stuff carried over, so I<br>
>> think everyone does --prefix= somewhere<br>
>> and that should create the vmwgfx_dri.so which will be a link to the<br>
>> libgallium_dri.so you've found.<br>
> <br>
> Right.  Running 'ninja' and 'ninja install' together, for the entire<br>
> project, is still faster than the old 'make' system (at least with an<br>
> SSD)...so we didn't bother with the custom lib/ symlinks.<br>
> <br>
> I wrote a wrapper script for ninja that makes it easy to work with<br>
> multiple build trees, can also automatically 'ninja install', and<br>
> which can be run from anywhere in your git repository:<br>
> <br>
> <a href="https://nam04.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~kwg%2Fnj%2Fplain%2Fnj&amp;data=02%7C01%7Cjfonseca%40vmware.com%7C68873d3170214283bd2f08d6a24aea95%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636874839986720161&amp;sdata=bQLVu4ZVREZaXrg%2BCi6ZmGsz5PGYYsOVV5qP%2FsGIKJs%3D&amp;reserved=0">
https://nam04.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~kwg%2Fnj%2Fplain%2Fnj&amp;data=02%7C01%7Cjfonseca%40vmware.com%7C68873d3170214283bd2f08d6a24aea95%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636874839986720161&amp;sdata=bQLVu4ZVREZaXrg%2BCi6ZmGsz5PGYYsOVV5qP%2FsGIKJs%3D&amp;reserved=0</a><br>
> <br>
> In my setup, I do:<br>
> <br>
> $ mkdir -p build/debug/install<br>
> $ meson --buildtype=debug --prefix=$PWD/build/debug/install \<br>
>    -Ddri-drivers=i965 -Dgallium-drivers=iris -Dvulkan-drivers=intel \<br>
>    -Dglvnd=true -Dtools=intel,nir,glsl,intel-ui build/debug<br>
> <br>
> $ mkdir -p build/release/install<br>
> $ CFLAGS='-O3 -g -fno-omit-frame-pointer -march=native' \<br>
>    CXXFLAGS='-O3 -g -fno-omit-frame-pointer -march=native' \<br>
>    meson --buildtype=release --prefix=$PWD/build/release/install \<br>
>    -Ddri-drivers=i965 -Dvulkan-drivers=intel -Dgallium-drivers=iris \<br>
>    -Dglvnd=true build/release<br>
> <br>
> Then,<br>
> <br>
> $ nj<br>
> <br>
> from anywhere in your Mesa repo will build and install the build/debug<br>
> tree.  Or to use the build/release tree:<br>
> <br>
> $ nj release<br>
> $ nj release clean<br>
> <br>
> You can simply point LD_LIBRARY_PATH at mesa/build/debug/install/lib to<br>
> use your newly built Mesa (instead of pointing it at the old mesa/lib).<br>
> <br>
> For simpler projects, nj also works with a single 'build' directory<br>
> (with no subdirectories), and it can also do in-tree builds if you're<br>
> using CMake (say for Piglit).<br>
> <br>
> Hope this helps!<br>
<br>
Yeah, doing a 'ninja install' with a few other tweaks to my script <br>
solves the issue.  Thanks, Ken!<br>
<br>
<br>
I'd like to point out that the Mesa doc page for Meson doesn't even <br>
mention 'ninja install' despite the title of the page being "Compilation <br>
and *Installation* using Meson"<br>
<br>
Perhaps someone can fix that.  It would also be helpful to have a few <br>
concrete examples of meson/ninja commands for common configurations.<br>
<br>
<br>
> <br>
>>> 2. When the build completes I see that there's a libgallium_dri.so file<br>
>>> that's HUGE:<br>
>>><br>
>>> $ ls -l build-meson-dri/src/gallium/targets/dri/libgallium_dri.so<br>
>>><br>
>>> -rwxr-xr-x 1 brianp users 726507584 Mar  5 20:47<br>
>>> build-meson-dri/src/gallium/targets/dri/libgallium_dri.so*<br>
>>><br>
>>><br>
>>> 726MB seems a bit excessive.  The libvdpau_gallium.so and<br>
>>> libxatracker.so libraries are also about that size.  What's the story there?<br>
>><br>
>> meson build debug by default, I expect you've gotten a bunch of that.<br>
>><br>
>> Dave.<br>
> <br>
> I suspect it also has to do with static LLVM.  Mine is only 49M with<br>
> debugging symbols...<br>
<br>
Yeah, that occurred to me too later.  But when I don't specify static <br>
LLVM I get tons of undefined LLVM symbols:<br>
<br>
[...]<br>
src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_tgsi.c.o): In function <br>
`lp_build_action_set_dst_type':<br>
/home/projects/Mesa-gitlab/mesa/build-meson-dri/../src/gallium/auxiliary/gallivm/lp_bld_tgsi.c:94:
<br>
undefined reference to `LLVMTypeOf'<br>
/home/projects/Mesa-gitlab/mesa/build-meson-dri/../src/gallium/auxiliary/gallivm/lp_bld_tgsi.c:91:
<br>
undefined reference to `LLVMVoidTypeInContext'<br>
[...]<br>
<br>
I have LLVM 7.0 installed and see both static and dynamic libraries in <br>
my /usr/local/lib/<br>
<br>
-Brian<br>
_______________________________________________<br>
mesa-dev mailing list<br>
mesa-dev@lists.freedesktop.org<br>
<a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fmesa-dev&amp;data=02%7C01%7Cjfonseca%40vmware.com%7C68873d3170214283bd2f08d6a24aea95%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636874839986720161&amp;sdata=rSEibPOGXAgtZJbNIHAQzFHZW%2Bycbva9tmNHygM6nIE%3D&amp;reserved=0">https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fmesa-dev&amp;data=02%7C01%7Cjfonseca%40vmware.com%7C68873d3170214283bd2f08d6a24aea95%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636874839986720161&amp;sdata=rSEibPOGXAgtZJbNIHAQzFHZW%2Bycbva9tmNHygM6nIE%3D&amp;reserved=0</a></div>
</span></font></div>
</div>
</body>
</html>