Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use the generic flags
-x c++
to enable C++ mode, instead of the Clang-specific-stdlib=libc++
and Mac-specific-mmacosx-version-min=10.7
.Fixes build failure on Mac OS X 10.6.
This reverts part of #67 and fixes it a different way.
The reason why any fix was necessary in the first place is that apparently distutils compiles all code, even C++ code, using the C compiler. This seems to be a longstanding distutils bug. The C compiler of course doesn't expect C++ code, which appears to be what caused the missing symbols mentioned in #66. (It appears that only some systems are affected. Reverting the change from #67, I see the missing symbol errors on OS X 10.8, but not on macOS 10.13. It may depend on the clang version or on which C++ standard library is used. #66 doesn't mention what version of macOS was being used there.)
The solution implemented in #67 was to enable C++ mode in the C compiler by using the flag
-stdlib=libc++
. And libc++ was first shipped in Mac OS X 10.7, so the flag-mmacosx-version-min=10.7
was added.This causes build failure on Mac OS X 10.6 and earlier, because those OS versions don't use clang by default, and only clang understands
-stdlib
:The plyvel code isn't doing anything that's specific to libc++ or Mac OS X 10.7 or later, and it compiles fine using libstdc++, which is the default C++ standard library on OS X 10.8 and earlier. The revised solution implemented in this PR is to enable C++ mode in the C compiler using the standard
-x c++
flag instead. I have verified this compiles fine on Mac OS X 10.6 and that a test file containingimport plyvel
runs without showing any missing symbol errors.