diff --git a/.github/workflows/wheel_linux_x86_64_cu11.yml b/.github/workflows/wheel_linux_x86_64_cu11.yml index 12c2b82eef..8f544c5c6b 100644 --- a/.github/workflows/wheel_linux_x86_64_cu11.yml +++ b/.github/workflows/wheel_linux_x86_64_cu11.yml @@ -87,7 +87,7 @@ jobs: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:$CUQUANTUM_SDK \ PL_BACKEND="${{ matrix.pl_backend }}" - CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair -w {dest_dir} {wheel}" + CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}" CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 diff --git a/bin/auditwheel b/bin/auditwheel new file mode 100755 index 0000000000..e7142fa4ab --- /dev/null +++ b/bin/auditwheel @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +# Patch to not ship CUDA system libraries +# Follows https://github.com/DIPlib/diplib/tree/master/tools/travis +import sys + +from auditwheel.main import main +from auditwheel.policy import _POLICIES as POLICIES + +# Do not include licensed dynamic libraries +libs = [ + "libcudart.so.11.0", + "libcublasLt.so.11", + "libcublas.so.11", + "libcusparse.so.11", + "libcustatevec.so.1", +] + +print(f"Excluding {libs}") + +for p in POLICIES: + p["lib_whitelist"].extend(libs) + +if __name__ == "__main__": + sys.exit(main())