youzan / ZanRedisDB

Yet another distributed fault-tolerant key-value database Compatible with Redis written in Golang.
MIT License
388 stars 60 forks source link

ZanRedisDB make failed:undefined reference to `ZSTD_versionNumber' #56

Open hhofchina opened 4 years ago

hhofchina commented 4 years ago

github.com/youzan/gorocksdb

/root/soft/rocksdb/librocksdb.a(db_impl.o): In function rocksdb::DBImpl::DBImpl(rocksdb::DBOptions const&, std::string const&, bool, bool)': /root/soft/rocksdb/./util/compression.h:275: undefined reference toZSTD_versionNumber'

absolute8511 commented 4 years ago

rocksdb的zstd压缩开启了的话, 可以使用下面两种方式解决

添加CGO_LDFLAGS参数, 例如 CGO_LDFLAGS="-L/usr/local/lib -lrocksdb -lzstd" ,这样要求其他部署机器上也要安装 zstd 库

或者编译rocksdb时, 使用ROCKSDB_DISABLE_ZSTD禁用zstd

hhofchina commented 4 years ago

/root/soft/rocksdb/./util/compression.h:844: undefined reference to LZ4_createStreamDecode' /root/soft/rocksdb/librocksdb.a(format.o): In functionrocksdb::UncompressBlockContentsForCompressionType(rocksdb::UncompressionContext const&, char const, unsigned long, rocksdb::BlockContents, unsigned int, rocksdb::ImmutableCFOptions const&, rocksdb::MemoryAllocator*)': format.cc:(.text+0x103e): undefined reference to LZ4_setStreamDecode' format.cc:(.text+0x1065): undefined reference toLZ4_decompress_safe_continue' format.cc:(.text+0x1074): undefined reference to LZ4_freeStreamDecode' format.cc:(.text+0x127e): undefined reference toLZ4_createStreamDecode' format.cc:(.text+0x129e): undefined reference to LZ4_setStreamDecode' format.cc:(.text+0x12c5): undefined reference toLZ4_decompress_safe_continue' format.cc:(.text+0x12d4): undefined reference to `LZ4_freeStreamDecode'

需要继续禁用LZ4?

absolute8511 commented 4 years ago

是的, 类似处理