Skip to content

Instantly share code, notes, and snippets.

@mlagunas
Last active December 13, 2023 18:07
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlagunas/5bd92a6ef48ff18d82b22aed367d9d1c to your computer and use it in GitHub Desktop.
Save mlagunas/5bd92a6ef48ff18d82b22aed367d9d1c to your computer and use it in GitHub Desktop.
Compile mitsuba in less than 10 minutes
# go to the dir where you will download the source files
cd ...
# download the source files
git clone https://github.com/mitsuba-renderer/mitsuba
# go into the mitsuba folder
cd mitsuba
# copy the config file to build
cp build/config-linux-gcc.py build.py
# install all the necessary libraries
# if libpng12-dev fails to install just change it to -> libpng-dev
sudo apt-get install build-essential scons git libpng12-dev libjpeg-dev libilmbase-dev libxerces-c-dev libboost-all-dev libopenexr-dev libglewmx-dev libxxf86vm-dev libeigen3-dev libfftw3-dev
# get collada support
sudo apt-get install libcollada-dom-dev
# if you want to have the GUI install QT5
sudo apt-get install qt5-default libqt5opengl5-dev libqt5xmlpatterns5-dev
# start compiling and wait for "scons:Done building targets."
# if you meet problems here because there are no "(" in the prints it is
# probably because you have scons > 3. Create an environment in Conda with
# python 2.7, download scons 2.5 (https://scons.org/scons-251-is-available.html)
# and run "python setup.py install". Then, using the environement you have
# created, run the command below.
# also if you meet problems with the boost library make sure that you add
# the '-lboost_system' in config.py CXXFLAGS variable.
# if you meet problems with QT5 Widgets
# In mitsuba/data/scons/qt5.py change validmodules (line 392) to include the version number, e.g. QtCore => Qt5Core
# Change mitsuba/build/SConscript to their updated names, for instance, change line 28 to
# qtEnv.EnableQt5Modules(['Qt5Gui', 'Qt5Widgets', 'Qt5Core', 'Qt5OpenGL', 'Qt5Xml', 'Qt5XmlPatterns', 'Qt5Network'])
QT_SELECT=qt5 scons -j8
# update the pahts
source setpath.sh
# run mitsuba with the GUI
# if this fails due to libxerces, probably is because the version 3.1 is deprecated. Download it https://packages.ubuntu.com/xenial/amd64/libxerces-c3.1/download
# and manually install it
mtsgui
@JonasDeSchouwer
Copy link

JonasDeSchouwer commented May 5, 2022

Shouldn't line 11 be cp build/config-linux-gcc.py config.py?

On Ubuntu 16.04.7-amd64, I found the snippet qtEnv.EnableQt5Modules(['Qt5Gui', 'Qt5Widgets', 'Qt5Core', 'Qt5OpenGL', 'Qt5Xml', 'Qt5XmlPatterns', 'Qt5Network']) in the file mitsuba/src/mtsgui/SConscript

@JonasDeSchouwer
Copy link

JonasDeSchouwer commented Jun 2, 2022

Also, I found the line defining qtEnv at location mitsuba/src/mtsgui/SConscript.
In addition, I had to edit the file mitsuba/data/scons and include 'Qt5Gui', 'Qt5Widgets', 'Qt5Core', 'Qt5OpenGL', 'Qt5Xml', 'Qt5XmlPatterns', 'Qt5Network' in the list validModules on line 374.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment