Skip to content

Commit

Permalink
Update build_wheels.sh script to exclude more libs
Browse files Browse the repository at this point in the history
This is required in case we are building on a machine that has GPUs
because the CUDA-Q build scripts will automatically switch the target
to `nvidia` if GPUs are present, and that will start linking additional
libraries to the wheel libs, which we do not wish to include in our
CUDA-QX libraries.

Signed-off-by: Ben Howe <[email protected]>
  • Loading branch information
bmhowe23 committed Jan 10, 2025
1 parent 980ff15 commit d56bac1
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/scripts/build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,10 @@ cd libs/qec
SKBUILD_CMAKE_ARGS="-DCUDAQ_DIR=$cudaq_prefix/lib/cmake/cudaq;-DCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=/opt/rh/gcc-toolset-11/root/usr/lib/gcc/x86_64-redhat-linux/11/" \
$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' ' ')

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/_skbuild/lib" \
$python -m auditwheel -v repair dist/*.whl \
--exclude libcudaq-em-default.so \
--exclude libcudaq-python-interop.so \
--exclude libcudaq-ensmallen.so \
--exclude libcudaq-common.so \
--exclude libcudaq-platform-default.so \
--exclude libnvqir-qpp.so \
--exclude libnvqir.so \
--exclude libcudaq.so \
--exclude libcudaq-spin.so \
--exclude libcudaq-nlopt.so \
$python -m auditwheel -v repair dist/*.whl $CUDAQ_EXCLUDE_LIST \
--wheel-dir /wheels

# ==============================================================================
Expand All @@ -109,17 +101,7 @@ SKBUILD_CMAKE_ARGS="-DCUDAQ_DIR=$cudaq_prefix/lib/cmake/cudaq;-DCMAKE_CXX_COMPIL
$python -m build --wheel

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/_skbuild/lib" \
$python -m auditwheel -v repair dist/*.whl \
--exclude libcudaq-em-default.so \
--exclude libcudaq-python-interop.so \
--exclude libcudaq-ensmallen.so \
--exclude libcudaq-common.so \
--exclude libcudaq-platform-default.so \
--exclude libnvqir-qpp.so \
--exclude libnvqir.so \
--exclude libcudaq.so \
--exclude libcudaq-spin.so \
--exclude libcudaq-nlopt.so \
$python -m auditwheel -v repair dist/*.whl $CUDAQ_EXCLUDE_LIST \
--exclude libgfortran.so.5 \
--exclude libquadmath.so.0 \
--exclude libmvec.so.1 \
Expand Down

0 comments on commit d56bac1

Please sign in to comment.