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

error when trying to modify code to force use terarkzip without binding code modifications #238

Open
hiqsociety opened this issue Jun 12, 2022 · 3 comments

Comments

@hiqsociety
Copy link

hiqsociety commented Jun 12, 2022

tried to force terarkzip table as default but it's not compiled.

i edited the options/options.cc file to force it to use terarkzip as default coz it's difficult to write binding for the programming language i'm using.

[ 91%] Linking CXX executable cache_bench
[ 92%] Linking CXX executable column_aware_encoding_exp
/usr/bin/ld: libterarkdb.a(options.cc.o): in function `terarkdb::ColumnFamilyOptions::ColumnFamilyOptions()':
/go/src/github.com/terarkdb/options/options.cc:130: undefined reference to `terarkdb::NewTerarkZipTableFactory(terarkdb::TerarkZipTableOptions const&, std::shared_ptr<terarkdb::TableFactory>)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/hash_table_bench.dir/build.make:95: hash_table_bench] Error 1
make[1]: *** [CMakeFiles/Makefile2:303: CMakeFiles/hash_table_bench.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: libterarkdb.a(options.cc.o): in function `terarkdb::ColumnFamilyOptions::ColumnFamilyOptions()':
/go/src/github.com/terarkdb/options/options.cc:130: undefined reference to `terarkdb::NewTerarkZipTableFactory(terarkdb::TerarkZipTableOptions const&, std::shared_ptr<terarkdb::TableFactory>)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/cache_bench.dir/build.make:95: cache_bench] Error 1
make[1]: *** [CMakeFiles/Makefile2:373: CMakeFiles/cache_bench.dir/all] Error 2
[ 92%] Linking CXX executable memtablerep_bench
/usr/bin/ld: libterarkdb.a(options.cc.o): in function `terarkdb::ColumnFamilyOptions::ColumnFamilyOptions()':
/go/src/github.com/terarkdb/options/options.cc:130: undefined reference to `terarkdb::NewTerarkZipTableFactory(terarkdb::TerarkZipTableOptions const&, std::shared_ptr<terarkdb::TableFactory>)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/column_aware_encoding_exp.dir/build.make:95: column_aware_encoding_exp] Error 1
make[1]: *** [CMakeFiles/Makefile2:267: CMakeFiles/column_aware_encoding_exp.dir/all] Error 2
/usr/bin/ld: libterarkdb.a(options.cc.o): in function `terarkdb::ColumnFamilyOptions::ColumnFamilyOptions()':
/go/src/github.com/terarkdb/options/options.cc:130: undefined reference to `terarkdb::NewTerarkZipTableFactory(terarkdb::TerarkZipTableOptions const&, std::shared_ptr<terarkdb::TableFactory>)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/memtablerep_bench.dir/build.make:95: memtablerep_bench] Error 1
make[1]: *** [CMakeFiles/Makefile2:409: CMakeFiles/memtablerep_bench.dir/all] Error 2

/*
ColumnFamilyOptions::ColumnFamilyOptions()
    : compression(Snappy_Supported() ? kSnappyCompression : kNoCompression),
      table_factory(
          std::shared_ptr<TableFactory>(new BlockBasedTableFactory())) {}
*/

ColumnFamilyOptions::ColumnFamilyOptions()
    : compression(Snappy_Supported() ? kSnappyCompression : kNoCompression),
      table_factory(
          std::shared_ptr<TableFactory>(new BlockBasedTableFactory())) {
  terarkdb::TerarkZipTableOptions tzt_options;
i edited the options/options.cc file as previously mentioned to force it to use terarkzip as default coz it's difficult to write binding for the programming language i'm using.
  tzt_options.localTempDir = "/tmp";
  tzt_options.indexNestLevel = 3;
  tzt_options.sampleRatio = 0.01;
  tzt_options.terarkZipMinLevel = 2; // Start using TerarkZipTable from level 2
  // reset table...
  table_factory.reset(
        NewTerarkZipTableFactory(tzt_options, table_factory));
}

@yapple
Copy link
Collaborator

yapple commented Jun 12, 2022

can you provide your Cmake options?

@hiqsociety
Copy link
Author

hiqsociety commented Jun 13, 2022

i used the standard

WITH_TESTS=OFF WITH_ZNS=OFF ./build.sh

i edited the options/options.cc file as previously mentioned to force it to use terarkzip as default coz it's difficult to write binding for the programming language i'm using.

below cmake


MESSAGE("[terarkdb] cmake install prefix: ${CMAKE_INSTALL_PREFIX}")
SET(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
SET(CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_PREFIX}/bin)

if (TERARK_INCLUDE_PREFIX)
  SET(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include/${TERARK_INCLUDE_PREFIX})
else()
  SET(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include)
endif()

# Enable or disable flags
option(WITH_COVERAGE "build with gcov support" OFF)
option(WITH_JEMALLOC "build with JeMalloc" ON)
option(WITH_SNAPPY "build with SNAPPY" ON)
option(WITH_LZ4 "build with lz4" ON)
option(WITH_ZLIB "build with zlib" ON)
option(WITH_ZSTD "build with zstd" ON)
option(WITH_BZ2 "build with bzip2" ON)
option(WITH_WINDOWS_UTF8_FILENAMES "use UTF8 as characterset for opening files, regardles of the system code page" OFF)
option(WITH_BYTEDANCE_METRICS "build with bytedance internal metrics" OFF)
option(WITH_ASAN "build with ASAN" OFF)
option(WITH_GFLAGS "build with GFlags" ON)
include(CMakeDependentOption)
# Tests are excluded from Release builds
CMAKE_DEPENDENT_OPTION(WITH_TESTS "build with tests" ON "CMAKE_BUILD_TYPE STREQUAL Debug" OFF)
option(WITH_TOOLS "build with tools" OFF)
option(WITH_TERARK_ZIP "build with TerarkZipTable support" ON)
option(WITH_ZENFS "build with experimental zenfs" OFF)
option(WITH_DIAGNOSE_CACHE "build with diagnosable cache support" OFF)
option(WITH_BOOSTLIB "build with boost, if WITH_TERARK_ZIP is ON, this will also set to ON" OFF)
option(WITH_TERARKDB_NAMESPACE "namespace" "terarkdb")


@hiqsociety
Copy link
Author

hi, any updates on this?

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

2 participants