mitsuba-renderer / mitsuba3

Mitsuba 3: A Retargetable Forward and Inverse Renderer
https://www.mitsuba-renderer.org/
Other
2.1k stars 246 forks source link

Compiling problems in Windows #1219

Closed JunranGuo closed 4 months ago

JunranGuo commented 4 months ago

Summary

Cant compile mitsuba3 because couldnt find jit.h

System configuration

System information:

OS: Windows 10 CPU: i5-13490F GPU:NVidia-4060 Python version: 3.8 CUDA version: 11.8 cmake version: 3.30.0 Mitsuba3 and Drjit version: Sorry I dont know what is the exact version of the mitsuba3 im compiling , I believe both of mitsuba3 and drjit are the latest version. Compiled with: VS Studio 17 2022 Variants compiled: ["scalar_mono", "llvm_mono", "llvm_ad_mono", "cuda_mono", "cuda_ad_mono", "scalar_rgb", "llvm_rgb", "llvm_ad_rgb", "cuda_rgb", "cuda_ad_rgb"]

Description

Although the mitsuba3 file is in mitsuba3-3.5.0 , but they are clone by using git I try to compile mitsuba3 by using the comand lines: cmake -G "Visual Studio 17 2022" -A x64 -B build cmake --build build --config Release

the logs are as follows

D:\Visual Studio\Visual Studio IDE\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: “D:\mit
suba3-3.5.0\mitsuba3\build\CMakeFiles\427561785181ebe494b7ab1454066c9b\__init__.py.rule;D:\mitsuba3-3.5.0\mitsuba3\buil
d\CMakeFiles\427561785181ebe494b7ab1454066c9b\_reduce.py.rule;D:\mitsuba3-3.5.0\mitsuba3\build\CMakeFiles\427561785181e
be494b7ab1454066c9b\_sh_eval.py.rule;D:\mitsuba3-3.5.0\mitsuba3\build\CMakeFiles\427561785181ebe494b7ab1454066c9b\ast.p
y.rule;D:\mitsuba3-3.5.0\mitsuba3\build\CMakeFiles\4467fd06e91748ecf05158afd6bb888c\__init__.py.rule;D:\mitsuba3-3.5.0\
mitsuba3\build\CMakeFiles\4467fd06e91748ecf05158afd6bb888c\ad.py.rule;D:\mitsuba3-3.5.0\mitsuba3\build\CMakeFiles\42756
1785181ebe494b7ab1454066c9b\dda.py.rule;D:\mitsuba3-3.5.0\mitsuba3\build\CMakeFiles\427561785181ebe494b7ab1454066c9b\de
tail.py.rule;D:\mitsuba3-3.5.0\mitsuba3\build\CMakeFiles\427561785181ebe494b7ab1454066c9b\interop.py.rule;D:\mitsuba3-3
.5.0\mitsuba3\build\CMakeFiles\e0a74570698d64b38947851a6c1ed3d8\__init__.py.rule;D:\mitsuba3-3.5.0\mitsuba3\build\CMake
Files\e0a74570698d64b38947851a6c1ed3d8\ad.py.rule;D:\mitsuba3-3.5.0\mitsuba3\build\CMakeFiles\cbf760cdef3ce7f96ef5ca1d6
7f2aa29\__init__.py.rule;D:\mitsuba3-3.5.0\mitsuba3\build\CMakeFiles\cbf760cdef3ce7f96ef5ca1d67f2aa29\__init__.pyi.rule
;D:\mitsuba3-3.5.0\mitsuba3\build\CMakeFiles\cbfe7df260278fd2060363f04a0dc5fc\drjit-stub-scalar.rule;D:\mitsuba3-3.5.0\
mitsuba3\ext\drjit\src\python\CMakeLists.txt”的自定义生成已退出,代码为 1。 [D:\mitsuba3-3.5.0\mitsuba3\build\ext\drjit\src\python\dr
jit-stub-scalar.vcxproj]
  Building Custom Rule D:/mitsuba3-3.5.0/mitsuba3/src/python/CMakeLists.txt
  alias.cpp
D:\mitsuba3-3.5.0\mitsuba3\include\mitsuba/core/fwd.h(4,10): fatal  error C1083: 无法打开包括文件: “drjit-core/jit.h”: No such
file or directory [D:\mitsuba3-3.5.0\mitsuba3\build\src\python\mitsuba_alias.vcxproj]

It said that it couldn't find jit.h in drjit-core, seems like the project didnt include headers in drjit-core and dirjit.

Besides if I use VS Studio to compile mitsuba3 it couldnt find 'printf' while using something of drjit in array_base.h and array_route.h

Steps to reproduce

I simply follow the steps on https://mitsuba.readthedocs.io/en/stable/src/developer_guide/compiling.html?highlight=compile 1.git clone --recursive https://github.com/mitsuba-renderer/mitsuba3 2.cmake -G "Visual Studio 17 2022" -A x64 -B build 3.cmake --build build --config Release or compile in VS Studio

I have tried fixing it by adding the include directories in the cmakelist in src/python, and including stdio.h in the array headers, howerver after I compile mitsub3 and try to run: setpath.bat mitsuba scene.xml

it said dr have no attribute __version I would be appreciated if you could give me some tips on compiling it :),thank you very much

merlinND commented 4 months ago

Hello @JunranGuo,

At the moment, the master branch is undergoing heavy development as Mitsuba transitions into the next version. Could you try again to compile at the v3.5.2 tag?

git clone --recursive https://github.com/mitsuba-renderer/mitsuba3 --branch v3.5.2

Make sure to:

  1. If you are not doing a fresh clone but just switching to the tag, recursively pull all of the submodules after checking out the tag
  2. Delete the build folder to rebuild from scratch
njroussel commented 4 months ago

We've pushed a commit a couple of days ago (https://github.com/mitsuba-renderer/mitsuba3/commit/5cca53c3a563aa55bf4ad18c722dc47c0c7ffe25) that fixes Windows builds on master.

However, I'd still suggest you use an older release as mentioned in the README and Merlin recommended.

Please report back if your issue is still unresolved.