「Dev:Doc/Building Blender/Mac/OpenMP」の版間の差分

提供: wiki
移動先: 案内検索
(相違点なし)

2013年11月13日 (水) 14:17時点における版

Mac OpenMP Build with non-apple GCC

The official apple gcc version is at version 4.2, and does not include improvements to support use of OpenMP inside other threads. For multithreading of fluids, smoke, cloth, sculpting, a newer version must be used. These are instructions for compiling Blender with gcc-4.6.1.

Instructions by Jens Verwiebe, from http://www.jensverwiebe.de/Blender/Compiling_Blender_OSX_with_gcc-4_6_1.rtf.

Get Compiler

Get the compiler for example from http://hpc.sourceforge.net/ or macports.

Alternatively you can compile yourself, it´s not that hard. A step by step tut I used too: http://solarianprogrammer.com/?p=187

Configure your user-config.py

Set CC, CXX and BF_CXX according to your installation of gcc-4.6.1. For example I put it in a place not to disturb the standard compilers:

CC = '/Volumes/Daten1TB/usr/local/bin/gcc-4.6.1'
CXX = '/Volumes/Daten1TB/usr/local/bin/g++-4.6.1'
BF_CXX = '/Volumes/Daten1TB/usr/local/'   !!!! for 32bit: BF_CXX_LIB_STATIC = '${BF_CXX}/lib/i386/libstdc++.a'
WITH_BF_STATICCXX = True

You may have to set WITH_BF_OPENMP = True if your compiler has not the full suffix.

Add to the PLATFORM_LINKFLAGS '-static-libgcc'

Remove ! the '-arch',MACOSX_ARCHITECTURE from PLATFORM_LINKFLAGS ( both occurrences ), due non-Apple compilers don´t handle arch that convenient, the -m switches will do.

Remove the "-with-tune=core2" from the flags. Since Darwin systems are primarily Xeon, Core-2 or similar the default tuning has been changed to -mtune=core2.

Don´t forget to set the main MACOSX_ARCHITECTURE = 'your arch' , for it sets other important switches as -m64(32) and determines the right python tmodules unzipped to bundle!