diff --git a/README.md b/README.md index 1103b84..69ed1cb 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Contrat des artefacts : | Artefact | Étiquette | Cible | | --- | --- | --- | -| `ctranslate2-4.6.3-cp3*-manylinux_2_35_aarch64.whl` | glibc ≥ 2.35 | Ubuntu 22.04, DGX OS / Ubuntu 24.04, JetPack 6 | +| `ctranslate2-4.6.3-cp3{10,11,12,13,14}-manylinux_2_35_aarch64.whl` | glibc ≥ 2.35 | Ubuntu 22.04, DGX OS / Ubuntu 24.04, JetPack 6 | | `libctranslate2-4_4.6.3-1~cuda13_arm64.deb`, `libctranslate2-dev_…deb` | jammy, noble | idem | ## Construction diff --git a/build.sh b/build.sh index d5b93eb..f633fbd 100755 --- a/build.sh +++ b/build.sh @@ -66,24 +66,37 @@ etape_wheel() { ln -s "$TMP/include" "$STAGE/include" ln -s "$TMP/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" "$STAGE/lib" + # Outillage : uv fournit les CPython demandés (l'image n'a que le 3.10 + # d'Ubuntu 22.04), patchelf de PyPI remplace le 0.14.3 d'Ubuntu, trop + # vieux pour auditwheel (>= 0.14.5). python3 -m venv "$WORK/venv" # shellcheck disable=SC1091 . "$WORK/venv/bin/activate" - pip install -q -U pip setuptools wheel pybind11 auditwheel - rm -rf "$WORK/wheel-raw" - CTRANSLATE2_ROOT=$STAGE pip wheel -q --no-deps --no-build-isolation "$SRC/python" -w "$WORK/wheel-raw" + pip install -q -U pip auditwheel patchelf uv + export UV_PYTHON_INSTALL_DIR=$WORK/pythons # Étiquette manylinux d'après la glibc de l'image (2.35 → manylinux_2_35). GLIBC=$(ldd --version | head -1 | grep -oE '[0-9]+\.[0-9]+$' | tr . _) mkdir -p "$DIST" - # Les bibliothèques CUDA ne sont PAS embarquées : CTranslate2 les charge - # dynamiquement (CUDA_DYNAMIC_LOADING) depuis le toolkit ou les paquets - # pip nvidia-*. Seules libctranslate2 et OpenBLAS entrent dans la roue. - LD_LIBRARY_PATH=$STAGE/lib auditwheel repair \ - --plat "manylinux_${GLIBC}_aarch64" \ - --exclude 'libcuda.so.1' --exclude 'libcublas*' --exclude 'libcublasLt*' \ - --exclude 'libcudnn*' --exclude 'libcudart*' \ - -w "$DIST" "$WORK"/wheel-raw/*.whl + for py in $PYTHON_VERSIONS; do + log "roue pour CPython $py" + uv venv -q --python "$py" "$WORK/venv-$py" + uv pip install -q --python "$WORK/venv-$py/bin/python" setuptools wheel pybind11 + rm -rf "$WORK/wheel-raw-$py" + CTRANSLATE2_ROOT=$STAGE "$WORK/venv-$py/bin/python" -m pip wheel -q --no-deps --no-build-isolation \ + "$SRC/python" -w "$WORK/wheel-raw-$py" 2>/dev/null \ + || { uv pip install -q --python "$WORK/venv-$py/bin/python" pip \ + && CTRANSLATE2_ROOT=$STAGE "$WORK/venv-$py/bin/python" -m pip wheel -q --no-deps --no-build-isolation \ + "$SRC/python" -w "$WORK/wheel-raw-$py"; } + # Les bibliothèques CUDA ne sont PAS embarquées : CTranslate2 les charge + # dynamiquement (CUDA_DYNAMIC_LOADING) depuis le toolkit ou les paquets + # pip nvidia-*. Seules libctranslate2 et OpenBLAS entrent dans la roue. + LD_LIBRARY_PATH=$STAGE/lib auditwheel repair \ + --plat "manylinux_${GLIBC}_aarch64" \ + --exclude 'libcuda.so.1' --exclude 'libcublas*' --exclude 'libcublasLt*' \ + --exclude 'libcudnn*' --exclude 'libcudart*' \ + -w "$DIST" "$WORK/wheel-raw-$py"/*.whl + done ls -la "$DIST"/*.whl } @@ -91,7 +104,7 @@ etape_check() { log "contrôles sans GPU" # shellcheck disable=SC1091 . "$WORK/venv/bin/activate" - pip install -q "$DIST"/ctranslate2-*.whl numpy pyyaml + pip install -q "$DIST"/ctranslate2-*-cp310-*.whl numpy pyyaml python3 - <<'PY' import ctranslate2, subprocess, glob, os print("ctranslate2", ctranslate2.__version__) diff --git a/versions.env b/versions.env index cb3c9bc..23691cb 100644 --- a/versions.env +++ b/versions.env @@ -12,3 +12,6 @@ CUDA_IMAGE=nvidia/cuda:13.0.1-cudnn-devel-ubuntu22.04 # CTranslate2 ajoute les siens à la suite (list(APPEND CUDA_NVCC_FLAGS)). CUDA_ARCH_LIST="8.7;9.0" CUDA_NVCC_EXTRA="-gencode;arch=compute_121,code=[sm_121,compute_121]" +# CPython visés par les roues (uv les télécharge) : 3.10 (Ubuntu 22.04), +# 3.12 (DGX OS / Ubuntu 24.04), et les intermédiaires/suivants des venv uv. +PYTHON_VERSIONS="3.10 3.11 3.12 3.13 3.14"