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

COMP: Disable OpenXR runtime build by default on macOS #160

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Jan 12, 2024

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.

macOS errors related to OpenXR-SDK and vtkRenderingOpenXR

For future reference, see #150 (comment)

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.

## 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 Jan 12, 2024

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

Originally posted by @jcfr in #150 (comment)

@jcfr jcfr merged commit 21f3fe6 into KitwareMedical:master Jan 12, 2024
@jcfr jcfr deleted the fix-macos-configuration branch January 12, 2024 03:19
@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.

1 participant