apple / apple/coremltools

import coremltools fails with missing symbol on CentOS 7

Open
#1,549 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
5.4k
Forks
850
Avg merge
4d 5h
Merged PRs (30d)
10

Description

## 🐞Describing the bug
import coremltools fails with missing symbol on CentOS 7

## Stack Trace
```
Traceback (most recent call last):
File "", line 1, in
File "/opt/_internal/cpython-3.9.13/lib/python3.9/site-packages/coremltools/__init__.py", line 72, in
from . import converters
File "/opt/_internal/cpython-3.9.13/lib/python3.9/site-packages/coremltools/converters/__init__.py", line 12, in
from ._converters_entry import convert
File "/opt/_internal/cpython-3.9.13/lib/python3.9/site-packages/coremltools/converters/_converters_entry.py", line 21, in
from coremltools.converters.mil.converter import mil_convert
File "/opt/_internal/cpython-3.9.13/lib/python3.9/site-packages/coremltools/converters/mil/converter.py", line 23, in
from coremltools.libmodelpackage import ModelPackage
ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /opt/_internal/cpython-3.9.13/lib/python3.9/site-packages/coremltools/libmodelpackage.so)
```

## To Reproduce
- Please add a minimal code example that can reproduce the error when running it.
```
docker run -it --rm quay.io/pypa/manylinux2014_x86_64
python3.9 -m pip install coremltools protobuf~=3.20.0
python3.9 -c 'import coremltools'
```

## System environment (please complete the following information):
- coremltools version: 5.2.0
- OS (e.g. MacOS version or Linux type): CentOS 7

## Additional context
The published wheel claims to be supported starting with glibc 2.5 (CentOS 5+): `manylinux1`
Running auditwheel shows that it's not the case:
```
python3.9 -m pip download --no-deps coremltools -d wheels
auditwheel show wheels/coremltools-5.2.0-cp39-none-manylinux1_x86_64.whl

coremltools-5.2.0-cp39-none-manylinux1_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.2.5', 'GLIBC_2.14',
'GLIBC_2.4', 'GLIBC_2.3.4', 'GLIBC_2.3', 'GLIBC_2.6'}, libstdc++.so.6
with versions {'GLIBCXX_3.4.9', 'GLIBCXX_3.4.20', 'GLIBCXX_3.4.18',
'GLIBCXX_3.4.14', 'CXXABI_1.3.3', 'GLIBCXX_3.4.21', 'GLIBCXX_3.4',
'GLIBCXX_3.4.11', 'CXXABI_1.3.9', 'CXXABI_1.3.5', 'CXXABI_1.3'},
libuuid.so.1 with versions {'UUID_1.0'}, libpthread.so.0 with versions
{'GLIBC_2.2.5'}

This constrains the platform tag to "manylinux_2_24_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.
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the import failure with the provided manylinux2014 Docker command and inspect the published coremltools wheel with auditwheel. Trace the dependency on libmodelpackage.so and verify that the resulting wheel’s platform tag and libstdc++ symbols support CentOS 7; done means the documented installation imports successfully there.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, linux, python
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.