6

我完成了 Mesa 网站上编译/安装页面上的所有步骤,并阅读了常见问题解答。您发送给 scons 进行编译的最终命令会在 python 脚本中引发错误。这是我的输出。我究竟做错了什么?另外,如果有人使用最新的 mesa 和 mingw 或 VS2012 为 mesa 编译了 dll,请分享!

这是我的输出,我已经很长时间没有编写 python 了,但似乎地图/字典不包含键/值对。

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

scons: Reading SConscript files ...
KeyError: 'CCVERSION':
  File "C:\Downloads\MesaLib-9.1.5\Mesa-9.1.5\SConstruct", line 40:
    ENV = os.environ,
  File "C:\Python27\scons-2.3.0\SCons\Environment.py", line 1002:
    apply_tools(self, tools, toolpath)
  File "C:\Python27\scons-2.3.0\SCons\Environment.py", line 106:
    env.Tool(tool)
  File "C:\Python27\scons-2.3.0\SCons\Environment.py", line 1786:
    tool(self)
  File "C:\Python27\scons-2.3.0\SCons\Tool\__init__.py", line 183:
    self.generate(env, *args, **kw)
  File "C:\Downloads\MesaLib-9.1.5\Mesa-9.1.5\scons\gallium.py", line 313:
    ccversion = env['CCVERSION']
  File "C:\Python27\scons-2.3.0\SCons\Environment.py", line 412:
    return self._dict[key]
4

1 回答 1

17

常用scons选项:

build=release
machine=x86
platform=windows
libgl-gdi
  1. Linux (Debian Wheezy), toolchain=crossmingw:在链接阶段失败,因为它找不到__vscprintf,除其他外。 从 Debian Jessie 8.5 和 Mesa 开始工作d2f42a945ec0fbcc51b59cfd329258bd62ebf0d2,通过:

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

    DLL 安装到build/windows-x86/gallium/targets/libgl-gdi/opengl32.dll

  2. Windows, toolchain=mingw:因“命令行太长”而失败。尽管LongCmdLinesOnWin32.

  3. Windows ,VS2012 ExpressMSVC_VERSION=11.0,:从.src/glsl/ralloc.c::ralloc_size()


编辑:更完整的程序:

  1. 为 Windows 桌面安装 Visual Studio Express 2012:

    http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop
    
  2. 安装 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. 安装 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. libxml2为 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. 安装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. 安装Scons

    http://www.scons.org/
    http://prdownloads.sourceforge.net/scons/scons-2.3.0-setup.exe
    
    Installer should find the Python install automagically
    
  7. 在您的顶部附近添加这些PATH

    C:\Python27\
    C:\Python27\Scripts
    
  8. 下载台面:

    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. 启动 MSYS 外壳:

    C:\mingw\msys\1.0\msys.bat
    
    Change into mesa src directory:
    cd /c/Mesa-9.1.5/
    
  10. 构建台面:

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

这应该创建一个opengl32.dllin build\windows-x86\gallium\targets\libgl-gdi

通过更多的跑腿工作,可以构建llvmpipe.

于 2013-07-29T06:30:10.470 回答