Kitware / LookingGlassVTKModule

Other
15 stars 12 forks source link

Need to update CMakeLists for new LookingGlassCoreSDK rename? #54

Open rmlearney opened 1 year ago

rmlearney commented 1 year ago

MacOS 12.5.1, M1 arm64, Apple clang version 13.1.6 (clang-1316.0.21.2.5)

Trying to build and getting an interesting error about not finding arm64 symbols - seems this repo is reverting to the previous HEAD which is still linking to an older version of the SDK without the arm64 dylib.

I went into vtk/Remote/RenderingLookingGlass and pulled the latest (55da190d), but on running ccmake it reverts to the previous HEAD at 55dad90.

 Found Git: /usr/bin/git (found version "2.32.1 (Apple Git-133)")
 From https://github.com/Kitware/LookingGlassVTKModule
  * branch            HEAD       -> FETCH_HEAD
 Previous HEAD position was 5da190d Merge pull request #53 from psavery/fix-compile-warnings
 HEAD is now at 55dad90 Merge pull request #45 from psavery/device-aspect-ratio
 LookingGlass: Building as a Remote VTK module
 Remote - HoloPlayCore [OK]
 Remote - HoloPlayCore_INCLUDE_DIR:/Users/rmlearney/git/vtk/build/HoloPlayCore/HoloPlayCore/include
 Remote - HoloPlayCore_LIBRARY:/Users/rmlearney/git/vtk/build/HoloPlayCore/HoloPlayCore/dylib/macos/libHoloPlayCore.dylib
 Remote - HoloPlayCore_RUNTIME_LIBRARY:/Users/rmlearney/git/vtk/build/HoloPlayCore/HoloPlayCore/dylib/macos/libHoloPlayCore.dylib
 Found HoloPlayCore: /Users/rmlearney/git/vtk/build/HoloPlayCore/HoloPlayCore/dylib/macos/libHoloPlayCore.dylib
 Configuring done

Unfortunately it seems to be ignoring the LookingGlassCoreSDK I cloned into /src - probably because it's looking for HoloPlayCore not LookingGlassCoreSDK which they renamed it to in the interim.

Workaround

  1. Generate the build file
  2. Delete /build/HoloPlayCore
  3. Clone the latest Looking Glass LookingGlassCoreSDK repo into /vtk as advised in this repo's readme.md
  4. Make a symlink from /vtk/LookingGlassCoreSDK to /vtk/build/HoloPlayCore
psavery commented 1 year ago

You'll need to tell CMake where to find the SDK library/include paths, by setting these variables:

-DHoloPlayCore_LIBRARY:PATH=/<path>/<to>/HoloPlayCore/dylib/macos/libHoloPlayCore.dylib
-DHoloPlayCore_INCLUDE_DIR:PATH=<path>/<to>/HoloPlayCore/include

If you don't specify those CMake options, then this one is downloaded automatically, which is an older version without arm64 support. We can't update that automatic download version yet until some issues in #52 are resolved (especially the Linux glibc issue, since we need wheel support).

You can modify which tag of this module that VTK uses by editing this line. We haven't made any changes since that tag that are relevant for arm64 support, though, so it shouldn't be needed (rather, specifying the SDK library/include paths is what is needed).

psavery commented 1 year ago

Note also that if you only care about Python support for this module, you could checkout #52 and just run pip install . in the root directory of this project, and it will build this module automatically (linking against a pre-built VTK) and install it.

For arm64, I had an issue where the Looking Glass render window is not automatically moved into the looking glass device (it appears behind some of your windows on your main display, and you have to move it to the device yourself). See #52 for details.