[Mesa-dev] Mesa build instructions

Eric Anholt eric at anholt.net
Fri Apr 11 11:50:50 PDT 2014


Matt Turner <mattst88 at gmail.com> writes:

> Someone asked about my Mesa build set up. Rather than sending it
> privately I figured I'd post it for posterity on mesa-dev.
>
> I build with
>
> CFLAGS="-O2 -march=native -pipe" CXXFLAGS="$CFLAGS" ./autogen.sh
> --with-dri-drivers=i965 --with-gallium-drivers=
> --with-egl-platforms=x11,drm --enable-glx-tls --enable-gles1
> --enable-gles2
>
> --enable-debug enables assertions and builds with -g, but also
> silently adds -O0 to your CFLAGS.
>
> My build set up consists of
>
> ~/projects/mesa - contains  mesa git checkout
> ~/projects/mesa-release - release build directory
> ~/projects/mesa-debug - debug build directory
>
> I do out-of-tree builds into the debug and release directories by
> running ../mesa/autogen.sh ... from each of them, with the only
> difference being the --enable-debug flag.
>
> Environment variables allow you to use your built mesa without
> installing it: LIBGL_DRIVERS_PATH, LD_LIBRARY_PATH. Mesa's build
> system links built files into $(builddir)/$(libdir), e.g.,
> ~/projects/mesa-release/lib/. I use some wrapper scripts to allow me
> to easily run programs against my Mesa builds:

For anyone that's curious about how I work:

My scripts setup looks a lot like Matt's.  I don't do OOT builds, and
instead I just have 6 main trees:

~/src/mesa (normal debug build)
~/src/mesa-release (non-debug build)
~/src/mesa-clean (usually HEAD~1 of ~/src/mesa)
~/src/32/mesa
~/src/32/mesa-release
~/src/32/mesa-clean

The debug build also is with -O2 so that I can actually get
mostly-representative performance results while developing.  REALLY
IMPORTANT: Don't forget -fno-omit-frame-pointer on 64-bit, otherwise you
won't get backtraces from sysprof and perf (similarly, in your kernel,
CONFIG_FRAME_POINTER=y).

I think the most important feature of my setup is the clean builds.  By
having copies of unmodified mesa along with patched mesa, I can use
http://anholt.net/compare-perf/ to easily produce stats to test whether
my change is actually having the desired effect.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140411/9bb8cd03/attachment-0001.sig>


More information about the mesa-dev mailing list