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 RPATH in pybind11 module for 0.33 #543

Merged
merged 9 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# Release 0.33.1

### New features since last release

* pip-installed CUDA runtime libraries can now be accessed from a virtualenv.
[(#543)](https://github.com/PennyLaneAI/pennylane-lightning/pull/543)

### Bug fixes

* The pybind11 compiled module RPATH linkage has been restored to pre-0.33 behaviour.
[(#543)](https://github.com/PennyLaneAI/pennylane-lightning/pull/543)

Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to add author to the contributor.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, thanks. I'll update, skip CI, and merge onto the RC branch

### Contributors

This release contains contributions from (in alphabetical order):

Lee J. O'Riordan

---

# Release 0.33.0

### New features since last release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky

CIBW_BEFORE_TEST: |
python -m pip install git+https://github.com/PennyLaneAI/[email protected]-rc0
python -m pip install git+https://github.com/PennyLaneAI/[email protected]
if ${{ matrix.pl_backend == 'lightning_kokkos'}}; then SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv; fi

CIBW_TEST_COMMAND: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_linux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky

CIBW_BEFORE_TEST: |
python -m pip install git+https://github.com/PennyLaneAI/[email protected]-rc0
python -m pip install git+https://github.com/PennyLaneAI/[email protected]
if ${{ matrix.pl_backend == 'lightning_kokkos'}}; then SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv; fi

CIBW_TEST_COMMAND: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/wheel_linux_x86_64_cu11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ jobs:
# ensure nvcc is available
CIBW_ENVIRONMENT: |
PATH=$PATH:/usr/local/cuda/bin \
CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:$CUQUANTUM_SDK \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 \
PL_BACKEND="${{ matrix.pl_backend }}"

CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_macos_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky

CIBW_BEFORE_TEST: |
python -m pip install git+https://github.com/PennyLaneAI/[email protected]-rc0
python -m pip install git+https://github.com/PennyLaneAI/[email protected]
if ${{ matrix.pl_backend == 'lightning_kokkos'}}; then SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv; fi

CIBW_TEST_COMMAND: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_macos_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky

CIBW_BEFORE_TEST: |
python -m pip install git+https://github.com/PennyLaneAI/[email protected]-rc0
python -m pip install git+https://github.com/PennyLaneAI/[email protected]
if ${{ matrix.pl_backend == 'lightning_kokkos'}}; then SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv; fi

CIBW_TEST_COMMAND: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_win_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky

CIBW_BEFORE_TEST: |
python -m pip install git+https://github.com/PennyLaneAI/[email protected]-rc0
python -m pip install git+https://github.com/PennyLaneAI/[email protected]

CIBW_TEST_COMMAND: |
pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ if(ENABLE_PYTHON)
message(STATUS "ENABLE_PYTHON is ON.")
pybind11_add_module("${PL_BACKEND}_ops" "pennylane_lightning/core/src/bindings/Bindings.cpp")

# Allow pip installation of cuQuantum & CUDA 11 libs to be accessible without setting LD_LIBRARY_PATH for lightning_gpu
if("${PL_BACKEND}" STREQUAL "lightning_gpu")
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
set_target_properties("${PL_BACKEND}_ops" PROPERTIES BUILD_RPATH "$ORIGIN/../cuquantum/lib:$ORIGIN/../nvidia/cuda_runtime/lib:$ORIGIN/../nvidia/cublas/lib:$ORIGIN/../nvidia/cusparse/lib:$ORIGIN")
endif()

target_link_libraries("${PL_BACKEND}_ops" PRIVATE lightning_compile_options
lightning_external_libs
)
Expand All @@ -138,7 +144,6 @@ if(ENABLE_PYTHON)
)

set_target_properties("${PL_BACKEND}_ops" PROPERTIES CXX_VISIBILITY_PRESET hidden)

target_compile_definitions("${PL_BACKEND}_ops" PRIVATE VERSION_INFO=${VERSION_STRING})
endif()

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.33.0"
__version__ = "0.33.1-rc0"
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Ensure the libraries can see additional libs at same level;
# Required for external deps when loading in Python
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_RPATH "$ORIGIN/../cuquantum/lib:$ORIGIN/../cuquantum/lib64:$ORIGIN/")
set(CMAKE_INSTALL_RPATH "$ORIGIN/../cuquantum/lib:$ORIGIN/../cuquantum/lib64:$ORIGIN/")

#########################
## Set Default Options ##
#########################
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pip==23.0
git+https://github.com/PennyLaneAI/pennylane.git@master
git+https://github.com/PennyLaneAI/pennylane.git@v0.33.0
ninja
flaky
pybind11
Expand Down
Loading