You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Philipp Moritz <pc...@gmail.com> on 2021/09/10 07:12:08 UTC

[Python] manylinux2014 and _GLIBCXX_USE_CXX11_ABI setting

Dear all,

how do you think _GLIBCXX_USE_CXX11_ABI should be set for manylinux2014
(and manylinux2010) wheels? Should it be 0 or 1? Unfortunately I don't see
https://www.python.org/dev/peps/pep-0599/ or
https://github.com/pypa/manylinux specifying it. I think for manylinux1 the
common wisdom was to set it to 0. It would then also make sense to have the
same setting for the later wheels since the manylinux* wheels are supposed
to be compatible with each other. Which is a bummer since that means we
cannot use the new ABI (and std::list::size() is O(n) in the old one as far
as I know).

My understanding is that PyTorch is setting it to 0 (based on
https://github.com/pytorch/pytorch/issues/51039) and so does TensorFlow (
https://github.com/tensorflow/tensorflow/blob/5dcfc51118817f27fad5246812d83e5dccdc5f72/tensorflow/tools/dockerfiles/tests/build-cpu.sh#L35).
It looks like in Arrow we are setting it to 1 since
https://github.com/apache/arrow/commit/de7198274a3a2c90af765d55838e4f4339bae84f
.

It would be great to have some clarity around this in the community and
make sure we all use the same setting to avoid subtle incompatibilities.
I'm specifically asking because in Ray we are currently deciding on how it
should be set (see https://github.com/ray-project/ray/pull/18273).

Thanks in advance for your input!

Best,
Philipp.

Re: [Python] manylinux2014 and _GLIBCXX_USE_CXX11_ABI setting

Posted by Keith Kraus <ke...@voltrondata.com>.
Apologies, libstdc++ is what I meant (too used to arguing about glibc
compatibility). Devtoolset forcibly disables the `_GLIBCXX_USE_CXX11_ABI`
flag because the mixed linkage model it uses can't support it:
https://bugzilla.redhat.com/show_bug.cgi?id=1546704. RHEL / CentOS 8 does
support the new ABI.

-Keith

On Fri, Sep 10, 2021 at 11:13 AM Antoine Pitrou <an...@python.org> wrote:

>
> Le 10/09/2021 à 17:05, Keith Kraus a écrit :
> > For what it's worth, setting it to 1 as opposed to 0 will make the
> package
> > incompatible with CentOS / RHEL 7 as the glibc they ship does not support
> > the new ABI.
>
> It is not about the glibc, it's about the stdlibc++.
>
>
> >
> > -Keith
> >
> > On Fri, Sep 10, 2021, 4:53 AM Philipp Moritz <pc...@gmail.com> wrote:
> >
> >> Ah ok, that makes sense! I'm also not even sure if
> >> _GLIBCXX_USE_CXX11_ABI=0 was ever mandated on manylinux1, it might
> >> just be a community convention.
> >>
> >> I posted
> >>
> >>
> https://discuss.python.org/t/how-to-set-glibcxx-use-cxx11-abi-for-manylinux2014-and-manylinux2010-wheels/10551
> >> ,
> >> we can shift the discussion there.
> >>
> >> On Fri, Sep 10, 2021 at 1:45 AM Antoine Pitrou <an...@python.org>
> wrote:
> >>
> >>>
> >>> Le 10/09/2021 à 10:05, Philipp Moritz a écrit :
> >>>> Thanks for your answer Antoine!
> >>>>
> >>>> Considering your first comment, there is a section in
> >>>> https://www.python.org/dev/peps/pep-0571 under "Backwards
> >> compatibility
> >>>> with manylinux1 wheels" that states
> >>>> "manylinux1 wheels are considered manylinux2010 wheels" and the same
> >>> remark
> >>>> in https://www.python.org/dev/peps/pep-0599/ for manylinux2014 about
> >>>> compatibility with both manylinux2010 and manylinux1.
> >>>
> >>> As far as I understand, this sentence is talking about system
> >>> compatibility: if you can use manylinux2010 wheels on a system, you can
> >>> also use manylinux1 wheels. That doesn't necessarily mean a manylinux1
> >>> wheel will nicely interoperate with a manylinux2010 wheel that would
> >>> expose the same symbols.
> >>>
> >>> It seems wheel-to-wheel interoperability is a grey area of the
> manylinux
> >>> specs.  To their credit, though, the issues with C++ symbol / ABI
> >>> conflicts are pretty abstruse and almost impossible to predict.
> >>>
> >>> Regards
> >>>
> >>> Antoine.
> >>>
> >>
> >
>

Re: [Python] manylinux2014 and _GLIBCXX_USE_CXX11_ABI setting

Posted by Antoine Pitrou <an...@python.org>.
Le 10/09/2021 à 17:05, Keith Kraus a écrit :
> For what it's worth, setting it to 1 as opposed to 0 will make the package
> incompatible with CentOS / RHEL 7 as the glibc they ship does not support
> the new ABI.

It is not about the glibc, it's about the stdlibc++.


> 
> -Keith
> 
> On Fri, Sep 10, 2021, 4:53 AM Philipp Moritz <pc...@gmail.com> wrote:
> 
>> Ah ok, that makes sense! I'm also not even sure if
>> _GLIBCXX_USE_CXX11_ABI=0 was ever mandated on manylinux1, it might
>> just be a community convention.
>>
>> I posted
>>
>> https://discuss.python.org/t/how-to-set-glibcxx-use-cxx11-abi-for-manylinux2014-and-manylinux2010-wheels/10551
>> ,
>> we can shift the discussion there.
>>
>> On Fri, Sep 10, 2021 at 1:45 AM Antoine Pitrou <an...@python.org> wrote:
>>
>>>
>>> Le 10/09/2021 à 10:05, Philipp Moritz a écrit :
>>>> Thanks for your answer Antoine!
>>>>
>>>> Considering your first comment, there is a section in
>>>> https://www.python.org/dev/peps/pep-0571 under "Backwards
>> compatibility
>>>> with manylinux1 wheels" that states
>>>> "manylinux1 wheels are considered manylinux2010 wheels" and the same
>>> remark
>>>> in https://www.python.org/dev/peps/pep-0599/ for manylinux2014 about
>>>> compatibility with both manylinux2010 and manylinux1.
>>>
>>> As far as I understand, this sentence is talking about system
>>> compatibility: if you can use manylinux2010 wheels on a system, you can
>>> also use manylinux1 wheels. That doesn't necessarily mean a manylinux1
>>> wheel will nicely interoperate with a manylinux2010 wheel that would
>>> expose the same symbols.
>>>
>>> It seems wheel-to-wheel interoperability is a grey area of the manylinux
>>> specs.  To their credit, though, the issues with C++ symbol / ABI
>>> conflicts are pretty abstruse and almost impossible to predict.
>>>
>>> Regards
>>>
>>> Antoine.
>>>
>>
> 

Re: [Python] manylinux2014 and _GLIBCXX_USE_CXX11_ABI setting

Posted by Keith Kraus <ke...@voltrondata.com>.
For what it's worth, setting it to 1 as opposed to 0 will make the package
incompatible with CentOS / RHEL 7 as the glibc they ship does not support
the new ABI.

-Keith

On Fri, Sep 10, 2021, 4:53 AM Philipp Moritz <pc...@gmail.com> wrote:

> Ah ok, that makes sense! I'm also not even sure if
> _GLIBCXX_USE_CXX11_ABI=0 was ever mandated on manylinux1, it might
> just be a community convention.
>
> I posted
>
> https://discuss.python.org/t/how-to-set-glibcxx-use-cxx11-abi-for-manylinux2014-and-manylinux2010-wheels/10551
> ,
> we can shift the discussion there.
>
> On Fri, Sep 10, 2021 at 1:45 AM Antoine Pitrou <an...@python.org> wrote:
>
> >
> > Le 10/09/2021 à 10:05, Philipp Moritz a écrit :
> > > Thanks for your answer Antoine!
> > >
> > > Considering your first comment, there is a section in
> > > https://www.python.org/dev/peps/pep-0571 under "Backwards
> compatibility
> > > with manylinux1 wheels" that states
> > > "manylinux1 wheels are considered manylinux2010 wheels" and the same
> > remark
> > > in https://www.python.org/dev/peps/pep-0599/ for manylinux2014 about
> > > compatibility with both manylinux2010 and manylinux1.
> >
> > As far as I understand, this sentence is talking about system
> > compatibility: if you can use manylinux2010 wheels on a system, you can
> > also use manylinux1 wheels. That doesn't necessarily mean a manylinux1
> > wheel will nicely interoperate with a manylinux2010 wheel that would
> > expose the same symbols.
> >
> > It seems wheel-to-wheel interoperability is a grey area of the manylinux
> > specs.  To their credit, though, the issues with C++ symbol / ABI
> > conflicts are pretty abstruse and almost impossible to predict.
> >
> > Regards
> >
> > Antoine.
> >
>

Re: [Python] manylinux2014 and _GLIBCXX_USE_CXX11_ABI setting

Posted by Philipp Moritz <pc...@gmail.com>.
Ah ok, that makes sense! I'm also not even sure if
_GLIBCXX_USE_CXX11_ABI=0 was ever mandated on manylinux1, it might
just be a community convention.

I posted
https://discuss.python.org/t/how-to-set-glibcxx-use-cxx11-abi-for-manylinux2014-and-manylinux2010-wheels/10551
,
we can shift the discussion there.

On Fri, Sep 10, 2021 at 1:45 AM Antoine Pitrou <an...@python.org> wrote:

>
> Le 10/09/2021 à 10:05, Philipp Moritz a écrit :
> > Thanks for your answer Antoine!
> >
> > Considering your first comment, there is a section in
> > https://www.python.org/dev/peps/pep-0571 under "Backwards compatibility
> > with manylinux1 wheels" that states
> > "manylinux1 wheels are considered manylinux2010 wheels" and the same
> remark
> > in https://www.python.org/dev/peps/pep-0599/ for manylinux2014 about
> > compatibility with both manylinux2010 and manylinux1.
>
> As far as I understand, this sentence is talking about system
> compatibility: if you can use manylinux2010 wheels on a system, you can
> also use manylinux1 wheels. That doesn't necessarily mean a manylinux1
> wheel will nicely interoperate with a manylinux2010 wheel that would
> expose the same symbols.
>
> It seems wheel-to-wheel interoperability is a grey area of the manylinux
> specs.  To their credit, though, the issues with C++ symbol / ABI
> conflicts are pretty abstruse and almost impossible to predict.
>
> Regards
>
> Antoine.
>

Re: [Python] manylinux2014 and _GLIBCXX_USE_CXX11_ABI setting

Posted by Antoine Pitrou <an...@python.org>.
Le 10/09/2021 à 10:05, Philipp Moritz a écrit :
> Thanks for your answer Antoine!
> 
> Considering your first comment, there is a section in
> https://www.python.org/dev/peps/pep-0571 under "Backwards compatibility
> with manylinux1 wheels" that states
> "manylinux1 wheels are considered manylinux2010 wheels" and the same remark
> in https://www.python.org/dev/peps/pep-0599/ for manylinux2014 about
> compatibility with both manylinux2010 and manylinux1.

As far as I understand, this sentence is talking about system 
compatibility: if you can use manylinux2010 wheels on a system, you can 
also use manylinux1 wheels. That doesn't necessarily mean a manylinux1 
wheel will nicely interoperate with a manylinux2010 wheel that would 
expose the same symbols.

It seems wheel-to-wheel interoperability is a grey area of the manylinux 
specs.  To their credit, though, the issues with C++ symbol / ABI 
conflicts are pretty abstruse and almost impossible to predict.

Regards

Antoine.

Re: [Python] manylinux2014 and _GLIBCXX_USE_CXX11_ABI setting

Posted by Philipp Moritz <pc...@gmail.com>.
Thanks for your answer Antoine!

Considering your first comment, there is a section in
https://www.python.org/dev/peps/pep-0571 under "Backwards compatibility
with manylinux1 wheels" that states
"manylinux1 wheels are considered manylinux2010 wheels" and the same remark
in https://www.python.org/dev/peps/pep-0599/ for manylinux2014 about
compatibility with both manylinux2010 and manylinux1.

I agree we should bring this up in https://discuss.python.org/c/packaging/14.
Especially because hopefully one day we can get rid
of _GLIBCXX_USE_CXX11_ABI=0
and it is possible that will need a bit more coordination across the Python
community. I'm happy to get a discussion started over there.

On Fri, Sep 10, 2021 at 12:40 AM Antoine Pitrou <an...@python.org> wrote:

>
> Le 10/09/2021 à 09:12, Philipp Moritz a écrit :
> > Dear all,
> >
> > how do you think _GLIBCXX_USE_CXX11_ABI should be set for manylinux2014
> > (and manylinux2010) wheels? Should it be 0 or 1? Unfortunately I don't
> see
> > https://www.python.org/dev/peps/pep-0599/ or
> > https://github.com/pypa/manylinux specifying it. I think for manylinux1
> the
> > common wisdom was to set it to 0. It would then also make sense to have
> the
> > same setting for the later wheels since the manylinux* wheels are
> supposed
> > to be compatible with each other.
>
> Are they? Where it is specified that they should be compatible?
>
> > It would be great to have some clarity around this in the community and
> > make sure we all use the same setting to avoid subtle incompatibilities.
>
> Perhaps this should be asked more widely on
> https://discuss.python.org/c/packaging/14 ?
>
> Regards
>
> Antoine.
>

Re: [Python] manylinux2014 and _GLIBCXX_USE_CXX11_ABI setting

Posted by Antoine Pitrou <an...@python.org>.
Le 10/09/2021 à 09:12, Philipp Moritz a écrit :
> Dear all,
> 
> how do you think _GLIBCXX_USE_CXX11_ABI should be set for manylinux2014
> (and manylinux2010) wheels? Should it be 0 or 1? Unfortunately I don't see
> https://www.python.org/dev/peps/pep-0599/ or
> https://github.com/pypa/manylinux specifying it. I think for manylinux1 the
> common wisdom was to set it to 0. It would then also make sense to have the
> same setting for the later wheels since the manylinux* wheels are supposed
> to be compatible with each other.

Are they? Where it is specified that they should be compatible?

> It would be great to have some clarity around this in the community and
> make sure we all use the same setting to avoid subtle incompatibilities.

Perhaps this should be asked more widely on 
https://discuss.python.org/c/packaging/14 ?

Regards

Antoine.