Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Plisson <damien.plisson@yahoo.fr>2009-12-17 20:05:28 +0300
committerDamien Plisson <damien.plisson@yahoo.fr>2009-12-17 20:05:28 +0300
commit1975ee5eecc17514b441fb9ac921063c38fcabc4 (patch)
treeb17498faf199f276e843c30767d6b06577e3c9a1 /source/blender/editors/physics/SConscript
parent4271a40ee7a53029f04389234278b7f64d834a11 (diff)
OSX vs OpenMP : implement workaround to fix crashes when using mop from a background thread
Fix# 20043 & 20392 The issue is that OSX lib does not implement TLS (Thread Local Storage), so libgomp uses pthread functions to read/write thread specific vars. But this implementation is currently (gcc 4.2) buggy : the write function is called only at lib start (in main thread), and the var is undefined for background thread. The workaround is to perform this gomp_tls_key var write at beginning of background threads that use openMP. (Currently: render & fluidsim)
Diffstat (limited to 'source/blender/editors/physics/SConscript')
-rw-r--r--source/blender/editors/physics/SConscript9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/physics/SConscript b/source/blender/editors/physics/SConscript
index 85a40c91b3a..fcf94eae994 100644
--- a/source/blender/editors/physics/SConscript
+++ b/source/blender/editors/physics/SConscript
@@ -8,6 +8,8 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../gpu'
incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern'
+defs = ''
+
if env['OURPLATFORM'] == 'linux2':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
@@ -15,4 +17,9 @@ if env['OURPLATFORM'] == 'linux2':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
-env.BlenderLib ( 'bf_editors_physics', sources, Split(incs), [], libtype=['core'], priority=[45] )
+
+if env['OURPLATFORM'] == 'darwin':
+ if env['WITH_BF_OPENMP']:
+ defs += ' PARALLEL=1'
+
+env.BlenderLib ( 'bf_editors_physics', sources, Split(incs), Split(defs), libtype=['core'], priority=[45] )