karllolee / py-leveldb

Automatically exported from code.google.com/p/py-leveldb
Other
0 stars 0 forks source link

build with snappy #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install snappy
2. compile leveldb (notice the -DSNAPPY)
3. python setup.py build
4. import leveldb

What is the expected output?
Just works.

What do you see instead?
ImportError: ./leveldb.so: undefined symbol: _ZN6snappy13RawUncompressEPKcmPc

What version of the product are you using? On what operating system?
r35 on gentoo
I installed snappy from gentoo package-management as static-library.
I updated the leveldb source inside the py-leveldb package to 
42fb47f6edab02d4abb814631c6615dd4661d7d2 but still use your make-options.

Please provide any additional information below.
I "fixed" the ImportError with -lsnappy in the extra_link_args but I guess this 
wouldn't work if a user doesn't has snappy.

extra_link_args = ['-L./leveldb-read-only', '-Bstatic', '-lleveldb', '-lsnappy']

Also I was a bit confused with the documentation about how leveldb uses snappy. 
I thought it would be used on the fly, when I install snappy and didn't expect 
that recompiling the python module was required.. but maybe It's just me :)
Maybe you could also had some boolean like LevelDB.hasSnappy or usesSnappy if 
this is possible.

Original issue reported on code.google.com by balrok.1...@gmail.com on 21 Nov 2011 at 2:07

GoogleCodeExporter commented 9 years ago
This is a bit of a mess. I´ll figure something better out.

I was trying to add a hasSnappy() function a while back, but the LevelDB API 
didn´t seem to expose it.

Looking at it now, I see something which does the same thing in db/db_ bench.cc

Original comment by arnim...@gmail.com on 21 Nov 2011 at 2:42

GoogleCodeExporter commented 9 years ago
I updated both setup.py and compile_leveldb.sh

Both snappy and leveldb are included as svn externals. The script builds each 
as static libraries, and setup.py will use them.

This seems to work for me. Let me know if there are further issues.

Original comment by arnim...@gmail.com on 21 Nov 2011 at 10:55

GoogleCodeExporter commented 9 years ago

Original comment by arnim...@gmail.com on 15 May 2012 at 9:52