Skip to content
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

Please do not hardcode libc++ #3518

Open
barracuda156 opened this issue Mar 18, 2024 · 4 comments
Open

Please do not hardcode libc++ #3518

barracuda156 opened this issue Mar 18, 2024 · 4 comments
Labels
awaiting reply bug Issue described a bug

Comments

@barracuda156
Copy link

Currently -stdlib=libc++ flag is passed unconditionally on macOS.
Ref: https://github.com/piskvorky/gensim/blob/develop/setup.py

This is undesirable, since while Apple does use libc++ starting from 10.7, hardcoding it unnecessarily breaks compilation against libstdc++.

@gojomo
Copy link
Collaborator

gojomo commented Mar 19, 2024

What should the relevant line be instead, to work in the most places? Can you propose a fitx in a PR?

@barracuda156
Copy link
Author

@gojomo Can it be made conditional on Clang being used (i.e. not GCC)? That would solve the problem, since Clang on macOS always uses libc++ and, AFAIK, always supports -stdlib= flag, while GCC by default does not support -stdlib= and may link to either libstdc++ or libc++ (the former is the default behavior, the latter can be used if GCC is built with -stdlib= support).

I can confirm that a build with GCC does not need -stdlib= passed, it knows what to link to by default.

@gojomo
Copy link
Collaborator

gojomo commented Mar 19, 2024

I'm not an expert on MacOS build options - even though MacOS is my primary system, when using/building Gensim, I'm almost always doing it on Linux VMs.

So I can't imagine what your proposal would mean in the changed file(s), or evaluate it with my own judgement. But, a concrete PR could be auto-verified as still passing tests, still creating successful official MacOS wheel builds, and then (via testimony of yourself & others) recommended as also better in less-common/non-official-wheel build environments.

@barracuda156
Copy link
Author

@gojomo I will see how to make
it conditional.

@mpenkov mpenkov added bug Issue described a bug awaiting reply labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting reply bug Issue described a bug
Projects
None yet
Development

No branches or pull requests

3 participants