I'm trying to reinstall my virtual env after upgrade to MacOS Big Sur.
But error appears:
4 warnings generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Qunused-arguments -Qunused-arguments -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION=2.3.21 -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/python#3.8/3.8.6_1/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-parset1.c -o build/temp.macosx-11.0-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-parset1.o
src/rl_addons/renderPM/gt1/gt1-parset1.c:604:28: warning: for loop has empty body [-Wempty-body]
for (i = 0; i < size; i++);
^
src/rl_addons/renderPM/gt1/gt1-parset1.c:604:28: note: put the semicolon on a separate line to silence this warning
src/rl_addons/renderPM/gt1/gt1-parset1.c:1907:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for (i = 0; i < sizeof(internal_procs) / sizeof(InternalGt1ProcListing); i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/rl_addons/renderPM/gt1/gt1-parset1.c:710:1: warning: function 'print_value_deep' is not needed and will not be emitted [-Wunneeded-internal-declaration]
print_value_deep (Gt1PSContext *psc, Gt1Value *val, int nest)
^
3 warnings generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Qunused-arguments -Qunused-arguments -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION=2.3.21 -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/python#3.8/3.8.6_1/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-dict.c -o build/temp.macosx-11.0-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-dict.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Qunused-arguments -Qunused-arguments -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION=2.3.21 -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/python#3.8/3.8.6_1/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-namecontext.c -o build/temp.macosx-11.0-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-namecontext.o
src/rl_addons/renderPM/gt1/gt1-namecontext.c:100:9: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
len = strlen (s);
^
src/rl_addons/renderPM/gt1/gt1-namecontext.c:100:9: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
src/rl_addons/renderPM/gt1/gt1-namecontext.c:102:3: error: implicitly declaring library function 'memcpy' with type 'void *(void *, const void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
memcpy (new, s, len);
^
src/rl_addons/renderPM/gt1/gt1-namecontext.c:102:3: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
src/rl_addons/renderPM/gt1/gt1-namecontext.c:172:10: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
if (!strcmp (nc->table[i & mask].name, name))
^
src/rl_addons/renderPM/gt1/gt1-namecontext.c:172:10: note: include the header <string.h> or explicitly provide a declaration for 'strcmp'
3 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/zulfugar/PycharmProjects/AppForm/.venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_w/8xmqn_ys20n91w63y9lcl6nr0000gn/T/pip-install-_q2xgbny/reportlab/setup.py'"'"'; __file__='"'"'/private/var/folders/_w/8xmqn_ys20n91w63y9lcl6nr0000gn/T/pip-install-_q2xgbny/reportlab/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/_w/8xmqn_ys20n91w63y9lcl6nr0000gn/T/pip-record-08bq_70o/install-record.txt --single-version-externally-managed --compile --install-headers /Users/zulfugar/PycharmProjects/AppForm/.venv/include/site/python3.8/reportlab Check the logs for full command output.
I tried:
Reinstall xcode-select --install;
Reinstalled Python brew install python#3.8;
Installed Xcode itself;
None of above helped.
What can be the issue?
this worked for me
CFLAGS="-Wno-error=implicit-function-declaration" pip install reportlab
I found that updating my pip requirements.txt pinned version of reportlab from 3.3.x to 3.5.59 (latest as of today) resolved this issue for me.
I have not yet done any validation of the changes between those versions. YMMV!
Fixed issue by downloading source code and updating src/rl_addons/renderPM/gt1/gt1-namecontext.c
There was
#if defined(_WIN32) || defined(macintosh)
# include <string.h>
#endif
Seems macintosh is not defined on MacOS Big Sur, added include <string.h> without if statement and build using python setup.py install
Worked.
Related
I'm trying to install the celerite package, but I’m struggling to get it pip installed on my Apple M1 Mac. The Terminal output is below. Is this an M1 issue or a Python-C headers issue?
~ > pip install celerite
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/UNKNOWN
sysconfig: /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9
WARNING: Additional context:
user = False
home = None
root = None
prefix = None
Collecting celerite
Using cached celerite-0.4.0.tar.gz (1.3 MB)
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from celerite) (1.19.5)
Requirement already satisfied: pybind11 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from celerite) (2.6.2)
Using legacy 'setup.py install' for celerite, since package 'wheel' is not installed.
Installing collected packages: celerite
Running setup.py install for celerite ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/setup.py'"'"'; __file__='"'"'/private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-record-eyjraeap/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/celerite
cwd: /private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/
Complete output (142 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
creating build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/terms.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/build.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/timer.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/celerite.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/plot_setup.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/modeling.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
running egg_info
writing celerite.egg-info/PKG-INFO
writing dependency_links to celerite.egg-info/dependency_links.txt
writing requirements to celerite.egg-info/requires.txt
writing top-level names to celerite.egg-info/top_level.txt
reading manifest file 'celerite.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'celerite.egg-info/SOURCES.txt'
copying celerite/solver.cpp -> build/lib.macosx-10.9-x86_64-3.9/celerite
running build_ext
testing C++14/C++11 support
creating var
creating var/folders
creating var/folders/y9
creating var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp
creating var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp6bm3jgjr.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp6bm3jgjr.o -std=c++14
testing compiler flags
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpw_0z5jvh.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpw_0z5jvh.o -stdlib=libc++
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpzofp_v4s.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpzofp_v4s.o -fvisibility=hidden
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp7n02kzyj.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp7n02kzyj.o -Wno-unused-function
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpaax51kgm.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpaax51kgm.o -Wno-uninitialized
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp9nw9zr5w.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp9nw9zr5w.o -Wno-unused-local-typedefs
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp5rqw4hd2.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp5rqw4hd2.o -funroll-loops
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpzv7s8yxb.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpzv7s8yxb.o -march=native
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpbedvthn6.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpbedvthn6.o -mmacosx-version-min=10.9
building 'celerite.solver' extension
creating build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/celerite
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Icpp/include -Icpp/lib/eigen_3.3.3 -I/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include -I/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c celerite/solver.cpp -o build/temp.macosx-10.9-x86_64-3.9/celerite/solver.o -DNODEBUG -DVERSION_INFO="0.4.0" -std=c++14 -stdlib=libc++ -fvisibility=hidden -Wno-unused-function -Wno-uninitialized -Wno-unused-local-typedefs -funroll-loops -march=native -mmacosx-version-min=10.9
In file included from celerite/solver.cpp:1:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pybind11.h:45:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/attr.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/cast.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pytypes.h:12:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/detail/common.h:124:
/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:14:2: error: "Something's broken. UCHAR_MAX should be defined in limits.h."
#error "Something's broken. UCHAR_MAX should be defined in limits.h."
^
/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:18:2: error: "Python's source code assumes C's unsigned char is an 8-bit type."
#error "Python's source code assumes C's unsigned char is an 8-bit type."
^
/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:27:5: error: "Python.h requires that stdio.h define NULL."
# error "Python.h requires that stdio.h define NULL."
^
In file included from celerite/solver.cpp:1:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pybind11.h:45:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/attr.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/cast.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pytypes.h:12:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/detail/common.h:124:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:30:
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:73:64: error: use of undeclared identifier 'strchr'
char* __libcpp_strchr(const char* __s, int __c) {return (char*)strchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:80:75: error: use of undeclared identifier 'strpbrk'
char* __libcpp_strpbrk(const char* __s1, const char* __s2) {return (char*)strpbrk(__s1, __s2);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:87:65: error: use of undeclared identifier 'strrchr'; did you mean 'strchr'?
char* __libcpp_strrchr(const char* __s, int __c) {return (char*)strrchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:75:13: note: 'strchr' declared here
const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:94:49: error: unknown type name 'size_t'
void* __libcpp_memchr(const void* __s, int __c, size_t __n) {return (void*)memchr(__s, __c, __n);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:96:46: error: unknown type name 'size_t'
const void* memchr(const void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:98:46: error: unknown type name 'size_t'
void* memchr( void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:101:74: error: use of undeclared identifier 'strstr'; did you mean 'strchr'?
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:77:13: note: 'strchr' declared here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:101:74: error: no matching function for call to 'strchr'
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:77:13: note: candidate disabled: <no message provided>
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:101:81: error: cannot initialize a parameter of type 'char *' with an lvalue of type 'const char *'
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^~~~
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:77:32: note: passing argument to parameter '__s' here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
In file included from celerite/solver.cpp:1:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pybind11.h:45:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/attr.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/cast.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pytypes.h:12:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/detail/common.h:124:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:34:
In file included from /Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:100:
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:769:12: error: no member named 'labs' in the global namespace; did you mean 'abs'?
return ::labs(__x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:768:39: note: 'abs' declared here
inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:773:12: error: no member named 'llabs' in the global namespace
return ::llabs(__x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:781:12: error: no member named 'fabsf' in the global namespace
return ::fabsf(__lcpp_x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:785:12: error: no member named 'fabs' in the global namespace; did you mean 'abs'?
return ::fabs(__lcpp_x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:768:39: note: 'abs' declared here
inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:790:12: error: no member named 'fabsl' in the global namespace
return ::fabsl(__lcpp_x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:804:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:805:12: error: no member named 'ldiv' in the global namespace
return ::ldiv(__x, __y);
~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/setup.py'"'"'; __file__='"'"'/private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-record-eyjraeap/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/celerite Check the logs for full command output.
'''
There are many similar posts with the same error what I am facing, but none of the solutions worked for me. Please do not think this as repeated. I am reaching you out after trying with all the solutions suggested.
I am trying to create a python library from c++ file that uses boost library with
#include <boost/thread.hpp>
I have installed Boost in Ubuntu through the commands
./bootstrap.sh --prefix=/usr/local
and then
./b2 install --with-thread
.
Now, when I try to run a file with #include <boost/thread.hpp> it gives me this error saying
src/main.cpp:2:10: fatal error: boost/thread.hpp: No such file or directory
Am I missing on something? Can someone help me how can I solve this.
Error
I will attach a screenshot of the same for viewing.
Also pasting the error description in-case someone does not feel comfortable to view image
Failed building wheel for python-example
Running setup.py clean for python-example
Failed to build python-example
Installing collected packages: python-example
Running setup.py install for python-example ... error
Complete output from command /home/hmi/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-h4742spy /setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-3l3u7dxm/install-record.txt --single-version-externally- managed --compile:
running install
running build
running build_ext
gcc -pthread -B /home/hmi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hmi/anaconda3/include/python3.7m -c /tmp/tmpbv27mdxm.cpp -o tmp/tmpbv27mdxm.o -std=c++17
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/hmi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hmi/anaconda3/include/python3.7m -c /tmp/tmps2iqs0qp.cpp -o tmp/tmps2iqs0qp.o -fvisibility=hidden
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
building 'python_example' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -B /home/hmi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hmi/anaconda3/include -I/home/hmi/anaconda3/include -I/home/hmi/anaconda3/include/python3.7m -c src/main.cpp -o build/temp.linux-x86_64-3.7/src/main.o -DVERSION_INFO="0.0.1" -std=c++17 -fvisibility=hidden
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src/main.cpp:2:10: fatal error: boost/thread.hpp: No such file or directory
#include <boost/thread.hpp>
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
I have also tried with this command
g++ -std=c++11 main.cpp -lpthread -lboost_system -lboost_thread -o main
. But similar result.
OS : Ubuntu 18.04
Boost version : 1.55
I have now resolved it with the command mentioned by Botje but with sudo.
sudo apt install libboost-thread-dev
But I did not want to do through root. So I have refrained its usage. But now I did not find any other way. I would be glad to know if any other solution works
I am trying to install the quickfix FIX engine module for python on Centos7/Ubuntu16 and MacOSX. I followed the instructions on http://www.quickfixengine.org/quickfix/doc/html/
The installation on Centos/Ubuntu works perfectly with a pip3.6 install quickfix; however I keep getting errors on MacOSX Mojave 10.14
First I ran a xcode-select --install to install command line tools and then I brew install gcc.
Finally I executed the pip3 install quickfix. This command kept failing with a long error log like so:
Collecting quickfix
Downloading https://files.pythonhosted.org/packages/62/b0/caf2dfae8779551f6e1d2bc78668d8f5a2303d21311fdd54345722b68cbc/quickfix-1.15.1.tar.gz (1.5MB)
|████████████████████████████████| 1.5MB 8.0MB/s
Building wheels for collected packages: quickfix
Building wheel for quickfix (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/setup.py'"'"'; __file__='"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/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/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-wheel-dk9t7tmj --python-tag cp36
cwd: /private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/
Complete output (56 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
copying quickfix.py -> build/lib.macosx-10.6-intel-3.6
copying quickfixt11.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix40.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix41.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix42.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix43.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix44.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50sp1.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50sp2.py -> build/lib.macosx-10.6-intel-3.6
running build_ext
Testing for std::tr1::shared_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_tr1_shared_ptr.cpp -o test_std_tr1_shared_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_tr1_shared_ptr.cpp:1:10: fatal error: 'tr1/memory' file not found
#include <tr1/memory>
^~~~~~~~~~~~
1 warning and 1 error generated.
...not found
Testing for std::shared_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -std=c++0x -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_shared_ptr.cpp -o test_std_shared_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_shared_ptr.cpp:1:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 warning and 1 error generated.
...not found
Testing for std::unique_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -std=c++0x -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_unique_ptr.cpp -o test_std_unique_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_unique_ptr.cpp:1:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 warning and 1 error generated.
...not found
building '_quickfix' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/C++
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c C++/DataDictionaryProvider.cpp -o build/temp.macosx-10.6-intel-3.6/C++/DataDictionaryProvider.o -std=c++0x -Wno-deprecated -Wno-unused-variable -Wno-deprecated-declarations -Wno-maybe-uninitialized
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from C++/DataDictionaryProvider.cpp:26:
In file included from C++/DataDictionaryProvider.h:29:
In file included from C++/DataDictionary.h:29:
In file included from C++/Fields.h:25:
In file included from C++/FixFields.h:4:
C++/Field.h:29:10: fatal error: 'sstream' file not found
#include <sstream>
^~~~~~~~~
2 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for quickfix
Running setup.py clean for quickfix
Failed to build quickfix
Installing collected packages: quickfix
Running setup.py install for quickfix ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/setup.py'"'"'; __file__='"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/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/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-record-s677l2km/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/
Complete output (56 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
copying quickfix.py -> build/lib.macosx-10.6-intel-3.6
copying quickfixt11.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix40.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix41.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix42.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix43.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix44.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50sp1.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50sp2.py -> build/lib.macosx-10.6-intel-3.6
running build_ext
Testing for std::tr1::shared_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_tr1_shared_ptr.cpp -o test_std_tr1_shared_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_tr1_shared_ptr.cpp:1:10: fatal error: 'tr1/memory' file not found
#include <tr1/memory>
^~~~~~~~~~~~
1 warning and 1 error generated.
...not found
Testing for std::shared_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -std=c++0x -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_shared_ptr.cpp -o test_std_shared_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_shared_ptr.cpp:1:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 warning and 1 error generated.
...not found
Testing for std::unique_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -std=c++0x -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_unique_ptr.cpp -o test_std_unique_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_unique_ptr.cpp:1:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 warning and 1 error generated.
...not found
building '_quickfix' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/C++
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c C++/DataDictionaryProvider.cpp -o build/temp.macosx-10.6-intel-3.6/C++/DataDictionaryProvider.o -std=c++0x -Wno-deprecated -Wno-unused-variable -Wno-deprecated-declarations -Wno-maybe-uninitialized
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from C++/DataDictionaryProvider.cpp:26:
In file included from C++/DataDictionaryProvider.h:29:
In file included from C++/DataDictionary.h:29:
In file included from C++/Fields.h:25:
In file included from C++/FixFields.h:4:
C++/Field.h:29:10: fatal error: 'sstream' file not found
#include <sstream>
^~~~~~~~~
2 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/setup.py'"'"'; __file__='"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/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/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-record-s677l2km/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
I then proceeded to install from src code. so I downloaded the zip package and ran:
./bootstrap
./configure --with-python3
make
this produced the following errors after make:
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in UnitTest++
make[2]: Nothing to be done for `all'.
Making all in src
Making all in C++
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in test
make[5]: Nothing to be done for `all'.
rm -rf ../../lib/libquickfix.a
rm -rf ../../lib/libquickfix.la
rm -rf ../../lib/libquickfix.so
rm -rf ../../lib/libquickfix.dylib
ln -s ../src/C++/.libs/libquickfix.a ../../lib/libquickfix.a
ln -s ../src/C++/.libs/libquickfix.la ../../lib/libquickfix.la
ln -s ../src/C++/.libs/libquickfix.so ../../lib/libquickfix.so
ln -s ../src/C++/.libs/libquickfix.dylib ../../lib/libquickfix.dylib
bash ./copy.sh ../../include/quickfix *.h
: command not found
: invalid option11: set: -
set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
: command not found
: command not found shift
: command not found
'/copy.sh: line 17: syntax error near unexpected token `do
'/copy.sh: line 17: `do
make[5]: *** [all-local] Error 2
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
I cannot find anything in their docs which is very very minimal nor on Stack Overflow. I am aware that I can continue my dev on a centos or ubuntu but I would really like it to work on Mac as well.
I tried to install a pygrib package. in python 2.
I install all required package. (https://jswhit.github.io/pygrib/docs/pygrib-module.html)
I command pip installs pygrib. but it has an error.
I can't find an error in the error script. there are many warnings. but I don't think that's no problem that doesn't install.
how can fix this error?
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KuwhgZ/pygrib/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 /tmp/pip-wheel-TKG3Ld --python-tag cp27
cwd: /tmp/pip-install-KuwhgZ/pygrib/
Complete output (38 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying ncepgrib2.py -> build/lib.linux-x86_64-2.7
running build_ext
skipping 'pygrib.c' Cython extension (up-to-date)
building 'pygrib' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -Ig2clib_src -I/usr/include/python2.7 -c pygrib.c -o build/temp.linux-x86_64-2.7/pygrib.o
In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from pygrib.c:613:
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_16keys':
pygrib.c:13996:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_18_read_only_keys':
pygrib.c:14427:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_30tostring':
pygrib.c:18559:53: warning: passing argument 2 of 'grib_get_message' from incompatible pointer type [-Wincompatible-pointer-types]
__pyx_v_err = grib_get_message(__pyx_v_self->_gh, (&__pyx_v_message), (&__pyx_v_size));
^
In file included from pygrib.c:614:0:
/usr/include/grib_api.h:554:5: note: expected 'const void **' but argument is of type 'void **'
int grib_get_message(grib_handle* h ,const void** message, size_t *message_length);
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/pygrib.o -leccodes -o build/lib.linux-x86_64-2.7/pygrib.so
/usr/bin/ld: cannot find -leccodes
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pygrib
Running setup.py clean for pygrib
Failed to build pygrib
Installing collected packages: pygrib
Running setup.py install for pygrib ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-NTYS3Y/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-KuwhgZ/pygrib/
Complete output (38 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying ncepgrib2.py -> build/lib.linux-x86_64-2.7
running build_ext
skipping 'pygrib.c' Cython extension (up-to-date)
building 'pygrib' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -Ig2clib_src -I/usr/include/python2.7 -c pygrib.c -o build/temp.linux-x86_64-2.7/pygrib.o
In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from pygrib.c:613:
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_16keys':
pygrib.c:13996:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_18_read_only_keys':
pygrib.c:14427:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_30tostring':
pygrib.c:18559:53: warning: passing argument 2 of 'grib_get_message' from incompatible pointer type [-Wincompatible-pointer-types]
__pyx_v_err = grib_get_message(__pyx_v_self->_gh, (&__pyx_v_message), (&__pyx_v_size));
^
In file included from pygrib.c:614:0:
/usr/include/grib_api.h:554:5: note: expected 'const void **' but argument is of type 'void **'
int grib_get_message(grib_handle* h ,const void** message, size_t *message_length);
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/pygrib.o -leccodes -o build/lib.linux-x86_64-2.7/pygrib.so
/usr/bin/ld: cannot find -leccodes
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-NTYS3Y/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
The operant part is cannot find -leccodes, which means it cant find the library libeccodes.so
To install it, you want to do
sudo apt install libeccodes-dev
The latest versions of pygrib, since version 2.0.2, require usage of an ECMWF package called ecCodes which replaces grib-api. Your gcc exit code is saying that you are missing "-leccodes' compile flag.
ecCodes can be found here: https://confluence.ecmwf.int/display/ECC/ecCodes+Home
And here is where grib-api is announced to be replaced by ecCodes: https://confluence.ecmwf.int/display/GRIB/Home
Installing the ecCodes package should provide the gcc flag "-leccodes'
I'm trying to run a geoDjango project on OSX Mojave (10.14.5).
Therefore I've installed the dependencies as suggested on the Django docs from kyngchaos (tried brew packages as well)
Created my virtualenv which shows
New python executable in /Users/ts/.virtualenvs/project_upstream/bin/python2.7
Also creating executable in /Users/ts/.virtualenvs/project_upstream/bin/python
checked gdal with
$ gdal-config --version
2.4.1
and tried to install pygdal with:
pip install pygdal==2.4.1.*
which fails with
ERROR: Complete output from command /Users/ts/.virtualenvs/project_upstream/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-install-qTnsBS/pygdal/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/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-record-vlffrN/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ts/.virtualenvs/project_upstream/bin/../include/site/python2.7/pygdal:
ERROR: running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-2.7
creating build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gnm.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/__init__.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gdalnumeric.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/osr.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gdal.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/ogr.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gdal_array.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gdalconst.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
running build_ext
clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/ts/.virtualenvs/project_upstream/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/2.4/include/gdal -I/Library/Frameworks/GDAL.framework/Versions/2.4/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o
clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/ts/.virtualenvs/project_upstream/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/2.4/include/gdal -I/Library/Frameworks/GDAL.framework/Versions/2.4/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o -std=c++11
building 'osgeo._gdal' extension
creating build/temp.macosx-10.14-x86_64-2.7
creating build/temp.macosx-10.14-x86_64-2.7/extensions
clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/ts/.virtualenvs/project_upstream/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/2.4/include/gdal -I/Library/Frameworks/GDAL.framework/Versions/2.4/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.14-x86_64-2.7/extensions/gdal_wrap.o -std=c++11 -I/Library/Frameworks/GDAL.framework/Versions/2.4/Headers
In file included from extensions/gdal_wrap.cpp:173:
In file included from /usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:88:
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register PyObject *obj, /* Object */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register PyObject *obj /* Object */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:575:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register const wchar_t *w, /* wchar_t buffer */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register wchar_t *w, /* wchar_t buffer */
^~~~~~~~~
In file included from extensions/gdal_wrap.cpp:173:
In file included from /usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:97:
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:173:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register PyObject *obj, /* string or Unicode object */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register char **s, /* pointer to buffer variable */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:175:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register Py_ssize_t *len /* pointer to length variable or NULL
^~~~~~~~~
7 warnings generated.
clang++ -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk build/temp.macosx-10.14-x86_64-2.7/extensions/gdal_wrap.o -L/Library/Frameworks/GDAL.framework/Versions/2.4/lib -lgdal -o build/lib.macosx-10.14-x86_64-2.7/osgeo/_gdal.so
ld: warning: directory not found for option '-L/Library/Frameworks/GDAL.framework/Versions/2.4/lib'
ld: library not found for -lgdal
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1
----------------------------------------
ERROR: Command "/Users/ts/.virtualenvs/project_upstream/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-install-qTnsBS/pygdal/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/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-record-vlffrN/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ts/.virtualenvs/project_upstream/bin/../include/site/python2.7/pygdal" failed with error code 1 in /private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-install-qTnsBS/pygdal/
To solve this I've removed all packages and reinstalled. Further tried different packages from brew and kynchaos and instructions found at this issue without luck.
The strange thing is I can install pygdal without problems using no virtualenv!
Does one know how to overcome this error – what might be the reason for it?
The problem was solved by reinstalling virtualenv