uci-rendering / psdr-cuda

Path-space differentiable renderer
BSD 3-Clause "New" or "Revised" License
155 stars 11 forks source link

Build error on Windows #34

Closed sapo17 closed 1 year ago

sapo17 commented 1 year ago

Hello,

I'm trying to build psdr-cuda on windows. However, unfortunately I am getting a strange error.

As mentioned on here, I'm following the instructions for windows.

I am searching for a solution now more than two days, but I couldn't find any. Here is the cmake output:

[main] Building folder: psdr-cuda 
[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build "XXX/psdr-cuda/build" --config Release --target ALL_BUILD -j 14 --
[build] MSBuild version 17.3.1+2badb37d1 for .NET Framework
[build]   Checking Build System
[build]   Building Custom Rule XXX/psdr-cuda/CMakeLists.txt
[build]   bitmap.cpp
[build]   bitmap_loader.cpp
[build] XXX\psdr-cuda\include\psdr/core/tinyexr.h(2449,39): warning C4018: '<': signed/unsigned mismatch [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build] XXX\psdr-cuda\include\psdr/core/tinyexr.h(2712,35): warning C4018: '<': signed/unsigned mismatch [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build]   miniz.cpp
[build] XXX\psdr-cuda\src\core\miniz.cpp(2430,143): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build]   sampler.cpp
[build]   pmf.cpp
[build]   cube_distrb.cpp
[build]   diffuse.cpp
[build]   ggx.cpp
[build]   roughconductor.cpp
[build]   area.cpp
[build]   envmap.cpp
[build]   sensor.cpp
[build]   perspective.cpp
[build]   mesh.cpp
[build]   ptx.cpp
[build] XXX\psdr-cuda\src\optix\ptx.cpp(93,13): warning C4273: 'psdr::getPtxString': inconsistent dll linkage [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build] XXX\psdr-cuda\include\psdr/optix/ptx.h(18,21): message : see previous definition of 'getPtxString' [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build]   scene_optix.cpp
[build] XXX\psdr-cuda\include\psdr/scene/optix.h(271,59): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build]   scene.cpp
[build]   scene_loader.cpp
[build]   integrator.cpp
[build]   field.cpp
[build]   Compiling...
[build]   direct.cpp
[build]   psdr.cpp
[build]      Creating library XXX/psdr-cuda/build/lib/Release/psdr_cuda.lib and object XXX/psdr-cuda/build/lib/Release/psdr_cuda.exp
[build] LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build] diffuse.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl enoki::DiffArray<struct enoki::CUDAArray<float> >::lt_(struct enoki::DiffArray<struct enoki::CUDAArray<float> > const &)const " (__imp_?lt_@?$DiffArray@U?$CUDAArray@M@enoki@@@enoki@@QEBA@AEBU12@@Z) [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build] diffuse.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl enoki::DiffArray<struct enoki::CUDAArray<float> >::eq_(struct enoki::DiffArray<struct enoki::CUDAArray<float> > const &)const " (__imp_?eq_@?$DiffArray@U?$CUDAArray@M@enoki@@@enoki@@QEBA@AEBU12@@Z) [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build] diffuse.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl enoki::DiffArray<struct enoki::CUDAArray<float> >::gt_(struct enoki::DiffArray<struct enoki::CUDAArray<float> > const &)const " (__imp_?gt_@?$DiffArray@U?$CUDAArray@M@enoki@@@enoki@@QEBA@AEBU12@@Z) [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build] ggx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl enoki::DiffArray<struct enoki::CUDAArray<float> >::le_(struct enoki::DiffArray<struct enoki::CUDAArray<float> > const &)const " (__imp_?le_@?$DiffArray@U?$CUDAArray@M@enoki@@@enoki@@QEBA@AEBU12@@Z) [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build] roughconductor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl enoki::DiffArray<struct enoki::CUDAArray<float> >::neq_(struct enoki::DiffArray<struct enoki::CUDAArray<float> > const &)const " (__imp_?neq_@?$DiffArray@U?$CUDAArray@M@enoki@@@enoki@@QEBA@AEBU12@@Z) [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build] sensor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl enoki::ArrayBase<float,struct enoki::DiffArray<struct enoki::CUDAArray<float> > >::operator[](unsigned __int64)" (__imp_??A?$ArrayBase@MU?$DiffArray@U?$CUDAArray@M@enoki@@@enoki@@@enoki@@QEAA@_K@Z) [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[build] XXX\psdr-cuda\build\lib\Release\psdr_cuda.cp310-win_amd64.pyd : fatal error LNK1120: 6 unresolved externals [XXX\psdr-cuda\build\psdr_cuda.vcxproj]
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --build "XXX/psdr-cuda/build" --config Release --target ALL_BUILD -j 14 -- exited with code: 1 and signal: null
[build] Build finished with exit code 1

Has this occured to anyone else? Any help/tip would be greatly appreciated!

Best, Can

sapo17 commented 1 year ago

So apparently the the precompiled binaries that were mentioned were out of date.

The new precompiled binaries can be found on the psdr-cuda repository (look for README.md).

Using the new precompiled binaries helped me to fix above mentioned problem