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.
- Loading branch information
Showing
6 changed files
with
112 additions
and
68 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,45 @@ | ||
# Prerequisite | ||
|
||
1. You need to install Visual Studio Community first, for example VS2019. | ||
2. [vcpkg](https://github.com/microsoft/vcpkg) | ||
3. [CMake](https://cmake.org/download/) | ||
|
||
# Building | ||
|
||
The following steps are done in *Developer Powershell for VS 2019*(StartMenu - Visual Studio 2019 - Developer Powershell for VS 2019) | ||
|
||
1. Install RocksDB | ||
```powershell | ||
cd <vcpkg_root> | ||
.\vcpkg.exe install rocksdb[*]:x64-windows-static | ||
``` | ||
This will automatically install dependent compression libraries(lz4, snappy, zstd, zlib), and build rocksdb with these libraries enabled. | ||
|
||
`<vcpkg_root>` is the path where you've installed the vcpkg, `C:/src/vcpkg` for example. | ||
|
||
2. Install WiredTiger | ||
|
||
see [wiredtiger/README.md](wiredtiger/README.md) | ||
|
||
3. Clone YCSB-cpp | ||
```powershell | ||
cd <somewhere> | ||
git clone https://github.com/kabu1204/YCSB-cpp | ||
cd YCSB-cpp | ||
git submodule update --init | ||
``` | ||
4. Build YCSB-cpp | ||
```powershell | ||
mkdir build | ||
cd build | ||
cmake -DBIND_ROCKSDB=1 -DWITH_SNAPPY=1 -DCMAKE_TOOLCHAIN_FILE=<vcpkg_root>/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static .. | ||
msbuild ycsb-cpp.sln /p:Configuration=Release | ||
``` | ||
`-DCMAKE_TOOLCHAIN_FILE=<vcpkg_root>/scripts/buildsystems/vcpkg.cmake` enables CMake `find_packege()` to find libraries | ||
installed by vcpkg. You do not need to use backslash '\' in your path here. | ||
|
||
`-DBIND_ROCKSDB=1` binds rocksdb. | ||
|
||
`-DWITH_SNAPPY=1` tells CMake to link snappy with YCSB, same for `WITH_LZ4`, `WITH_ZLIB` and `WITH_ZSTD`. | ||
|
||
The executable `ycsb.exe` can be found in `build/Release`. |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# WiredTiger | ||
|
||
The code in `wiredtiger_db.cc` assumes your libwiredtiger to have built-in `<compressor>` that you specify in the | ||
`wiredtiger.properties`. | ||
|
||
For example, if you specify `wiredtiger.blk_mgr.compressor=snappy` in `wiredtiger.properties`, your libwiredtiger | ||
should be built with `DHAVE_BUILTIN_EXTENSION_SNAPPY=1`. | ||
|
||
## Install WiredTiger library on POSIX | ||
|
||
Download and extract the source: | ||
``` | ||
wget https://github.com/wiredtiger/wiredtiger/archive/refs/tags/11.1.0.tar.gz | ||
tar xvzf 11.1.0.tar.gz | ||
mkdir -p wiredtiger-11.1.0/build | ||
cd wiredtiger-11.1.0/build | ||
``` | ||
|
||
Enable built-in compressors and build | ||
``` | ||
cmake -DHAVE_BUILTIN_EXTENSION_LZ4=1 -DHAVE_BUILTIN_EXTENSION_SNAPPY=1 -DHAVE_BUILTIN_EXTENSION_ZLIB=1 -DHAVE_BUILTIN_EXTENSION_ZSTD=1 -DENABLE_STATIC=1 ../. | ||
make -j$(nproc) | ||
sudo make install | ||
``` | ||
|
||
## Install WiredTiger library on Windows with vcpkg | ||
|
||
Build wiredtiger on Windows with built-in compressors is a little more complicated, we need to modify some source code of wiredtiger. | ||
|
||
So I made a vcpkg port of wiredtiger, which simplifies the process. | ||
|
||
1. install cmake/vcpkg on Windows | ||
2. refer to the step 1-2 of [wiredtiger-vcpkg](https://github.com/kabu1204/wiredtiger-vcpkg) to install wiredtiger.lib. |
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