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

Missing/mismatch in shared libs with VS Code on Linux #507

Closed
paulmelis opened this issue Nov 4, 2022 · 8 comments
Closed

Missing/mismatch in shared libs with VS Code on Linux #507

paulmelis opened this issue Nov 4, 2022 · 8 comments
Assignees
Labels
build Build system related work
Milestone

Comments

@paulmelis
Copy link
Contributor

Description

I'm following the VSCode guide at https://stereokit.net/Pages/Guides/Getting-Started-VS-Code.html on Linux. It appears some native shared libs are missing, either because the StereoKit package expects them to be installed globally, or perhaps due to some project dependency that wasn't added.

When running dotnet run in a terminal window within VS Code I get:

melis@juggle 15:50:~/concepts/skmap$ dotnet run
[SK error] Failed to load StereoKitC!
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'StereoKitC' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libStereoKitC: cannot open shared object file: No such file or directory
   at StereoKit.NativeAPI.sk_run(Action app_update, Action app_shutdown)
   at StereoKit.SK.Run(Action onStep, Action onShutdown) in C:\Data\Repositories\Stereo Kit\StereoKit\SK.cs:line 199
   at Program.Main(String[] args) in /home/melis/concepts/skmap/Program.cs:line 9

Looking a bit closer with LD_DEBUG=all dotnet run it seems /home/melis/concepts/skmap/bin/Debug/net6.0/runtimes/linux-x64/native/libStereoKitC.so is not finding two libs:

melis@juggle 15:53:~$ ldd /home/melis/concepts/skmap/bin/Debug/net6.0/runtimes/linux-x64/native/libStereoKitC.so |grep not
	libGLEW.so.2.1 => not found
	libjsoncpp.so.1 => not found

I have both GLEW and jsoncpp installed as system packages, but the shared lib versions don't match. And I don't see them in the native code dir within the project:

melis@juggle 15:55:~/concepts/skmap/bin/Debug/net6.0$ find . -name libGLEW\*
melis@juggle 15:55:~/concepts/skmap/bin/Debug/net6.0$ find . -name \*jsoncpp\*
melis@juggle 15:55:~/concepts/skmap/bin/Debug/net6.0$ 

Should these be installed separately through dotnet add package?

Platform / Environment

Arch Linux, VS Code 1.66.0, dotnet 6.0.110

@maluoi
Copy link
Collaborator

maluoi commented Nov 4, 2022

Ahaaa, I suspect this could be the same as #485! The libGLEW and libjsoncpp version bits you've called out here are probably the details I've been missing, this all makes a lot more sense now.

I don't really know what exactly is the best way to handle this as a Linux user, ( I am still a Linux novice :( ) but I think there's some work I can do on the build side to make this smoother.

@maluoi maluoi added the build Build system related work label Nov 4, 2022
@maluoi maluoi added this to the v0.3.7 milestone Nov 4, 2022
@maluoi maluoi self-assigned this Nov 4, 2022
@maluoi
Copy link
Collaborator

maluoi commented Nov 5, 2022

FYI, I did write what I believe should be a fix for this! It'll be in the next build :)

@maluoi
Copy link
Collaborator

maluoi commented Nov 15, 2022

A fix for this is now up in v0.3.7-preview.6! If this continues, please re-open!

@maluoi maluoi closed this as completed Nov 15, 2022
maluoi added a commit that referenced this issue Nov 15, 2022
This update merges in some big changes to the way the C# build scripts work! This allows for switching between the Oculus and Standard OpenXR Loader (for those _not_ targeting Quest!), as well as lays the groundwork for the upcoming Maui based multi-target template. Some projects _may_ experience issues upgrading due to this, especially if using the Universal template. If you see this in your project, I'd love to know, notes at the bottom about that.

Here's the changelog:
- Added auto-copy of Assets folder <SKCopyAssets>true/false, <SKAssetFolder>path, and <SKAssetDestination>path
- Added auto-compile for shaders in the Assets folder.
- Added ability to switch between the standard and Oculus version of the OpenXR Loader, <SKOpenXRLoader>.
- Added support for multimaterial skinned meshes, thanks @holloway! #495
- Added `Tex.GenParticle`.
- Added `Mesh.GenerateCircle`, and added `doubleSided` to `Mesh.GeneratePlane`, thanks @jackdaus! #503
- Added `Backend.OpenXR.OnPollEvent` to allow for more OpenXR extension implementations, thanks @jackdaus! #513
- Added `UI.Toggle` overload with sprite arguments. #514
- Added IntPtr overloads for `Sound.Read/WriteSamples`.
- Removed Linux dependencies on libjsoncpp and libglew. #507 and #485
- Text material now uses DepthTest.LessEq, should help reduce z-fighting artifacts on far text.
- Cmake now works with Android, thanks @malek! #516
- Fixed an issue with a missing library on UWP ARM via cmake, #501
- Fixed an issue with parsing certain URIs in GLTF files.
- Fixed an issue with `Material.Copy` not copying material chaining.
- Fixed an issue with the simulated hand's wrist joint not matching real hand data.
- UI.Panel now uses the correct visual element. #484

Previously, asset copying was manually added to templates, this update adds some code that makes this no longer necessary. For existing projects, duplicate asset copying isn't a problem, but the Universal template did a bit extra in order to use a shared asset folder. Please see this branch of the Universal template for changes that you'll probably need!
https://github.com/StereoKit/SKTemplate-Universal/tree/feature/v0.3.7_Asset_Copy
@TrueGeek
Copy link

I've updated to v0.3.7-preview.6 and I'm still seeing this same issue.

I'm on an M1 Mac. @paulmelis do you still see this on Linux?

@maluoi
Copy link
Collaborator

maluoi commented Nov 28, 2022

@TrueGeek Could you clarify on what you mean by M1 Mac? Are you running Linux on your Mac, or is this MacOS? SK doesn't currently support MacOS, so there's probably a number of different things that might trip up StereoKit in ways that might look like this.

@TrueGeek
Copy link

Ah, that would explain it. Yes, I'm on MacOS.

@paulmelis
Copy link
Contributor Author

For completeness, just tested v0.3.7-preview.6 on Linux and the issue is gone!

@maluoi
Copy link
Collaborator

maluoi commented Nov 29, 2022

That's awesome to hear! Thanks so much for verifying that! :D

@maluoi maluoi mentioned this issue Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system related work
Projects
Status: Done
Development

No branches or pull requests

3 participants