✨ Enhance QDMI device library lookup on Unix#1888
Draft
flowerthrower wants to merge 15 commits into
Draft
Conversation
…-qdmi-device-library-lookup
…om-job-parameters-to-fomac
…-qdmi-device-library-lookup
Contributor
Cpp-Linter Report
|
Member
|
Something seems broken in how this PR was set up. I am also not 100% I get what kind of problems this is trying to solve. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
While adding tests that use the FoMaC with the DDSIM QDMI device, I found that applications loading MQT Core indirectly still need to set DYLD_LIBRARY_PATH or LD_LIBRARY_PATH, even when the driver and device libraries are installed in the same directory. Our Windows implementation already does this a bit better.
On Unix systems, dlopen does not reliably search the directory of the already-loaded driver library. This PR uses dladdr to locate the loaded QDMI driver and searches its directory when a device library is specified by filename only. Paths that already contain a directory component are still loaded directly. If this sibling lookup fails, the original dlopen behavior is used as a fallback. This actually matches the existing Windows behavior and allows consumers to load MQT-installed QDMI devices without modifying the process-wide library search path.
Checklist
If PR contains AI-assisted content:
Assisted-by: [Model Name] via [Tool Name]footer.