Closed ZhuWeiLin0 closed 1 year ago
I can see that there is no plugin folder in /usr/local/include/rocksdb/ can anyone tell why would this happen? and what's the purpose of folder /usr/local/include/rocksdb/ ?
I found that /usr/local/include/rocksdb/ is quite important. I install rocksdb and zenfs again and now I can see plugin folder in /usr/local/include/rocksdb/
But I got new problems For example, I wrote a new function in Class ZenFS() and I called this function in zenfs.cc However, it reports :
zenfs.cc:557:20: error: ‘class rocksdb::ZenFS’ has no member named ‘GetReadWriteHints’
557 | rwh_map = zenFS->GetReadWriteHints();
| ^~~~~~~~~~~~~~~~~
make: *** [Makefile:31: zenfs] Error 1
I checked ‘class rocksdb::ZenFS’ in /usr/local/include/rocksdb/, there is no function I wrote. so I guess now my problem is why would this happen.
i directly repalced io_zenfs.h zbd_zenfs.h in /usr/local/include/rocksdb/plugin with what I wrote. now I get a more severe problem. when I run make under plugin/zenfs/util it reports:
g++ -std=c++17 -faligned-new -DHAVE_ALIGNED_NEW -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DGFLAGS=1 -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_UINT128_EXTENSION -I/usr/local/include -isystem third-party/gtest-1.8.1/fused-src -g -o zenfs zenfs.cc -L/usr/local/lib -ldl -lrocksdb -lpthread -lrt -ldl -lgflags
/usr/bin/ld: /tmp/ccbCakH5.o: in function `rocksdb::zbd_open(bool, bool)':
/home/rocksdb/plugin/zenfs/util/zenfs.cc:62: undefined reference to `rocksdb::ZonedBlockDevice::ZonedBlockDevice(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rocksdb::ZbdBackendType, std::shared_ptr<rocksdb::Logger>, std::shared_ptr<rocksdb::ZenFSMetrics>)'
/usr/bin/ld: /home/rocksdb/plugin/zenfs/util/zenfs.cc:64: undefined reference to `rocksdb::ZonedBlockDevice::Open(bool, bool)'
/usr/bin/ld: /tmp/ccbCakH5.o: in function `rocksdb::zenfs_mount(std::unique_ptr<rocksdb::ZonedBlockDevice, std::default_delete<rocksdb::ZonedBlockDevice> >&, std::unique_ptr<rocksdb::ZenFS, std::default_delete<rocksdb::ZenFS> >*, bool)':
/home/zwl/rocksdb/plugin/zenfs/util/zenfs.cc:82: undefined reference to `rocksdb::ZenFS::ZenFS(rocksdb::ZonedBlockDevice*, std::shared_ptr<rocksdb::FileSystem>, std::shared_ptr<rocksdb::Logger>)'
/usr/bin/ld: /home/rocksdb/plugin/zenfs/util/zenfs.cc:83: undefined reference to `rocksdb::ZenFS::Mount(bool)'
/usr/bin/ld: /tmp/ccbCakH5.o: in function `rocksdb::zenfs_tool_mkfs()':
/home/rocksdb/plugin/zenfs/util/zenfs.cc:181: undefined reference to `rocksdb::ZenFS::ZenFS(rocksdb::ZonedBlockDevice*, std::shared_ptr<rocksdb::FileSystem>, std::shared_ptr<rocksdb::Logger>)'
/usr/bin/ld: /home/rocksdb/plugin/zenfs/util/zenfs.cc:185: undefined reference to `rocksdb::ZenFS::MkFS(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, bool)'
/usr/bin/ld: /home/rocksdb/plugin/zenfs/util/zenfs.cc:193: undefined reference to `rocksdb::ZonedBlockDevice::GetFreeSpace()'
/usr/bin/ld: /tmp/ccbCakH5.o: in function `rocksdb::zenfs_tool_df()':
/home/rocksdb/plugin/zenfs/util/zenfs.cc:268: undefined reference to `rocksdb::ZonedBlockDevice::GetUsedSpace()'
/usr/bin/ld: /home/rocksdb/plugin/zenfs/util/zenfs.cc:269: undefined reference to `rocksdb::ZonedBlockDevice::GetFreeSpace()'
/usr/bin/ld: /home/rocksdb/plugin/zenfs/util/zenfs.cc:270: undefined reference to `rocksdb::ZonedBlockDevice::GetReclaimableSpace()'
/usr/bin/ld: /tmp/ccbCakH5.o: in function `rocksdb::zenfs_tool_lsuuid()':
/home/rocksdb/plugin/zenfs/util/zenfs.cc:286: undefined reference to `rocksdb::ListZenFileSystems(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rocksdb::ZbdBackendType>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rocksdb::ZbdBackendType> > > >&)'
/usr/bin/ld: /tmp/ccbCakH5.o: in function `rocksdb::zenfs_tool_backup()':
/home/rocksdb/plugin/zenfs/util/zenfs.cc:554: undefined reference to `rocksdb::ZenFS::GetWriteLifeTimeHints[abi:cxx11]()'
/usr/bin/ld: /home/rocksdb/plugin/zenfs/util/zenfs.cc:557: undefined reference to `rocksdb::ZenFS::GetReadWriteHints[abi:cxx11]()'
/usr/bin/ld: /tmp/ccbCakH5.o: in function `rocksdb::zenfs_tool_remove_directory()':
/home/rocksdb/plugin/zenfs/util/zenfs.cc:680: undefined reference to `rocksdb::ZenFS::DeleteDirRecursive(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rocksdb::IOOptions const&, rocksdb::IODebugContext*)'
/usr/bin/ld: /tmp/ccbCakH5.o: in function `rocksdb::zenfs_tool_dump()':
/home/rocksdb/plugin/zenfs/util/zenfs.cc:777: undefined reference to `rocksdb::ZonedBlockDevice::EncodeJson(std::ostream&)'
/usr/bin/ld: /home/rocksdb/plugin/zenfs/util/zenfs.cc:779: undefined reference to `rocksdb::ZenFS::EncodeJson(std::ostream&)'
/usr/bin/ld: /tmp/ccbCakH5.o: in function `rocksdb::ZenFS::ReportSuperblock(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/usr/local/include/rocksdb/plugin/zenfs/fs/fs_zenfs.h:294: undefined reference to `rocksdb::Superblock::GetReport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
collect2: error: ld returned 1 exit status
make: *** [Makefile:31: zenfs] Error 1
I figured out ! I miss typed ROCKSDB_PLUGINS as PLUGINS_ROCKSDB.... stupid mistake
I wrote a new head file selection.h and put it under /include selection.h only contains some Macro definition like #define XXX
when I do 'make' under /plugin/zenfs/util it reports:
I followed #50 but it does not work.
here is what's inside /usr/local/include/rocksdb/
Any help is deeply Thanked!