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 error for the latest version #248

Closed kekeMemory closed 1 year ago

kekeMemory commented 1 year ago

Hi, I really want to know the reason for that.

I have used QEMU for setting the zenfs env and done db_tench test successfully in the past.

Since I restarted the QEMU ,I failed in building zenfs utility after executing the compile

I got the message:

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 -DLIBZBD -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 -isystem ./third-party/folly -I/usr/local/include  -g -o zenfs zenfs.cc -L/usr/local/lib -ldl -lrocksdb -lpthread -lrt -ldl -lsnappy -lgflags -lz -lbz2 -llz4 -lzstd -lzbd
In file included from zenfs.cc:26:
/usr/local/include/rocksdb/plugin/zenfs/fs/fs_zenfs.h:158:40: error: 'std::filesystem' has not been declared
158 |   std::string FormatPathLexically(std::filesystem::path filepath);
|                                        ^~~~~~~~~~
/usr/local/include/rocksdb/plugin/zenfs/fs/fs_zenfs.h:158:57: error: expected ',' or '...' before 'filepath'
158 |   std::string FormatPathLexically(std::filesystem::path filepath);
|                                                         ^~~~~~~~
make: *** [Makefile:31: zenfs] Error 1

Then I updated to the latest version https://github.com/westerndigitalcorporation/zenfs I still can not compile successfully, I got the message:

In file included from zenfs.cc:25: /usr/local/include/rocksdb/plugin/zenfs/fs/fs_zenfs.h:158:40: error: 'std::filesystem' has not been declared 158 | std::string FormatPathLexically(std::filesystem::path filepath); | ^~~~~~~~~~ /usr/local/include/rocksdb/plugin/zenfs/fs/fs_zenfs.h:158:57: error: expected ',' or '...' before 'filepath' 158 | std::string FormatPathLexically(std::filesystem::path filepath); | ^~~~~~~~ zenfs.cc: In function 'std::unique_ptrrocksdb::ZonedBlockDevice rocksdb::zbd_open(bool, bool)': zenfs.cc:61:27: error: 'ZbdBackendType' has not been declared 61 | FLAGS_zbd.empty() ? ZbdBackendType::kZoneFS : ZbdBackendType::kBlockDev, | ^~~~~~~~~~~~~~ zenfs.cc:61:53: error: 'ZbdBackendType' has not been declared 61 | FLAGS_zbd.empty() ? ZbdBackendType::kZoneFS : ZbdBackendType::kBlockDev, | ^~~~~~~~~~~~~~ zenfs.cc:62:15: error: no matching function for call to 'std::unique_ptrrocksdb::ZonedBlockDevice::unique_ptr(<brace-enclosed initializer list>)' 62 | nullptr)};

percona-ysorokin commented 1 year ago

@kekeMemory According to the command line g++ -std=c++11 ..., you simply did not set c++ standard to c++17

kekeMemory commented 1 year ago

Thanks a lot, I have solved the this problem