stephan-hof / pyrocksdb

Python bindings for RocksDB
BSD 3-Clause "New" or "Revised" License
150 stars 169 forks source link

Failing to install pyrocksdb against rocksdb 2.8 #21

Closed venugopal-kandru closed 9 years ago

venugopal-kandru commented 9 years ago

Hi Stephan, We tried to install pyrocksdb from the doc 'http://pyrocksdb.readthedocs.org/en/v0.2.1/installation.html' in a ubuntu server with the following dependencies and failed, ubuntu 14.04 gcc 4.8.2 rocksdb 2.8 pyrocksdb 0.2.1

Error faced:

root@devserver:/tmp/rocksdb# sudo pip install git+git://github.com/stephan-hof/pyrocksdb.git@v0.2.1
Downloading/unpacking git+git://github.com/stephan-hof/pyrocksdb.git@v0.2.1
  Cloning git://github.com/stephan-hof/pyrocksdb.git (to v0.2.1) to /tmp/pip-Q187Rq-build
  Running setup.py (path:/tmp/pip-Q187Rq-build/setup.py) egg_info for package from git+git://github.com/stephan-hof/pyrocksdb.git@v0.2.1
    Compiling rocksdb/_rocksdb.pyx because it changed.
    Cythonizing rocksdb/_rocksdb.pyx

Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages (from pyrocksdb==0.2.1)
Requirement already satisfied (use --upgrade to upgrade): Cython>=0.20 in /usr/local/lib/python2.7/dist-packages (from pyrocksdb==0.2.1)
Installing collected packages: pyrocksdb
  Running setup.py install for pyrocksdb

    building 'rocksdb._rocksdb' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c rocksdb/_rocksdb.cpp -o build/
temp.linux-x86_64-2.7/rocksdb/_rocksdb.o -std=gnu++11 -O3 -Wall -Wextra -Wconversion -fno-strict-aliasing
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
    rocksdb/_rocksdb.cpp: In function ‘PyObject* __pyx_pf_7rocksdb_8_rocksdb_19PyBloomFilterPolicy_6create_filter(__pyx_obj_7rocksdb_8_rocksdb_PyBloomFilterPolicy*, PyOb
ject*)’:
    rocksdb/_rocksdb.cpp:5874:99: warning: conversion to ‘int’ from ‘std::vector<rocksdb::Slice>::size_type {aka long unsigned int}’ may alter its value [-Wconversion]
         __pyx_v_self->policy->CreateFilter(py_rocks::vector_data(__pyx_v_c_keys), __pyx_v_c_keys.size(), (&__pyx_v_dst));
                                                                                                       ^
    rocksdb/_rocksdb.cpp: In function ‘int __pyx_pf_7rocksdb_8_rocksdb_2DB___cinit__(__pyx_obj_7rocksdb_8_rocksdb_DB*, PyObject*, __pyx_obj_7rocksdb_8_rocksdb_Options*, 
PyObject*)’:
    rocksdb/_rocksdb.cpp:21807:24: error: base operand of ‘->’ has non-pointer type ‘rocksdb::Options’
       __pyx_t_6 = __pyx_t_5->info_log;
                            ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-Q187Rq-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(_
_file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bdobOT-record/install-record.txt --single-version-externally-managed --compile:
    running install   

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/rocksdb

copying rocksdb/interfaces.py -> build/lib.linux-x86_64-2.7/rocksdb

copying rocksdb/__init__.py -> build/lib.linux-x86_64-2.7/rocksdb

copying rocksdb/errors.py -> build/lib.linux-x86_64-2.7/rocksdb

creating build/lib.linux-x86_64-2.7/rocksdb/tests

copying rocksdb/tests/test_db.py -> build/lib.linux-x86_64-2.7/rocksdb/tests

copying rocksdb/tests/__init__.py -> build/lib.linux-x86_64-2.7/rocksdb/tests

copying rocksdb/tests/test_options.py -> build/lib.linux-x86_64-2.7/rocksdb/tests

running egg_info

creating pyrocksdb.egg-info

writing requirements to pyrocksdb.egg-info/requires.txt

writing pyrocksdb.egg-info/PKG-INFO

writing top-level names to pyrocksdb.egg-info/top_level.txt

writing dependency_links to pyrocksdb.egg-info/dependency_links.txt

writing manifest file 'pyrocksdb.egg-info/SOURCES.txt'

warning: manifest_maker: standard file '-c' not found

reading manifest file 'pyrocksdb.egg-info/SOURCES.txt'

writing manifest file 'pyrocksdb.egg-info/SOURCES.txt'

copying rocksdb/_rocksdb.cpp -> build/lib.linux-x86_64-2.7/rocksdb

running build_ext

building 'rocksdb._rocksdb' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/rocksdb

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c rocksdb/_rocksdb.cpp -o build/temp.linux-x86_64-2.7/rocksdb/_rocksdb.o -std=gnu++11 -O3 -Wall -Wextra -Wconversion -fno-strict-aliasing

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]

rocksdb/_rocksdb.cpp: In function ‘PyObject* __pyx_pf_7rocksdb_8_rocksdb_19PyBloomFilterPolicy_6create_filter(__pyx_obj_7rocksdb_8_rocksdb_PyBloomFilterPolicy*, PyObject*)’:

rocksdb/_rocksdb.cpp:5874:99: warning: conversion to ‘int’ from ‘std::vector<rocksdb::Slice>::size_type {aka long unsigned int}’ may alter its value [-Wconversion]

     __pyx_v_self->policy->CreateFilter(py_rocks::vector_data(__pyx_v_c_keys), __pyx_v_c_keys.size(), (&__pyx_v_dst));

                                                                                                   ^

rocksdb/_rocksdb.cpp: In function ‘int __pyx_pf_7rocksdb_8_rocksdb_2DB___cinit__(__pyx_obj_7rocksdb_8_rocksdb_DB*, PyObject*, __pyx_obj_7rocksdb_8_rocksdb_Options*, PyObject*)’:

rocksdb/_rocksdb.cpp:21807:24: error: base operand of ‘->’ has non-pointer type ‘rocksdb::Options’

   __pyx_t_6 = __pyx_t_5->info_log;

                        ^

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
stephan-hof commented 9 years ago

Hi, I reproduced the error and for me it looks like a bug in cython itself. I guess you had also this version installed.

pip freeze
Cython==0.22
...

For now, install please this specific cython version.

pip install Cython==0.20

I will investiage whats wrong with cython. This 0.22 version is pretty new, so it could be that there is a regression.

venugopal-kandru commented 9 years ago

Hi @stephan-hof , You are right, i have installed the same cython version(Cython==0.22) and it failed.

Resolved by installing Cython==0.20, thanks a lot!

stephan-hof commented 9 years ago

I filled this on the Cython maillinglist https://groups.google.com/forum/#!topic/cython-users/Zmd_dsn-dCo Lets see what they say.