I'm trying to build snappy-java for FreeBSD 8.1 to use it with cassandra (can't enable columns compression without it).

Trying to build it from source and getting an error:

$ hg clone https://snappy-java.googlecode.com/hg/ snappy-java 
$ cd snappy-java 
$ export JAVA_HOME=/usr/local/openjdk6 && gmake 

The process starts, but after some time i get the following error:

g++ -I/usr/local/openjdk6/include -Ilib/inc_mac -O2 -fPIC - 
fvisibility=hidden  -Ilib/include   -I"/usr/local/openjdk6/include/ 
freebsd" -Itarget/snappy-1.0.4 -o target/snappy-1.0.4-Default/ 
libsnappyjava.so target/snappy-1.0.4-Default/snappy-sinksource.o 
target/snappy-1.0.4-Default/snappy-stubs-internal.o target/ 
snappy-1.0.4-Default/snappy.o target/snappy-1.0.4-Default/ 
SnappyNative.o -shared -static 
/usr/bin/ld: /usr/lib/crtbeginT.o: relocation R_X86_64_32 can not be 
used when making a shared object; recompile with -fPIC 
/usr/lib/crtbeginT.o: could not read symbols: Bad value 
gmake: *** [target/snappy-1.0.4-Default/libsnappyjava.so] Error 1 

So -fPIC is already ON... Any help is appreciated. Thanks

can't enable columns compression without it

That is not quite true. DeflateCompressor is still available without the Snappy libraries. Do you require or prefer Snappy? If so, I would add the downloadable .jar from the Snappy project to your classpath. There is no need to perform your own build.


Try to remove the -static from the compilerflags. You are building a shared libary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.