Add cann_dependencies (#19929)

### Description
<!-- Describe your changes. -->

Add `cann_dependencies`


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

The previous [PR](https://github.com/microsoft/onnxruntime/pull/17365)
avioded using patchelf but lost `cann_dependencies`, This PR adds
`cann_dependencies` to avoid require cann libraries when repairing
wheel.
This commit is contained in:
wangshuai09 2024-03-16 11:28:43 +08:00 committed by GitHub
parent b29849a287
commit 1eb67a07ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -232,6 +232,8 @@ try:
tensorrt_dependencies = ["libnvinfer.so.8", "libnvinfer_plugin.so.8", "libnvonnxparser.so.8"]
cann_dependencies = ["libascendcl.so", "libacl_op_compiler.so", "libfmk_onnx_parser.so"]
dest = "onnxruntime/capi/libonnxruntime_providers_openvino.so"
if path.isfile(dest):
subprocess.run(
@ -255,7 +257,7 @@ try:
file = glob(path.join(self.dist_dir, "*linux*.whl"))[0]
logger.info("repairing %s for manylinux1", file)
auditwheel_cmd = ["auditwheel", "-v", "repair", "-w", self.dist_dir, file]
for i in cuda_dependencies + rocm_dependencies + tensorrt_dependencies:
for i in cuda_dependencies + rocm_dependencies + tensorrt_dependencies + cann_dependencies:
auditwheel_cmd += ["--exclude", i]
logger.info("Running %s", " ".join([shlex.quote(arg) for arg in auditwheel_cmd]))
try: