Build Blender Time saving tips?

When i build blender and update it with make update, do i always have to use make release to use the cuda function? or can i make a full release to skip the generating cuda kernel process.

Or are there any other time saving tips to build blender?

One more. What do i have to do to get a second branch like the sculpting branch without messing with the 2.8 building folder? Do i have to create a new folder and then do everything again or can this happen in one folder?

Thanks

1 Like

Anyone got some ideas about it? especially about the different build in one folder? Its on windows 10.

You can generate the Cmake files from the repository and create your own builds with the repository by using Git commands tobranch. There there is one called “lite” that shows how to do a stripped down version. This has code that shows what a minimum version looks like - which works for Cmake generation on Linux. But for windows using Cmake, you’d disable these features by ticking them off.

But basically to save you time on Windows - disable the following in your Cmake generation and build something light (instead of like 20 min, go down to 3-5 min):

  • Cycles
  • CUDA
  • Alembic
  • OpenVDB
  • Numpy
  • … And other things that won’t break the UI for testing purposes.

For testing branches and creating new ones, you’d need to use something like TortoiseSVN or a git like console commands to create and use the branches from their repositories. Here I wouldn’t have a clue, as in Blender I don’t know, personally I use a fork from Github, so Tortoise gives me Windows GUI systems to do branching and merging and there is a lot of info about how to use Git to sync a repository, fork it, and branch it easily (even in the Web UI) - but hopefully someone here can answer for the Bblender branches repository (from Graphicall I guess?).

But if you use Tortoise to sync to the repository, syncing from origin may give you all the branches to choose from, and the software remembers and pulls the correct branch data, and that is handy for switching back and forth. Git console commands can also do this. The repository updates to said branch, and vice versa, or merges, or whatever you want. Since the library is remote, nothing messes up unless you commit bad code.

1 Like

If you are on linux/mac, have a look at ccache.

2 Likes

+1, since I started using ccache I’ve never looked back. It’s a huge timesaver, especially for bisecting - on a fast system you can do a rebuild in around 10seconds or less (when most files are cached).
It saves time when bisecting an error.

Other tips:

  • Disable features you’re not developing speeds up building & linking.
  • Use CMake’s ninja generator.
  • Don’t build the install target, instead symlink ${SOURCE}/resources into ${BUILD}/bin/2.80.
2 Likes

The most expensive targets with MSVC are

Cycles_kernel
Cycles_kernel_osl
Extern_ceres
Bf_intern_libmv
Bf_Freestyle

If you’re looking to save some time and these are features you are not using turn them off in cmake.

make lite works on windows as well, so for easy quick builds without all the expensive features this is a great option.

Also supported is ninja, this gives up to 73% faster builds (for minor changes) however you lose all IDE support so it’s not a very popular choice.

There is an alternative for ccache on windows called clcache however, i have never tested this, it’s on my todo list to see if we can support it, but i have to admit it’s pretty low on that list.

3 Likes

I started documented how to setup the Ninja Build system for compiling blender. Currently there are no instructions to be found, and it is not fully supported (you need to ignore that the initial build will not work)

https://wiki.blender.org/wiki/User:Jbakker/Dev_Setup#Ninja_build_system

1 Like

If you’re only doing builds for yourself, then a good time saver is to change the CMake config to only build CUDA binaries for the hardware that you’re using.

1 Like

On windows there’s no instructions either, i’ll update the wiki at one point, but for now

  1. Make sure ninja is available in the path
  2. make full 2019 ninja
1 Like

Something that helps my build time a lot is to use WITH_CYCLES_NATIVE_ONLY.
That and ccache as mentioned. But cycles native kernels benefit all platforms.

1 Like

WITH_CYCLES_NATIVE_ONLY is misleading on windows though, on linux you build on an AVX2 box you’d get an AVX2 kernel with this option, on windows you get an SSE2 kernel since the compiler has no swtich akin to -march=native

1 Like

It should work immediately if you use make ninja instead of make BUILD_CMAKE_ARGS="-G Ninja".

make help mentions it, but the wiki documentation for setting up builds for developers should be expanded.

1 Like

Seems like there is a catch there. make ninja generates and builds via ninja, but off course can’t find the libraries I compiled via install_deps.sh.

make ninja BUILD_CMAKE_ARGS="..." will generate a CMake build system, but tries to compile via ninja :slight_smile:

make ninja BUILD_CMAKE_ARGS="-G Ninja ..." will generate a ninja build system and tries to compile using ninja.

It seems some small adjustments are needed. I do see the code inside the GNUmakefile, but any changes to the BUILD_CMAKE_ARGS are ignored on my system.

1 Like

This is fixed in master now.

2 Likes