Skip to content

Conversation

m0nsky
Copy link
Contributor

@m0nsky m0nsky commented Jul 10, 2024

After the introduction of the GGML dependency in the July 2024 binary update, the tests for Linux/OSX were failing because the NativeLibrary failed to load the GGML dependency.

There were two ways to tackle the issue:

  • Specify UseDllDirectoryForDependencies in NativeLibrary.TryLoad, however, this does not seem to help on Linux / OSX
  • Set the LD_LIBRARY_PATH environment variable to the current runtime directory, however, the LD_LIBRARY_PATH environment variable has to be set before the application starts, making it unusable in most cases, and incompatible with attempting to load multiple libraries

This PR introduces manually resolving the GGML dependency in TryLoadLibrary before loading the main library, for Linux & OSX.

I have ran the unit tests locally on Ubuntu 22.04 and they are now passing, and have also confirmed that building a standalone application where the .so files are placed in the same directory as the executable still work correctly.

I haven't ran the tests for OSX because I don't have access to it, but I hope those tests will also pass now, as they were reporting the same error. Maybe we can do this through GitHub?

Note: this is based on, and will merge into july-2024-binaries

@martindevans
Copy link
Member

Thank you for all your hard work on this!

@martindevans martindevans merged commit 705efa9 into SciSharp:july-2024-binaries Jul 10, 2024
@m0nsky m0nsky deleted the ggml-dependency-linux-osx branch July 11, 2024 07:06
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.

2 participants