Skip to content

Commit 05a7654

Browse files
khalatepradnyabettinaheim
authored andcommitted
[python] [wheels] Bundle QRMI library for Pasqal (#4126)
This PR introduces support for the Pasqal QRMI connector on Linux x86_64 platforms, updates build and packaging scripts to ensure correct handling of the `libqrmi` library and adjusts runtime linking settings. Signed-off-by: Pradnya Khalate <pkhalate@nvidia.com>
1 parent 4ae33a7 commit 05a7654

File tree

5 files changed

+23
-1
lines changed

5 files changed

+23
-1
lines changed

docker/build/devdeps.manylinux.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ ENV ZLIB_INSTALL_PREFIX=/usr/local/zlib
126126
ENV OPENSSL_INSTALL_PREFIX=/usr/local/openssl
127127
ENV CURL_INSTALL_PREFIX=/usr/local/curl
128128
ENV AWS_INSTALL_PREFIX=/usr/local/aws
129+
ENV QRMI_INSTALL_PREFIX=/usr/local/qrmi
129130
ENV CUQUANTUM_INSTALL_PREFIX=/usr/local/cuquantum
130131
ENV CUTENSOR_INSTALL_PREFIX=/usr/local/cutensor
131132
RUN bash /scripts/install_prerequisites.sh

pyproject.toml.cu12

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,12 @@ cmake.args = [
8080
"-DCUDAQ_ENABLE_PASQAL_QRMI_CONNECTOR=OFF"
8181
]
8282

83+
# Linux x86_64: enable Pasqal QRMI connector
84+
[[tool.scikit-build.overrides]]
85+
if.platform-system = "linux"
86+
if.platform-machine = "x86_64"
87+
inherit.cmake.args = "append"
88+
cmake.args = ["-DCUDAQ_ENABLE_PASQAL_QRMI_CONNECTOR=ON"]
89+
8390
[tool.setuptools_scm]
8491
write_to = "_version.py"

pyproject.toml.cu13

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ cmake.args = [
8282
"-DCUDAQ_ENABLE_PASQAL_QRMI_CONNECTOR=OFF"
8383
]
8484

85+
# Linux x86_64: enable Pasqal QRMI connector
86+
[[tool.scikit-build.overrides]]
87+
if.platform-system = "linux"
88+
if.platform-machine = "x86_64"
89+
inherit.cmake.args = "append"
90+
cmake.args = ["-DCUDAQ_ENABLE_PASQAL_QRMI_CONNECTOR=ON"]
91+
8592
# macOS: Disable symbol stripping. LLVM's JIT relies on local symbols for
8693
# internal data structures (eg., PassRegistry). On macOS
8794
# with it's two-level namespace they are removed by stripping which

runtime/cudaq/platform/pasqal/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ if(CUDAQ_ENABLE_PASQAL_QRMI_CONNECTOR AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
108108
set_property(TARGET ${SERVERHELPER_LIBRARY_NAME} APPEND PROPERTY
109109
BUILD_RPATH "${QRMI_LIBRARY_DIR}")
110110
set_property(TARGET ${SERVERHELPER_LIBRARY_NAME} APPEND PROPERTY
111-
INSTALL_RPATH "${QRMI_LIBRARY_DIR}")
111+
INSTALL_RPATH "$ORIGIN" "${QRMI_LIBRARY_DIR}")
112112
endif()
113113
endif()
114114
endif()

scripts/build_wheel.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,13 @@ else
404404

405405
# Move repaired wheel to output
406406
repaired_wheel=$(ls "${auditwheel_tmp:?}"/*manylinux*.whl 2>/dev/null | head -1)
407+
if [ "$(uname -m)" = "x86_64" ] && [ -n "$repaired_wheel" ]; then
408+
if ! unzip -l "$repaired_wheel" 2>/dev/null | grep -q 'libqrmi'; then
409+
echo "WARNING: libqrmi.so not bundled in x86_64 wheel"
410+
else
411+
echo "Verified libqrmi.so is bundled in x86_64 wheel"
412+
fi
413+
fi
407414
if [ -n "$repaired_wheel" ]; then
408415
mv "$repaired_wheel" "$output_dir/"
409416
echo "Repaired wheel: $output_dir/$(basename "$repaired_wheel")"

0 commit comments

Comments
 (0)