OpenNMT / OpenNMT/CTranslate2

how to build, so that auditwheel can bundle dependencies

Open
#1,892 1 comment 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

When build like this, and then install, and make the python wheel,

cmake \
    -DCMAKE_PREFIX_PATH=/opt/intel/oneapi/mkl/latest \
    -DWITH_MKL=ON \
    -DBLA_VENDOR=Intel \
    -DMKL_INCLUDE_DIR=/opt/intel/oneapi/mkl/latest/include \
    -DMKL_LIBRARY_DIR=/opt/intel/oneapi/mkl/latest/lib \
    -DCMAKE_INSTALL_PREFIX=$PWD/install \
    -DBUILD_TESTS=OFF \
    -DWITH_DNNL=OFF \
    -DWITH_CUDA=ON \
    -DWITH_CUDNN=ON \
    -DCUDA_ARCH_LIST=Common \
    -DWITH_OPENBLAS=OFF \
    -DCUDA_DYNAMIC_LOADING=OFF \
    ..

auditwheel does not see the dependencies (libctranslate2.so specially), and so does not bundle them:

~/ai/CTranslate2/python$ auditwheel show dist/ctranslate2-4.6.0-cp311-cp311-linux_x86_64.whl 

ctranslate2-4.6.0-cp311-cp311-linux_x86_64.whl is consistent with the
following platform tag: "linux_x86_64".

The wheel references external versioned symbols in these
system-provided shared libraries: libgcc_s.so.1 with versions
{'GCC_3.0'}, libc.so.6 with versions {'GLIBC_2.4', 'GLIBC_2.34',
'GLIBC_2.14', 'GLIBC_2.32', 'GLIBC_2.2.5'}, libstdc++.so.6 with
versions {'CXXABI_1.3.9', 'GLIBCXX_3.4.14', 'GLIBCXX_3.4.9',
'GLIBCXX_3.4.11', 'CXXABI_1.3', 'CXXABI_1.3.13', 'CXXABI_1.3.11',
'CXXABI_1.3.2', 'GLIBCXX_3.4.18', 'CXXABI_1.3.5', 'GLIBCXX_3.4.19',
'GLIBCXX_3.4', 'GLIBCXX_3.4.15', 'GLIBCXX_3.4.20', 'GLIBCXX_3.4.29',
'GLIBCXX_3.4.21', 'CXXABI_1.3.3'}

This constrains the platform tag to "manylinux_2_34_x86_64". In order
to achieve a more compatible tag, you would need to recompile a new
wheel from source on a system with earlier versions of these
libraries, such as a recent manylinux image.

What should I do to resolve this please?

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

Start by reproducing the shown CMake configuration and building the wheel in python/dist, then run auditwheel show on the generated ctranslate2 wheel. Trace how libctranslate2.so and its dependencies are installed and discovered during wheel inspection. Done means the resulting wheel has the intended bundled dependencies and auditwheel reports the expected compatibility tag.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, python
Domain
build-system, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.