piskvorky/gensim

Please do not hardcode `libc++`

barracuda156 opened this issue · 4 comments

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++.

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

@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.

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.

@gojomo I will see how to make
it conditional.