Skip to content

✨ Enhance QDMI device library lookup on Unix#1888

Draft
flowerthrower wants to merge 15 commits into
mainfrom
fix-unix-qdmi-device-library-lookup
Draft

✨ Enhance QDMI device library lookup on Unix#1888
flowerthrower wants to merge 15 commits into
mainfrom
fix-unix-qdmi-device-library-lookup

Conversation

@flowerthrower

Copy link
Copy Markdown
Collaborator

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

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • I have disclosed the use of AI tools in the PR description as per our AI Usage Guidelines.
  • AI-assisted commits include an Assisted-by: [Model Name] via [Tool Name] footer.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

@flowerthrower flowerthrower added the enhancement Improvement of existing feature label Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v22.1.8) reports: 1 concern(s)
  • bindings/fomac/fomac.cpp:297:57: warning: [misc-include-cleaner]

    no header providing "size_t" is directly included

       25 |          const QDMI_Program_Format programFormat, const size_t numShots,
          |                                                         ^

Have any feedback or feature suggestions? Share it here.

@burgholzer

burgholzer commented Jul 10, 2026

Copy link
Copy Markdown
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.
Our CI (in C++ as well as Python) is working just fine and the CI in the IQM repository is also working just fine. (and it is using the DD device)
Am I overlooking something?

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
include/mqt-core/fomac/FoMaC.hpp 95.6% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement of existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants