westerndigitalcorporation / zenfs

ZenFS is a storage backend for RocksDB that enables support for ZNS SSDs and SMR HDDs.
GNU General Public License v2.0
243 stars 88 forks source link

Compile zenfs error. #50

Closed Haltz closed 3 years ago

Haltz commented 3 years ago
zns@zns-server:~/rocksdb/plugin/zenfs/util$ make
g++ -std=c++11 -faligned-new -DHAVE_ALIGNED_NEW -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DSNAPPY -DGFLAGS=1 -DZLIB -DBZIP2 -DLZ4 -DZSTD -DROCKSDB_MALLOC_USABLE_SIZE -DROCKSDB_PTHREAD_ADAPTIVE_MUTEX -DROCKSDB_BACKTRACE -DROCKSDB_RANGESYNC_PRESENT -DROCKSDB_SCHED_GETCPU_PRESENT -DROCKSDB_AUXV_GETAUXVAL_PRESENT -march=native -DHAVE_SSE42 -DHAVE_PCLMUL -DHAVE_AVX2 -DHAVE_BMI -DHAVE_LZCNT -DHAVE_UINT128_EXTENSION -DROCKSDB_SUPPORT_THREAD_LOCAL -isystem third-party/gtest-1.8.1/fused-src -I/usr/local/include  -o zenfs zenfs.cc -L/usr/local/lib -ldl -lrocksdb -lpthread -lrt -ldl -lsnappy -lgflags -lz -lbz2 -llz4 -lzstd
zenfs.cc:17:10: fatal error: rocksdb/plugin/zenfs/fs/fs_zenfs.h: No such file or directory
   17 | #include <rocksdb/plugin/zenfs/fs/fs_zenfs.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:14: zenfs] Error 1

Zenfs was not compiled along with rocksdb, and fs_zenfs.h is not in header files dir. Thanks a lot!

skyzh commented 3 years ago

Please run make install before compiling utilities.

Haltz commented 3 years ago
DEBUG_LEVEL=0 ROCKSDB_PLUGINS=zenfs make -j48 db_bench install

What you mean is as above? if it is that, i have already done it.

Haltz commented 3 years ago

There is one more question i want to ask: does pushd make any sense? On my opinion, it is useless. I appreciate it if some of you can reply.

skyzh commented 3 years ago

Would you please be more specific, which pushd?

Haltz commented 3 years ago

image pushd in README.md

skyzh commented 3 years ago

It is used along with popd to quickly go back to RocksDB root directory. It is not necessary indeed, but is useful.

Haltz commented 3 years ago

Please tell me if you need more info.

skyzh commented 3 years ago
  • Ubuntu 20.04 LTS server
  • Kernel 5.13.0-051300-generic
  • Rocksdb 6.22.1

Please tell me if you need more info.

The information you provided might not be related to this issue.

I suggest you going over the make install procedure, and see if headers are installed to the required location /usr/local/include.

Haltz commented 3 years ago

No, and if i specify include dir, make report errors, i think it means ROCKDB_PLUGIN=zenfs did nothing. thanks very much if you can tell me how to compile plugin manually or how can i run zenfs utilties.

skyzh commented 3 years ago

The instruction in README works perfectly for us. Would you please provide:

Haltz commented 3 years ago
skyzh commented 3 years ago
Haltz commented 3 years ago
zns@zns-server:~/rocksdb$ ROCKSDB_PLUGINS=zenfs sudo make install
$DEBUG_LEVEL is 0
echo 'prefix=/usr/local' > rocksdb.pc
echo 'exec_prefix=${prefix}' >> rocksdb.pc
echo 'includedir=${prefix}/include' >> rocksdb.pc
echo 'libdir=/usr/local/lib' >> rocksdb.pc
echo '' >> rocksdb.pc
echo 'Name: rocksdb' >> rocksdb.pc
echo 'Description: An embeddable persistent key-value store for fast storage' >> rocksdb.pc
echo Version: 6.24.0 >> rocksdb.pc
echo 'Libs: -L${libdir}  -ldl -lrocksdb' >> rocksdb.pc
echo 'Libs.private: -lpthread -lrt -ldl -lsnappy -lgflags -lz -lbz2 -llz4 -lzstd ' >> rocksdb.pc
echo 'Cflags: -I${includedir} -std=c++11  -faligned-new -DHAVE_ALIGNED_NEW -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX  -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DSNAPPY -DGFLAGS=1 -DZLIB -DBZIP2 -DLZ4 -DZSTD -DROCKSDB_MALLOC_USABLE_SIZE -DROCKSDB_PTHREAD_ADAPTIVE_MUTEX -DROCKSDB_BACKTRACE -DROCKSDB_RANGESYNC_PRESENT -DROCKSDB_SCHED_GETCPU_PRESENT -DROCKSDB_AUXV_GETAUXVAL_PRESENT -march=native   -DHAVE_SSE42  -DHAVE_PCLMUL  -DHAVE_AVX2  -DHAVE_BMI  -DHAVE_LZCNT -DHAVE_UINT128_EXTENSION -DROCKSDB_SUPPORT_THREAD_LOCAL  -isystem third-party/gtest-1.8.1/fused-src' >> rocksdb.pc
install -d /usr/local/lib
install -d /usr/local/lib/pkgconfig
for header_dir in `find "include/rocksdb" -type d`; do \
    install -d //usr/local/$header_dir; \
done
for header in `find "include/rocksdb" -type f -name *.h`; do \
    install -C -m 644 $header //usr/local/$header; \
done
for header in ; do \
    install -d //usr/local/include/rocksdb/`dirname $header`; \
    install -C -m 644 $header //usr/local/include/rocksdb/$header; \
done
install -C -m 644 rocksdb.pc /usr/local/lib/pkgconfig/rocksdb.pc
install -d /usr/local/lib
install -C -m 755 librocksdb.a /usr/local/lib
[ -e librocksdb.so.6.24.0 ] && make install-shared || :

Same output of other commands as before.

skyzh commented 3 years ago

use sudo -E, otherwise the environment variable will not take effect.

Haltz commented 3 years ago

Looks like it fixed the problem. Thanks for patience!