RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1.02k stars 186 forks source link

CMake error when building without OpenVKL on Apple Silicon #576

Closed stukowski closed 9 months ago

stukowski commented 1 year ago

With CMake settings OSPRAY_ENABLE_VOLUMES=OFF and OSPRAY_BUILD_ISA=NEON2X I get:

-- ISPC supports: x86, x86-64, arm, aarch64
CMake Error at cmake/ospray_macros.cmake:214 (message):
  Your OpenVKL build does not support NEON2X!
Call Stack (most recent call first):
  cmake/ospray_options.cmake:108 (ospray_configure_ispc_isa)
  CMakeLists.txt:42 (include)

I would like to build OSPRay without OpenVKL, because my application doesn't use volume rendering functions. CMake macro(ospray_configure_ispc_isa) seems to still check the OpenVKL configuration even though it has been disabled.

johguenther commented 1 year ago

devel 8d31a2fd9ad859d1ea0e9594bcea1f50515c5173 has a fix.

stukowski commented 1 year ago

When building OSPRay 3.0.0 on Windows/MSVC with OSPRAY_ENABLE_VOLUMES=OFF, I am getting the following linker error:

FAILED: ospray_module_cpu.dll ospray_module_cpu.lib
cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=modules\cpu\CMakeFiles\ospray_module_cpu.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\ospray_module_cpu.rsp  /out:ospray_module_cpu.dll /implib:ospray_module_cpu.lib /pdb:ospray_module_cpu.pdb /dll /version:3.0 /machine:x64 /INCREMENTAL:NO /DEF:C:\Users\stuko\ovito\deps\ospray\build\modules\cpu\ospray_module_cpu.def  /DEF:modules\cpu\ospray_module_cpu.def  && cd ."
LINK: command "C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\ospray_module_cpu.rsp /out:ospray_module_cpu.dll /implib:ospray_module_cpu.lib /pdb:ospray_module_cpu.pdb /dll /version:3.0 /machine:x64 /INCREMENTAL:NO /DEF:C:\Users\stuko\ovito\deps\ospray\build\modules\cpu\ospray_module_cpu.def /DEF:modules\cpu\ospray_module_cpu.def /MANIFEST /MANIFESTFILE:ospray_module_cpu.dll.manifest" failed (exit code 1120) with the following output:
ospray_module_cpu.def : error LNK2001: unresolved external symbol LinearTransferFunction_get___un_3C_s_5B__c_unTransferFunction_5D__3E_vyf_avx
ospray_module_cpu.def : error LNK2001: unresolved external symbol LinearTransferFunction_get___un_3C_s_5B__c_unTransferFunction_5D__3E_vyf_avx2
ospray_module_cpu.def : error LNK2001: unresolved external symbol LinearTransferFunction_get___un_3C_s_5B__c_unTransferFunction_5D__3E_vyf_sse4
ospray_module_cpu.def : error LNK2001: unresolved external symbol TransferFunction_dispatch_get___un_3C_s_5B__c_unTransferFunction_5D__3E_vyf_avx
ospray_module_cpu.def : error LNK2001: unresolved external symbol TransferFunction_dispatch_get___un_3C_s_5B__c_unTransferFunction_5D__3E_vyf_avx2
ospray_module_cpu.def : error LNK2001: unresolved external symbol TransferFunction_dispatch_get___un_3C_s_5B__c_unTransferFunction_5D__3E_vyf_sse4
ospray_module_cpu.def : error LNK2001: unresolved external symbol Volume_intersect_kernel___UM_un_3C_s_5B_unRTCIntersectFunctionNArguments_5D__3E__avx
ospray_module_cpu.def : error LNK2001: unresolved external symbol Volume_intersect_kernel___UM_un_3C_s_5B_unRTCIntersectFunctionNArguments_5D__3E__avx2
ospray_module_cpu.def : error LNK2001: unresolved external symbol Volume_intersect_kernel___UM_un_3C_s_5B_unRTCIntersectFunctionNArguments_5D__3E__sse4
ospray_module_cpu.lib : fatal error LNK1120: 9 unresolved externals

I was able to fix it by manually removing three corresponding lines from the file /modules/cpu/ispc_symbols.txt:

https://github.com/stukowski/ospray/commit/a7a2114a3c1e0d4ae5b401d3497ee4ef6c9245b9

johguenther commented 12 months ago

Windows build without OpenVKL is fixed in devel https://github.com/ospray/ospray/commit/945a44ebc9fad2907a20a07f2a5bad90ff8b3aca.