forked from ls4154/YCSB-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YCSB-cpp can now be built on windows, using vcpkg and CMake. See README.md for usage.
- Loading branch information
Showing
7 changed files
with
167 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(ycsb-cpp LANGUAGES C CXX) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
set(CMAKE_BUILD_TYPE Release) | ||
|
||
option(BIND_ROCKSDB "build with rocksdb" OFF) | ||
option(BIND_WIREDTIGER "build with wiredtiger" OFF) | ||
option(WITH_ZLIB "linking YCSB with zlib; needed by HdrHISTOGRAM, DO NOT TURN OFF" ON) | ||
option(WITH_LZ4 "linking YCSB with lz4" OFF) | ||
option(WITH_SNAPPY "linking YCSB with snappy" OFF) | ||
option(WITH_ZSTD "linking YCSB with zstd" OFF) | ||
|
||
file(GLOB_RECURSE YCSB_CORE_SRC "core/*.cc") | ||
|
||
add_executable(ycsb ${YCSB_CORE_SRC}) | ||
target_include_directories(ycsb PRIVATE ${PROJECT_SOURCE_DIR}) | ||
|
||
if (BIND_ROCKSDB) | ||
message(STATUS "BIND_ROCKSDB - ON") | ||
# rocksdb need zlib | ||
set(WITH_ZLIB ON) | ||
file(GLOB_RECURSE YCSB_ROCKSDB_SRC "rocksdb/*.cc") | ||
target_sources(ycsb PRIVATE ${YCSB_ROCKSDB_SRC}) | ||
find_package(RocksDB CONFIG REQUIRED) | ||
target_link_libraries(ycsb PRIVATE RocksDB::rocksdb rpcrt4.lib) | ||
else() | ||
message(STATUS "BIND_ROCKSDB - OFF") | ||
endif() | ||
|
||
if(WITH_ZLIB) | ||
message(STATUS "WITH_ZLIB - ON") | ||
find_package(ZLIB REQUIRED) | ||
target_link_libraries(ycsb PRIVATE ZLIB::ZLIB) | ||
else() | ||
message(STATUS "WITH_ZLIB - OFF") | ||
endif() | ||
|
||
if(WITH_SNAPPY) | ||
message(STATUS "WITH_SNAPPY - ON") | ||
find_package(Snappy CONFIG REQUIRED) | ||
target_link_libraries(ycsb PRIVATE Snappy::snappy) | ||
else() | ||
message(STATUS "WITH_SNAPPY - OFF") | ||
endif() | ||
|
||
if(WITH_LZ4) | ||
message(STATUS "WITH_LZ4 - ON") | ||
find_package(lz4 CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE lz4::lz4) | ||
else() | ||
message(STATUS "WITH_LZ4 - OFF") | ||
endif() | ||
|
||
if(WITH_ZSTD) | ||
message(STATUS "WITH_ZSTD - ON") | ||
find_package(zstd CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>) | ||
else() | ||
message(STATUS "WITH_ZSTD - OFF") | ||
endif() | ||
|
||
add_subdirectory(HdrHistogram_c) | ||
include_directories(HdrHistogram_c/include) | ||
add_compile_definitions(-DHDRMEASUREMENT) | ||
add_dependencies(ycsb hdr_histogram) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
#include <cstdint> | ||
#include <exception> | ||
#include <random> | ||
#include <locale> | ||
|
||
namespace ycsbc { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
rocksdb.dbname=/tmp/ycsb-rocskdb | ||
rocksdb.dbname=ycsb-rocksdb | ||
rocksdb.format=single | ||
rocksdb.destroy=false | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters