Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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/ 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/] Error 1 

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

share|improve this question
up vote 0 down vote accepted
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.

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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