-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
Removal of libstdc++ reminants from the stack on Mac #183
Comments
This sounds roughly the same as targeting different MSVC versions on Windows, is there a possibility to introduce a metapackage/feature selection here just as is being discussed for that? |
Thanks @jakirkham. Really useful information! How does this compare with the libraries available on |
FYI this is the other issue that I mentioned that came up in issue ( conda-forge/numpy-feedstock#15 ). |
However, the situation is not so bad as the C APIs between |
The point is we shouldn't be using |
On Fri, Jul 1, 2016 at 9:15 AM, jakirkham [email protected] wrote:
If you are using only C, are you using libstdc++ or libc++ at all? is the In any case, IIUC, libc++ (and clang) have been around for a long enough BTW, python3.6 isn't out yet, so there is room to update the compiler used If there is input from the computation computing community to python-dev, -CHB Christopher Barker, Ph.D. Emergency Response Division |
@jakirkham Thanks for writing this paper 👍 I do not question a As seen in conda-forge/gdal-feedstock#85 there are packages where As this is mainly to target osx libc++ issues I personally would split this into parts (osx-toolchain, linux-toolchain) or drop it completely on linux. |
Minor clarification. On Mac
I'm not really sure about all the things. Though there are many offerings in There are some libraries that use C++ internally, but only expose a C API. Those don't cause issues in terms of C++ object passing as they don't do it. Examples include SciPy as confirmed by @rgommers. Though I have had some installation issues on some customer machines that use 10.11. So, it might be best to avoid it in those case too. See PR ( conda-forge/scipy-feedstock#2 ) for the SciPy change to The few big ones that come to mind that could be issues are Boost. Though we have packaged this and ours uses Also, I am pretty sure Qt4 uses HDF5 was recently switched to I don't really know the extent and manner C++ is used in libraries like If things get too hairy, I'd be ok blasting |
IMO that is the way to proceed for now until we have a better solution. @gillins, @msarahan, @kmuehlbauer, @pelson and all of @conda-forge/core maybe we could take a vote on this? (It can be 👍 or 👎 here to reduce the noise.) |
No worries. It's an imperfect solution for an OS (OS X) that is in transition. Sadly they have not put
I have not followed that as closely as I probably need too. Was a bit worried that we were headed towards breakage in there. So I wanted to try and communicate everything I could to make sure we all understand the issues. I need to get my bearings with that PR. Maybe a short explanation of what is going at the bottom of that PR will help.
Feel free to apply the |
Sorry, this got lost in the mix @ChrisBarker-NOAA.
No. If you are all C, this doesn't matter basically.
Not really. This ends up getting baked into the OS. That being said, there is no problem passing back and forth C objects. So, C libraries can be built with either system compiler without issue. On Mac, this means that one is linked to
We should totally be able to standardize on However, the question came up a few weeks back about rebuilding and using the Continuum The question is what is soon for that switch. @msarahan estimated a week or two to build it. Though I think that is assuming that he gets a whole week or two to do so. In reality his time seems to be under high demand. So, I'm unclear whether it will happen in the next month or next few months. Also, this assumes we don't hit a big snag building
Haha. Yeah. We can see this is a bit tricky from experience. Though it is doable and I think @gillins and I have made progress at simplifying the situation. We might have to accept some less desirable things like patching
So, Python is all C. As stated before, this doesn't factor into the discussion. In fact, I think by having it only be C this problem is way simpler than it would be if it were C++.
Yeah, I have one computer that is a 6 year old MacBook Pro on 10.6 that is on its dying bed and it still has 64-bit. 10.7 had 64-bit only. Definitely time to cut the cord with 32-bit on Mac. So, dropping 32-bit means dropping 10.6. AFAICT Continuum only supports 10.7 and up. Also 10.7 includes the introduction of
A few weeks back we decided that we only care about 10.9 at conda-forge. It is probably the only issue I know of that had zero controversy and overwhelming support all the way up to demand. I'm all in favor of having us write a letter to get Python using |
On Fri, Jul 1, 2016 at 11:21 AM, jakirkham [email protected] wrote:
Personally, I think 3.6 should dump 32 bit, and go to a more modern
And though we are trying to keep a consistent conda environment where we
Good data point. Though the computational community is a bit less likely to
I think 3.6 should support only the oldest version that Apple still -CHB Christopher Barker, Ph.D. Emergency Response Division |
Apple doesn't publish end of support dates, but the last security update for 10.6 was back in 2013. See http://www.computerworld.com/article/2487996/malware-vulnerabilities/apple-retires-snow-leopard-from-support--leaves-1-in-5-macs-vulnerable-to-at.html python.org builds should definitely drop 32-bit for Python 3.6, but I wouldn't be surprised if it doesn't happen due to inertia. A letter sounds like a great idea. |
On Fri, Jul 1, 2016 at 12:59 PM, Ralf Gommers [email protected]
I just asked my IT folks, they apparently get work from their security scan python.org builds should definitely drop 32-bit for Python 3.6, but I
-CHB Christopher Barker, Ph.D. Emergency Response Division |
(digital letter). python-dev is indeed the appropriate place I think. What I understood @jakirkham meant by "letter" is a clear story in support of dropping 10.6 and 32-bit support, sent by someone to for example python-dev in the name of a larger group of people. |
On Fri, Jul 1, 2016 at 2:25 PM, Ralf Gommers [email protected]
-CHB
Christopher Barker, Ph.D. Emergency Response Division |
composing it here plus a ping to @matthewbrett (who just suffered through the pain of building dual-arch wheels) would be a good start. |
Yep, this is a serious and related issue. I'm more than happy to have the letter written here. Don't know if you have a medium of preference. We have done Google Docs in the past and allowed anyone with a link to edit. Here's a link for this one ( https://docs.google.com/document/d/1AQNGU726hLfvDPQCe7SJjclxQ4fgL4V1ryLh2xUuNIM/edit?usp=sharing ). |
If you would prefer something different, we also have Hackpad as an option. Though other suggestions are welcome. |
Thanks, GDocs works fine I'd say. |
Looks to me like they haven't - there's a separate i386/PPC installer for OS X 10.5 at https://www.python.org/downloads/release/python-352/. |
Coming back around to this:
Do we, yea or nay, (with 👍 or 👎 ) need to remove gcc, etc as a temporary fix? (I'm reposing @ocefpaf's question, which neatly avoids the need for me to vote on it, since there isn't a reaction emoji for |
Thanks for writing this up @jakirkham . One other thing to consider before we start patching If I have a chance I'll see if building |
Honestly, I don't if I would normally agree with that, @ChrisBarker-NOAA. I remember getting stuff built on my ancient 10.6 Mac and once it was working I was extremely reluctant to update as I would have to go back through that process with a new OS. With the impact of |
I have not, @gillins. Though I'm willing to learn about it and give it a try if it could help. As mentioned elsewhere, this would be a great thing to add to the |
On Fri, Jul 1, 2016 at 3:24 PM, Ralf Gommers [email protected]
I'm pretty sure no one's going to do that for 3.6 though. -CHB |
On Sat, Jul 2, 2016 at 12:47 PM, jakirkham [email protected] wrote:
-CHB Christopher Barker, Ph.D. Emergency Response Division |
On Fri, Jul 1, 2016 at 2:49 PM, jakirkham [email protected] wrote:
And add your name to the bottom, as well... @matthewbrett https://github.com/matthewbrett: I hope you can take a -Chris Christopher Barker, Ph.D. Emergency Response Division |
The default stdlib changed to |
Thanks Ralf -- I just fixed a couple typos -- now I think we need more -CHB On Mon, Jul 4, 2016 at 3:11 PM, Ralf Gommers [email protected]
Christopher Barker, Ph.D. Emergency Response Division |
Did this letter end up going out? It looks like the plan for 3.7 is currently a "provisional new installer variant for macOS 10.9 and later systems with 64-bit (x86_64)" ...which seems likely to create more confusion: |
There was a recently a discussion about this on python dev. https://mail.python.org/pipermail/python-dev/2018-January/thread.html But I think it's pretty locked in for 3.7 already. |
IDK (it’s been a while), but we should send it (possibly again). Are you able to see/edit the document, @ihnorton? Would you be willing to give it a quick review? |
FWIW I just commented over at cpython#5448, with a few justifications and some stats about low % of users on <10.9.
Bummer.
Yes. Just made a few small edits; could potentially add some examples of where this could be a problem for current release-cycle packages on PyPI. Two big ones that people would likely want to use at the same time: Tensorflow (cp36 wheel targets libc++) and matplotlib (cp36 wheel: several backends use C++ and target libstdc++). But given the link posted by ChrisBarker, I guess it's probably too late. |
Even if they seem committed, I see no harm in sending the email anyways. Worse thing that happens is they say no and continue with their current plan. Outcomes only improve from there. |
This was addressed a while back. Closing it out. Thanks all for the help 🙂 |
So, there has been a lot of discussion and in some case frustration with segmentation faults caused by a mixture libstdc++ and libc++ being used. Basically, these libraries cannot pass C++ objects between each other. However, passing C objects is totally fine. Over the past few weeks @gillins and myself have been addressing this in the stack. Though it seems there is lots of confusion or simply lack of knowledge about this problem in general. As a result, I'm writing this up to discuss what is happening, why it is happening, what we are doing to fix, and how people can help. To start, let's get some history about the choices we have made.
Why
clang
/clang++
/libc++
? First, on Mac thegcc
/g++
/libstdc++
went unmaintained some time ago and got converted to a frontend toclang
/clang++
. Second, thelibstdc++
library seems to be missing on newer OS X's (e.g. 10.11) from my experience, which causes issues usinggcc
/g++
. Third, users often want to use new C++ features like C++11, which is only possible withclang++
andlibc++
. As a result, we accepted the use ofclang
/clang++
/libc++
as our de facto toolchain.However, it is hard to get software to pickup
clang
/clang++
and uselibc++
for some reason. Instead things like to pick up the datedgcc
andg++
. So, we figured out some environment variables that mostly worked and copied them around. The suggestion at that time by @wesm and others was we should package this up. Personally I was feeling overwhelmed just staying on top of notifications related to building on Mac and this sounded like a good way to address that. So, we wrote thetoolchain
to try to set those automatically. The hope was this should make it easy for people to use and recommend, and it let me return to a lower volume of pings (but still remained quite busy).Still there were many pieces of code that already entered the ecosystem that were built before we made the decision to use
clang
/clang++
/libc++
and before the creation of thetoolchain
. Now this is a very serious problem as these pieces of software are usinglibstdc++
. Why is this a problem? Because if C++ objects pass from a library usinglibc++
tolibstdc++
or vice versa one will get segmentation faults. The only exception is exception objects, which can be thrown across the boundary. This causes people all sorts of issues see this thread, these recommendations, and this detail explanation of where this does or doesn't cause problems. However, we really can't be digging into code to see if might be ok (unless we know that code well) so we should be switching everything else toclang
/clang++
/libc++
. This is what @gillins and I set out to do with thetoolchain
in hand.While the
toolchain
does work ok in many cases, there is no guarantee that there won't occasionally be software that needs special hand holding. @gillins and myself have already watchedlibtool
gobble up some flags that we are passing around. We still don't know why that is the case, but there are plenty of reports of this behavior like this SO question, this upstream patch (note the silence that follows), this Macports issue, this FreeBSD thread, etc. (really this list goes on and on). This problem is not exclusive to ourlibtool
, but affects the systemlibtool
. The workaround we have used is forcing-stdlib=libc++
inCC
andCXX
. It is not pretty, but it works withlibtool
. However, the workaround does not work (nor is it needed) withcmake
. We could look at patching ourlibtool
. Though it doesn't seem the patch has been accepted upstream or whether it ever will. That being said, maybe it saves some pain. There may be other special cases I don't yet know of please feel free to share them here.cc @gillins @pelson @ocefpaf @msarahan @kmuehlbauer
The text was updated successfully, but these errors were encountered: