-
Notifications
You must be signed in to change notification settings - Fork 249
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
Load ShaderConductor dependencies on Mac and Linux #52
Comments
It'd be good to get this fixed if possible, as it's blocking our adoption of this software on macOS. :) I'm happy to try and have a crack at it myself if you're able to direct me towards where the linking gets set up in the build process! To anyone looking at this - it's possible to get it to work by renaming |
I'm not farmilar with the shared lib on either linux or macos. The CI runs tests on these systems but doesn't fail. Maybe because they are resolved by linker, not dlopen? Rename and symlink sound a good way. Does anyone can provide a PR? Thanks. |
It took me about 30 minutes with I had to change the rpath for both the binary and the Even then it would not work until I did |
Get back to this issue after all these years. I had a fix that might help. But I don't have en environment to test it. Anyone like to have a try? The change is in: gongminmin@05f4536 |
The dynamic libraries on Mac using rpath mechanisms to load dependency libraries, so is important to be in mind when you create a dylib, you must specify correct ID, dependencies and rpaths where linker will find dependency libraries.
If you download ShaderConductor Mac dylib from AzurePipeline artifacts and you use for example MacDependencies app, you can see:
File: libShaderConductor.dylib
ID: @rpath/libShaderConductor.dylib
Dependency with: @rpath/libdxcompiler.3.7.dylib
Rpaths: /Users/vts/agent/2.155.1/work/1/s/Build/ninja-osx-clang9-x64-Release/External/DirectXShaderCompiler/lib.
I created a netcore 3.0 app and make a NativeLibrary.Load to load libShaderConductor.dylib but it produces a fail when load dxcompiler library dependency.
Issues:
Dependency filename is wrong, @rpath/libdxcompiler.3.7.dylib must be @rpath/libdxcompiler.dylib
RPaths is wrong, RPaths could be @loader_path; @executable_path
Is possible fix this references using install_name_tool on Mac but maybe is possible fix it from ninja script.
This is an interesting article about this issue on Mac.
Edit. In Linux exists the same issue, it is possible fix with patchelf command but would be fixed in ninja script.
The text was updated successfully, but these errors were encountered: