Virtual Reality extension issue

I checked out tag v4.11.20210226 from the Slicer repo, which is the latest stable version, and built the source in release mode (Windows 10) as a result Slicer loads as expected (running from Slicer-build\Slicer.exe). Now I would like to add the Virtual reality extension. I opened up the extension manager and install the extension (no errors here). I close the manager and Slicer. When re-opening Slicer I get the following error “cannot load library …/NA-MIC/Extensions-29738/SlicerVirtualReality/lib/Slicer-4.11/qt-loadable-modules\qSlicerVirtualRealityModule.dll: The specific module could not be found.”. If I download the installer from Slicer’s website everything works. No changes to the source code at all. What am I missing here?

In general, you cannot mix binaries built on different computers due to potential ABI incompatibilities. It is not just that you need to build from the exact same source code but use the exact same build environment (built tools, build options, etc.).

In practice this should not cause any problem, as you can only build an extension if you have already built Slicer.

Hi Andras,

Thank you for answering my question although it doesn’t make much sense to me yet, please correct me if I’m wrong.

I would expect a Slicer build (any build, any machine, any OS) to be able to download and use any extension using the manager. Please, if I’m wrong please correct me but your answer sounded like Slicer and all extensions need to be built in the same machine for all platforms prior to becoming available for download.

Everything was working (my own Slicer build + downloaded VR Extension) when building from tag v4.11.20200930. Anyway, I will download and build the VR extension too.

This is correct.

If your build environment on your machine happens to completely match the build environment on the factory machine then the you can use your custom-built extension with a factory-built Slicer. If there are slight differences then the extension will be loaded but it will randomly crash, and if there are major differences then the extension will not be even loaded.

Hi Andras,

I would appreciate any help on this issue. I checked out the 3D Slicer tag v4.11.20210226 and have it built (default CMake parameters) as release x64. Now I checked out Slicer’s Virtual Reality extension source code and I am trying to build it against my Slicer’s build (setting up Slicer_build_Dir on CMake). I have followed the exact same steps for Slicer tag v4.11.20200930 and Virtual Realy extension built without problems. I am pasting below the output I got (Windows). Thanks in advance for any help.

