Build Blender from source (first time)

It’s my first time building Blender from source and I’m having some difficulties.
I use Arch Linux and followed the instructions on the wiki page but running “make” gave me this :

Configuring Blender in "/home/caetano/blender-git/build_linux" ...
-- Boost version: 1.63.0
-- Found the following Boost libraries:
--   filesystem
--   regex
--   thread
--   date_time
--   locale
--   system
--   chrono
--   atomic
CMake Warning at build_files/cmake/macros.cmake:1533 (message):
  Python package 'requests' path could not be found in:

  '/opt/lib/python-3.5/lib/python3.5/site-packages/requests',
  '/opt/lib/python-3.5/lib/python3/site-packages/requests',
  '/opt/lib/python-3.5/lib/python3.5/dist-packages/requests',
  '/opt/lib/python-3.5/lib/python3/dist-packages/requests',

  The 'WITH_PYTHON_INSTALL_REQUESTS' option will be ignored when installing
  Python.

  The build will be usable, only add-ons that depend on this package won't be
  functional.
Call Stack (most recent call first):
  CMakeLists.txt:1569 (find_python_package)


CMake Error at intern/CMakeLists.txt:96 (add_subdirectory):
  add_subdirectory given source "SLIM" which is not an existing directory.


-- Blender Skipping: (bf_alembic;bf_collada;bf_intern_ctr;bf_intern_opencl;bf_intern_utfconv;extern_sdlew)
-- Disabling Cycles tests because tests folder does not exist
-- Found Git: /usr/bin/git
-- Configuring incomplete, errors occurred!
See also "/home/caetano/blender-git/build_linux/CMakeFiles/CMakeOutput.log".
See also "/home/caetano/blender-git/build_linux/CMakeFiles/CMakeError.log".
make: *** [GNUmakefile:127: all] Error 1


How did you obtain the source code? Because I added the folder “SLIM” when integrating the new UV unwrapping algorithm. So if you built blender exactly as described in wiki page that should not happen.

Are you using the install_deps.sh script for the base dependencies, or are you installing the dependencies yourself from Arch’s repos? Since install_deps.sh isn’t mentioned on the link you posted, I’m going to assume that you’re somewhere between the two. That is, you’re not using install_deps.sh, but your cmake configuration is defaulting to looking in the paths where install_deps.sh would put dependencies. You may need to run cmake and fix any configuration options.

For reference, here’s the text from my CMakeCache.txt file that gets generated by cmake. I’ve got most standard Blender configure options enabled (plus a few extras, like JACK support). Assuming you have all of the proper base libraries installed, that config may work for you (though obviously the paths to our source directories will be different).

I tried install_deps.sh yesterday but it failed on every dependency. However I re-tried today and most of them worked (no idea why) and I got to the end of the script. I could copy-paste the code given at the end and the compiling succeeded ! (for the failed dependencies I installed them from the Arch repos and checked if the versions were equal or superior to what’s required according to the wiki page)

That was for the master branch, now I’m trying to compile the uv_unwrapping_slim_algorithm branch, but I’m not sure about the git commands, as I’m pretty new to git. I know there are many things to know in order to use git properly and keep things organized but for now I will just try this branch the easiest way, as I don’t have a lot of time.
I guess I have to

git checkout uv_unwrapping_slim_algorithm

but that’s probably not all as I find no SLIM folder.

Welcome to the woolly and wonderful world of version control. By doing a checkout as you’ve typed, you’re in a branch. There are not necessarily any new folders or files in a branch. In fact, the vast majority of things should be identical to the master branch. The differences would be the content of those files. So things should build, but maybe you’re missing an additional dependency.

My recommendation would be to get the master branch to properly build first. Then venture off into the side branches.

You may also want to use a GUI to help visualize how branching works. For Git repositories, I use gitg (pacman -S gitg), but I think TortoiseHg supports git repos, too. I still interact with repos from the command line, but the graphical tools really help get a good ‘big picture’ sense of things.

Thanks. I think the master branch was built properly as the cmake command I copy-pasted resulted in saying “Blender was built successfully” and I could run the generated Blender binary.
I’m trying gitg and it looks very friendly for a beginner like me.
Now trying to compile with the uv_unwrapping_slim_algorythm branch I’m not sure what I should do.
If I checkout the branch from command line it then appears in gitg in Branches under master with a checkmark on it.
Do I have something else to do before compiling ?
I guess I have to merge the branch into master but it fails to do that, saying it has conflicts
And if I simply install_deps and compile from there it fails too.

No need to merge. You should be fine building from the branch. What’s the compile error you get? Is it the same as what you posted in the OP?

