Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CGO_LDFLAGS miss in Makefile #218

Open
chenlx0 opened this issue Feb 27, 2022 · 0 comments
Open

CGO_LDFLAGS miss in Makefile #218

chenlx0 opened this issue Feb 27, 2022 · 0 comments

Comments

@chenlx0
Copy link

chenlx0 commented Feb 27, 2022

Hi, I have installed rocksdb static library on my machine. And I try to compile go-ycsb with rocksdb support, but it fails when linking.

/data/clx_work/rocksdb/./util/compression.h:608: undefined reference to `snappy::RawCompress(char const*, unsigned long, char*, unsigned long*)'
/usr/local/lib/gcc/x86_64-pc-linux-gnu/9.4.0/../../../librocksdb.a(blob_file_builder.o): In function `rocksdb::BZip2_Compress(rocksdb::CompressionInfo const&, unsigned int, char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/data/clx_work/rocksdb/./util/compression.h:886: undefined reference to `BZ2_bzCompressInit'
/data/clx_work/rocksdb/./util/compression.h:900: undefined reference to `BZ2_bzCompress'
/data/clx_work/rocksdb/./util/compression.h:909: undefined reference to `BZ2_bzCompressEnd'
/usr/local/lib/gcc/x86_64-pc-linux-gnu/9.4.0/../../../librocksdb.a(blob_file_builder.o): In function `rocksdb::Zlib_Compress(rocksdb::CompressionInfo const&, unsigned int, char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/data/clx_work/rocksdb/./util/compression.h:705: undefined reference to `deflateInit2_'
/data/clx_work/rocksdb/./util/compression.h:714: undefined reference to `deflateSetDictionary'
/data/clx_work/rocksdb/./util/compression.h:732: undefined reference to `deflate'
/data/clx_work/rocksdb/./util/compression.h:741: undefined reference to `deflateEnd'
...

According to gorocksdb README.md, CGO_LDFLAGS is required when compiling with rocksdb static library. And this environment variable is missing in our Makefile.

CGO_LDFLAGS="-L/path/to/rocksdb -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4 -lzstd"

#57 said that it is better to pass CGO_LDFLAGS outside the Makefile manually, I think it is better to mention this in readme.md to make this project more user-friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant