Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
391 views
in Technique[技术] by (71.8m points)

python - Building Mesa for windows 7. Mesa 9.1

I went through all the steps on the compiling / installing page on Mesa's site, and read the FAQ. The final command that you send to scons for compilation throws errors within python scripts. This is my output. What am I doing wrong? Also if anyone has compiled dll's for mesa using up to date mesa and mingw, or VS2012, then please share!

Here is my output, I haven't programmed python in a long time but it appears a map/dictionary doesn't contain the key/value pair.

C:DownloadsMesaLib-9.1.5Mesa-9.1.5>scons platform=windows toolchain=crossming
w machine=x86_64 mesagdi libgl-gdi

scons: Reading SConscript files ...
KeyError: 'CCVERSION':
  File "C:DownloadsMesaLib-9.1.5Mesa-9.1.5SConstruct", line 40:
    ENV = os.environ,
  File "C:Python27scons-2.3.0SConsEnvironment.py", line 1002:
    apply_tools(self, tools, toolpath)
  File "C:Python27scons-2.3.0SConsEnvironment.py", line 106:
    env.Tool(tool)
  File "C:Python27scons-2.3.0SConsEnvironment.py", line 1786:
    tool(self)
  File "C:Python27scons-2.3.0SConsTool\__init__.py", line 183:
    self.generate(env, *args, **kw)
  File "C:DownloadsMesaLib-9.1.5Mesa-9.1.5sconsgallium.py", line 313:
    ccversion = env['CCVERSION']
  File "C:Python27scons-2.3.0SConsEnvironment.py", line 412:
    return self._dict[key]
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Common scons options:

build=release
machine=x86
platform=windows
libgl-gdi
  1. Linux (Debian Wheezy), toolchain=crossmingw: Fails during linking phase because it can't find __vscprintf, among other things. Works as of Debian Jessie 8.5 & Mesa d2f42a945ec0fbcc51b59cfd329258bd62ebf0d2 via:

    scons 
    toolchain=crossmingw 
    build=release 
    machine=x86 
    platform=windows 
    libgl-gdi
    

    DLL is installed to build/windows-x86/gallium/targets/libgl-gdi/opengl32.dll

  2. Windows, toolchain=mingw: Fails with "The command line is too long." despite multiple permutations of both snippits on LongCmdLinesOnWin32.

  3. Windows, VS2012 Express, MSVC_VERSION=11.0: Succeeds after removing stray C99-isms from src/glsl/ralloc.c::ralloc_size().


EDIT: More complete procedure:

  1. Install Visual Studio Express 2012 for Windows Desktop:

    http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop
    
  2. Install MinGW:

    http://www.mingw.org/
    http://sourceforge.net/projects/mingw/files/
    http://sourceforge.net/projects/mingw/files/latest/download?source=files
    mingw-get-inst-20120426.exe
    
    Run installer:
    Download latest repo catalogs
    Install to C:MinGW (default)
    Check:
    * C compiler
    * C++ compiler
    * MSYS basic system
    * MinGW developer toolkit (should install msys-flex and msys-bison)
    
  3. Install Python 2.7:

    http://www.python.org/download/
    http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi
    
    You have to use 32-bit Python because the Scons people only distribute 32-bit installers.
    
    Install for all users (default)
    Install to C:Python27 (default)
    Use default install options/customizations
    
  4. Install libxml2 for Python:

    http://www.lfd.uci.edu/~gohlke/pythonlibs/
    libxml2-python-2.9.1.win32-py2.7.?exe
    
    Installer should find the python install automagically
    
  5. Install pywin32:

    http://pywin32.sourceforge.net/
    http://sourceforge.net/projects/pywin32/files/pywin32/
    http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/
    http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win32-py2.7.exe
    
    Installer should find the Python install automagically
    
  6. Install Scons:

    http://www.scons.org/
    http://prdownloads.sourceforge.net/scons/scons-2.3.0-setup.exe
    
    Installer should find the Python install automagically
    
  7. Add these near the top of your PATH:

    C:Python27
    C:Python27Scripts
    
  8. Download Mesa:

    ftp://ftp.freedesktop.org/pub/mesa/
    ftp://ftp.freedesktop.org/pub/mesa/9.1.5/MesaLib-9.1.5.zip
    
    Extract somewhere (C:Mesa-9.1.5)
    
  9. Start MSYS shell:

    C:mingwmsys1.0msys.bat
    
    Change into mesa src directory:
    cd /c/Mesa-9.1.5/
    
  10. Build Mesa:

    scons.py 
    build=release 
    machine=x86 
    platform=windows 
    MSVC_VERSION=11.0 
    libgl-gdi 
    

This should create an opengl32.dll in buildwindows-x86galliumargetslibgl-gdi.

With a little bit more legwork it's possible to build llvmpipe.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...