2025-06-19 15:26:36 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
auditwheel repair dist/* \
|
|
|
|
|
--plat manylinux_2_35_x86_64 \
|
|
|
|
|
--exclude libcublas* \
|
2025-07-11 08:17:58 -07:00
|
|
|
--exclude libnvrtc* \
|
|
|
|
|
-w wheel_tmp
|
2025-06-19 15:26:36 -07:00
|
|
|
|
2025-07-11 08:17:58 -07:00
|
|
|
|
|
|
|
|
mkdir wheelhouse
|
|
|
|
|
cd wheel_tmp
|
2025-06-19 15:26:36 -07:00
|
|
|
repaired_wheel=$(find . -name "*.whl" -print -quit)
|
|
|
|
|
unzip -q "${repaired_wheel}"
|
2025-07-11 08:17:58 -07:00
|
|
|
rm "${repaired_wheel}"
|
2025-06-19 15:26:36 -07:00
|
|
|
core_so=$(find mlx -name "core*.so" -print -quit)
|
|
|
|
|
rpath=$(patchelf --print-rpath "${core_so}")
|
|
|
|
|
rpath=$rpath:\$ORIGIN/../nvidia/cublas/lib:\$ORIGIN/../nvidia/cuda_nvrtc/lib
|
|
|
|
|
patchelf --force-rpath --set-rpath "$rpath" "$core_so"
|
|
|
|
|
|
|
|
|
|
# Re-zip the repaired wheel
|
2025-07-11 08:17:58 -07:00
|
|
|
zip -r -q "../wheelhouse/${repaired_wheel}" .
|