linux compilation support

metadata
Wenzel Jakob 2011-08-13 02:49:58 -04:00
parent 4a5435f8c7
commit 8abac198d0
10 changed files with 36 additions and 17 deletions

View File

@ -40,6 +40,9 @@ vars.Add('SHLINKFLAGS', 'Linker flags (dynamic libraries)')
vars.Add('BASEINCLUDE', 'Base include path') vars.Add('BASEINCLUDE', 'Base include path')
vars.Add('BASELIB', 'Base libraries') vars.Add('BASELIB', 'Base libraries')
vars.Add('BASELIBDIR', 'Base library search path') vars.Add('BASELIBDIR', 'Base library search path')
vars.Add('PYTHONINCLUDE', 'Python include path')
vars.Add('PYTHONLIB', 'Python libraries')
vars.Add('PYTHONLIBDIR', 'Python library path')
vars.Add('XERCESINCLUDE', 'Xerces-C include path') vars.Add('XERCESINCLUDE', 'Xerces-C include path')
vars.Add('XERCESLIB', 'Xerces-C libraries') vars.Add('XERCESLIB', 'Xerces-C libraries')
vars.Add('XERCESLIBDIR', 'Xerces-C library path') vars.Add('XERCESLIBDIR', 'Xerces-C library path')
@ -81,6 +84,8 @@ except Exception:
hasQt = False hasQt = False
hasCollada=True hasCollada=True
hasPython = True
env.Append(CPPPATH=env['BASEINCLUDE']) env.Append(CPPPATH=env['BASEINCLUDE'])
env.Append(CPPFLAGS=[]) env.Append(CPPFLAGS=[])
env.Append(LIBPATH=[]) env.Append(LIBPATH=[])
@ -137,6 +142,8 @@ if env.has_key('COLLADAINCLUDE'):
env.Prepend(CPPPATH=env['COLLADAINCLUDE']) env.Prepend(CPPPATH=env['COLLADAINCLUDE'])
if env.has_key('COLLADALIBDIR'): if env.has_key('COLLADALIBDIR'):
env.Prepend(LIBPATH=env['COLLADALIBDIR']) env.Prepend(LIBPATH=env['COLLADALIBDIR'])
if env.has_key('PYTHONINCLUDE'):
env.Prepend(CPPPATH=env['PYTHONINCLUDE'])
if not conf.CheckCXX(): if not conf.CheckCXX():
print 'Could not compile a simple C++ fragment, verify that ' + \ print 'Could not compile a simple C++ fragment, verify that ' + \
@ -159,6 +166,9 @@ if not conf.CheckCXXHeader('xercesc/dom/DOMLSParser.hpp'):
if not conf.CheckCXXHeader('dae.h'): if not conf.CheckCXXHeader('dae.h'):
hasCollada = False hasCollada = False
print 'COLLADA DOM is missing: not building the COLLADA importer' print 'COLLADA DOM is missing: not building the COLLADA importer'
if not conf.CheckCXXHeader('pyconfig.h'):
hasPython = False
print 'Python is missing: not building the python support library'
if not conf.CheckCXXHeader('boost/math/distributions/students_t.hpp'): if not conf.CheckCXXHeader('boost/math/distributions/students_t.hpp'):
print 'Boost is missing (install libboost-dev)!' print 'Boost is missing (install libboost-dev)!'
Exit(1) Exit(1)
@ -232,8 +242,6 @@ if hasCollada:
env.SConsignFile() env.SConsignFile()
hasPython = True
# MSVC: Embed the manifest into libraries and executables # MSVC: Embed the manifest into libraries and executables
if sys.platform == 'win32': if sys.platform == 'win32':
env['LINKCOM'] = [env['LINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1'] env['LINKCOM'] = [env['LINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1']

View File

@ -25,6 +25,8 @@ GLFLAGS = ['-DGLEW_MX']
BOOSTINCLUDE = ['#dependencies'] BOOSTINCLUDE = ['#dependencies']
BOOSTLIB = ['boost_filesystem', 'boost_system'] BOOSTLIB = ['boost_filesystem', 'boost_system']
BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib'] BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib']
PYTHONINCLUDE = ['/System/Library/Frameworks/Python.framework/Versions/2.5/Headers']
PYTHONLIBS = ['boost_python', 'boost_system', 'Python']
COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4'] COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4']
COLLADALIB = ['libCollada14Dom'] COLLADALIB = ['libCollada14Dom']
COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib'] COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib']

View File

@ -25,6 +25,8 @@ GLFLAGS = ['-DGLEW_MX']
BOOSTINCLUDE = ['#dependencies'] BOOSTINCLUDE = ['#dependencies']
BOOSTLIB = ['boost_filesystem', 'boost_system'] BOOSTLIB = ['boost_filesystem', 'boost_system']
BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib'] BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib']
PYTHONINCLUDE = ['/System/Library/Frameworks/Python.framework/Versions/2.5/Headers']
PYTHONLIBS = ['boost_python', 'boost_system', 'Python']
COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4'] COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4']
COLLADALIB = ['libCollada14Dom'] COLLADALIB = ['libCollada14Dom']
COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib'] COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib']

View File

@ -25,6 +25,8 @@ GLFLAGS = ['-DGLEW_MX']
BOOSTINCLUDE = ['#dependencies'] BOOSTINCLUDE = ['#dependencies']
BOOSTLIB = ['boost_filesystem', 'boost_system'] BOOSTLIB = ['boost_filesystem', 'boost_system']
BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib'] BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib']
PYTHONINCLUDE = ['/System/Library/Frameworks/Python.framework/Versions/2.5/Headers']
PYTHONLIBS = ['boost_python', 'boost_system', 'Python']
COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4'] COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4']
COLLADALIB = ['libCollada14Dom'] COLLADALIB = ['libCollada14Dom']
COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib'] COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib']

View File

@ -15,6 +15,8 @@ XERCESINCLUDE = []
XERCESLIB = ['xerces-c'] XERCESLIB = ['xerces-c']
GLLIB = ['GL', 'GLU', 'GLEWmx', 'Xxf86vm', 'X11'] GLLIB = ['GL', 'GLU', 'GLEWmx', 'Xxf86vm', 'X11']
GLFLAGS = ['-DGLEW_MX'] GLFLAGS = ['-DGLEW_MX']
BOOSTLIB = ['libboost_system', 'libboost_filesystem'] BOOSTLIB = ['boost_system', 'boost_filesystem']
PYTHONINCLUDE = ['/usr/include/python2.6']
PYTHONLIB = ['python2.6', 'boost_python']
COLLADAINCLUDE = ['/usr/include/collada-dom', '/usr/include/collada-dom/1.4'] COLLADAINCLUDE = ['/usr/include/collada-dom', '/usr/include/collada-dom/1.4']
COLLADALIB = ['libcollada14dom'] COLLADALIB = ['collada14dom']

View File

@ -15,6 +15,8 @@ XERCESINCLUDE = []
XERCESLIB = ['xerces-c'] XERCESLIB = ['xerces-c']
GLLIB = ['GL', 'GLU', 'GLEWmx', 'Xxf86vm', 'X11'] GLLIB = ['GL', 'GLU', 'GLEWmx', 'Xxf86vm', 'X11']
GLFLAGS = ['-DGLEW_MX'] GLFLAGS = ['-DGLEW_MX']
BOOSTLIB = ['libboost_system', 'libboost_filesystem'] BOOSTLIB = ['boost_system', 'boost_filesystem']
PYTHONINCLUDE = ['/usr/include/python2.6']
PYTHONLIB = ['python2.6', 'boost_python']
COLLADAINCLUDE = ['/usr/include/collada-dom', '/usr/include/collada-dom/1.4'] COLLADAINCLUDE = ['/usr/include/collada-dom', '/usr/include/collada-dom/1.4']
COLLADALIB = ['libcollada14dom'] COLLADALIB = ['collada14dom']

View File

