为Windows7构建台面。台面9.1

2024-04-29 06:28:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我浏览了Mesa网站编译/安装页面上的所有步骤,并阅读了FAQ。发送给scons进行编译的最后一个命令在python脚本中抛出错误。这是我的输出。我做错什么了?另外,如果有人使用最新的mesa和mingw或VS2012为mesa编译了dll,请共享!

这是我的输出,我很久没有编写python了,但是似乎map/dictionary不包含键/值对。

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]

Tags: pyselfenvenvironmentdownloadslinetoolsscons
1条回答
网友
1楼 · 发布于 2024-04-29 06:28:23

常用选项:

build=release
machine=x86
platform=windows
libgl-gdi
  1. Linux(Debian喘息),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失败,原因是“命令行太长”。尽管两个snippits在^{}上都有多个排列。

  3. src/glsl/ralloc.c::ralloc_size()中删除stray C99-isms后,MSVC_VERSION=11.0成功


编辑:更完整的过程:

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

    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. 安装Python2.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. 为Python安装libxml2

    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. 下载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. 启动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 \
    

这将在build\windows-x86\gallium\targets\libgl-gdi中创建opengl32.dll

使用little bit more legwork可以构建llvmpipe

相关问题 更多 >