From 3a0c32592c8150d9a925b95a5831e4217d111d02 Mon Sep 17 00:00:00 2001 From: Ben Howe Date: Tue, 4 Nov 2025 15:58:39 -0800 Subject: [PATCH 1/3] Build updates for wheels Signed-off-by: Ben Howe --- .github/workflows/scripts/build_wheels.sh | 3 +++ libs/qec/lib/CMakeLists.txt | 4 +--- libs/qec/lib/realtime/CMakeLists.txt | 1 + libs/qec/lib/realtime/quantinuum/CMakeLists.txt | 2 ++ libs/qec/lib/realtime/simulation/CMakeLists.txt | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/build_wheels.sh b/.github/workflows/scripts/build_wheels.sh index 3fd2b913..54cc89c4 100755 --- a/.github/workflows/scripts/build_wheels.sh +++ b/.github/workflows/scripts/build_wheels.sh @@ -158,12 +158,15 @@ $python -m build --wheel CUDAQ_EXCLUDE_LIST=$(for f in $(find $cudaq_prefix/lib -name "*.so" -printf "%P\n" | sort); do echo "--exclude $f"; done | tr '\n' ' ') +# We need to exclude a few libraries to prevent auditwheel from mistakenly grafting them into the wheel. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/_skbuild/lib:$tensorrt_path/lib" \ $python -m auditwheel -v repair dist/*.whl $CUDAQ_EXCLUDE_LIST \ --wheel-dir /wheels \ --exclude libcudart.so.${cuda_version} \ --exclude libnvinfer.so.10 \ --exclude libnvonnxparser.so.10 \ + --exclude libcudaq-qec.so \ + --exclude libcudaq-qec-realtime-decoding.so \ ${PLAT_STR} # ============================================================================== diff --git a/libs/qec/lib/CMakeLists.txt b/libs/qec/lib/CMakeLists.txt index 623cadf0..73aa4b89 100644 --- a/libs/qec/lib/CMakeLists.txt +++ b/libs/qec/lib/CMakeLists.txt @@ -93,6 +93,4 @@ install(DIRECTORY ${CUDAQX_QEC_INCLUDE_DIR}/cudaq FILES_MATCHING PATTERN "*.h" ) -if (NOT SKBUILD) - add_subdirectory(realtime) -endif() +add_subdirectory(realtime) diff --git a/libs/qec/lib/realtime/CMakeLists.txt b/libs/qec/lib/realtime/CMakeLists.txt index 174970a3..cfc9d75f 100644 --- a/libs/qec/lib/realtime/CMakeLists.txt +++ b/libs/qec/lib/realtime/CMakeLists.txt @@ -43,6 +43,7 @@ set_target_properties(cudaq-qec-realtime-decoding PROPERTIES install(TARGETS cudaq-qec-realtime-decoding + COMPONENT qec-lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/libs/qec/lib/realtime/quantinuum/CMakeLists.txt b/libs/qec/lib/realtime/quantinuum/CMakeLists.txt index d05e271e..b23b7dce 100644 --- a/libs/qec/lib/realtime/quantinuum/CMakeLists.txt +++ b/libs/qec/lib/realtime/quantinuum/CMakeLists.txt @@ -49,6 +49,7 @@ set_target_properties(cudaq-qec-realtime-decoding-quantinuum PROPERTIES ) install(TARGETS cudaq-qec-realtime-decoding-quantinuum + COMPONENT qec-lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -65,5 +66,6 @@ set_target_properties(cudaq-qec-realtime-decoding-cudaq-stubs PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) install(TARGETS cudaq-qec-realtime-decoding-cudaq-stubs + COMPONENT qec-lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/libs/qec/lib/realtime/simulation/CMakeLists.txt b/libs/qec/lib/realtime/simulation/CMakeLists.txt index 630d6eca..1551a6b4 100644 --- a/libs/qec/lib/realtime/simulation/CMakeLists.txt +++ b/libs/qec/lib/realtime/simulation/CMakeLists.txt @@ -43,6 +43,7 @@ set_target_properties(cudaq-qec-realtime-decoding-simulation PROPERTIES install(TARGETS cudaq-qec-realtime-decoding-simulation + COMPONENT qec-lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) From e5e9251537909457cb273884804ef1152a4e479e Mon Sep 17 00:00:00 2001 From: Ben Howe Date: Tue, 4 Nov 2025 16:35:56 -0800 Subject: [PATCH 2/3] Update scripts/ci/test_wheels.sh Signed-off-by: Ben Howe --- scripts/ci/test_wheels.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/ci/test_wheels.sh b/scripts/ci/test_wheels.sh index 3c80253d..a70fc9c0 100644 --- a/scripts/ci/test_wheels.sh +++ b/scripts/ci/test_wheels.sh @@ -69,6 +69,12 @@ elif [[ "$cuda_version" == "12" ]]; then ${python} -m pip install torch==2.9.0 --index-url https://download.pytorch.org/whl/cu126 fi +# Temporary hack until tensorrt-cu13 bumps its package version to accommodate +# for the breaking change in nvidia-cuda-runtime-cu13. +if [[ "$cuda_version" == "13" ]]; then + ${python} -m pip install ${FIND_LINKS} "nvidia-cuda-runtime-cu13==0.0.0a0" +fi + # QEC library # ====================================== From 0b2c5a64ac0b88cb3be152889fdce9321aa4d07f Mon Sep 17 00:00:00 2001 From: Ben Howe Date: Tue, 4 Nov 2025 17:08:27 -0800 Subject: [PATCH 3/3] Add docs info to Building.md Signed-off-by: Ben Howe --- Building.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Building.md b/Building.md index 3f05704f..82fdfb25 100644 --- a/Building.md +++ b/Building.md @@ -55,12 +55,11 @@ export PYTHONPATH=${CUDAQ_INSTALL_PREFIX}:${CUDAQX_INSTALL_PREFIX} export PATH="${CUDAQ_INSTALL_PREFIX}/bin:${CUDAQX_INSTALL_PREFIX}/bin:${PATH}" ctest # Run the python tests -# The --ignore option is to bypass tests that require additional packages not contained in +# The --ignore option is to bypass tests that require additional packages not contained in # the standard docker container cd .. python3 -m pytest -v libs/qec/python/tests --ignore libs/qec/python/tests/test_tensor_network_decoder.py python3 -m pytest -v libs/solvers/python/tests --ignore libs/solvers/python/tests/test_gqe.py - ``` If you want to change which version of CUDA-Q that CUDA-QX is paired with, you @@ -81,3 +80,14 @@ contributing to CUDA-QX, but it should be noted that while this environment will have many GPU-accelerated simulators installed in it, it won't contain the *highest* performing CUDA-Q simulators. See [this note](https://nvidia.github.io/cuda-quantum/latest/using/install/data_center_install.html) for more details. + +## Building CUDA-QX Documentation from Source + +If you want to build and render our documentation from source, you can do this +with the same environment as above. In particular, after running `ninja install`, +you can run `ninja docs`. This places the documentation into the +`/workspaces/cudaqx/build/docs/build/` directory. From there, you can open +the `index.html` file in your browser, or if you are using VSCode or Cursor, you +can simply browse to the `index.html` file in the Explorer panel, right click on +the file, and select "Open with Live Server", and that will open your browser +with the main docs page loaded automatically.