I recently went through the process of building a mangled version of Mesa to perform software rendering on X11, GDI and OSMesa and perhaps some of my experience may help others, most of this is derived from various posts on the mesa forum and anything else I have managed to understand.<div>
<br></div><div>----------------------------------------</div><div>I built using the 7.11.2 tar ball from <a href="http://freedesktop.org/mesa/mesa/snapshots">freedesktop.org/mesa/mesa/snapshots</a> (I read somewhere there are differences between this and the official release, there did appear to be but I didn't spend any time looking at whether the differences were relevant).</div>
<div><br></div><div><b>Prerequisites:</b></div><div><br></div><div>CMake 2.6</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>To build LLVM</div></blockquote><div>LLVM 2.8</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div>There is a note else where to use the mingw version, I had no luck with these, and building LLVM with CMake was a trivial, I would recommend using the NMake generator on windows as the VCproj generator had a bug shown with LLVM and 64bit targets.</div>
<div>To Build:</div><div><div> cd "LLVM-2.8"</div><div> mkdir "build" directory</div><div> cd "build"</div><div> cmake -G{NMake or GMake} .. // Use CMake to generate either GNU Make</div>
<div> // files or NMake files on windows.</div><div> gmake or nmake</div><div> gmake or nmake install</div></div><div><br></div></blockquote>Python 2.7<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div>I used 64bit</div></blockquote><div><div>Scons</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>Use the tarball, extract and run "python setup.py install" - if you use 32bit python there are windows installers.</div>
</blockquote>Flex and Bison</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>For Linux these are easy to figure out, for windows see MINGW</div></blockquote>MINGW (Windows only)<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div>Download and extract somewhere</div><div>run MinGW\msys\1.0\msys.bat</div><div>in msys - mingw-get install msys-flex msys-bison</div></blockquote><div><div><div><div><div><br></div><div><div><b>Building Windows</b></div>
<div><br></div><div><div>Start a "Visual Studio 2008 x64 Command Prompt": NOTE - Fix the following paths</div><div>for you install and there are helper batch files in Mesa/7.11.2/src/setup_*.bat.</div><div><br>
</div>
<div> set PATH=%PATH%;<b><ROOT></b>\MinGW\bin;<b><ROOT></b>\MinGW\msys\1.0\bin;<b><ROOT></b>\Python27;<b><ROOT></b>\Python\Scripts</div><div> set LLVM=<b><ROOT></b>\LLVM\x86_64</div><div>
set CXXFLAGS=/DUSE_MGL_NAMESPACE</div><div> set CFLAGS=/DUSE_MGL_NAMESPACE</div><div> cd MesaLib-x.x.x</div><div> scons MSVS_VERSION=9.0 machine=x86_64 build=release platform=windows \</div><div> verbose=yes dri=no -j4 mesagdi osmesa glu</div>
<div><br></div><div>For 32-bit use the same procedure as above but change x86_64.</div><div><br></div></div><div><div><b>Building Linux (for completeness)</b></div><div><b><br></b></div><div>I used configure/make and this worked well enough for me, although I needed to make some changes for our needs i.e. mangling.</div>
<div><br><div><div> cd MesaLib-x.x.x</div><div> make distclean</div><div><br></div><div> PATH={LLVM_INSTALL}/bin:$PATH \</div><div> CXXFLAGS="-DUSE_MGL_NAMESPACE" \</div><div> CFLAGS="-DUSE_MGL_NAMESPACE" \</div>
<div> ./configure \</div><div> --prefix `pwd`/build/Linux64 \</div><div> --enable-debug=no \</div><div> --disable-driglx-direct \</div><div> --enable-gl-osmesa=yes \</div><div> --disable-glw \</div>
<div> --disable-glut \</div><div> --with-driver=xlib \</div><div> --with-dri-drivers= \</div><div> --with-osmesa-bits=32 \</div><div> --with-gallium-drivers= \</div><div> --disable-egl \</div>
<div> --enable-64-bit</div><div><br></div><div> gmake -j4</div><div> gmake install</div></div></div></div><div><br></div><div><br></div><div><b>Potential Issues</b></div><div><br></div><div>Mangling</div></div>
</div></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div><div><div><div>I need to make some changes to *.def files on windows and make other changes on Linux to ensure mangled mesa functioned the way I expected. i.e. GLU uses mangled symbols and OSMesa and MesaGL did not both export gl* procedures. I am not certain this is all necessary however and I may just be creating work for my self.</div>
<div><br></div></div></div></div></div></div></blockquote><div><div><div><div><div><div>OSMesa</div></div></div></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>- I have a set of FrameBufferObject tests, which all failed with the GDI driver, they were failing in 7.7.1 and they are still failing with 7.11.2.</div>
<div>- I believe these is a memory problem specific to OSMesa, which is triggered when a call to OSMesaDestroyContext is made after OSMesaMakeCurrent has been called. I was unable to track down the exact location of the problem. I had a look through the 8.* tree to see if there was something I could backport, however I was unable to locate such a change.</div>
<div><br></div></blockquote>----------------------------------------<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div></blockquote><div>Brian, much like Bruno I would love to help the effort. The barrier I see right now is, if we contribute towards the build/test of a particular configuration to ensure it builds and runs successfully, it is very difficult to tell what we are likely to have broken. The mesa project is vast and the number of possible combinations is large and growing.</div>
<div><br></div><div>What I am getting at is what can we do to help set up continues verification of builds and tests such that we can easily identify the point of break? </div><div><br></div><div>I believe to really encourage contributions, it has to be easy for anyone to make a change without the fear of what they may have broken elsewhere, as far a I can tell we are not there yet.</div>
<div><br></div><div>Finally - I want to say that I like many others am very appreciative of all the effort you and others put into the Mesa project, and I am very much looking forward to seeing Gallium and particularly the llvm-pipe driver reach its potential.</div>
<div><br></div><div>Thank you,</div><div><br></div><div>Viral</div><div><div><div><div><div><div><br><br><div class="gmail_quote">On 4 May 2012 01:06, Bruno Kim Medeiros Cesar <span dir="ltr"><<a href="mailto:bruno.cesar@neolog.com.br" target="_blank">bruno.cesar@neolog.com.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for your support, Brian!<br>
<br>
I didn't manage to build the 7.11.2 version because it lacks<br>
opengl32.mingw.def (as I recall from memory), but succeeded in building<br>
7.10.x which has this *.def.<br>
<br>
Now there's another problem, maybe some of "other ways" you feel the driver<br>
may fail :) It tries to call a dxtn.dll, which is not present, do you know<br>
what it is?<br>
<br>
Tomorrow may be a luckier day,<br>
<br>
Bruno Kim.<br>
<br>
PS.: walking through the code I found a cpp with Lisp code that is processed<br>
by a custom builtin compiler... Can't say if it's awesome or frightening!<br>
<br>
-----Mensagem original-----<br>
De: Brian Paul [mailto:<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>]<br>
Enviada em: quinta-feira, 3 de maio de 2012 16:49<br>
Para: Bruno Kim Medeiros Cesar<br>
Cc: <a href="mailto:mesa-users@lists.freedesktop.org">mesa-users@lists.freedesktop.org</a><br>
Assunto: Re: [Mesa-users] Error compiling 8.0.2 in Windows, and some support<br>
<div class="im"><br>
On 05/03/2012 12:41 PM, Bruno Kim Medeiros Cesar wrote:<br>
> Hello, all. I'm trying to build Mesa 8.0.2 in Windows 7, using<br>
><br>
> scons platform=windows machine=x86 statetrackers=mesa winsys=gdi<br>
> build=release drivers=gdi,mesagdi,mesa,trace<br>
><br>
> and bumped in the following error while compiling wmesa.c:<br>
><br>
> Compiling src\mesa\drivers\windows\gdi\wmesa.c ...<br>
><br>
</div>> -- snip --<br>
<div class="im">><br>
> Finished generating code<br>
><br>
> scons: building terminated because of errors.<br>
><br>
> The error is clear enough, I looked at the source and indeed there is<br>
> no function pointer member of gl_renderbuffer.<br>
<br>
Yeah, the windows driver hasn't had much attention lately. I'm<br>
cherry-picking some changes from Mesa master to the 8.0 branch to hopefully<br>
fix this problem for the next 8.0.x release. But I have a feeling that the<br>
driver may fail in other ways.<br>
<br>
You're probably best off going back to 7.12 or 7.11 release.<br>
<br>
<br>
> Sidenote 1: why not provide standalone DLLs?<br>
<br>
Nobody has volunteered to make/maintain them.<br>
<br>
<br>
> Sidenote 2: my need is solely software rendering, which drivers should<br>
> I pass to scons? And where is documented the available CLI arguments?<br>
</div>> Statetrackers and winsys aren't documented at -h.<br>
<div class="HOEnZb"><div class="h5"><br>
The "osmesa" target will build the "Off-Screen" Mesa interface which doesn't<br>
use any wgl/glx entrypoingts.<br>
<br>
<br>
><br>
> Sidenote 3: I will now try to build with windows as target in a Linux<br>
> environment, because the Windows build process requires a lot of Unix<br>
> dependencies - had to install MinGW, GnuWin32 and such. How could it<br>
> be minimized? I saw that you need help maintaining Windows driver<br>
> building, testing and maintenance, how could I help? Just checking out<br>
> the repo and testing new releases is enough, or more expertise is<br>
> required? I'm just a Java developer intern without much experience J<br>
<br>
Checking out the code and trying to fix build issues would be great.<br>
<br>
-Brian<br>
<br>
_______________________________________________<br>
mesa-users mailing list<br>
<a href="mailto:mesa-users@lists.freedesktop.org">mesa-users@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-users" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-users</a><br>
</div></div></blockquote></div><br></div></div></div></div></div></div>