@ -6,14 +6,14 @@ Build-Depends: debhelper (>= 7), build-essential, scons, qt4-dev-tools,
libpng12-dev, libjpeg62-dev, libilmbase-dev, libopenexr-dev, libpng12-dev, libjpeg62-dev, libilmbase-dev, libopenexr-dev,
libxerces-c-dev, libboost-dev, libglewmx1.5-dev, libxxf86vm-dev, libxerces-c-dev, libboost-dev, libglewmx1.5-dev, libxxf86vm-dev,
collada-dom-dev, libboost-system-dev, libboost-filesystem-dev, collada-dom-dev, libboost-system-dev, libboost-filesystem-dev,
libgl1-mesa-dev, libglu1-mesa-dev, pkg-config libboost-python-dev, libgl1-mesa-dev, libglu1-mesa-dev, pkg-config
Standards-Version: 3.8.3 Standards-Version: 3.8.3
Homepage: http://www.mitsuba-renderer.org Homepage: http://www.mitsuba-renderer.org
Package: mitsuba Package: mitsuba
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-core, libqt4-gui, libqt4-network, libqt4-opengl, libqt4-xml, libpng12-0, libjpeg62, Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-core, libqt4-gui, libqt4-network, libqt4-opengl, libqt4-xml, libpng12-0, libjpeg62,
libilmbase6, libopenexr6, libxerces-c3.1, libboost-filesystem1.42.0, libboost-system1.42.0, libglewmx1.5, libxxf86vm1, collada-dom, libilmbase6, libopenexr6, libxerces-c3.1, libboost-filesystem1.42.0, libboost-system1.42.0, libboost-python1.42.0, libglewmx1.5, libxxf86vm1, collada-dom,
libgl1-mesa-glx, libglu1-mesa libgl1-mesa-glx, libglu1-mesa
Description: Mitsuba renderer Description: Mitsuba renderer
Mitsuba is an extensible rendering framework written in portable C++. It implements unbiased as well as biased techniques and contains heavy optimizations targeted towards current CPU architectures. Mitsuba is an extensible rendering framework written in portable C++. It implements unbiased as well as biased techniques and contains heavy optimizations targeted towards current CPU architectures.
@ -26,7 +26,8 @@ Package: mitsuba-dev
Architecture: any Architecture: any
Depends: qt4-dev-tools, libpng12-dev, libjpeg62-dev, libilmbase-dev, libopenexr-dev, Depends: qt4-dev-tools, libpng12-dev, libjpeg62-dev, libilmbase-dev, libopenexr-dev,
libxerces-c-dev, libboost-dev, libglewmx1.5-dev, libxxf86vm-dev, libxerces-c-dev, libboost-dev, libglewmx1.5-dev, libxxf86vm-dev,
collada-dom-dev, libboost-system-dev, libboost-filesystem-dev, mitsuba collada-dom-dev, libboost-system-dev, libboost-filesystem-dev,
libboost-python-dev, mitsuba
Description: Mitsuba renderer -- development files Description: Mitsuba renderer -- development files
Mitsuba is an extensible rendering framework written in portable C++. It implements unbiased as well as biased techniques and contains heavy optimizations targeted towards current CPU architectures. Mitsuba is an extensible rendering framework written in portable C++. It implements unbiased as well as biased techniques and contains heavy optimizations targeted towards current CPU architectures.
. .

View File

@ -77,7 +77,7 @@ First, run
$\text{\$}$ sudo apt-get install build-essential scons mercurial qt4-dev-tools libpng12-dev $\text{\$}$ sudo apt-get install build-essential scons mercurial qt4-dev-tools libpng12-dev
libjpeg62-dev libilmbase-dev libxerces-c3-dev libboost1.42-all-dev libjpeg62-dev libilmbase-dev libxerces-c3-dev libboost1.42-all-dev
libopenexr-dev libglewmx1.5-dev libxxf86vm-dev libpcrecpp0 libopenexr-dev libglewmx1.5-dev libxxf86vm-dev libpcrecpp0
libboost-system-dev libboost-filesystem-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-python-dev libboost-dev
\end{shell} \end{shell}
Please ensure that the installed version of the boost libraries is 1.42 or later. Please ensure that the installed version of the boost libraries is 1.42 or later.
To get COLLADA support, you will also need to install the \texttt{collada-dom} packages or build it from scratch. Here, we install the \code{x86\_64} binaries and development headers that can be found in the \texttt{dependencies/linux} directory\footnote{The directory also contains source packages in case these binaries don't work for you.}: To get COLLADA support, you will also need to install the \texttt{collada-dom} packages or build it from scratch. Here, we install the \code{x86\_64} binaries and development headers that can be found in the \texttt{dependencies/linux} directory\footnote{The directory also contains source packages in case these binaries don't work for you.}:

View File

@ -3,12 +3,12 @@ Import('env', 'sys', 'os', 'hasPython')
pythonEnv = env.Clone() pythonEnv = env.Clone()
pythonEnv.Append(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_PYTHON']]) pythonEnv.Append(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_PYTHON']])
pythonEnv['SHLIBPREFIX']='' pythonEnv['SHLIBPREFIX']=''
if pythonEnv.has_key('PYTHONINCLUDE'):
pythonEnv.Prepend(CPPPATH=pythonEnv['PYTHONINCLUDE'])
if sys.platform == 'darwin': if pythonEnv.has_key('PYTHONLIBDIR'):
pythonEnv.Append(CXXFLAGS = ['-framework', 'Python'], pythonEnv.Prepend(LIBPATH=pythonEnv['PYTHONLIBDIR'])
CPPPATH=['/System/Library/Frameworks/Python.framework/Versions/2.5/Headers'], if pythonEnv.has_key('PYTHONLIB'):
LIBS=['boost_python', 'boost_system', 'Python']) pythonEnv.Prepend(LIBS=pythonEnv['PYTHONLIB'])
if hasPython: if hasPython:
mtspy = pythonEnv.SharedLibrary('mtspy', ['base.cpp']); mtspy = pythonEnv.SharedLibrary('mtspy', ['base.cpp']);

View File

@ -8,6 +8,6 @@ std::string hello() {
return "Hello world!"; return "Hello world!";
} }
BOOST_PYTHON_MODULE(mitsuba) { BOOST_PYTHON_MODULE(mtspy) {
def("hello", hello, "Return hello world..."); def("hello", hello, "Return hello world...");
} }