Repository navigation
cant install on OSX Maverick (10.9.5) python 3.4.3 #69
Description
After pip install python-rapidjson
The following output happens
Collecting python-rapidjson
Using cached python-rapidjson-0.0.11.tar.gz
Installing collected packages: python-rapidjson
Running setup.py install for python-rapidjson ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -u -c "import setuptools, tokenize;file='/private/var/folders/cm/dwsx5_yn5p92nzfyrn8g68wr0000gn/T/pip-build-4fiy0ttq/python-rapidjson/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/cm/dwsx5_yn5p92nzfyrn8g68wr0000gn/T/pip-8yx2m6bb-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'rapidjson' extension
creating build
creating build/temp.macosx-10.6-intel-3.4
creating build/temp.macosx-10.6-intel-3.4/python-rapidjson
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -I./rapidjson/include -I/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c ./python-rapidjson/rapidjson.cpp -o build/temp.macosx-10.6-intel-3.4/./python-rapidjson/rapidjson.o -pedantic
In file included from /Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/Python.h:78,
from ./python-rapidjson/rapidjson.cpp:1:
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:88: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:89: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:90: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:91: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:92: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:93: error: ISO C++ does not support 'long long'
In file included from ./rapidjson/include/rapidjson/writer.h:21,
from ./python-rapidjson/rapidjson.cpp:11:
./rapidjson/include/rapidjson/internal/dtoa.h:32: warning: unknown option after '#pragma GCC diagnostic' kind
In file included from /Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/Python.h:78,
from ./python-rapidjson/rapidjson.cpp:1:
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:88: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:89: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:90: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:91: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:92: error: ISO C++ does not support 'long long'
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/longobject.h:93: error: ISO C++ does not support 'long long'
In file included from ./rapidjson/include/rapidjson/writer.h:21,
from ./python-rapidjson/rapidjson.cpp:11:
./rapidjson/include/rapidjson/internal/dtoa.h:32: warning: unknown option after '#pragma GCC diagnostic' kind
fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: can't figure out the architecture type of: /var/folders/cm/dwsx5_yn5p92nzfyrn8g68wr0000gn/T//cccQX3Nv.out
error: command 'gcc-4.2' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -u -c "import setuptools, tokenize;file='/private/var/folders/cm/dwsx5_yn5p92nzfyrn8g68wr0000gn/T/pip-build-4fiy0ttq/python-rapidjson/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/cm/dwsx5_yn5p92nzfyrn8g68wr0000gn/T/pip-8yx2m6bb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/cm/dwsx5_yn5p92nzfyrn8g68wr0000gn/T/pip-build-4fiy0ttq/python-rapidjson/
Have tried to uninstall XCode and install Command Line tools, didnt help.
Currently
gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Activity
sejans commentedon Mar 19, 2017
I added in setup.py the following line, and it installed - but is it correct way?
extension_options['extra_compile_args'] = ['-pedantic', '-Wno-long-long']If yes - the issue can be closed
lelit commentedon Mar 20, 2017
I do not have Macs around to test, so I'd say that option should not have nasty side effects.
Does the compiled library works as expected? It would be great if you could execute the test suite to assert that...
If it help, I can easily add the
-Wno-long-longoption, maybe conditionated bysys.platform: what does the following emit on that system?I guess
darwin, am I correct?sejans commentedon Mar 21, 2017
Very similar error happened on Linux as well
Ubuntu 14.04.5 LTS (GNU/Linux 2.6.32-26-pve x86_64)Here is output
`Downloading/unpacking python-rapidjson
Downloading python-rapidjson-0.0.11.tar.gz (154kB): 154kB downloaded
Running setup.py (path:/tmp/pip_build_root/python-rapidjson/setup.py) egg_info for package python-rapidjson
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
Installing collected packages: python-rapidjson
Running setup.py install for python-rapidjson
building 'rapidjson' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I./rapidjson/include -I/usr/include/python3.4m -c ./python-rapidjson/rapidjson.cpp -o build/temp.linux-x86_64-3.4/./python-rapidjson/rapidjson.o -pedantic
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ [enabled by default]
In file included from /usr/include/python3.4m/Python.h:50:0,
from ./python-rapidjson/rapidjson.cpp:1:
/usr/include/python3.4m/pyport.h:58:27: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
#define PY_LONG_LONG long long
^
/usr/include/python3.4m/longobject.h:88:44: note: in expansion of macro 'PY_LONG_LONG'
PyAPI_FUNC(PyObject *) PyLong_FromLongLong(PY_LONG_LONG);
^
/usr/include/python3.4m/pyport.h:58:27: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
#define PY_LONG_LONG long long
^
/usr/include/python3.4m/longobject.h:89:61: note: in expansion of macro 'PY_LONG_LONG'
PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG);
^
In file included from /usr/include/python3.4m/Python.h:50:0,
from ./python-rapidjson/rapidjson.cpp:1:
/usr/include/python3.4m/pyport.h:58:27: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
#define PY_LONG_LONG long long
^
/usr/include/python3.4m/pyport.h:771:34: note: in definition of macro 'PyAPI_FUNC'
# define PyAPI_FUNC(RTYPE) RTYPE
^
/usr/include/python3.4m/longobject.h:90:12: note: in expansion of macro 'PY_LONG_LONG'
PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *);
^
/usr/include/python3.4m/pyport.h:58:27: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
#define PY_LONG_LONG long long
^
/usr/include/python3.4m/pyport.h:771:34: note: in definition of macro 'PyAPI_FUNC'
# define PyAPI_FUNC(RTYPE) RTYPE
^
/usr/include/python3.4m/longobject.h:91:21: note: in expansion of macro 'PY_LONG_LONG'
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
^
/usr/include/python3.4m/pyport.h:58:27: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
#define PY_LONG_LONG long long
^
/usr/include/python3.4m/pyport.h:771:34: note: in definition of macro 'PyAPI_FUNC'
# define PyAPI_FUNC(RTYPE) RTYPE
^
/usr/include/python3.4m/longobject.h:92:21: note: in expansion of macro 'PY_LONG_LONG'
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
^
/usr/include/python3.4m/pyport.h:58:27: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
#define PY_LONG_LONG long long
^
/usr/include/python3.4m/pyport.h:771:34: note: in definition of macro 'PyAPI_FUNC'
# define PyAPI_FUNC(RTYPE) RTYPE
^
/usr/include/python3.4m/longobject.h:93:12: note: in expansion of macro 'PY_LONG_LONG'
PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject , int );
^
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/./python-rapidjson/rapidjson.o -o build/lib.linux-x86_64-3.4/rapidjson.cpython-34m.so
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
Successfully installed python-rapidjson
Cleaning up...`
However as you can see the last lines tell that package successfully installed, so in Linux case these were warning, but on OSX case they were errors.
sys.platform is darwin!
currently package is working well on OSX and Linux
p.s. on OSX El Capitan and OSX Sierra - there were no problems installing package (no long long warnings)
Force g++ to accept "long long" type
lelit commentedon Mar 21, 2017
Since apparently it does not hurt, I added the option unconditionally, let's see.
lelit commentedon Mar 21, 2017
Thank you!
sejans commentedon Mar 25, 2017
ok then i close the issue