Skip to content

Commit

Permalink
Fix missing lk_catalyst.so in LK editable installation (#945)
Browse files Browse the repository at this point in the history
### Before submitting

Please complete the following checklist when submitting a PR:

- [ ] All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to
the
      [`tests`](../tests) directory!

- [ ] All new functions and code must be clearly commented and
documented.
If you do make documentation changes, make sure that the docs build and
      render correctly by running `make docs`.

- [ ] Ensure that the test suite passes, by running `make test`.

- [x] Add a new entry to the `.github/CHANGELOG.md` file, summarizing
the
      change, and including a link back to the PR.

- [x] Ensure that code is properly formatted by running `make format`. 

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


------------------------------------------------------------------------------------------------------------

**Context:**

This PR is a fix for the
[issue](#939)
reported by @maliasadi.

[sc-76118]

**Description of the Change:**

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**

---------

Co-authored-by: ringo-but-quantum <[email protected]>
  • Loading branch information
multiphaseCFD and ringo-but-quantum authored Oct 16, 2024
1 parent 1293b96 commit 7c43ed6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@

### Bug fixes

* Fix missing `liblightning_kokkos_catalyst.so` in Lightning-Kokkos editable installation.
[(#945)](https://github.com/PennyLaneAI/pennylane-lightning/pull/945)

* Add concept restriction to ensure `ConstMult` inline function only hit with arithmetic-values times complex values. Fixes build failures with the test suite when enabling OpenMP, and disabling BLAS and Python under clang.
[(#936)](https://github.com/PennyLaneAI/pennylane-lightning/pull/936)

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.39.0-dev44"
__version__ = "0.39.0-dev45"
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ def build_extension(self, ext: CMakeExtension):
env=os.environ,
)

# Ensure that catalyst shared object is copied to the build directory for pip editable install
if backend in ("lightning_kokkos"):
source = os.path.join(f"{extdir}", f"lib{backend}_catalyst.so")
destination = os.path.join(os.getcwd(), "build")
shutil.copy(source, destination)

with open(os.path.join("pennylane_lightning", "core", "_version.py"), encoding="utf-8") as f:
version = f.readlines()[-1].split()[-1].strip("\"'")

Expand Down

0 comments on commit 7c43ed6

Please sign in to comment.