Use OpenMP on OSX when compiling with the intel compiler
parent
53796152c6
commit
9406274cf0
|
@ -42,6 +42,7 @@ if not 'DISTDIR' in env:
|
||||||
Exit(1)
|
Exit(1)
|
||||||
|
|
||||||
distDir = env.GetBuildPath(env['DISTDIR'])
|
distDir = env.GetBuildPath(env['DISTDIR'])
|
||||||
|
basePath = env.GetBuildPath('#')
|
||||||
|
|
||||||
for file in os.listdir(env.GetBuildPath('#data/schema')):
|
for file in os.listdir(env.GetBuildPath('#data/schema')):
|
||||||
if fnmatch.fnmatch(file, '*.xsl') or fnmatch.fnmatch(file, '*.xsd'):
|
if fnmatch.fnmatch(file, '*.xsl') or fnmatch.fnmatch(file, '*.xsd'):
|
||||||
|
@ -79,7 +80,6 @@ if sys.platform == 'win32':
|
||||||
|
|
||||||
if hasCollada:
|
if hasCollada:
|
||||||
install(distDir, ['converter/mtsimport.exe'])
|
install(distDir, ['converter/mtsimport.exe'])
|
||||||
basePath = env.GetBuildPath('#')
|
|
||||||
sdkDir = os.path.join(distDir, "sdk")
|
sdkDir = os.path.join(distDir, "sdk")
|
||||||
sdkLibDir = os.path.join(sdkDir, "lib")
|
sdkLibDir = os.path.join(sdkDir, "lib")
|
||||||
|
|
||||||
|
@ -117,6 +117,10 @@ elif sys.platform == 'darwin':
|
||||||
for i in plugins:
|
for i in plugins:
|
||||||
plugin = env.Install(os.path.join(distDir, 'plugins'), i)
|
plugin = env.Install(os.path.join(distDir, 'plugins'), i)
|
||||||
installTargets += fixOSXPluginPath(plugin)
|
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'])
|
install(os.path.join(distDir, 'Contents/MacOS'), ['mitsuba/mitsuba', 'mitsuba/mtssrv', 'mitsuba/mtsutil'])
|
||||||
if hasCollada:
|
if hasCollada:
|
||||||
install(os.path.join(distDir, 'Contents/MacOS'), ['converter/mtsimport'])
|
install(os.path.join(distDir, 'Contents/MacOS'), ['converter/mtsimport'])
|
||||||
|
|
|
@ -127,7 +127,21 @@
|
||||||
#define MTS_NAMESPACE_BEGIN namespace mitsuba {
|
#define MTS_NAMESPACE_BEGIN namespace mitsuba {
|
||||||
#define MTS_NAMESPACE_END }
|
#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
|
#define BOOST_FILESYSTEM_VERSION 2
|
||||||
|
|
||||||
/* Use ELF support for thread-local storage on Linux? This
|
/* Use ELF support for thread-local storage on Linux? This
|
||||||
|
|
|
@ -19,9 +19,6 @@
|
||||||
#include <mitsuba/core/plugin.h>
|
#include <mitsuba/core/plugin.h>
|
||||||
#include <mitsuba/render/gatherproc.h>
|
#include <mitsuba/render/gatherproc.h>
|
||||||
#include <mitsuba/render/renderqueue.h>
|
#include <mitsuba/render/renderqueue.h>
|
||||||
#if !defined(__OSX__) && defined(_OPENMP)
|
|
||||||
#include <omp.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MTS_NAMESPACE_BEGIN
|
MTS_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
@ -66,7 +63,7 @@ public:
|
||||||
/* Indicates if the gathering steps should be canceled if not enough photons are generated. */
|
/* Indicates if the gathering steps should be canceled if not enough photons are generated. */
|
||||||
m_autoCancelGathering = props.getBoolean("autoCancelGathering", true);
|
m_autoCancelGathering = props.getBoolean("autoCancelGathering", true);
|
||||||
m_mutex = new Mutex();
|
m_mutex = new Mutex();
|
||||||
#if defined(__OSX__)
|
#if MTS_BROKEN_OPENMP == 1
|
||||||
Log(EError, "Progressive photon mapping currently doesn't work "
|
Log(EError, "Progressive photon mapping currently doesn't work "
|
||||||
"on OSX due to a bug in OpenMP that affects Leopard & Snow Leopard");
|
"on OSX due to a bug in OpenMP that affects Leopard & Snow Leopard");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,9 +20,7 @@
|
||||||
#include <mitsuba/core/bitmap.h>
|
#include <mitsuba/core/bitmap.h>
|
||||||
#include <mitsuba/render/gatherproc.h>
|
#include <mitsuba/render/gatherproc.h>
|
||||||
#include <mitsuba/render/renderqueue.h>
|
#include <mitsuba/render/renderqueue.h>
|
||||||
#if !defined(__OSX__) && defined(_OPENMP)
|
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
MTS_NAMESPACE_BEGIN
|
MTS_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
@ -67,7 +65,7 @@ public:
|
||||||
/* Indicates if the gathering steps should be canceled if not enough photons are generated. */
|
/* Indicates if the gathering steps should be canceled if not enough photons are generated. */
|
||||||
m_autoCancelGathering = props.getBoolean("autoCancelGathering", true);
|
m_autoCancelGathering = props.getBoolean("autoCancelGathering", true);
|
||||||
m_mutex = new Mutex();
|
m_mutex = new Mutex();
|
||||||
#if defined(__OSX__)
|
#if MTS_BROKEN_OPENMP == 1
|
||||||
Log(EError, "Stochastic progressive photon mapping currently doesn't work "
|
Log(EError, "Stochastic progressive photon mapping currently doesn't work "
|
||||||
"on OSX due to a bug in OpenMP that affects Leopard & Snow Leopard");
|
"on OSX due to a bug in OpenMP that affects Leopard & Snow Leopard");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,6 +11,9 @@ if pythonEnv.has_key('PYTHONLIBDIR'):
|
||||||
pythonEnv.Prepend(LIBPATH=pythonEnv['PYTHONLIBDIR'])
|
pythonEnv.Prepend(LIBPATH=pythonEnv['PYTHONLIBDIR'])
|
||||||
if pythonEnv.has_key('PYTHONLIB'):
|
if pythonEnv.has_key('PYTHONLIB'):
|
||||||
pythonEnv.Prepend(LIBS=pythonEnv['PYTHONLIB'])
|
pythonEnv.Prepend(LIBS=pythonEnv['PYTHONLIB'])
|
||||||
|
if pythonEnv.has_key('XERCESINCLUDE'):
|
||||||
|
pythonEnv.Prepend(CPPPATH=pythonEnv['XERCESINCLUDE'])
|
||||||
|
|
||||||
if hasPython:
|
if hasPython:
|
||||||
libpython = pythonEnv.SharedLibrary('mitsuba', ['core.cpp', 'render.cpp']);
|
libpython = pythonEnv.SharedLibrary('mitsuba',
|
||||||
|
['core.cpp', 'render.cpp']);
|
||||||
|
|
Loading…
Reference in New Issue