Open source 编译/链接windows blender

Open source 编译/链接windows blender,open-source,blender,Open Source,Blender,我在链接blender for windows时遇到问题。我使用CGuy创建MaMax文件并使用MIMGW编译器(明文32-G++.exe C++编译器)和(明W32-GC.exe C编译器)。 我从 如 所有链接错误都与lib\windows\gcc有关 以下是其中一些: lib\windows\gcc\tiff\lib/libtiff.a(tif_pixarlog.o):(.text+0x172d):对“deflateInit”的未定义引用 lib\windows\gcc\openim

我在链接blender for windows时遇到问题。我使用CGuy创建MaMax文件并使用MIMGW编译器(明文32-G++.exe C++编译器)和(明W32-GC.exe C编译器)。 我从



所有链接错误都与lib\windows\gcc有关
以下是其中一些:

lib\windows\gcc\tiff\lib/libtiff.a(tif_pixarlog.o):(.text+0x172d):对“deflateInit”的未定义引用

lib\windows\gcc\openimageio\lib/libOpenImageIO.a(sysutil.cpp.obj):sysutil.cpp:(.text+0x32):对的未定义引用`GetProcessMemoryInfo@12"

lib\windows\gcc\openimageio\lib/libOpenImageIO.a(socketinput.cpp.obj):socketinput.cpp:(.text+0x45c2):对的未定义引用`WSASetLastError@4"

在我的lib\windows\gcc\openimageio中有一个批处理文件(oiio build.bat),我猜这是由CMake生成的

cmake ..\oiio\src\ -G "MinGW Makefiles" ^
    -DBUILDSTATIC=1 ^
    -DBOOST_CUSTOM=0 ^
    -DBOOST_ROOT=..\lib\windows\gcc\boost\ ^
    -DBoost_USE_STATIC_RUNTIME=ON ^
    -DLINKSTATIC=ON ^
    -DILMBASE_HALF_LIBRARIES=..\lib\windows\gcc\openexr\lib\libHalf.a ^
    -DILMBASE_IMATH_LIBRARIES=..\lib\windows\gcc\openexr\lib\libImath.a ^
    -DILMBASE_ILMTHREAD_LIBRARIES=..\lib\windows\gcc\openexr\lib\libIlmThread.a ^
    -DILMBASE_IEX_LIBRARIES=..\lib\windows\gcc\openexr\lib\libIex.a ^
    -DOPENEXR_ILMIMF_LIBRARIES=..\lib\windows\gcc\openexr\lib\libIlmImf.a ^
    -DILMBASE_INCLUDE_DIR=..\lib\windows\gcc\openexr\include ^
    -DOPENEXR_INCLUDE_DIR=..\lib\windows\gcc\openexr\include ^
    -DZLIB_INCLUDE_DIR=..\lib\windows\zlib\include ^
    -DZLIB_LIBRARY=..\lib\windows\zlib\lib\libz.a ^
    -DPNG_LIBRARY=..\lib\windows\png\lib\libpng.a ^
    -DPNG_PNG_INCLUDE_DIR=..\lib\windows\png\include ^
    -DJPEG_LIBRARY=..\lib\windows\jpeg\lib\libjpeg.lib ^
    -DJPEG_INCLUDE_DIR=..\lib\windows\jpeg\include ^
    -DTIFF_LIBRARY=..\lib\windows\tiff\lib\libtiff.lib ^
    -DTIFF_INCLUDE_DIR=..\lib\windows\tiff\include ^
    -DCMAKE_INSTALL_PREFIX=..\lib\windows\gcc\openimageio ^
    -DUSE_OPENGL=OFF ^
    -DUSE_TBB=OFF ^
    -DUSE_FIELD3D=OFF ^
    -DUSE_QT=OFF ^
    -DUSE_PYTHON=OFF ^
    -DCMAKE_BUILD_TYPE=Release
mingw32-make install
原来lib\windows\gcc\oiio不存在

编辑:试图用SCON编译blender 2.71,我发现如果我不从blender文件夹运行python,我会得到*No SContruct文件。错误

所以

使用python26\python.exe scons/scons.py,我得到

ValueError: zero length field name in format:
  File "D:\blender-source\blender\SConstruct", line 54:
    EnsureSConsVersion(1,0,0)
  File "D:\blender-source\blender\scons\scons-local\SCons\Script\SConscript.py", line 607:
    env = self.factory()
  File "D:\blender-source\blender\scons\scons-local\SCons\Script\SConscript.py", line 587:
    default_env = SCons.Defaults.DefaultEnvironment()
  File "D:\blender-source\blender\scons\scons-local\SCons\Defaults.py", line 88:
    _default_env = SCons.Environment.Environment(*args, **kw)
  File "D:\blender-source\blender\scons\scons-local\SCons\Environment.py", line 1003:
    apply_tools(self, tools, toolpath)
  File "D:\blender-source\blender\scons\scons-local\SCons\Environment.py", line 107:
    env.Tool(tool)
  File "D:\blender-source\blender\scons\scons-local\SCons\Environment.py", line 1787:
    tool(self)
  File "D:\blender-source\blender\scons\scons-local\SCons\Tool\__init__.py", line 183:
    self.generate(env, *args, **kw)
  File "D:\blender-source\blender\scons\scons-local\SCons\Tool\default.py", line 41:
    SCons.Tool.Tool(t)(env)
  File "D:\blender-source\blender\scons\scons-local\SCons\Tool\__init__.py", line 183:
    self.generate(env, *args, **kw)
  File "D:\blender-source\blender\scons\scons-local\SCons\Tool\dmd.py", line 131:
    env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '')
