pmwkaa / ioarena

Embedded storage benchmarking tool
Other
130 stars 22 forks source link

Link errors building db_bench on OS X #3

Closed snej closed 7 years ago

snej commented 8 years ago

Checked out current master (853a50d2132796db5e12769a0daed04f1384daef) and configured it to build all of the databases except leveldb. I don't have any of them installed in /usr, so it's building the sources in the submodules.

The build fails with a link error building db_bench as part of RocksDB. See below. Looks like it's not linking with libz, as well as whatever library bzip comes from.

(MacBook Pro running OS X 10.11.2. Dev tools from Xcode 7.1.1.)

$  cmake .. -DENABLE_ROCKSDB=ON -DENABLE_LMDB=ON -DENABLE_FORESTDB=ON -DENABLE_NESSDB=ON -DENABLE_WIREDTIGER=ON -DENABLE_SOPHIA=ON
...
...
$ make
...
...
  CCLD     db_bench
Undefined symbols for architecture x86_64:
  "_BZ2_bzCompress", referenced from:
      rocksdb::BlockBasedTableBuilder::WriteBlock(rocksdb::Slice const&, rocksdb::BlockHandle*) in block_based_table_builder.o
  "_BZ2_bzCompressEnd", referenced from:
      rocksdb::BlockBasedTableBuilder::WriteBlock(rocksdb::Slice const&, rocksdb::BlockHandle*) in block_based_table_builder.o
  "_BZ2_bzCompressInit", referenced from:
      rocksdb::BlockBasedTableBuilder::WriteBlock(rocksdb::Slice const&, rocksdb::BlockHandle*) in block_based_table_builder.o
  "_BZ2_bzDecompress", referenced from:
      rocksdb::BZip2_Uncompress(char const*, unsigned long, int*, unsigned int) in format.o
  "_BZ2_bzDecompressEnd", referenced from:
      rocksdb::BZip2_Uncompress(char const*, unsigned long, int*, unsigned int) in format.o
  "_BZ2_bzDecompressInit", referenced from:
      rocksdb::BZip2_Uncompress(char const*, unsigned long, int*, unsigned int) in format.o
  "_deflate", referenced from:
      rocksdb::BlockBasedTableBuilder::WriteBlock(rocksdb::Slice const&, rocksdb::BlockHandle*) in block_based_table_builder.o
  "_deflateEnd", referenced from:
      rocksdb::BlockBasedTableBuilder::WriteBlock(rocksdb::Slice const&, rocksdb::BlockHandle*) in block_based_table_builder.o
  "_deflateInit2_", referenced from:
      rocksdb::BlockBasedTableBuilder::WriteBlock(rocksdb::Slice const&, rocksdb::BlockHandle*) in block_based_table_builder.o
  "_inflate", referenced from:
      rocksdb::Zlib_Uncompress(char const*, unsigned long, int*, unsigned int, int) in format.o
  "_inflateEnd", referenced from:
      rocksdb::Zlib_Uncompress(char const*, unsigned long, int*, unsigned int, int) in format.o
  "_inflateInit2_", referenced from:
      rocksdb::Zlib_Uncompress(char const*, unsigned long, int*, unsigned int, int) in format.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [db_bench] Error 1
make[2]: *** [db/rocksdb/librocksdb.so] Error 2
make[1]: *** [CMakeFiles/librocksdb.dir/all] Error 2
make: *** [all] Error 2
pmwkaa commented 8 years ago

Hi, thanks for the report. Could this be RocksDB build issue (by simply trying to build rocksdb separately on MacOS) ?

git clone --recursive git://github.com/pmwkaa/ioarena.git
cd db/rocksdb
cmake .
make

Unfortunately i don't have a MacOSX to test it atm.

snej commented 8 years ago

cmake failed with errors. The comment at the first line of CMakeLists.txt says This cmake build is for Windows 64-bit only — looks like Unix builds just use make.

erthink commented 8 years ago

Now devel branch should be build successfully. @snej, could you check this?

snej commented 8 years ago

Sorry, building current devel branch of ioarena (commit a62cf1b83f1c1eae395616ec20a0137fb2873391) fails exactly as before.

erthink commented 8 years ago

Hm, it is very strange.

Current cmake script inside IoArena don't call RocksDB to build db_bench, but only the shared_lib target. Therefore such building errors are NOT possible. I has checked this right now.

@snej, please check this again using a clean environment, for instance just run the ./runme.sh

snej commented 8 years ago

Weird! I did a fresh clone of ioarena from Github, then git checkout devel. Let me try again.

snej commented 8 years ago

Reproduced it, again with a fresh checkout. Here's a log of the session: ioarena_build.txt

Here's a zip archive of the build directory if you want to look at the generated makefiles: build.zip

snej commented 8 years ago

The runme.sh script doesn't work either; it fails with:

Scanning dependencies of target libleveldb
[ 11%] Generating db/leveldb/libleveldb.so.1
make[3]: *** No rule to make target `libleveldb.so.1'.  Stop.
make[2]: *** [db/leveldb/libleveldb.so.1] Error 2
make[1]: *** [CMakeFiles/libleveldb.dir/all] Error 2
make: *** [all] Error 2
erthink commented 8 years ago

I understood and fixed trouble with the leveldb, but not with rocksdb (seems it is a rockdb bug).

Please try again by the runme.sh (devel branch).

erthink commented 8 years ago

Please someone - check again the devel-branch on OSX in a clean environment by runme.sh

erthink commented 8 years ago

Please check this again in a week: devel-branch on OSX, in a clean environment by runme.sh Otherwise I will assume (hopefully) that the problem was fixed. Ok?

BohuTANG commented 8 years ago

OOPS, it still broken as @snej described. It seems that it is RocksDB issue.