Building Blender with Multi-threading (OpenMP) on osx 10.9

Building Blender for Mac is quite easy. Just follow this tutorial and you will get Blender. Only issue with this: There is no multi-threading! This is quite a Big Deal! In order to build Blender with Multi-threading, we need OpenMP, and apple compiler does not support this. So we need to use another compiler.

So let’s install gcc 4.8!

Follow the tutorial bellow, but only until you read “We are ready to compile GCC now.”

Note: I used following versions of the libraries: cloog-0.18.0, gmp-5.1.3, isl-0.11.1, mpc-1.0.1, mpfr-3.1.2

NoteII: He use gcc-4.8.1, i use gcc-4.8.2 instead and change all names accordingly. If you use 4.8.2 just make sure you use 4.8.2 instead of 4.8.1 in all the commands!

Note III: He used XCode 4.6.2, i use Xcode 5.0.2

http://solarianprogrammer.com/2013/06/11/compiling-gcc-mac-os-x/

Now, since the Tutorial above is missing some steps in between i will put them here. In the same Terminal you used for the Tutorial – copy paste each line and hit enter:

cd ..
cd ..
cd gcc*
mkdir build && cd build

../configure --prefix=/usr/gcc-4.8.2 --enable-checking=release --with-gmp=/usr/gcc-4.8.2 --with-mpfr=/usr/gcc-4.8.2 --with-mpc=/usr/gcc-4.8.2 --enable-languages=c,c++,fortran,objc,obj-c++ --with-isl=/usr/gcc-4.8.2 --with-cloog=/usr/gcc-4.8.2 --program-suffix=-4.8.2

make -j 8
make install

Note: the ../configure … is all one command until … –programm-suffix=-4.8.2

You now have gcc-4.8.2 installed in /usr/gcc-4.8.2

Now we can build Blender using scons. (read here if you don’t already know how to do that):

But first edit user_config.py and change:

CC = ‘/usr/gcc-4.8.2/bin/gcc-4.8.2’

CXX = ‘/usr/gcc-4.8.2/bin/g++-4.8.2’

BF_CXX = ‘/usr/gcc-4.8.2’

WITH_BF_STATICCXX = True

Build Blender and you should have a Multi-threaded Blender.

I write this here with the hopes that someone might not have to spend a couple of days like i just did to get this up and running…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s