scons: warning: VC version 12.0 not installed.  C/C++ compilers are most likely not set correctly.
 Installed versions are: ['9.0']
File "D:\blender-source\blender\SConstruct", line 143, in <module>
WindowsError: [Error 2] The system cannot find the file specified:
  File "D:\blender-source\blender\SConstruct", line 207:
    opts.Update(env)
  File "D:\blender-source\blender\scons\scons-local\SCons\Variables\__init__.py", line 173:
    exec open(filename, 'rU').read() in {}, values
  File "<string>", line 3:
    None
  File "c:\python27\lib\subprocess.py", line 710:
    errread, errwrite)
  File "c:\python27\lib\subprocess.py", line 958:
    startupinfo)
使用python27\python.exe scons/scons.py,我得到

ValueError: zero length field name in format:
  File "D:\blender-source\blender\SConstruct", line 54:
    EnsureSConsVersion(1,0,0)
  File "D:\blender-source\blender\scons\scons-local\SCons\Script\SConscript.py", line 607:
    env = self.factory()
  File "D:\blender-source\blender\scons\scons-local\SCons\Script\SConscript.py", line 587:
    default_env = SCons.Defaults.DefaultEnvironment()
  File "D:\blender-source\blender\scons\scons-local\SCons\Defaults.py", line 88:
    _default_env = SCons.Environment.Environment(*args, **kw)
  File "D:\blender-source\blender\scons\scons-local\SCons\Environment.py", line 1003:
    apply_tools(self, tools, toolpath)
  File "D:\blender-source\blender\scons\scons-local\SCons\Environment.py", line 107:
    env.Tool(tool)
  File "D:\blender-source\blender\scons\scons-local\SCons\Environment.py", line 1787:
    tool(self)
  File "D:\blender-source\blender\scons\scons-local\SCons\Tool\__init__.py", line 183:
    self.generate(env, *args, **kw)
  File "D:\blender-source\blender\scons\scons-local\SCons\Tool\default.py", line 41:
    SCons.Tool.Tool(t)(env)
  File "D:\blender-source\blender\scons\scons-local\SCons\Tool\__init__.py", line 183:
    self.generate(env, *args, **kw)
  File "D:\blender-source\blender\scons\scons-local\SCons\Tool\dmd.py", line 131:
    env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '')
scons: warning: VC version 12.0 not installed.  C/C++ compilers are most likely not set correctly.
 Installed versions are: ['9.0']
File "D:\blender-source\blender\SConstruct", line 143, in <module>
WindowsError: [Error 2] The system cannot find the file specified:
  File "D:\blender-source\blender\SConstruct", line 207:
    opts.Update(env)
  File "D:\blender-source\blender\scons\scons-local\SCons\Variables\__init__.py", line 173:
    exec open(filename, 'rU').read() in {}, values
  File "<string>", line 3:
    None
  File "c:\python27\lib\subprocess.py", line 710:
    errread, errwrite)
  File "c:\python27\lib\subprocess.py", line 958:
    startupinfo)
scons:警告:未安装VC 12.0版。C/C++编译器很可能设置不正确。
已安装的版本为:['9.0']
文件“D:\blender source\blender\SConstruct”,第143行,在
WindowsError:[错误2]系统找不到指定的文件:
文件“D:\blender source\blender\SConstruct”,第207行:
选项更新(环境)
文件“D:\blender source\blender\scons\scons local\scons\Variables\\uuuu init\uuuu.py”,第173行:
{}中的exec open(文件名为'rU').read(),值
文件“”,第3行:
没有一个
文件“c:\python27\lib\subprocess.py”,第710行:
错误读取,错误写入)
文件“c:\python27\lib\subprocess.py”,第958行:
startupinfo)

CMake+Mingw32已经很长时间没有经过测试了,但SCons+Mingw64肯定能工作,因为Blender build Bot也会利用它进行夜间构建:

从buildslave列表中,您可以看到没有mingw32 slave,我不确定在不久的将来是否会有mingw32 slave


无论如何,使用SCons和Mingw64,您应该有一种直接的方式来运行编译过程。只需确保安装了Mingw64和python2.6或python2.7。然后查看blender源代码和lib/mingw64。使用Blender源根目录中的C:\Python27\python.exe scons\scons.py启动编译过程。这应该是开箱即用的编译。

scons.py脚本给了我一个错误:scons:**找不到SConstruct。生成错误消息的代码行是:raise SCons.Errors.UserError(“未找到任何SConstruct文件”)