Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable OpenXR runtime on macOS and remove stub module #150

Merged

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Dec 30, 2023

Since attempting to build on macOS results into few errors described below, this commit sets the default value for SlicerVirtualReality_HAS_OPENXR_SUPPORT to OFF.

It also removes the VirtualRealityStub module and re-enable support for building on macOS. This means an extension will be built but it would not have any working XR runtimes.

macOS errors related to OpenXR-SDK and vtkRenderingOpenXR

Issue finding "OpenGL.framework"

During the configuration of the external project associated with the
vtkRenderingVR project, error like the following was reported:

  CMake Error in /D/S/A/VTK/Rendering/VR/CMakeLists.txt:
    Imported target "VTK::RenderingOpenGL2" includes non-existent path
      "/Applications/Xcode-14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/OpenGL.framework"
    in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
    * The path was deleted, renamed, or moved to another location.
    * An install or uninstall procedure did not complete successfully.
    * The installation package was faulty and references files it does not
    provide.

It was fixed by adding the missing symlink:

cd /Applications/Xcode-14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
ln -s MacOSX.sdk MacOSX14.0.sdk

Issue building "OpenXR-SDK" project

The following was reported when linking the libopenxr_loader library:

  [  6%] Linking CXX shared library libopenxr_loader.dylib
  -macosx_version_min has been renamed to -macos_version_min
  ld: unknown options: --version-script=/D/S/S-0-E-b/SlicerVirtualReality-build/OpenXR-SDK/src/loader/openxr-loader.map --no-undefined
  clang-14: error: linker command failed with exit code 1 (use -v to see invocation)

Updating "OpenXR-SDK" from release-1.0.26 to release-1.0.32 allows to
address this.

Issue resolving "XrGraphicsBindingOpenGL"

Here is the error reported while building the vtkRenderingOpenXR module:

    [ 15%] Building CXX object vtkRenderingOpenXR/CMakeFiles/RenderingOpenXR.dir/vtkOpenXRManagerConnection.cxx.o
  In file included from /D/S/A/VTK/Rendering/OpenXR/vtkOpenXRManagerOpenGLGraphics.cxx:15:
  /D/S/A/VTK/Rendering/OpenXR/vtkOpenXRManagerOpenGLGraphics.h:119:19: error: use of undeclared identifier 'XrGraphicsBindingOpenGL'
    std::shared_ptr<XrGraphicsBindingOpenGL> GraphicsBinding;
                    ^
  /D/S/A/VTK/Rendering/OpenXR/vtkOpenXRManagerOpenGLGraphics.h:49:16: error: cannot initialize return object of type 'vtkObjectBase *' with an rvalue of type 'vtkOpenXRManagerOpenGLGraphics *'
    vtkTypeMacro(vtkOpenXRManagerOpenGLGraphics, vtkOpenXRManagerGraphics);
    ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@jcfr
Copy link
Contributor Author

jcfr commented Dec 30, 2023

With this change, here the configuration output. Since it was done from an existing build tree, the variable habe been explicitly removed to simulate a clean build.

cmake \
  -USlicerVirtualReality_HAS_OPENVR_SUPPORT \
  -USlicerVirtualReality_HAS_OPENXR_SUPPORT .

[...]
-- 
-- Setting SlicerVirtualReality_HAS_OPENVR_SUPPORT to OFF (OpenVR not supported on macOS)
-- 
-- 
-- Setting SlicerVirtualReality_HAS_OPENXR_SUPPORT to OFF (OpenXR not supported on macOS)
-- 
-- SlicerVirtualReality_EXTERNAL_PROJECT_DEPENDENCIES:vtkRenderingVR
-- Remote - VTKExternalModule [OK]
-- Remote - VTKExternalModule_SOURCE_DIR:/D/S/S-0-E-b/SlicerVirtualReality-build/VTKExternalModule
-- SuperBuild - First pass
-- SuperBuild - First pass - done
-- SuperBuild - inner => Requires vtkRenderingVR, 
-- SuperBuild -   vtkRenderingVR[OK]
-- SuperBuild -   VTK_SOURCE_DIR:/Users/svc-dashboard/D/S/A/VTK-build/../VTK
-- SuperBuild -   vtkRenderingVR_DIR:/D/S/S-0-E-b/SlicerVirtualReality-build/vtkRenderingVR-build
-- SuperBuild - inner[OK]
-- Configuring done
-- Generating done
-- Build files have been written to: /D/S/S-0-E-b/SlicerVirtualReality-build

We can observe the two XR runtime OpenVR and OpenXR are disabled. Only the generic base vtkRenderingVR module is being built.

...
[100%] Built target qSlicerVirtualRealityModuleGenericCxxTests
[ 94%] Forcing configure step for 'inner'
[ 94%] No install step for 'inner'
[100%] Completed 'inner'
[100%] Built target inner

@jcfr jcfr requested a review from lassoan December 30, 2023 07:32
@jcfr jcfr force-pushed the remove-stub-and-build-macos-with-no-runtime branch 3 times, most recently from 99d8986 to 77a3b79 Compare January 12, 2024 02:40
@jcfr jcfr force-pushed the remove-stub-and-build-macos-with-no-runtime branch from 77a3b79 to 462ddda Compare January 12, 2024 03:46
@jcfr jcfr closed this Jan 12, 2024
@jcfr jcfr deleted the remove-stub-and-build-macos-with-no-runtime branch January 12, 2024 05:08
@jcfr jcfr restored the remove-stub-and-build-macos-with-no-runtime branch January 12, 2024 05:09
@jcfr jcfr reopened this Jan 12, 2024
@jcfr jcfr merged commit cac2e96 into KitwareMedical:master Jan 12, 2024
@jcfr jcfr deleted the remove-stub-and-build-macos-with-no-runtime branch January 12, 2024 05:10
@jcfr jcfr linked an issue Jan 12, 2024 that may be closed by this pull request
@jcfr jcfr mentioned this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add MacOS support
1 participant