diff --git a/build/SConscript.install b/build/SConscript.install index 2a5bbf3d..8c3f0198 100644 --- a/build/SConscript.install +++ b/build/SConscript.install @@ -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']) diff --git a/include/mitsuba/core/platform.h b/include/mitsuba/core/platform.h index f6e082ba..b50567e2 100644 --- a/include/mitsuba/core/platform.h +++ b/include/mitsuba/core/platform.h @@ -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 diff --git a/src/integrators/photonmapper/ppm.cpp b/src/integrators/photonmapper/ppm.cpp index 5d289e25..84b049f0 100644 --- a/src/integrators/photonmapper/ppm.cpp +++ b/src/integrators/photonmapper/ppm.cpp @@ -19,9 +19,6 @@ #include #include #include -#if !defined(__OSX__) && defined(_OPENMP) -#include -#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 diff --git a/src/integrators/photonmapper/sppm.cpp b/src/integrators/photonmapper/sppm.cpp index ac6e8163..208e6c5d 100644 --- a/src/integrators/photonmapper/sppm.cpp +++ b/src/integrators/photonmapper/sppm.cpp @@ -20,9 +20,7 @@ #include #include #include -#if !defined(__OSX__) && defined(_OPENMP) #include -#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 diff --git a/src/libpython/SConscript b/src/libpython/SConscript index 6984ac84..e66e0d9d 100644 --- a/src/libpython/SConscript +++ b/src/libpython/SConscript @@ -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']);