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

Unable to load shared library 'rodbus_ffi' or one of its dependencies. #126

Open
toondaey opened this issue Oct 6, 2023 · 4 comments
Open

Comments

@toondaey
Copy link

toondaey commented Oct 6, 2023

I'm trying to experiment with rodbus in C# but I'm getting this error about missing dylib: Unable to load shared library 'rodbus_ffi' or one of its dependencies.. Below is the full error:

 ---> System.DllNotFoundException: Unable to load shared library 'rodbus_ffi' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable:
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/rodbus_ffi.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/rodbus_ffi.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/rodbus_ffi.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/rodbus_ffi.dylib' (no such file)
dlopen(/Users/[User]/project/bin/Debug/net7.0/rodbus_ffi.dylib, 0x0001): tried: '/Users/[User]/project/bin/Debug/net7.0/rodbus_ffi.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/[User]/project/bin/Debug/net7.0/rodbus_ffi.dylib' (no such file), '/Users/[User]/project/bin/Debug/net7.0/rodbus_ffi.dylib' (no such file)
dlopen(rodbus_ffi.dylib, 0x0001): tried: 'rodbus_ffi.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSrodbus_ffi.dylib' (no such file), '/usr/lib/rodbus_ffi.dylib' (no such file, not in dyld cache), 'rodbus_ffi.dylib' (no such file), '/usr/local/lib/rodbus_ffi.dylib' (no such file), '/usr/lib/rodbus_ffi.dylib' (no such file, not in dyld cache)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/librodbus_ffi.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/librodbus_ffi.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/librodbus_ffi.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/librodbus_ffi.dylib' (no such file)
dlopen(/Users/[User]/project/bin/Debug/net7.0/librodbus_ffi.dylib, 0x0001): tried: '/Users/[User]/project/bin/Debug/net7.0/librodbus_ffi.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/[User]/project/bin/Debug/net7.0/librodbus_ffi.dylib' (no such file), '/Users/[User]/project/bin/Debug/net7.0/librodbus_ffi.dylib' (no such file)
dlopen(librodbus_ffi.dylib, 0x0001): tried: 'librodbus_ffi.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibrodbus_ffi.dylib' (no such file), '/usr/lib/librodbus_ffi.dylib' (no such file, not in dyld cache), 'librodbus_ffi.dylib' (no such file), '/usr/local/lib/librodbus_ffi.dylib' (no such file), '/usr/lib/librodbus_ffi.dylib' (no such file, not in dyld cache)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/rodbus_ffi, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/rodbus_ffi' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/rodbus_ffi' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/rodbus_ffi' (no such file)
dlopen(/Users/[User]/project/bin/Debug/net7.0/rodbus_ffi, 0x0001): tried: '/Users/[User]/project/bin/Debug/net7.0/rodbus_ffi' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/[User]/project/bin/Debug/net7.0/rodbus_ffi' (no such file), '/Users/[User]/project/bin/Debug/net7.0/rodbus_ffi' (no such file)
dlopen(rodbus_ffi, 0x0001): tried: 'rodbus_ffi' (no such file), '/System/Volumes/Preboot/Cryptexes/OSrodbus_ffi' (no such file), '/usr/lib/rodbus_ffi' (no such file, not in dyld cache), 'rodbus_ffi' (no such file), '/usr/local/lib/rodbus_ffi' (no such file), '/usr/lib/rodbus_ffi' (no such file, not in dyld cache)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/librodbus_ffi, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/librodbus_ffi' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/librodbus_ffi' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.9/librodbus_ffi' (no such file)
dlopen(/Users/[User]/project/bin/Debug/net7.0/librodbus_ffi, 0x0001): tried: '/Users/[User]/project/bin/Debug/net7.0/librodbus_ffi' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/[User]/project/bin/Debug/net7.0/librodbus_ffi' (no such file), '/Users/[User]/project/bin/Debug/net7.0/librodbus_ffi' (no such file)
dlopen(librodbus_ffi, 0x0001): tried: 'librodbus_ffi' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibrodbus_ffi' (no such file), '/usr/lib/librodbus_ffi' (no such file, not in dyld cache), 'librodbus_ffi' (no such file), '/usr/local/lib/librodbus_ffi' (no such file), '/usr/lib/librodbus_ffi' (no such file, not in dyld cache)

I'm attempting this on an M1 Mac (not sure if this has anything to do with what's wrong)

@jadamcrain
Copy link
Member

I'm attempting this on an M1 Mac (not sure if this has anything to do with what's wrong)

That's the issue. There's no native library bundled in the nuget package for M1, just x64 MacOS.

We had a bit of trouble a couple of years ago w/ making Github's MacOS CI runner x-compile an M1, but might be worth trying again.

It's also possible for you to build everything locally if you're interested in going down that path.

@toondaey
Copy link
Author

toondaey commented Oct 6, 2023

Oh! Bummer! How do I go about the build?

@jadamcrain
Copy link
Member

@toondaey Github recently announced support for M1 runners:

https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/

I'm updating the CI to give this a try.

@jadamcrain
Copy link
Member

Hi @toondaey. I just released 1.4.0-RC1 to maven central. It includes an ARM64 binary for OSX.

Could you test this on your M1 Mac and any other ARM mac you might have?

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

No branches or pull requests

2 participants