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

Fix Python compiled module linkage and path under Windows #400

Merged
merged 9 commits into from
Jan 11, 2023
Merged

Conversation

mlxd
Copy link
Member

@mlxd mlxd commented Jan 11, 2023

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 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.

  • Add a new entry to the .github/CHANGELOG.md file, summarizing the
    change, and including a link back to the PR.

  • 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: Under Windows, CMake was not finding the correct version of Python to compile the wheels against. This was due to the incorrectly named -DPYTHON_EXECUTABLE flag, which should have been -DPython_EXECUTABLE. In addition, the compiled module path was incorrect in the resulting Windows wheel, and required either updating the PYTHONPATH environment variable, or a move of the modules to ensure Lightning worked on the OS.

Description of the Change: This PR fixes the Python version found by CMake, and moves the compiled module location in the resulting wheels to prevent the need for a user to update PYTHONPATH or manually move the resulting modules.

Benefits: Fixes Windows wheels for Lightning.

Possible Drawbacks:

Related GitHub Issues: #398

@mlxd mlxd added the do not merge Do not merge PR until this label is removed label Jan 11, 2023
@mlxd mlxd changed the base branch from master to v0.28.0_rc0 January 11, 2023 11:18
@mlxd mlxd changed the base branch from v0.28.0_rc0 to merge_v0.28.1 January 11, 2023 11:19
@mlxd mlxd changed the base branch from merge_v0.28.1 to master January 11, 2023 11:23
@mlxd
Copy link
Member Author

mlxd commented Jan 11, 2023

NOTE: To ensure testability, I will merge the conflicting files and undo once all test and comments are resolved for the release.

This PR is not to be merged in its current form.

@codecov
Copy link

codecov bot commented Jan 11, 2023

Codecov Report

Merging #400 (65db86f) into master (b8213b6) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #400   +/-   ##
=======================================
  Coverage   99.88%   99.88%           
=======================================
  Files          49       49           
  Lines        4463     4463           
=======================================
  Hits         4458     4458           
  Misses          5        5           
Impacted Files Coverage Δ
pennylane_lightning/_version.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, @mlxd!
Thank you for the quick fix!

@mlxd mlxd requested a review from multiphaseCFD January 11, 2023 14:39
Copy link
Member

@multiphaseCFD multiphaseCFD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Lee for the nice work!

Copy link
Contributor

@chaeyeunpark chaeyeunpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mlxd for fixing this. I also installed wheels using Windows+conda, which works well.

@mlxd mlxd changed the base branch from master to v0.28.0_rc0 January 11, 2023 16:33
@mlxd mlxd changed the base branch from v0.28.0_rc0 to master January 11, 2023 16:45
Copy link
Member Author

@mlxd mlxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating for merge onto master. Release tagged as v0.28.1_release

@mlxd mlxd merged commit 8e34f48 into master Jan 11, 2023
@mlxd mlxd removed the do not merge Do not merge PR until this label is removed label Jan 11, 2023
@mlxd mlxd mentioned this pull request Jun 21, 2023
5 tasks
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

Successfully merging this pull request may close these issues.

4 participants