From 04d2fdf123ce2a76fabb18e346537e9808dbd3e6 Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Fri, 14 Oct 2022 10:39:54 +0800 Subject: [PATCH] dir change --- .gitmodules | 14 +- Cargo.lock | 238 ++++++++++++++++++++++++++++-- Cargo.toml | 1 + cozorocks/Cargo.toml | 1 + cozorocks/build.rs | 30 +--- cozorocks/deps/WINDOWS.md | 10 -- cozorocks/deps/build_deps.sh | 71 --------- cozorocks/deps/clean_deps.sh | 24 --- cozorocks/deps/gflags | 1 - cozorocks/deps/jemalloc | 1 - cozorocks/deps/lz4 | 1 - cozorocks/deps/rocksdb | 1 - cozorocks/deps/thirdparty.inc | 268 ---------------------------------- cozorocks/deps/zstd | 1 - 14 files changed, 232 insertions(+), 430 deletions(-) delete mode 100644 cozorocks/deps/WINDOWS.md delete mode 100755 cozorocks/deps/build_deps.sh delete mode 100755 cozorocks/deps/clean_deps.sh delete mode 160000 cozorocks/deps/gflags delete mode 160000 cozorocks/deps/jemalloc delete mode 160000 cozorocks/deps/lz4 delete mode 160000 cozorocks/deps/rocksdb delete mode 100644 cozorocks/deps/thirdparty.inc delete mode 160000 cozorocks/deps/zstd diff --git a/.gitmodules b/.gitmodules index cad7672f..21f36417 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,3 @@ -[submodule "cozorocks/deps/gflags"] - path = cozorocks/deps/gflags - url = https://github.com/gflags/gflags.git -[submodule "cozorocks/deps/lz4"] - path = cozorocks/deps/lz4 - url = https://github.com/lz4/lz4.git -[submodule "cozorocks/deps/zstd"] - path = cozorocks/deps/zstd - url = https://github.com/facebook/zstd.git [submodule "cozorocks/deps/rocksdb"] - path = cozorocks/deps/rocksdb + path = cozorocks/rocksdb url = https://github.com/facebook/rocksdb.git -[submodule "cozorocks/deps/jemalloc"] - path = cozorocks/deps/jemalloc - url = https://github.com/jemalloc/jemalloc.git diff --git a/Cargo.lock b/Cargo.lock index 1da6de89..390175ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,7 +116,7 @@ checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", @@ -129,6 +129,25 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "bindgen" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -205,6 +224,17 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "casey" version = "0.3.3" @@ -219,6 +249,24 @@ name = "cc" version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "cfg-if" @@ -269,6 +317,17 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" +[[package]] +name = "clang-sys" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "3.2.22" @@ -363,6 +422,7 @@ dependencies = [ "smallvec", "smartstring", "thiserror", + "tikv-jemallocator-global", "unicode-normalization", "uuid", ] @@ -373,6 +433,7 @@ version = "0.1.0" dependencies = [ "cxx", "cxx-build", + "librocksdb-sys", "miette", ] @@ -391,7 +452,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -400,7 +461,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crossbeam-utils", ] @@ -410,7 +471,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crossbeam-epoch", "crossbeam-utils", ] @@ -422,7 +483,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", - "cfg-if", + "cfg-if 1.0.0", "crossbeam-utils", "memoffset", "scopeguard", @@ -434,7 +495,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -567,7 +628,7 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall", "windows-sys", @@ -582,6 +643,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" + [[package]] name = "generic-array" version = "0.14.6" @@ -598,7 +665,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -609,6 +676,12 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + [[package]] name = "gzip-header" version = "1.0.0" @@ -710,7 +783,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -740,6 +813,15 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +[[package]] +name = "jobserver" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.60" @@ -755,12 +837,55 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" +[[package]] +name = "libloading" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +dependencies = [ + "cfg-if 1.0.0", + "winapi", +] + +[[package]] +name = "librocksdb-sys" +version = "0.8.0+7.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" +dependencies = [ + "bindgen", + "bzip2-sys", + "cc", + "glob", + "libc", + "libz-sys", + "tikv-jemalloc-sys", + "zstd-sys", +] + +[[package]] +name = "libz-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "link-cplusplus" version = "1.0.7" @@ -776,7 +901,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -850,6 +975,12 @@ dependencies = [ "unicase", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.5.4" @@ -917,6 +1048,16 @@ dependencies = [ "syn", ] +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-complex" version = "0.4.2" @@ -1026,6 +1167,12 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + [[package]] name = "percent-encoding" version = "2.2.0" @@ -1115,6 +1262,12 @@ dependencies = [ "uncased", ] +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + [[package]] name = "ppv-lite86" version = "0.2.16" @@ -1358,6 +1511,12 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustls" version = "0.20.6" @@ -1456,11 +1615,17 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest", ] +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + [[package]] name = "simba" version = "0.7.2" @@ -1570,7 +1735,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand", "libc", "redox_syscall", @@ -1637,6 +1802,37 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "tikv-jemalloc-sys" +version = "0.5.2+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3" +dependencies = [ + "cc", + "fs_extra", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + +[[package]] +name = "tikv-jemallocator-global" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28047b535f87b21a79b0b450c5aed8235b32a5aaf8dcc6706b638c1eadea11f" +dependencies = [ + "cfg-if 0.1.10", + "tikv-jemallocator", +] + [[package]] name = "time" version = "0.1.44" @@ -1789,6 +1985,12 @@ dependencies = [ "serde", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.4" @@ -1813,7 +2015,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen-macro", ] @@ -1973,3 +2175,13 @@ name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "zstd-sys" +version = "2.0.1+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +dependencies = [ + "cc", + "libc", +] diff --git a/Cargo.toml b/Cargo.toml index 23049669..2b4ab25e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,7 @@ unicode-normalization = "0.1.21" thiserror = "1.0.34" uuid = { version = "1.1.2", features = ["v1", "v4", "serde"] } csv = "1.1.6" +tikv-jemallocator-global = "0.5.0" cozorocks = { path = "cozorocks" } clap = { version = "3.2.8", features = ["derive"] } diff --git a/cozorocks/Cargo.toml b/cozorocks/Cargo.toml index 3fd1af9c..b0113f75 100644 --- a/cozorocks/Cargo.toml +++ b/cozorocks/Cargo.toml @@ -9,6 +9,7 @@ license = "AGPL-3.0-or-later" [dependencies] cxx = "1.0.69" miette = "5.3.0" +librocksdb-sys = { version = "=0.8.0", features = ["static", "jemalloc", "lz4", "zstd", "rtti"] } [build-dependencies] cxx-build = "1.0.69" \ No newline at end of file diff --git a/cozorocks/build.rs b/cozorocks/build.rs index b397dcf3..374f6e37 100644 --- a/cozorocks/build.rs +++ b/cozorocks/build.rs @@ -6,7 +6,7 @@ fn main() { let mut builder = cxx_build::bridge("src/bridge/mod.rs"); builder .files(["bridge/status.cpp", "bridge/db.cpp", "bridge/tx.cpp"]) - .include("deps/rocksdb/include") + .include("rocksdb/include") .include("bridge"); if target.contains("msvc") { builder.flag_if_supported("-std:c++17"); @@ -14,31 +14,9 @@ fn main() { builder.flag_if_supported("-std=c++17"); }; builder.compile("cozorocks"); - - let manifest_dir = var("CARGO_MANIFEST_DIR").unwrap(); - - if target.contains("msvc") { - println!("cargo:rustc-link-search={}/deps/zstd/build/VS2010/bin/x64_Release", manifest_dir); - println!("cargo:rustc-link-search={}/deps/lz4/build/VS2017/bin/x64_Release", manifest_dir); - println!("cargo:rustc-link-search={}/deps/rocksdb/cmake_build/Release", manifest_dir); - println!("cargo:rustc-link-search={}/deps/gflags/cmake_build/lib/Release", manifest_dir); - println!("cargo:rustc-link-lib=static=rocksdb"); - println!("cargo:rustc-link-lib=static=gflags_static"); - println!("cargo:rustc-link-lib=libzstd"); - println!("cargo:rustc-link-lib=static=liblz4_static"); - println!("cargo:rustc-link-lib=rpcrt4"); - println!("cargo:rustc-link-lib=shlwapi"); - } else { - println!("cargo:rustc-link-search={}/deps/rocksdb/cmake_build/", manifest_dir); - println!("cargo:rustc-link-search={}/deps/zstd/lib/", manifest_dir); - println!("cargo:rustc-link-search={}/deps/lz4/lib/", manifest_dir); - println!("cargo:rustc-link-search={}/deps/jemalloc/lib/", manifest_dir); - println!("cargo:rustc-link-lib=static=zstd"); - println!("cargo:rustc-link-lib=static=rocksdb"); - println!("cargo:rustc-link-lib=static=lz4"); - println!("cargo:rustc-link-lib=static=jemalloc"); - - } + println!("cargo:rustc-link-lib=static=rocksdb"); + println!("cargo:rustc-link-lib=static=zstd"); + println!("cargo:rustc-link-lib=static=lz4"); println!("cargo:rerun-if-changed=src/bridge/mod.rs"); println!("cargo:rerun-if-changed=bridge/bridge.h"); diff --git a/cozorocks/deps/WINDOWS.md b/cozorocks/deps/WINDOWS.md deleted file mode 100644 index 60dc059c..00000000 --- a/cozorocks/deps/WINDOWS.md +++ /dev/null @@ -1,10 +0,0 @@ -# Building on Windows - -* Refer to https://github.com/facebook/rocksdb/wiki/Building-on-Windows, with the following changes. -* Build zlib using cmake instead of whatever was in the above instruction - * Copy `zconf.h` to the base directory after building -* Edit `thirdparty.inc` appropriately -* `set THIRDPARTY_HOME=C:\Users\zh217\cozo\cozorocks\deps` -* `cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DGFLAGS=1 -DLZ4=1 -DZSTD=1 -DUSE_RTTI=1 ..` -* `msbuild rocksdb.sln /m /p:Configuration=Release` -* Need to copy some dll files so that they could be found \ No newline at end of file diff --git a/cozorocks/deps/build_deps.sh b/cozorocks/deps/build_deps.sh deleted file mode 100755 index a03d81b4..00000000 --- a/cozorocks/deps/build_deps.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash - -set -e - -#if [[ "$OSTYPE" == "linux-gnu"* ]]; then -# export CC=/usr/bin/clang-12 -# export CPP=/usr/bin/clang-cpp-12 -# export CXX=/usr/bin/clang++-12 -# export LD=/usr/bin/ld.lld-12 -# if [ ! -f ${CC} ]; then echo "${CC} not found"; exit; fi -# if [ ! -f ${CPP} ]; then echo "${CPP} not found"; exit; fi -# if [ ! -f ${CXX} ]; then echo "${CXX} not found"; exit; fi -# if [ ! -f ${LD} ]; then echo "${LD} not found"; exit; fi -#fi - -N_CORES=$(getconf _NPROCESSORS_ONLN) - -export CFLAGS=-fPIE -export CXXFLAGS=-fPIE - -# gflags - -cd gflags -rm -fr cmake_build -mkdir cmake_build && cd cmake_build -cmake .. -make -j $N_CORES -cd ../.. - -# lz4 - -cd lz4 -make clean -make -j $N_CORES -cd .. - -# zstd - -cd zstd -make clean -make -j $N_CORES -cd .. - -# jemalloc -cd jemalloc -./autogen.sh --disable-debug --with-jemalloc-prefix='' -make -j $N_CORES -cd .. - -# rocksdb - -cd rocksdb -rm -fr cmake_build -mkdir cmake_build && cd cmake_build -# cp ../../thirdparty.inc ../thirdparty.inc -cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_MODULE_PATH="${PWD}/../../lz4;${PWD}/../../zstd" \ - -DROCKSDB_BUILD_SHARED=0 \ - -DGFLAGS_INCLUDE_DIR=${PWD}/../../gflags/cmake_build/include \ - -DGFLAGS_LIBRARIES=${PWD}/../../gflags/cmake_build/lib \ - -Dlz4_INCLUDE_DIRS=${PWD}/../../lz4/lib \ - -Dlz4_LIBRARIES=${PWD}/../../lz4/lib \ - -Dzstd_INCLUDE_DIRS=${PWD}/../../zstd/lib \ - -Dzstd_LIBRARIES=${PWD}/../../zstd/lib \ - -DJeMalloc_INCLUDE_DIRS=${PWD}/../../jemalloc/include \ - -DJeMalloc_LIBRARIES=${PWD}/../../jemalloc/lib \ - -DFAIL_ON_WARNINGS=0 \ - -DCMAKE_CXX_STANDARD=20 -DWITH_GFLAGS=1 -DWITH_LZ4=1 -DWITH_ZSTD=1 -DUSE_RTTI=1 -DWITH_TESTS=0 \ - -DWITH_JEMALLOC=1 -DWITH_BENCHMARK_TOOLS=0 -DWITH_CORE_TOOLS=0 -DWITH_TOOLS=0 -DWITH_TRACE_TOOLS=0 .. -make -j $N_CORES -cd .. diff --git a/cozorocks/deps/clean_deps.sh b/cozorocks/deps/clean_deps.sh deleted file mode 100755 index f9f7fea0..00000000 --- a/cozorocks/deps/clean_deps.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd gflags -rm -fr cmake_build -cd .. - -cd lz4 -make clean -cd .. - -cd zstd -make clean -cd .. - -cd jemalloc -make clean -rm -f 'configure~' -cd .. - -cd rocksdb -rm -fr cmake_build -cd .. \ No newline at end of file diff --git a/cozorocks/deps/gflags b/cozorocks/deps/gflags deleted file mode 160000 index a738fdf9..00000000 --- a/cozorocks/deps/gflags +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a738fdf9338412f83ab3f26f31ac11ed3f3ec4bd diff --git a/cozorocks/deps/jemalloc b/cozorocks/deps/jemalloc deleted file mode 160000 index 54eaed1d..00000000 --- a/cozorocks/deps/jemalloc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c diff --git a/cozorocks/deps/lz4 b/cozorocks/deps/lz4 deleted file mode 160000 index 5ff83968..00000000 --- a/cozorocks/deps/lz4 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5ff839680134437dbf4678f3d0c7b371d84f4964 diff --git a/cozorocks/deps/rocksdb b/cozorocks/deps/rocksdb deleted file mode 160000 index 59495ff2..00000000 --- a/cozorocks/deps/rocksdb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 59495ff26a410eab30dab4f76b76ec5ba4ad293b diff --git a/cozorocks/deps/thirdparty.inc b/cozorocks/deps/thirdparty.inc deleted file mode 100644 index 7e185557..00000000 --- a/cozorocks/deps/thirdparty.inc +++ /dev/null @@ -1,268 +0,0 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. -# Edit definitions below to specify paths to include files and libraries of all 3rd party libraries - -# TODO: Make this work with find_package and/or get rid of it -# -# This example assumes all the libraries locate in directories under THIRDPARTY_HOME environment variable -# Set environment variable THIRDPARTY_HOME to point to your third party libraries home (Unix style dir separators) -# or change the paths below to reflect where the libraries actually reside -# -set (THIRDPARTY_LIBS "") # Initialization, don't touch - -# -# Defaults -# -set(GFLAGS_HOME $ENV{THIRDPARTY_HOME}/gflags/cmake_build) -set(GFLAGS_INCLUDE ${GFLAGS_HOME}/include) -set(GFLAGS_LIB_DEBUG ${GFLAGS_HOME}/lib/Release/gflags_static.lib) -set(GFLAGS_LIB_RELEASE ${GFLAGS_HOME}/lib/Release/gflags_static.lib) - -# ================================================== GFLAGS ================================================== -# For compatibility -if (GFLAGS) - set(WITH_GFLAGS ON) -endif () - -if (WITH_GFLAGS) - message(STATUS "GFLAGS library is enabled") - - if(DEFINED ENV{GFLAGS_INCLUDE}) - set(GFLAGS_INCLUDE $ENV{GFLAGS_INCLUDE}) - endif() - - if(DEFINED ENV{GFLAGS_LIB_DEBUG}) - set(GFLAGS_LIB_DEBUG $ENV{GFLAGS_LIB_DEBUG}) - endif() - - if(DEFINED ENV{GFLAGS_LIB_RELEASE}) - set(GFLAGS_LIB_RELEASE $ENV{GFLAGS_LIB_RELEASE}) - endif() - - set(GFLAGS_CXX_FLAGS -DGFLAGS=gflags) - set(GFLAGS_LIBS debug ${GFLAGS_LIB_DEBUG} optimized ${GFLAGS_LIB_RELEASE}) - - add_definitions(${GFLAGS_CXX_FLAGS}) - include_directories(${GFLAGS_INCLUDE}) - set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${GFLAGS_LIBS}) -else () - message(STATUS "GFLAGS library is disabled") -endif () - -# ================================================== SNAPPY ================================================== -# -# Edit these 4 lines to define paths to Snappy -# -set(SNAPPY_HOME $ENV{THIRDPARTY_HOME}/Snappy.Library) -set(SNAPPY_INCLUDE ${SNAPPY_HOME}/build/native/inc/inc) -set(SNAPPY_LIB_DEBUG ${SNAPPY_HOME}/lib/native/debug/amd64/snappy.lib) -set(SNAPPY_LIB_RELEASE ${SNAPPY_HOME}/lib/native/retail/amd64/snappy.lib) - -# For compatibility -if(SNAPPY) - set(WITH_SNAPPY ON) -endif () - -if (WITH_SNAPPY) - message(STATUS "SNAPPY library is enabled") - - if(DEFINED ENV{SNAPPY_INCLUDE}) - set(SNAPPY_INCLUDE $ENV{SNAPPY_INCLUDE}) - endif() - - if(DEFINED ENV{SNAPPY_LIB_DEBUG}) - set(SNAPPY_LIB_DEBUG $ENV{SNAPPY_LIB_DEBUG}) - endif() - - if(DEFINED ENV{SNAPPY_LIB_RELEASE}) - set(SNAPPY_LIB_RELEASE $ENV{SNAPPY_LIB_RELEASE}) - endif() - - set(SNAPPY_CXX_FLAGS -DSNAPPY) - set(SNAPPY_LIBS debug ${SNAPPY_LIB_DEBUG} optimized ${SNAPPY_LIB_RELEASE}) - - add_definitions(${SNAPPY_CXX_FLAGS}) - include_directories(${SNAPPY_INCLUDE}) - set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${SNAPPY_LIBS}) -else () - message(STATUS "SNAPPY library is disabled") -endif () - -# ================================================== LZ4 ================================================== -# -# Edit these 4 lines to define paths to LZ4 -# -set(LZ4_HOME $ENV{THIRDPARTY_HOME}/lz4) -set(LZ4_INCLUDE ${LZ4_HOME}/lib) -set(LZ4_LIB_DEBUG ${LZ4_HOME}/build/VS2017/bin/x64_Release/liblz4.lib) -set(LZ4_LIB_RELEASE ${LZ4_HOME}/build/VS2017/bin/x64_Release/liblz4.lib) - - -# For compatibility -if (LZ4) - set(WITH_LZ4 ON) -endif () - -if (WITH_LZ4) - message(STATUS "LZ4 library is enabled") - - if(DEFINED ENV{LZ4_INCLUDE}) - set(LZ4_INCLUDE $ENV{LZ4_INCLUDE}) - endif() - - if(DEFINED ENV{LZ4_LIB_DEBUG}) - set(LZ4_LIB_DEBUG $ENV{LZ4_LIB_DEBUG}) - endif() - - if(DEFINED ENV{LZ4_LIB_RELEASE}) - set(LZ4_LIB_RELEASE $ENV{LZ4_LIB_RELEASE}) - endif() - - set(LZ4_CXX_FLAGS -DLZ4) - set(LZ4_LIBS debug ${LZ4_LIB_DEBUG} optimized ${LZ4_LIB_RELEASE}) - - add_definitions(${LZ4_CXX_FLAGS}) - include_directories(${LZ4_INCLUDE}) - set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${LZ4_LIBS}) -else () - message(STATUS "LZ4 library is disabled") -endif () - -# ================================================== ZLIB ================================================== -# -# Edit these 4 lines to define paths to ZLIB -# -set(ZLIB_HOME $ENV{THIRDPARTY_HOME}/ZLIB.Library) -set(ZLIB_INCLUDE ${ZLIB_HOME}/build/native/inc/inc) -set(ZLIB_LIB_DEBUG ${ZLIB_HOME}/lib/native/debug/amd64/zlib.lib) -set(ZLIB_LIB_RELEASE ${ZLIB_HOME}/lib/native/retail/amd64/zlib.lib) - -# For compatibilty -if (ZLIB) - set(WITH_ZLIB ON) -endif () - -if (WITH_ZLIB) - message(STATUS "ZLIB library is enabled") - - if(DEFINED ENV{ZLIB_INCLUDE}) - set(ZLIB_INCLUDE $ENV{ZLIB_INCLUDE}) - endif() - - if(DEFINED ENV{ZLIB_LIB_DEBUG}) - set(ZLIB_LIB_DEBUG $ENV{ZLIB_LIB_DEBUG}) - endif() - - if(DEFINED ENV{ZLIB_LIB_RELEASE}) - set(ZLIB_LIB_RELEASE $ENV{ZLIB_LIB_RELEASE}) - endif() - - set(ZLIB_CXX_FLAGS -DZLIB) - set(ZLIB_LIBS debug ${ZLIB_LIB_DEBUG} optimized ${ZLIB_LIB_RELEASE}) - - add_definitions(${ZLIB_CXX_FLAGS}) - include_directories(${ZLIB_INCLUDE}) - set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${ZLIB_LIBS}) -else () - message(STATUS "ZLIB library is disabled") -endif () - -# ================================================== XPRESS ================================================== -# This makes use of built-in Windows API, no additional includes, links to a system lib - -# For compatibilty -if (XPRESS) - set(WITH_XPRESS ON) -endif () - -if (WITH_XPRESS) - message(STATUS "XPRESS is enabled") - - add_definitions(-DXPRESS) - - # We are using the implementation provided by the system - set (SYSTEM_LIBS ${SYSTEM_LIBS} Cabinet.lib) -else () - message(STATUS "XPRESS is disabled") -endif () - - -# ================================================== ZSTD ================================================== -# -# Edit these 4 lines to define paths to ZSTD -# -set(ZSTD_HOME $ENV{THIRDPARTY_HOME}/zstd) -set(ZSTD_INCLUDE ${ZSTD_HOME}/lib) -set(ZSTD_LIB_DEBUG ${ZSTD_HOME}/build/VS2010/bin/x64_Release/libzstd.lib) -set(ZSTD_LIB_RELEASE ${ZSTD_HOME}//build/VS2010/bin/x64_Release/libzstd.lib) - -# For compatibility -if (ZSTD) - set(WITH_ZSTD ON) -endif () - -if (WITH_ZSTD) - message(STATUS "ZSTD library is enabled") - - if(DEFINED ENV{ZSTD_INCLUDE}) - set(ZSTD_INCLUDE $ENV{ZSTD_INCLUDE}) - endif() - - if(DEFINED ENV{ZSTD_LIB_DEBUG}) - set(ZSTD_LIB_DEBUG $ENV{ZSTD_LIB_DEBUG}) - endif() - - if(DEFINED ENV{ZSTD_LIB_RELEASE}) - set(ZSTD_LIB_RELEASE $ENV{ZSTD_LIB_RELEASE}) - endif() - - # ZSTD_STATIC_LINKING_ONLY only allows us to create an allocation functions override - # When jemalloc is in use - set(ZSTD_LIBS debug ${ZSTD_LIB_DEBUG} optimized ${ZSTD_LIB_RELEASE}) - - add_definitions(-DZSTD -DZSTD_STATIC_LINKING_ONLY) - include_directories(${ZSTD_INCLUDE}) - set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${ZSTD_LIBS}) -else () - message(STATUS "ZSTD library is disabled") -endif () - -# -# Edit these 4 lines to define paths to Jemalloc -# -set(JEMALLOC_HOME $ENV{THIRDPARTY_HOME}/Jemalloc.Library) -set(JEMALLOC_INCLUDE ${JEMALLOC_HOME}/build/native/inc) -set(JEMALLOC_LIB_DEBUG ${JEMALLOC_HOME}/lib/native/debug/amd64/jemalloc.lib) -set(JEMALLOC_LIB_RELEASE ${JEMALLOC_HOME}/lib/native/retail/amd64/jemalloc.lib) - -# ================================================== JEMALLOC ================================================== -if(JEMALLOC) - set(WITH_JEMALLOC ON) -endif() - -if (WITH_JEMALLOC) - message(STATUS "JEMALLOC library is enabled") - set(JEMALLOC_CXX_FLAGS "-DROCKSDB_JEMALLOC -DJEMALLOC_EXPORT= -DJEMALLOC_NO_RENAME") - - if(DEFINED ENV{JEMALLOC_INCLUDE}) - set(JEMALLOC_INCLUDE $ENV{JEMALLOC_INCLUDE}) - endif() - - if(DEFINED ENV{JEMALLOC_LIB_DEBUG}) - set(JEMALLOC_LIB_DEBUG $ENV{JEMALLOC_LIB_DEBUG}) - endif() - - if(DEFINED ENV{JEMALLOC_LIB_RELEASE}) - set(JEMALLOC_LIB_RELEASE $ENV{JEMALLOC_LIB_RELEASE}) - endif() - - set(JEMALLOC_LIBS debug ${JEMALLOC_LIB_DEBUG} optimized ${JEMALLOC_LIB_RELEASE}) - - add_definitions(${JEMALLOC_CXX_FLAGS}) - include_directories(${JEMALLOC_INCLUDE}) - set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${JEMALLOC_LIBS}) - set (ARTIFACT_SUFFIX "_je") - -else () - set (ARTIFACT_SUFFIX "") - message(STATUS "JEMALLOC library is disabled") -endif () diff --git a/cozorocks/deps/zstd b/cozorocks/deps/zstd deleted file mode 160000 index e47e674c..00000000 --- a/cozorocks/deps/zstd +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e47e674cd09583ff0503f0f6defd6d23d8b718d3