This fork is modified for CMake/Scons compilation, dependencies are updated to lastest(?) version.(Only Windows platform supported)
- Scons Compilation & Python 3 support (#ca4f9999).Python files: These are modified for Python3 gramma and SCons compilation.
- CMake support(#359d4644).
- Dependencies update (#3d6ecee8). Dependencies and some source files are updated to latest version.
- C++17(#ee38bdba): To compile under c++17,
std::binary_function
andstd::unary_function
are changed tostd::function
. doc/compiling.tex
: Use\begin{code}
and\end{code}
in line 333 and 337 , otherwise cannot compile.
Following environment/dependencies are required:
- Visual Studio
- CMake
- Qt 5.15
- Python 3.9
Optional:
- Scons 4.3.1(If you are using SCons).
Before you start, please notice that:
- All commands below are required to execute under VS Command Prompt(x64).
- Please make sure you can download files in cmake. If you can't, or you don't want to, please refer to the "Dependencies List" section, and download them manually.
- Modify
dependencies/CMakeLists.txt
- Check Line 7. Choose a number <= your CPU cores.
- Check Line 8 and Line 9 for proxies. If you don't know what it is, or you don't need it, just comment these 2 lines.
- Dependencies compilation: Go to
dependencies/
, and executecmake ./
. (Too many files, it will take a long time to compile.)
You can choose compile with CMake or SCons. (CMake is recommended)
You can compile with CMake GUI or command line.
- Specify
QT_DIR
andPython_ROOT_DIR
. - Create folder
cbuild
. (Compiling in folderbuild
is not recommended, because some scripts are in that folder and you may not want to mess them up.) - Config and generate project in GUI. (or go to
cbuild
folder and executecmake ..
in command line) - Open Visual Studio Solution
Mitsuba.sln
, compile entire solution. - You can run/debug mitsuba as normal VS project now.
When using SCons compilation, you need to specify which library to link in config.py
.
- Go back to project root directory:
cd ..
- Modify
build/config-win64-msvc2019.py
,build/config-win64-msvc2019-debug.py
:- Check
PYTHON39LIB
, modify toYour_Python_Installation_Path/libs/Your_Python_Version
- Check
PYTHON39INCLUDE
, modify toYour_Python_Installation_Path/include
. - Check
QTINCLUDE
: modify toYour_Qt_Installation_Path/Your_MSVC_version/include
- Check
QTDIR
: modify toYour_Qt_Installation_Path/Your_MSVC_version/
.
- Check
- Copy config file
build/config-win64-msvc2019.py
asconfig.py
:cp build/config-win64-msvc2019.py config.py
- Run
scons
under project root directory. - Executable program are distributed in
dist/
- If you can't download dependencies in cmake, you can download them manually to
dependencies/Downloads
. After downloading, you can start from Step 1 in "Compilation" section. - All downloaded content are stored in
dependencies/Downloads
- In this table, if "Filename" ends with '/', means this is a folder; otherwise this is a file.
Library | Filename | Link |
---|---|---|
zlib | zlib/ |
git clone --recurse-submodules https://github.com/madler/zlib.git |
OpenEXR | openexr/ |
git clone --recurse-submodules https://github.com/AcademySoftwareFoundation/openexr.git |
libjpeg-turbo | libjpeg/ |
git clone --recurse-submodules https://github.com/libjpeg-turbo/libjpeg-turbo.git |
libpng | libpng/ |
git clone --recurse-submodules https://github.com/glennrp/libpng.git |
boost | boost/ |
git clone --recurse-submodules --depth=1 --branch=boost-1.77.0 https://github.com/boostorg/boost.git |
xerces-c | xerces-c/ |
git clone --recurse-submodules https://github.com/apache/xerces-c.git |
glew | glew-2.2.0-win32.zip |
https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip |
half | half-2.2.0.zip |
https://iweb.dl.sourceforge.net/project/half/half/2.2.0/half-2.2.0.zip |
glext | glext.h |
https://www.khronos.org/registry/OpenGL/api/GL/glext.h |
khr | khrplatform.h |
https://www.khronos.org/registry/EGL/api/KHR/khrplatform.h |
FFTW | fftw-3.3.5-dll64.zip |
https://fftw.org/pub/fftw/fftw-3.3.5-dll64.zip |
- Fail to export hdr images under debug mode. (Works fine in release mode)
Feel free to open an issue, I will try to reply asap. (If this fork helps you, please give me a star ๐)