-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
build failure with Xcode 10 - libstdc++ not supported anymore #23424
Comments
Another contributor fixed that with |
Couldn't reproduce this on Mojave with Xcode 10.0 - let us know if the above suggestion doesn't fix it |
@TomAugspurger i already did that, to fix another issue. Now when I enter I've updated to xcode 10.1, the issue is still there. Tomorrow I'll try to install Xcode 9 again. Might there be a case for moving to libc++ anyway ? |
hi, i managed to get it building by deleting Xcode, and dowloading + installing Xcode 9.4.1 Command Line Tools from the Apple Developer website. There is still something funny going on, because I then installed Xcode 10 Command Line Tools (after first renaming the old ones at I'll continue to investigate, if thats OK |
Not sure if it's the same issue or if this is a good fix, but I also couldn't build after updating to mojave (I got my error at a different point though). I fixed it by adding the argument Lines 672 to 680 in d78bd7a
Credit for idea here Here's my error log before performing the above step:
|
cython/cython#2694 also suggests that upgrading the command line tools was sufficient. @JustinZhengBC, did you get the same error (without the extra link args) in a clean environment? Or was this in the same environment (with previously compiled files) from before you upgraded your command line tools? |
Yes, I get the error after running |
Thanks, that's strange. I'm just hesitant to add extra arguments to our setup script when we (I) don't really understand the root problem and why adding those arguments fixes it. |
@JustinZhengBC any chance you installed some of the components via homebrew as well? Shot in the dark but I'm wondering if there could be some type of conflict there between that installation alongside the standard Xcode-select install |
@WillAyd yes, I use homebrew and some c++ libraries do show up in |
Wonder if that could be it. There's also a page for homebrew dedicated to the topic: https://docs.brew.sh/C++-Standard-Libraries Do you have a way of either removing or upgrading those installed libraries to see if that resolves? |
I tried renaming the Cellar folder and running build, but it still failed. However, I did manage to get it building without extra arguments after running |
Hmm that's interesting. I wonder if that is part of the "Additional Components" that you get prompted to install when opening Xcode - any chance you recall having installed that or not? |
I just ran through the installer again, no such prompt appeared. I've opened XCode to look at the settings but I haven't opened any projects in it since updating, so I might've missed the prompt there |
I believe if you uninstall and reinstall Xcode it should prompt you for additional components the first time you open it (no project required). Something does seem off here; if you could help pinpoint would be great. May need some kind of doc updates |
A fresh install of the latest Xcode and command line tools can build with no errors and no prompts. However, while I can get old versions of Xcode from the Apple developer's website, those seem to be standalones so I can't replicate the update process. |
i managed to repro the issue on my system with the following sequence of steps:
After this I could reproduce the original failure mode i reported, and could get the extensions compiling OK using a variant of the fix proposed by @JustinZhengBC:
Probably these changes should be wrapped with a check for Mac OS >= 10.9 to avoid breaking other platforms. If i added only the part in extra_link_args, I see the compiler error i originally reported:
If i added only the extra_compile_args part, the compile succeeds but the linker would throw an error:
My working theory is that the older version of Xcode command line tools adds the headers into /usr/include and the libstdc++ binaries into somewhere like /usr/lib, and that subsequent uninstalls of Xcode / Command Line Tools don’t remove them. possibly useful liinkslibc++ https://libcxx.llvm.org/ |
hi @WillAyd the behaviour seems to depend if clang is able to find stdlibc++ headers/libs. This depends on the xcode install history, hence the difficulty in reproducing this. i suppose there are 2 options: (1) require the user to workaround this by installing stdlibc++ or (2) change mac os targets to build + link libc++. So far i am unable to get (1) working again on my system. I've tried:
But after each step I get the original compile error I reported. for option 2 i've created a PR. I didn't meant to preempt any decision on taking this - its my first PR and i didnt realise that pushing a branch to my fork would update the GH issue. CI is running now with travis, azure (passed), circle ci, appveyor (passed) please let me know how you'd like to proceed |
Hmm is our only requirement for the C++ headers/libs stemming from this? Not saying it's worth changing here but curious if we previously looked at the performance difference in linking against the c++ implementation vs using |
Hi, I got to the bottom of this issue, in the end, after a trawl through clang, distutils and python make/config files. The compiler standard library defaults to either When Recent macOS versions of python have a 64-bit only variant built for 10.9 (python.org), and a universal 64/32-bit variant built for 10.6 (python.org) or 10.7 (conda). I am running the conda universal variant, so It may work for some users, for 1 of 2 reasons:
I've pushed a revised change which sets the targeted macOS to 10.9, when running on a 10.9 or above system, with a python/distutils which targets pre-10.9. This should not break builds on pre-10.9 systems, unlike my previous approach. It fixes the issue on my system. CI is running now. Please let me know if you'd like me to submit it as a PR (assuming CI passes) |
@robbuckley I experienced the same issue. Thanks for the PR! |
@WillAyd could you please remove the 'cant repro tag'? |
Hey, I got the same errors but could not find |
Code Sample, a copy-pastable example if possible
Problem description
I setup a dev environment on Mac OS 10.13 according to https://pandas.pydata.org/pandas-docs/stable/contributing.html#creating-a-development-environment and all was well
Upgraded to 10.14 (mojave) and Xcode 10, and now i get the above failure.
Xcode 10 release notes includes the following deprecation notice
Building with libstdc++ was deprecated with Xcode 8 and is not supported in Xcode 10 when targeting iOS. C++ projects must now migrate to libc++ and are recommended to set a deployment target of macOS 10.9 or later, or iOS 7 or later. Besides changing the C++ Standard Library build setting, developers should audit hard-coded linker flags and target dependencies to remove references to libstdc++ (including -lstdc++, -lstdc++.6.0.9, libstdc++.6.0.9.tbd, and libstdc++.6.0.9.dylib). Project dependencies such as static archives that were built against libstdc++ will also need to be rebuilt against libc++. (40885260)
Some workaround suggestions are at https://stackoverflow.com/questions/52425766/stdlibc-headers-not-found-error-on-xcode-10 and the answer its linked to.
I dont have access to Xcode 9 anymore, so i can't try the workaround of copying the old libs from there
The text was updated successfully, but these errors were encountered: