Installation issue on Mac (libstdc++ vs libc++)
- Dominant language
- Python
- Stars
- 490
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Description
```
System Version: macOS 10.15.4 (19E287)
Kernel Version: Darwin 19.4.0
Xcode 11.4.1
Build version 11E503a
```
During `pip install python-snappy`, received:
```
Installing collected packages: python-snappy
Running setup.py install for python-snappy ... error
ERROR: Command errored out with exit status 1:
command: /Applications/miniconda3/envs/serialization-benchmarking/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/13/2dfbkf595fq1f1_5tjvzq35h0000gp/T/pip-install-nsuxlclp/python-snappy/setup.py'"'"'; __file__='"'"'/private/var/folders/13/2dfbkf595fq1f1_5tjvzq35h0000gp/T/pip-install-nsuxlclp/python-snappy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/13/2dfbkf595fq1f1_5tjvzq35h0000gp/T/pip-record-5g8l8mp0/install-record.txt --single-version-externally-managed --compile --install-headers /Applications/miniconda3/envs/serialization-benchmarking/include/python3.7m/python-snappy
cwd: /private/var/folders/13/2dfbkf595fq1f1_5tjvzq35h0000gp/T/pip-install-nsuxlclp/python-snappy/
Complete output (27 lines):
/Applications/miniconda3/envs/serialization-benchmarking/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'cffi_modules'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.7
creating build/lib.macosx-10.7-x86_64-3.7/snappy
copying snappy/snappy.py -> build/lib.macosx-10.7-x86_64-3.7/snappy
copying snappy/snappy_cffi.py -> build/lib.macosx-10.7-x86_64-3.7/snappy
copying snappy/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/snappy
copying snappy/hadoop_snappy.py -> build/lib.macosx-10.7-x86_64-3.7/snappy
copying snappy/snappy_formats.py -> build/lib.macosx-10.7-x86_64-3.7/snappy
copying snappy/__main__.py -> build/lib.macosx-10.7-x86_64-3.7/snappy
copying snappy/snappy_cffi_builder.py -> build/lib.macosx-10.7-x86_64-3.7/snappy
running build_ext
building 'snappy._snappy' extension
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/snappy
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/miniconda3/envs/serialization-benchmarking/include -arch x86_64 -I/Applications/miniconda3/envs/serialization-benchmarking/include -arch x86_64 -I/Applications/miniconda3/envs/serialization-benchmarking/include/python3.7m -c snappy/snappymodule.cc -o build/temp.macosx-10.7-x86_64-3.7/snappy/snappymodule.o
clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/miniconda3/envs/serialization-benchmarking/include -arch x86_64 -I/Applications/miniconda3/envs/serialization-benchmarking/include -arch x86_64 -I/Applications/miniconda3/envs/serialization-benchmarking/include/python3.7m -c snappy/crc32c.c -o build/temp.macosx-10.7-x86_64-3.7/snappy/crc32c.o
g++ -bundle -undefined dynamic_lookup -L/Applications/miniconda3/envs/serialization-benchmarking/lib -arch x86_64 -L/Applications/miniconda3/envs/serialization-benchmarking/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.7/snappy/snappymodule.o build/temp.macosx-10.7-x86_64-3.7/snappy/crc32c.o -lsnappy -o build/lib.macosx-10.7-x86_64-3.7/snappy/_snappy.cpython-37m-darwin.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/miniconda3/envs/serialization-benchmarking/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/13/2dfbkf595fq1f1_5tjvzq35h0000gp/T/pip-install-nsuxlclp/python-snappy/setup.py'"'"'; __file__='"'"'/private/var/folders/13/2dfbkf595fq1f1_5tjvzq35h0000gp/T/pip-install-nsuxlclp/python-snappy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/13/2dfbkf595fq1f1_5tjvzq35h0000gp/T/pip-record-5g8l8mp0/install-record.txt --single-version-externally-managed --compile --install-headers /Applications/miniconda3/envs/serialization-benchmarking/include/python3.7m/python-snappy Check the logs for full command output.
```
Fixed using: `CFLAGS="-stdlib=libc++" pip install python-snappy`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with setup.py and the snappy/snappymodule.cc build path shown in the installation log, then reproduce the macOS pip install without the workaround. Done means the extension links against libc++ and python-snappy installs successfully without requiring CFLAGS="-stdlib=libc++".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, macos, python
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100