-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCC version in manylinux_2_24 #1012
Comments
Maybe https://stackoverflow.com/questions/61590804/how-to-install-gcc-9-on-debianlatest-docker as long as it doesn’t update glibc by upgrading to a new os (which it might...), this should work like the dev toolset, I think? |
Once you install gcc-9, it will update at least manylinux_2_24 is mostly beneficial for alternate architectures where some functions were fixed in glibc (reported by numpy). |
Unfortunately, the 6.3.10 version of gcc is too old to compile OpenBLAS on arm64, I get a |
Not at all surprised. You want the most recent GCC possible for alternative archs. |
@h-vetinari @mattip, there are still a number of possibilities for OpenBLAS/numpy:
This would be the preferred option but, as mentioned in a previous comment, I simply can't take on this one but will be happy to review a PR doing that as it would benefit the whole manylinux ecosystem (checking it respects original symbol requirements for manylinux_2_24 and reliability/maintainability of proposed packages)
Allows to remove
It should produce a shared library that's perfectly valid on manylinux_2_24.
While I would not recommend it as a generic toolchain for the manylinux_2_24 image (libstdc++ issue), this one might be well suited for NumPy/OpenBLAS. OpenBLAS built successfully on the aarch64 manylinux_2_24 image using this toolchain with no extra non-compliant symbols:
Despite Ubuntu 18.04 not being listed as a potential manylinux candidate over at https://github.com/mayeut/pep600_compliance, it's only because the symbol analysis is done on libstdc++ (gcc 8 based) rather than on the default compiler used (gcc 7) |
We need newer compilers with older images; requiring the wheel to be based on an OS newer than the compiler doesn't work well. If you want to use GCC 9 or 10, now even 2_28 would be to old. This was available with RHEL based images, so it should(*) be possible here, too. CentOS 6 has GCC 8, and that's 2_12. *: No statement about how hard it is, just that it should be possible. |
That's quite a wide gap to bridge. Scipy is just recently thinking about bumping their gcc lower bound from 4.8 to 5.5 (not least due to being buildable on more exotic platforms) - the point being that I think very few projects can assume such modern compilers (with all that entails) for their entire user base.
RH presumably spent a non-trivial amount of time on that... Don't get me wrong, that'd be awesome to have, but I'm thinking that even "cutting-edge" packages should normally be fine with the compilers of a ~2 year old mainstream distro. That's part of the appeal of the perennial manylinux, IMO, because maintainers can choose themselves where they want to set their cutoff (assuming pypa would provide all those images).
Photon already has a number of compatibility issues, apparently. From the POV of a maintainer, I want to cover the largest possible portion of my user base (vis-à-vis trade-offs in terms of maintainability) - and it's IMO a legitimate choice not to care about fringe distros (where users can still build from source, and are presumably used to that anyway). |
Yes, it's fully headless and does not provide any libraries like X11. It's not a major issue but it's mentioned anyway. If one is using Photon, I guess they know it only works this way and won't rely on packages requiring these dependencies (e.g. use
Agreed, it's obviously up to the package maintainers to decide what they want to support. However, there's no reason for manylinux to knowingly provide images that are not compliant with PEP600. |
I did some experiments with PPA in the openblas PR. It seems to be the way to go to update the toolchain here. 1st experiments:
|
Regarding the toolchain issues, you might be interested how https://github.com/symengine/symengine-wheels handles this (because it builds based on conda-packages, which are compiled with much newer compilers). |
Yes, build gcc 10 with the patches from https://git.centos.org/rpms/devtoolset-10-gcc/blob/c7/f/SOURCES. |
would you be willing to contribute a PPA which provide such installable artefacts and maintain those ? PS, they do not only patch |
Nope. Sorry. |
Thanks for the link. Since those are tricks I'm certainly not comfortable getting those toolchains as default ones but these options are here for anyone interested in using them. |
2nd round of experiments with PPA
gcc is just a backport of hirsute gcc-10.3.0-1ubuntu1 with some features disabled (https://launchpadlibrarian.net/536669609/gcc-10_10.3.0-1ubuntu1_10.3.0-1ubuntu1~16.04.8.mayeut1.diff.gz) |
@mayeut any progress around this? Is there a PR somewhere? |
no progress since my last comment.
for gcc, I'm not likely to work more on this. I'm lacking experience to understand the patches from RH and in debian packaging to make this a clean installable package that won't mess with the system libraries. |
I compile a performance sensitive module. |
I will maintain that it could very well be that 2_28 is a better trade-off overall. 2_24 has been stuck for months; 2_28 would work more or less with out-of-the- And obviously 2_24 could still be added afterwards, once the work for it converges. |
It seems that only with https://github.com/mayeut/pep600_compliance#pep600-compliance-check |
From that table, at each manylinux click we would
Project who wish to support centos7/rhubi7 will need manylinux2_17 (manylinux2014) until 2024. It seems amazon2 supports yum and installs gcc 7.3.1 as a base package, so maybe manylinux2_26 is a viable target? The image is available from docker |
I think you're off-by-one here, as in: the right column needs to be shifted one row down. In particular |
@h-vetinari thanks, I rephrased the top line of the comment. The table column heading was correct. |
Based on current data from the pep-compliance repo, the EOL of manylinux_2_24 is imminent. I've opened a separate issue to discuss this: #1332 |
#1369 will drop support for manylinux_2_24 images on January 1st, 2023. This issue will never be fixed. |
If we split the problem in two parts: the compiler and the runtime(gcc_s and libstdc++), we could find a different solution that just solves the first part. We may do cross-compiling with a very new C/C++ compiler(either GCC or LLVM/Clang) and an old rootfs that contains old version of Glibc/libstdc++/gcc_s/ ... . Then we do not have to depend on RHEL's devtoolset, and do not have to bind ourselves to a specific Linux distro. You may still use the latest C++ grammar, if the new grammar doesn't require a new runtime support. For example, you can use C++17 and target Ubuntu 16.04 but you cannot use C++17's std::filesystem library. I think this limitation is acceptable because anyway you cannot make it work on Apple's operating systems. If an open source project supports Linux, most likely it supports macOS too. The same concern applies. With this approach, we still can get many benefits from the new compiler and toolchain that:
|
Yeah, except then every project would need to learn which C++ features require runtime support, which is really not realistic. People would get it wrong all the time, and stuff would definitely break. |
Also, I know one of the issues is that the special arches generally require newer compilers. The reason NumPy couldn't use manylinux_2_24 wan't due to C++ features (they didn't use any), but because the old compiler was buggy on other architectures, they required 6.3+ or something like that. (Maybe it's just the compiler, and the libs are fine, but I'd be a bit worried) |
If it does not work, you will get a compile time error instead of a runtime error, so it is easy to handle. macOS already works in this way. The C++17 filesystem limitation is a well-known issue among iOS developers. So it is not unacceptable. Also, my proposal has another benefit: better 32-bit support. Nowadays it's often seen a single compiler process takes more than 1GB memory, but a 32-bit system only has 2GB usermode address space. When you see GCC/LD hit the limitation, nothing else you can do. |
The beginning of the comments in this issue, closed for a year and a half, talked about how there is not a package with a split between the compiler and runtime. Is there now such a package or are you suggesting building a new compiler package? Who would maintain it? Where would it live? |
@snnn I'm not sure that's accurate. Why would you get a compiler error if you reference a symbol in the newer libstdc++? If you set things up so that the older |
Here are the details:
Then in the container do:
Then, outside of the docker container, get a bash and run
to get the docker instance id, then use clang -o t test.c --sysroot=/crossrootfs -v -fuse-ld=lld "/crossrootfs" is where the tarball was extracted to. If you think this idea is acceptable, then you can rebuild the manylinux_2_28_x86_64 with a different base image that you want to target to, for example, Ubuntu 16.04 or UBI8. If you use a standard UBI8 image from RH and do not manually install additional RPM packages there, you are guaranteed that it will receive good vulnerability management service from RH for free for many many years. The warranty is for the image you downloaded from RH, not RPM packages.
We do not need to build a custom compiler. We can get everything we need from the operating system's package manager, or from other vendors. For example, you may use Ubuntu 22.04 as the host OS, then get the latest LLVM from https://releases.llvm.org/. The compiler should have very decent support for every new hardware. |
I think that there are 3/4 different problems that are currently addressed by
@snnn, do you have a PoC somewhere (rather than the few commands posted here) ? I'd like to dig into this a bit more. |
The GCC version in manylinux1 is 4.8, painfully old, unable to build C++14 code (see #118). It’s actually possible to build GCC 9 on CentOS 5, though support was removed in GCC 10.
The GCC version in manylinux2010 is 8.3, new enough for basically full C++17 support minus a few library features.
The GCC version in manylinux2014 is 9.3, full support for C++17 and even bits of C++20.
The GCC version in manylinux_2_24 is a dismal 6.3, much worse than both the year based manylinuxes and not even new enough for C++17 language support (mostly added in GCC 7)! This is a huge step backward for an image with a higher GLIBC version. (PS: listing the GLIBC versions of the older manylinuxes would be nice, IMO)
Is there some way to replicate the “RHEL dev toolset” in the Debian based images?
The text was updated successfully, but these errors were encountered: