diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index b9dd80fe6..fd6823ee5 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -294,3 +294,10 @@ set_path_external_library(jemalloc STATIC ${CMAKE_CURRENT_SOURCE_DIR}/jemalloc/include/) import_header_library(rangev3 ${CMAKE_CURRENT_SOURCE_DIR}/rangev3/include) + +# Setup NuRaft +import_external_library(nuraft STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/nuraft/lib/libnuraft.a + ${CMAKE_CURRENT_SOURCE_DIR}/nuraft/include/) +find_package(OpenSSL REQUIRED) +target_link_libraries(nuraft INTERFACE ${OPENSSL_LIBRARIES}) diff --git a/libs/setup.sh b/libs/setup.sh index 2f968f71c..4b5b81dfc 100755 --- a/libs/setup.sh +++ b/libs/setup.sh @@ -126,6 +126,7 @@ declare -A primary_urls=( ["absl"]="https://$local_cache_host/git/abseil-cpp.git" ["jemalloc"]="https://$local_cache_host/git/jemalloc.git" ["range-v3"]="https://$local_cache_host/git/ericniebler/range-v3.git" + ["nuraft"]="https://$local_cache_host/git/eBay/NuRaft.git" ) # The goal of secondary urls is to have links to the "source of truth" of @@ -155,6 +156,7 @@ declare -A secondary_urls=( ["absl"]="https://github.com/abseil/abseil-cpp.git" ["jemalloc"]="https://github.com/jemalloc/jemalloc.git" ["range-v3"]="https://github.com/ericniebler/range-v3.git" + ["nuraft"]="https://github.com/eBay/NuRaft.git" ) # antlr @@ -277,3 +279,10 @@ popd #range-v3 release-0.12.0 range_v3_ref="release-0.12.0" repo_clone_try_double "${primary_urls[range-v3]}" "${secondary_urls[range-v3]}" "rangev3" "$range_v3_ref" + +# NuRaft +nuraft_tag="v2.1.0" +repo_clone_try_double "${primary_urls[nuraft]}" "${secondary_urls[nuraft]}" "nuraft" "$nuraft_tag" true +pushd nuraft +./prepare.sh +popd diff --git a/src/coordination/CMakeLists.txt b/src/coordination/CMakeLists.txt index e8c4b3735..25c569f37 100644 --- a/src/coordination/CMakeLists.txt +++ b/src/coordination/CMakeLists.txt @@ -25,5 +25,5 @@ target_sources(mg-coordination target_include_directories(mg-coordination PUBLIC include) target_link_libraries(mg-coordination - PUBLIC mg::utils mg::rpc mg::slk mg::io mg::repl_coord_glue lib::rangev3 + PUBLIC mg::utils mg::rpc mg::slk mg::io mg::repl_coord_glue lib::rangev3 nuraft ) diff --git a/src/coordination/coordinator_data.cpp b/src/coordination/coordinator_data.cpp index c236cf753..5bc8066de 100644 --- a/src/coordination/coordinator_data.cpp +++ b/src/coordination/coordinator_data.cpp @@ -17,6 +17,7 @@ #include #include +#include "libnuraft/nuraft.hxx" namespace memgraph::coordination {