OpenNMT / OpenNMT/CTranslate2

Source builds need workarounds for sdist, CUDA arches, non-x86 CPU dispatch, and setup.py hardcoding

Open
#2,082 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
4.7k
Forks
536
Avg merge
12h 12m
Merged PRs (30d)
4

Description

Building CTranslate2 from source currently needs multiple downstream workarounds. Core upstream issues:

  1. No PyPI sdist (highest impact)
    CTranslate2 publishes wheels but not source distributions, which forces custom source-resolution logic.
    Ask: Publish sdists to PyPI.

  2. Deprecated FindCUDA path breaks Blackwell arch handling (related: #1933)
    Current FindCUDA/select_compute_arch.cmake behavior drops newer multi-digit CUDA arch majors, requiring manual -gencode fixes.
    Ask: Migrate to FindCUDAToolkit + CMAKE_CUDA_ARCHITECTURES.

  3. ENABLE_CPU_DISPATCH breaks on unsupported non-x86/non-arm64 arches
    CPU_ISA_DISPATCH is undefined on targets like ppc64le/s390x.
    Ask: Add support or gracefully disable/fallback on unsupported arches.

  4. setup.py hardcodes absolute rpaths (related context: #1704)
    Absolute paths reduce wheel relocatability.
    Ask: Use $ORIGIN-relative rpaths by default.

  5. setup.py hardcodes GCC-specific flags (related: #1704)
    Flags like -fvisibility=hidden and -fno-openmp-implicit-rpath can fail on clang/amdclang.
    Ask: Gate flags by compiler/toolchain detection.

These fixes would significantly improve portability and reduce downstream patching.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the packaging setup.py and the deprecated FindCUDA/select_compute_arch.cmake path first, then locate ENABLE_CPU_DISPATCH and CPU_ISA_DISPATCH handling for unsupported architectures. Check how source distributions and wheels are configured. Done means sdists publish successfully, CUDA architectures work, unsupported CPU targets fall back cleanly, and rpaths and compiler flags are portable.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, python
Domain
build-system, operating-systems, release
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.