edlib
edlib copied to clipboard
Installation error on Mac OSx
Hi Martin,
I'm trying to build edlib on a new mac with a fresh installation of conda. I tried python 3.7, 3.6, and 2.7 but they fail with the same error.
Mac OS 10.14.5
(base) lm9-523-002:sahlkris$ conda --version
conda 4.6.11
(base) lm9-523-002:sahlkris$ python --version
Python 3.7.3
(base) lm9-523-002:sahlkris$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
(base) lm9-523-002:sahlkris$ pip install edlib
Collecting edlib
Downloading https://files.pythonhosted.org/packages/be/6f/52a7b59a1344d851783638699dd9c84cba0223bfb6f285a980f25465aec3/edlib-1.2.4.post1.tar.gz (82kB)
100% |████████████████████████████████| 92kB 5.4MB/s
Building wheels for collected packages: edlib
Building wheel for edlib (setup.py) ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/1n/h8yvp_ln7sggx2mp1kfclws06p13vf/T/pip-install-ie8pgjbl/edlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/1n/h8yvp_ln7sggx2mp1kfclws06p13vf/T/pip-wheel-i0uwhtc9 --python-tag cp37:
/anaconda3/lib/python3.7/site-packages/setuptools/dist.py:475: UserWarning: Normalizing '1.2.4-1' to '1.2.4.post1'
normalized_version,
running bdist_wheel
running build
running build_ext
building 'edlib' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/edlib
creating build/temp.macosx-10.7-x86_64-3.7/edlib/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -Iedlib/include -I/anaconda3/include/python3.7m -c edlib.bycython.cpp -o build/temp.macosx-10.7-x86_64-3.7/edlib.bycython.o -O3 -std=c++11
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
edlib.bycython.cpp:639:14: fatal error: 'cstdlib' file not found
#include <cstdlib>
^~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for edlib
Running setup.py clean for edlib
Failed to build edlib
Installing collected packages: edlib
Running setup.py install for edlib ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/1n/h8yvp_ln7sggx2mp1kfclws06p13vf/T/pip-install-ie8pgjbl/edlib/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/1n/h8yvp_ln7sggx2mp1kfclws06p13vf/T/pip-record-jm0ca7dw/install-record.txt --single-version-externally-managed --compile:
/anaconda3/lib/python3.7/site-packages/setuptools/dist.py:475: UserWarning: Normalizing '1.2.4-1' to '1.2.4.post1'
normalized_version,
running install
running build
running build_ext
building 'edlib' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/edlib
creating build/temp.macosx-10.7-x86_64-3.7/edlib/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -Iedlib/include -I/anaconda3/include/python3.7m -c edlib.bycython.cpp -o build/temp.macosx-10.7-x86_64-3.7/edlib.bycython.o -O3 -std=c++11
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
edlib.bycython.cpp:639:14: fatal error: 'cstdlib' file not found
#include <cstdlib>
^~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/1n/h8yvp_ln7sggx2mp1kfclws06p13vf/T/pip-install-ie8pgjbl/edlib/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/1n/h8yvp_ln7sggx2mp1kfclws06p13vf/T/pip-record-jm0ca7dw/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/1n/h8yvp_ln7sggx2mp1kfclws06p13vf/T/pip-install-ie8pgjbl/edlib/
You're trying to compile against GCC 4.2.1 libstdc++, which doesn't have the <cstdint>
header yet, because that is a C++11 only header. The fix is right there: warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
This is not an Edlib bug, but an issue with your toolchain.
@SoapZA thanks for taking a look at this one :)! @ksahlin said he was doing this via conda on Mac, which means he was installing Python version of Edlib, meaning he probably doesn't know much about the toolchain underneath. Neither do I, I have to admit. Where is this toolchain coming from? Is it using system gcc, and that gcc is too old? Or is conda recipe wrong (although I don't know too much about that either)? We could push this to conda recipe maintainer(s).