Monday, March 24, 2014

Building A Custom Blender Build (and failing)

I decided to compile my own build of Blender on Windows. The main reason is that the sewing addon I want is a patch, not a script, so I have to apply to to the Blender source code and then compile. I'm typically a Unix user (and most often I'm specifically a Darwin user), so when it comes to using the Windows command prompt, or knowing where certain important system files are, or anything a power user might need, I get a bit lost.

I have not yet produced a successful build. To illustrate a point about how difficult these things usually end up being, here are some of the issues I've run into so far:
  • I had no previous setup for Windows so I had to choose what tools to install, namely: a git or svn client, a compiler, a build system
  • I installed mingw64 in a directory with spaces in the pathname which is a no-no
  • I needed to add some directories to my Windows PATH variable
  • I retrieved precompiled libs for Windows but put them in the wrong place initially
  • I was not sure what command to actually use to install using the cmake-generated Makefile (mingw32-make, which confused me because I'm installing 64-bit blender with mingw64)
  • The compiler failed because of libmv, so I just decided to disable that in the build, as I don't need that feature in Blender
  • The process failed due to complaints about the openimageio library...and I had no clue how to proceed, so I decide to switch to using SCons instead of CMake, since somebody mentioned that the daily Blender builds are done with SCons and minGW
  • SCons installer can't find Python in the registry...I find out I need 32-bit Python, and I installed 64-bit Python
  • SCons errors out early, and I learn I need to set a flag BF_TOOLSET=mingw, which I just pass in the command line because SCons doesn't see my file for some reason...
  • After a long time, build errors out. More online searches suggest the problem may be due to the fact that I am using gcc 4.8 and I need to get 4.6 instead...
  • Now the build fails compiling files to do with Cycles when using SCons...
  • Now the build fails at the linking stage when compiling with CMake-gui...
The bullet points seem to fly by quickly...but keep in mind that each, on average, required significant time in google searches, trial and error, and CPU time to actually diagnose and get past.

The good news is of course the availability of builds on and of course you can always go to Still, I'm hoping I can get this figured out someday soon.

No comments:

Post a Comment