You may want to post the whole chunk of text that spits out after you type ‘make’. Sometimes relevant compile time errors aren’t easily discoverable right at the point that the final error message prints to the screen. Use something like pasteall.org.

Here is the output of the make command. As you can see it stopped pretty quickly. I tried another branch (cloth-improvements) and had no problem with this one. It really seems linked to the slim branch.

the weird thing is that the checkout seems way too quick. I also tried doing a checkout for blender2.8 and it took no more than a second, but downloading all the files for 2.8 in that time is definitely impossible with my internet connection. Are you sure there’s nothing else to do before install_deps and make ?

When you clone the source, unless you just cloned master (uncommon), you actually have all the branches, too. So a checkout is just changing the files that are already on your hard drive. You’re not downloading anything extra.

Edit: I stand corrected… git will download the remote branch files… but only the first time you do the checkout. After that, you’re just changing files that are already there.

And I just looked at the uv_unwrapping_slim_algorithm repository. It’s been about a month since it was last sync’d with master. There are a lot of compile configurations that have changed since then. That may be part of the issue.

Also, how did you checkout that branch? The first time you do it, it should be something like this:

git checkout --track origin/uv_unwrapping_slim_algorithm

That’s what pulls from the central repository. It only pulls the differences between master and that branch, so that’s why it’s fast. After the initial checkout, you can bounce between it and master like so:


git checkout master

git checkout uv_unwrapping_slim_algorithm

The first switches you to master and the second switches you to the uv_unwrapping_slim_algorithm branch.

Building in Arch is supposed to be easy, no need for the wiki.
Just download the PKGBUILD script change the URL for the branch that you want and it’ll pull build and install blender.

@Fweeb I only used checkout without any argument but got this output :

Switched to branch 'uv_unwrapping_slim_algorithm'
Your branch is up-to-date with 'origin/uv_unwrapping_slim_algorithm'.

But using the command you gave didn’t seem to make a difference. I re-tried to compile after that without success. I guess it can’t be properly compiled at the moment because of this master merge issue you pointed out. However if it was merged, maybe there’s already something usable in master ? I don’t see anything in the UI but maybe there’s a command.

@ramboblender which URL ? One from inside the script or the url you just gave ? Also change how exactly ? Sorry I’m new to this.

Download the script, name it PKGBUILD upper case. Right now it pulls master branch, line 41 and 43 is the URL you need to change so it’ll pull the branch you want, after that run it with pacman in terminal ( can’t remember exactly, don’t use Arch anymore) and hope that it builds that branch.

I tried makepkg ./PKGBUILD and got :

 makepkg ./PKGBUILD==> Making package: blender 17:2.78.c-2 (mer. avril 19 23:01:15 CEST 2017)
==> Checking runtime dependencies...
==> Missing dependencies:
  -> python-requests
  -> opencollada
  -> alembic
  -> openimageio
  -> opencolorio
  -> openshadinglanguage
  -> libspnav
  -> ptex
  -> opensubdiv
  -> openvdb
  -> log4cplus
==> Checking buildtime dependencies...
==> Missing dependencies:
  -> llvm35
  -> cuda
==> ERROR: Could not resolve all dependencies.


==> ERROR: An unknown error has occurred. Exiting...

but anyway I don’t think the problem comes from the way I build the source code by now, but rather from the branch itself.

OK, so to build SLIM you have to do the following:

We now have C++11 libraries for OS X, so no special hacks should be needed anymore. You can set WITH_CXX11=ON and checkout these precompiled darwin libraries instead of darwin-9.x.universal:
https://svn.blender.org/svnroot/bf-blender/trunk/lib/darwin

Note that it doesn’t run on mac osx 10.6 and older i think.

I’ve had issues with cycles in the past, if there are cycles related errors, try to build without cycles. same goes for other things like ffmpeg or whatever might cause issues due to the libraries. Hope this helps :slight_smile:

Blender needs other packages to build which you have to install prior to running PKGBUILD. It tells you on the PKGBUILD that it “depends” on those packages. You need to install those otherwise it’ll always fail. Line 26 on the script make sure all are installed on your system. Good luck.

@AurelGruber I’m on Linux, do you think it still applies ?
About ignoring Cycles and video codecs, I tried running “make lite” as the wiki suggests, still without success. I will look into how to compile manually… https://raw.githubusercontent.com/ChameleonScales/Blender-individual-icons/master/PNG-16x16/ICON_TIME.png
@ramboblender I may try that too but more as a last resort as I prefer to learn the more “multi-platform” way.

Hello.
I also get an error when trying to compile ‘uv_unwrapping_slim_algorythm’ branch on Linux. Do you know if that is a still active/maintained branch?