-
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
Cannot build C++14 in docker images #118
Comments
Unfortunately there aren't any compilers that both support c++14 and can generate manylinux1-compatible (= centos 5 compatible) builds. However, there is a plan to define |
Thank you for this quick reply. Meanwhile, while lacking such a newer standard, what would be the best way forward, on the short term? 'Downgrading' my C++14 code to 11, or building on another system (e.g., Travis CI's Ubuntu 12.04 (precise))? |
If you can downgrade your code to c++11, then that'll be the most reliable option, yeah. If you build on another system, then your wheels won't be I think the manylinux2/3 to-do list is actually pretty approachable if you want to go that way; most of it should be possible to copy directly from the manylinux1 equivalents. In any case, good luck! |
If you're really careful, it might be possible to use a newer version of |
Can't you (1) install a new gcc in the docker container and then (2) just vendor libstdc++ |
@rmcgibbo Thanks, not sure how easy that is (though I'll pay around a little bit, next week), but it's a very nice read on the actual problem! @mpharrigan The problem is that I can't find a GCC >= 5 for CentOS 5, so are you suggesting to build from source? |
Building a recent toolchain and then vendoring libstdc++ would indeed work AFAIK, though I don't know how easy it is. |
Yeah |
Right, I'll give these different options a shot, over the course of the next week, and see what works best in my case. |
I've built multilib GCC 6.3 for Centos 5 for Porable PyPy project: https://github.com/squeaky-pl/centos-devtools/releases If you manage to convince manylinux docker image to use this compiler instead it might work. You would need to untar it to your root and then use
|
@squeaky-pl: that's impressive. i'm eager to hear if it works for the manylinux case. if so, that would be fantastic. |
Wow, this is brilliant! Unpacking and compiling seems to be working like a charm, on my local docker image. However, I'm still running into a problem with
So, @squeaky-pl, is your GCC 6.3 also using a more recent version of CXXABI than the standard one on the |
I am not quite sure because I don't work with C++ at all. The compiler was compiled itself on Centos 5 but of course C++ standard library evolved quite a lot since GCC 4.8. The PEP itself says:
So probably this is |
@YannickJadoul what about feeding |
Hmmm, I don't know, but I can give that a shot tomorrow. But I'm guessing there's a reason this isn't that standard approach, or not? Any experience with what the size increase of the wheel would be? |
I think the issue here is that auditwheel assumes that you want to use the system libstdc++, so when it sees that you're using a newer version it just says "nope, not manylinux!" instead of invoking its vendoring logic. Maybe there should be a way to tell it that no, you really do want to vendor libstdc++ (or similar).
|
That dóes work!
Gives me an increase in size from about 2.1 MB ( |
Sweet. It's not really any more of a hack then anything else involved in shipping portable binaries – it's just that this time you got a peek behind the covers at the kind of thing that the docker image and auditwheel are trying to hide from you :-). In the longer run switching to manylinux2/3 is probably a better solution (if only so you don't have to keep maintaining your own toolchain forever!), but I don't think you need to feel bad about it or anything. Btw parselmouth looks super cool. |
I would say it would be cool (even in the future manylinux2) to let people use whatever C++ standard version they want especially when C++ goes so fast these days. It would be nice to show people that they can use newer compiler and get more manylinux packages, I don't mind maintaining that GCC because I've been doing that already for 3 years. |
@squeaky-pl: it's much less of an issue though for manylinux2/3, because for centos6/7 redhat is maintaining more up to date devtools compilers. |
...though actually it looks like the latest devtoolset compiler is GCC 5.3, so... maybe I'm wrong. |
@njsmith Thanks for the insight! And I dó like the fact that I've now got binary manylinux wheels :-) I'd actually still be interested in helping with the manylinux2/3, on the longer term, though I don't think I have all the necessary practical knowledge and experience to do all this. Also, the main 'magic' of Parselmouth is still in the pybind11 library, as far as I'm concerned; that thing is really awesome ;-) |
@squeaky-pl Just out of curiosity: did you actually have to come up with some tricks in order to get that CentOS 5 distribution of GCC 6, or was is 'just a matter of compiling' ? |
@YannickJadoul There are no tricks as far as I know. There is "standard GCC bootstraping pain" that might look tricky to somebody who never built GCC from source but it's no different than compiling GCC on a recent distribution in the end. https://github.com/squeaky-pl/centos-devtools you can look into build and build_deps if you are curious. |
I think it would be great if we could add some of the information in this thread as instructions for getting modern C++ working in the manylinux1 container to the wiki or readme or something. I think many people would benefit from them.
…Sent from my iPhone
On Jun 15, 2017, at 2:23 PM, Yannick Jadoul ***@***.***> wrote:
@njsmith Thanks for the insight! And I dó like the fact that I've now got binary manylinux wheels :-)
I'd actually still be interested in helping with the manylinux2/3, on the longer term, though I don't think I have all the necessary practical knowledge and experience to do all this.
Also, the main 'magic' of Parselmouth is still in the pybind11 library, as far as I'm concerned; that thing is really awesome ;-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Is there any possibility of getting runtime problems if a user imports two packages that both use compiled c++ code that statically links different versions of libstdc++?
…Sent from my iPhone
On Jun 15, 2017, at 2:23 PM, Yannick Jadoul ***@***.***> wrote:
@njsmith Thanks for the insight! And I dó like the fact that I've now got binary manylinux wheels :-)
I'd actually still be interested in helping with the manylinux2/3, on the longer term, though I don't think I have all the necessary practical knowledge and experience to do all this.
Also, the main 'magic' of Parselmouth is still in the pybind11 library, as far as I'm concerned; that thing is really awesome ;-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@rmcgibbo: If you have two extension modules that use C++ internally but that only communicate via python interfaces (i.e., they're not directly linking to each other or smuggling function pointers through pycapsules or something), then you should be OK with either static linking or vendoring libstdc++. (Watch out for cython's Also, that's assuming that you're using the standard Python interpreter. If you have Python embedded inside a C++ program then I think statically linking libstdc++ will be ok, but vendoring libstdc++ using auditwheel would not. So like, if you think someone might want to use your extension module from inside blender, then stick to statically linking libstdc++ or use the system libstdc++; don't try to vendor libstdc++. |
Actually that blender case is a pretty subtle gotcha – maybe that's an argument for not supporting libstdc++ vendoring in auditwheel, and recommending that people who need a newer libstdc++ do static linking. |
Side note. I pushed GCC 7.1 release: https://github.com/squeaky-pl/centos-devtools/releases/tag/7.1 |
@squeaky-pl I've finally gotten to using your binaries, and they're great! Thanks! Things work out fine on 64-bit. However, it seems as if that's ónly 64-bit, since my 32-bit builds are failing? Am I doing something wrong, or can't I use these binaries to build on the i686 manylinux docker image? (EDIT: more specifically, the error seems to be centered around |
Anaconda's download page puts 64-bit first and the (unlabeled) "Download" button downloads 64-bit: https://www.anaconda.com/distribution/#download-section This would suggest doing so can't be causing that many problems for a reasonably diverse category of Python users with modern computers. |
Excellent @matthew-brett, I did not realize the pypi stats were on BigQuery 👍 |
There are still a decent number of 32-bit only Windows users (based on Microsoft telemetry, not the python.org downloads), and the "default option" ought to work for them. And 32-bit processes work just fine on 64-bit Windows, which means everybody gets a working download. (That said, the Store package only has 64-bit. I'm waiting for complaints before adding a 32-bit package there, but haven't heard any yet :) ) The 32-bit version has a few advantages, even on a 64-bit OS (mostly lower memory usage), so I wouldn't expect it to go away. Certainly not for any current releases (e.g. if 3.8 was the first version to not provide 32-bit builds then you'll have to wait until all other versions are gone before finding any benefit). But if we get to a point where 32-bit Windows is no longer present then eventually the 32-bit builds will disappear. |
@tstenner @TkTech I wonder if you could update your tstenner/manylinux:gcc9.1.0 docker image so that it supports Python 3.8?
https://travis-ci.org/fonttools/skia-pathops/builds/618707554 |
@anthrotype You should just be able to take @TkTech's dockerfile, and rebuild that. Since the |
ah! thanks, it was in this very thread and I missed that :) |
I'm attempting to automate it with Github Actions so in the future new images should become available any time manylinux or gcc have a release. |
I tried this, but the version of gcc is old, is there anything special to enable a new gcc and g++?
|
This has been possible in manylinux2014 for quite some time now (gcc 10 toolchain). Older images are EOL (and manylinux_2_24 is deprecated) too will close this one. |
Hello. I'm in the situation where I have a C++14 extension (using the brilliant (pybind11)[https://github.com/pybind/pybind11] library), but the GCC version installed on the docker images are 4.8 and do not support the C++14 standard.
Is there a way I can get around this, and would still be able to produce
manylinux1
wheels?The text was updated successfully, but these errors were encountered: