Use OpenMP on OSX when compiling with the intel compiler

metadata
Wenzel Jakob 2011-08-22 15:01:20 -04:00
parent 53796152c6
commit 9406274cf0
5 changed files with 26 additions and 10 deletions

View File

@ -42,6 +42,7 @@ if not 'DISTDIR' in env:
Exit(1)
distDir = env.GetBuildPath(env['DISTDIR'])
basePath = env.GetBuildPath('#')
for file in os.listdir(env.GetBuildPath('#data/schema')):
if fnmatch.fnmatch(file, '*.xsl') or fnmatch.fnmatch(file, '*.xsd'):
@ -79,7 +80,6 @@ if sys.platform == 'win32':
if hasCollada:
install(distDir, ['converter/mtsimport.exe'])
basePath = env.GetBuildPath('#')
sdkDir = os.path.join(distDir, "sdk")
sdkLibDir = os.path.join(sdkDir, "lib")
@ -117,6 +117,10 @@ elif sys.platform == 'darwin':
for i in plugins:
plugin = env.Install(os.path.join(distDir, 'plugins'), i)
installTargets += fixOSXPluginPath(plugin)
for entry in os.walk(os.path.join(basePath, "include")):
includeDir = entry[0][len(basePath)+1:]
installTargets += env.Install(os.path.join(os.path.join(distDir, 'Headers'), includeDir),
[ ('#' + os.path.join(includeDir, fname)) for fname in entry[2] ])
install(os.path.join(distDir, 'Contents/MacOS'), ['mitsuba/mitsuba', 'mitsuba/mtssrv', 'mitsuba/mtsutil'])
if hasCollada:
install(os.path.join(distDir, 'Contents/MacOS'), ['converter/mtsimport'])

View File

@ -127,7 +127,21 @@
#define MTS_NAMESPACE_BEGIN namespace mitsuba {
#define MTS_NAMESPACE_END }
/* Compile with Boost filesystem v2 */
/* The default OpenMP implementation on OSX is seriously broken,
* for instance it segfaults when launching OpenMP threads
* from any other context than the main application thread
*/
#if defined(__OSX__) && !defined(__INTEL_COMPILER)
#define MTS_BROKEN_OPENMP 1
#else
#define MTS_BROKEN_OPENMP 0
#endif
/* Compile with Boost filesystem v2. At some point,
* the transition to v3 should be made, but as of now
* many Linux distributions still ship with Boost 1.42,
* which does not support version 3.
*/
#define BOOST_FILESYSTEM_VERSION 2
/* Use ELF support for thread-local storage on Linux? This

View File

@ -19,9 +19,6 @@
#include <mitsuba/core/plugin.h>
#include <mitsuba/render/gatherproc.h>
#include <mitsuba/render/renderqueue.h>
#if !defined(__OSX__) && defined(_OPENMP)
#include <omp.h>
#endif
MTS_NAMESPACE_BEGIN
@ -66,7 +63,7 @@ public:
/* Indicates if the gathering steps should be canceled if not enough photons are generated. */
m_autoCancelGathering = props.getBoolean("autoCancelGathering", true);
m_mutex = new Mutex();
#if defined(__OSX__)
#if MTS_BROKEN_OPENMP == 1
Log(EError, "Progressive photon mapping currently doesn't work "
"on OSX due to a bug in OpenMP that affects Leopard & Snow Leopard");
#endif

View File

@ -20,9 +20,7 @@
#include <mitsuba/core/bitmap.h>
#include <mitsuba/render/gatherproc.h>
#include <mitsuba/render/renderqueue.h>
#if !defined(__OSX__) && defined(_OPENMP)
#include <omp.h>
#endif
MTS_NAMESPACE_BEGIN
@ -67,7 +65,7 @@ public:
/* Indicates if the gathering steps should be canceled if not enough photons are generated. */
m_autoCancelGathering = props.getBoolean("autoCancelGathering", true);
m_mutex = new Mutex();
#if defined(__OSX__)
#if MTS_BROKEN_OPENMP == 1
Log(EError, "Stochastic progressive photon mapping currently doesn't work "
"on OSX due to a bug in OpenMP that affects Leopard & Snow Leopard");
#endif

View File

@ -11,6 +11,9 @@ if pythonEnv.has_key('PYTHONLIBDIR'):
pythonEnv.Prepend(LIBPATH=pythonEnv['PYTHONLIBDIR'])
if pythonEnv.has_key('PYTHONLIB'):
pythonEnv.Prepend(LIBS=pythonEnv['PYTHONLIB'])
if pythonEnv.has_key('XERCESINCLUDE'):
pythonEnv.Prepend(CPPPATH=pythonEnv['XERCESINCLUDE'])
if hasPython:
libpython = pythonEnv.SharedLibrary('mitsuba', ['core.cpp', 'render.cpp']);
libpython = pythonEnv.SharedLibrary('mitsuba',
['core.cpp', 'render.cpp']);