We’re using cycles from Blender 4.1 and are having difficulties compiling in VS 2022 for the oneapi device. Specifically, when compiling kernel/oneapi the compat.h file errors on always_inline not being found. We set the language to c++ 20 standard. Is there a special way to compile the oneapi support? I’m looking through the make files and not seeing anything.
I’m running your make file using the 2022 vs version and a few of your files won’t compile.
Image.cpp
C:\work\blender\intern\cycles\scene\image.cpp(651,14): error C2668: ‘ccl::anonymous-namespace'::isfinite': ambiguous c all to overloaded function [C:\work\build_windows_x64_vc17_Release\intern\cycles\scene\cycles_scene.vcxproj] C:\work\blender\intern\cycles\scene\image.cpp(40,6): could be 'bool ccl::
anonymous-namespace’::isfinite(uint16_t)’
C:\work\blender\intern\cycles\scene\image.cpp(36,6):
or ‘bool ccl::anonymous-namespace'::isfinite(ccl::half)' C:\work\blender\intern\cycles\scene\image.cpp(32,6): or 'bool ccl::
anonymous-namespace’::isfinite(ccl::uchar)’
And
C:\work\blender\intern\cycles\util\profiling.cpp(51,23): error C2672: ‘std::this_thread::sleep_until’: no matching over
loaded function found [C:\work\build_windows_x64_vc17_Release\intern\cycles\util\cycles_util.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\include\thread(208,10):
could be ‘void std::this_thread::sleep_until(const std::chrono::time_point<_Clock,_Duration> &)’
I can fix these locally but how is this not compiling with your environment?
I have release blender 4.1 up to Commit: b5f8a50c80e44013214a76df8b2886bc903acbfc [b5f8a50]
You’re using a newer compiler (the isfinite issue showed up with 2022 17.11) and c++ standard than the code had encountered around the time of blender 4.1 and running into some issues because of it.
You’re gonna need 92d935a2059e99dd4cbfcf18c14870ee77476ab2 for that isfinite issue
unsure about the sleep_until issue, but given main builds without issues on the latest vs2022 with c++17, (we’re following the VFX platform for the C++ standard) if it is a C++20 issue, we generally accept patches.
Yes I was able to fix the is infinite with a cast to double.
I did run the cmake on blender project and it did bark I had 17.6 so I’m downgrading to 17.5 and see if this helps.
Careful with vs2022, virtually all versions until the last few releases had various codegen issues that broke at-least one of our tests (worst case 40%) or caused build errors, if you want reliability, stick to vs2019
Ok I’ll go to 2019. We’re jumping from 2017 and don’t want to jump again for a while.
the last few 2022 releases are ok, but not with blender code that old so you’ll need to bump that to something newer than 4.1 if you want to go down that path.