Skip to content

Commit

Permalink
Miscellaneous compilation fixes for Linux (#36)
Browse files Browse the repository at this point in the history

* Remove a lingering prctl call
Fixes #34

* Fix COLLADA DOM library name

* Merge calls in Linux and MacOS
  • Loading branch information
amyspark authored and wjakob committed Oct 8, 2017
1 parent 9110048 commit 463e092
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions build/config-linux-gcc-debug.py
Expand Up @@ -4,7 +4,7 @@
DISTDIR = '#dist'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-O0', '-Wall', '-g', '-pipe', '-march=nocona', '-msse2', '-ftree-vectorize', '-mfpmath=sse', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fno-math-errno', '-fno-omit-frame-pointer', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fvisibility=hidden', '-mtls-dialect=gnu2']
CXXFLAGS = ['-O0', '-Wall', '-g', '-pipe', '-march=nocona', '-msse2', '-ftree-vectorize', '-mfpmath=sse', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fno-math-errno', '-fno-omit-frame-pointer', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fvisibility=hidden', '-mtls-dialect=gnu2', '-std=c++11', '-fPIC']
LINKFLAGS = []
SHLINKFLAGS = ['-rdynamic', '-shared', '-fPIC', '-lstdc++']
BASEINCLUDE = ['#include']
Expand All @@ -19,8 +19,8 @@
GLLIB = ['GL', 'GLU', 'GLEWmx', 'Xxf86vm', 'X11']
GLFLAGS = ['-DGLEW_MX']
BOOSTLIB = ['boost_system', 'boost_filesystem', 'boost_thread']
COLLADAINCLUDE = ['/usr/include/collada-dom', '/usr/include/collada-dom/1.4']
COLLADALIB = ['collada14dom', 'xml2']
COLLADAINCLUDE = ['/usr/include/collada-dom2.4', '/usr/include/collada-dom2.4/1.4']
COLLADALIB = ['collada-dom2.4-dp']
FFTWLIB = ['fftw3_threads', 'fftw3']

# The following runs a helper script to search for installed Python
Expand Down
5 changes: 2 additions & 3 deletions build/config-linux-gcc.py
Expand Up @@ -19,8 +19,8 @@
GLLIB = ['GL', 'GLU', 'GLEWmx', 'Xxf86vm', 'X11']
GLFLAGS = ['-DGLEW_MX']
BOOSTLIB = ['boost_system', 'boost_filesystem', 'boost_thread']
COLLADAINCLUDE = ['/usr/include/collada-dom', '/usr/include/collada-dom/1.4']
COLLADALIB = ['collada14dom', 'xml2']
COLLADAINCLUDE = ['/usr/include/collada-dom2.4', '/usr/include/collada-dom2.4/1.4']
COLLADALIB = ['collada-dom2.4-dp']
FFTWLIB = ['fftw3_threads', 'fftw3']

# The following runs a helper script to search for installed Python
Expand All @@ -33,4 +33,3 @@
sys.path.append(os.path.abspath('../data/scons'))
from detect_python import detect_python
locals().update(detect_python())

4 changes: 1 addition & 3 deletions src/libcore/thread.cpp
Expand Up @@ -633,9 +633,7 @@ void Thread::initializeOpenMP(size_t threadCount) {
}
const std::string threadName = "Mitsuba: " + thread->getName();

#if defined(__LINUX__)
prctl(PR_SET_NAME, threadName.c_str());
#elif defined(__OSX__)
#if defined(__LINUX__) || defined(__OSX__)
pthread_setname_np(threadName.c_str());
#elif defined(__WINDOWS__)
SetThreadName(threadName.c_str());
Expand Down

0 comments on commit 463e092

Please sign in to comment.