Rebuild started...
1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Release x64 ------
1>Checking Build System
2>------ Rebuild All started: Project: OpenVR, Configuration: Release x64 ------
2>Creating directories for 'OpenVR'
2>Building Custom Rule C:/source/repos/SlicerVirtualReality/CMakeLists.txt
2>Performing download step (download, verify and extract) for 'OpenVR'
2>-- verifying file...
2>       file='C:/source/repos/SlicerVirtualReality/build/v1.12.5.tar.gz'
2>-- File already exists and hash match (skip download):
2>  file='C:/source/repos/SlicerVirtualReality/build/v1.12.5.tar.gz'
2>  MD5='fabbc1ad83d7c382080ca00b878e6209'
2>-- extracting...
2>     src='C:/source/repos/SlicerVirtualReality/build/v1.12.5.tar.gz'
2>     dst='C:/source/repos/SlicerVirtualReality/build/OpenVR'
2>-- extracting... [tar xfz]
2>cmake -E tar : warning : skipping symbolic link "openvr-1.12.5/bin/osx64/OpenVR.framework/Headers" -> "Versions/Current/Headers".
2>cmake -E tar : warning : skipping symbolic link "openvr-1.12.5/bin/osx64/OpenVR.framework/OpenVR" -> "Versions/Current/OpenVR".
2>cmake -E tar : warning : skipping symbolic link "openvr-1.12.5/bin/osx64/OpenVR.framework/Resources" -> "Versions/Current/Resources".
2>cmake -E tar : warning : skipping symbolic link "openvr-1.12.5/bin/osx64/OpenVR.framework/Versions/Current" -> "A".
2>-- extracting... [analysis]
2>-- extracting... [rename]
2>-- extracting... [clean up]
2>-- extracting... done
2>No update step for 'OpenVR'
2>No patch step for 'OpenVR'
2>Generate version-OpenVR.txt and license-OpenVR.txt
2>No configure step for 'OpenVR'
2>No build step for 'OpenVR'
2>No install step for 'OpenVR'
2>Completed 'OpenVR'
2>Done building project "OpenVR.vcxproj".
3>------ Rebuild All started: Project: VTKRenderingOpenVR, Configuration: Release x64 ------
3>Creating directories for 'VTKRenderingOpenVR'
3>Building Custom Rule C:/source/repos/SlicerVirtualReality/CMakeLists.txt
3>No download step for 'VTKRenderingOpenVR'
3>No update step for 'VTKRenderingOpenVR'
3>No patch step for 'VTKRenderingOpenVR'
3>Performing configure step for 'VTKRenderingOpenVR'
3>loading initial cache file C:/source/repos/SlicerVirtualReality/build/VTKRenderingOpenVR-prefix/tmp/VTKRenderingOpenVR-cache-Release.cmake
3>CMake Warning (dev) in CMakeLists.txt:
3>  No project() command is present.  The top-level CMakeLists.txt file must
3>  contain a literal, direct call to the project() command.  Add a line of
3>  code such as
3>
3>    project(ProjectName)
3>
3>  near the top of the file, but after cmake_minimum_required().
3>
3>  CMake is pretending there is a "project(Project)" command on the first
3>  line.
3>This warning is for project developers.  Use -Wno-dev to suppress it.
3>
3>-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
3>CMake Error at CMakeLists.txt:1 (vtk_module_find_package):
3>  Unknown CMake command "vtk_module_find_package".
3>
3>
3>CMake Warning (dev) in CMakeLists.txt:
3>  No cmake_minimum_required command is present.  A line of code such as
3>
3>    cmake_minimum_required(VERSION 3.15)
3>
3>  should be added at the top of the file.  The version specified may be lower
3>  if you wish to support older CMake versions for this project.  For more
3>  information run "cmake --help-policy CMP0000".
3>This warning is for project developers.  Use -Wno-dev to suppress it.
3>
3>-- Configuring incomplete, errors occurred!
3>See also "C:/source/repos/SlicerVirtualReality/build/VTKRenderingOpenVR-build/CMakeFiles/CMakeOutput.log".
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'C:\source\repos\SlicerVirtualReality\build\CMakeFiles\39885bf821a71085a35f68fd677577b1\VTKRenderingOpenVR-mkdir.rule;C:\source\repos\SlicerVirtualReality\build\CMakeFiles\39885bf821a71085a35f68fd677577b1\VTKRenderingOpenVR-download.rule;C:\source\repos\SlicerVirtualReality\build\CMakeFiles\39885bf821a71085a35f68fd677577b1\VTKRenderingOpenVR-update.rule;C:\source\repos\SlicerVirtualReality\build\CMakeFiles\39885bf821a71085a35f68fd677577b1\VTKRenderingOpenVR-patch.rule;C:\source\repos\SlicerVirtualReality\build\CMakeFiles\39885bf821a71085a35f68fd677577b1\VTKRenderingOpenVR-configure.rule;C:\source\repos\SlicerVirtualReality\build\CMakeFiles\39885bf821a71085a35f68fd677577b1\VTKRenderingOpenVR-build.rule;C:\source\repos\SlicerVirtualReality\build\CMakeFiles\39885bf821a71085a35f68fd677577b1\VTKRenderingOpenVR-install.rule;C:\source\repos\SlicerVirtualReality\build\CMakeFiles\87df6f4498ed6ba2fa495718a2168dc1\VTKRenderingOpenVR-complete.rule;C:\source\repos\SlicerVirtualReality\build\CMakeFiles\5670f373fbe193eb89979bfb7c29ee58\VTKRenderingOpenVR.rule;C:\source\repos\SlicerVirtualReality\CMakeLists.txt' exited with code 1.
3>Done building project "VTKRenderingOpenVR.vcxproj" -- FAILED.
========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========

Instead you should build Slicer@master setting CMake option Slicer_VTK_VERSION_MAJOR to 9

Hi Jean.
Thanks for replying. I forgot to mention that I set Slicer_VTK_VERSION_MAJOR to 9. That was the reason I updated to the lastest tag. I just checked out master and still the same. I think it might be something within a CMakeFile. Please feel free to share your ideas.

Build errors are not specific to your setup and are also reported on the dashboard here

We will follow up when this is fixed.

Thanks.
I’ll wait for the fix.