From f3fb64e51997a5288fb7723d01253470e3afa69b Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Fri, 29 Nov 2024 17:38:30 +0000 Subject: [PATCH 01/14] skaled-2053-remove-hunter --- .github/workflows/build.yml | 3 --- CMakeLists.txt | 27 +++++------------------ DockerfileBase | 2 -- deps/build.sh | 44 ++++++++++++++++++++++++++++++++----- libBLS | 2 +- 5 files changed, 45 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef00922ea..be0cd1274 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -174,9 +174,6 @@ jobs: - name: verify jsonrpc has been built run: ls libBLS/deps/deps_inst/x86_or_x64/include/jsonrpccpp/client.h - - name: workaround for HUNTER - run: cd .. && mkdir -p "${HOME}"/.hunter/_Base/Download/crc32c/1.0.5/dc7fa8c/ && wget -O "${HOME}"/.hunter/_Base/Download/crc32c/1.0.5/dc7fa8c/hunter-1.0.5.tar.gz https://github.com/hunter-packages/crc32c/archive/refs/tags/hunter-1.0.5.tar.gz - - name: build consensus run: | cd scripts && ./build.py Debug diff --git a/CMakeLists.txt b/CMakeLists.txt index 6db04e2b4..70aab7590 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,11 +21,11 @@ if (NOT DEFINED DEPS_INSTALL_ROOT) endif () message(INFO "---- DEPS_INSTALL_ROOT in consensus is: ${DEPS_INSTALL_ROOT}") -include("cmake/HunterGate.cmake") -include("cmake/precompiledheader.cmake") +#include("cmake/HunterGate.cmake") +#include("cmake/precompiledheader.cmake") -HunterGate(URL "https://github.com/ruslo/hunter/archive/v0.23.76.tar.gz" SHA1 "c7b60993e841850e2c449afd454f5d5aa4ec04e4") +#HunterGate(URL "https://github.com/ruslo/hunter/archive/v0.23.76.tar.gz" SHA1 "c7b60993e841850e2c449afd454f5d5aa4ec04e4") option( CONSENSUS_PROFILING "Build for profiling" OFF ) if( SKALED_PROFILING ) @@ -65,16 +65,11 @@ set(CMAKE_PREFIX_PATH "${DEPS_INSTALL_ROOT}") # zeromq - #find_package(оч CONFIG REQUIRED) - #leveldb - -hunter_add_package(leveldb) find_package(leveldb CONFIG REQUIRED) - #set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wreturn-type -Winit-self") @@ -95,7 +90,6 @@ add_definitions("-DZMQ_NONBLOCKING") if (CMAKE_PROJECT_NAME STREQUAL "consensus") - unset(SKALE_HAVE_BOOST_FROM_HUNTER) # to install compiler cache: sudo apt-get install ccache find_program(CCACHE_FOUND ccache) if (CCACHE_FOUND) @@ -201,16 +195,7 @@ include_directories(. spdlog/include ${BLS_INCLUDE_DIRS} ${DEPS_INSTALL_ROOT}/in "${DEPS_INSTALL_ROOT}/include" ${CMAKE_BINARY_DIR}/deps/include) -if (SKALE_HAVE_BOOST_FROM_HUNTER) - set(BOOST_LIBS_4_CONSENSUS - Boost::log Boost::thread Boost::system Boost::filesystem Boost::program_options - ) -else () - set(BOOST_LIBS_4_CONSENSUS - #boost_log - boost_thread boost_system boost_filesystem boost_program_options - ) -endif () +set(BOOST_LIBS_FOR_CONSENSUS boost_thread boost_system boost_filesystem boost_program_options) set(DASH_D_SUFFIX "") if (${CMAKE_BUILD_TYPE} MATCHES "Debug") @@ -221,9 +206,9 @@ endif () SET(LINK_LIBRARIES backtrace Threads::Threads - ${BOOST_LIBS_4_CONSENSUS} + ${BOOST_LIBS_FOR_CONSENSUS} ${LIB_NAME_cryptopp} - leveldb::leveldb + leveldb "${DEPS_INSTALL_ROOT}/lib/libjsonrpccpp-client.a" "${DEPS_INSTALL_ROOT}/lib/libjsonrpccpp-server.a" "${DEPS_INSTALL_ROOT}/lib/libmicrohttpd.a" diff --git a/DockerfileBase b/DockerfileBase index 723a72b86..52b634741 100644 --- a/DockerfileBase +++ b/DockerfileBase @@ -36,8 +36,6 @@ WORKDIR /consensust RUN cd deps && ./build.sh RUN ccache -M 20G -RUN mkdir -p "${HOME}"/.hunter/_Base/Download/crc32c/1.0.5/dc7fa8c/ && \ - wget -O "${HOME}"/.hunter/_Base/Download/crc32c/1.0.5/dc7fa8c/hunter-1.0.5.tar.gz https://github.com/hunter-packages/crc32c/archive/refs/tags/hunter-1.0.5.tar.gz RUN mkdir build WORKDIR build RUN cmake .. -DCMAKE_BUILD_TYPE=Debug diff --git a/deps/build.sh b/deps/build.sh index f8ad20c7d..223318440 100755 --- a/deps/build.sh +++ b/deps/build.sh @@ -253,10 +253,10 @@ setup_variable() { #setup_variable "WITH_SOMETHING" "yeah!!!" #echo "WITH_SOMETHING outside is " $WITH_SOMETHING -setup_variable WITH_ZLIB "yes" +setup_variable WITH_ZLIB "no" setup_variable WITH_BLAKE3 "yes" setup_variable WITH_OPENSSL "no" -setup_variable WITH_CURL "yes" +setup_variable WITH_CURL "no" setup_variable WITH_LZMA "no" setup_variable WITH_SSH "no" setup_variable WITH_SODIUM "yes" @@ -276,7 +276,7 @@ setup_variable WITH_SOURCEY "no" setup_variable WITH_BOOST "no" setup_variable WITH_PUPNP "no" -setup_variable WITH_ARGTABLE2 "yes" +setup_variable WITH_ARGTABLE2 "no" # # notice: nettle and gnutls are needed for microhttpd on ubuntu 18.04 @@ -288,15 +288,17 @@ setup_variable WITH_GNU_TLS "no" # setup_variable WITH_GPGERROR "no" setup_variable WITH_GCRYPT "no" -setup_variable WITH_MICRO_HTTP_D "yes" -setup_variable WITH_JSONCPP "yes" -setup_variable WITH_JSONRPCCPP "yes" +setup_variable WITH_MICRO_HTTP_D "no" +setup_variable WITH_JSONCPP "no" +setup_variable WITH_JSONRPCCPP "no" setup_variable WITH_CRYPTOPP "yes" setup_variable WITH_FF "no" setup_variable WITH_GMP "no" setup_variable WITH_PBC "no" +setup_variable WITH_LEVELDB "yes" + if [ -z "${PARALLEL_COUNT}" ]; then PARALLEL_COUNT=$NUMBER_OF_CPU_CORES @@ -600,6 +602,7 @@ echo -e "${COLOR_VAR_NAME}WITH_CRYPTOPP${COLOR_DOTS}..........${COLOR_VAR_DESC}L echo -e "${COLOR_VAR_NAME}WITH_GMP${COLOR_DOTS}...............${COLOR_VAR_DESC}LibGMP${COLOR_DOTS}.................................${COLOR_VAR_VAL}$WITH_GMP${COLOR_RESET}" echo -e "${COLOR_VAR_NAME}WITH_FF${COLOR_DOTS}................${COLOR_VAR_DESC}LibFF${COLOR_DOTS}..................................${COLOR_VAR_VAL}$WITH_FF${COLOR_RESET}" echo -e "${COLOR_VAR_NAME}WITH_PBC${COLOR_DOTS}...............${COLOR_VAR_DESC}LibPBC${COLOR_DOTS}.................................${COLOR_VAR_VAL}$WITH_PBC${COLOR_RESET}" +echo -e "${COLOR_VAR_NAME}WITH_LEVELDB${COLOR_DOTS}...........${COLOR_VAR_DESC}LibLevelDB${COLOR_DOTS}.........................${COLOR_VAR_VAL}$WITH_LEVELDB${COLOR_RESET}" # # @@ -2374,6 +2377,35 @@ if [ "$WITH_BLAKE3" = "yes" ]; then fi fi +if [ "$WITH_LEVELDB" = "yes" ]; +then + echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}LEVELDB${COLOR_SEPARATOR} ===========================================${COLOR_RESET}" + if [ ! -f "$INSTALL_ROOT/lib/libleveldb.a" ]; + then + env_restore + cd "$SOURCES_ROOT" + if [ ! -d "leveldb" ]; + then + echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" + git clone https://github.com/google/leveldb.git --recursive + fi + cd leveldb + git checkout 1.22 + echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}" + mkdir -p build + cd build + $CMAKE "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \ + -DLEVELDB_BUILD_BENCHMARKS=OFF -DLEVELDB_BUILD_TESTS=OFF .. + echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}" + $MAKE ${PARALLEL_MAKE_OPTIONS} + $MAKE ${PARALLEL_MAKE_OPTIONS} install + cd "$SOURCES_ROOT" + else + echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}" + fi +fi + + echo -e "${COLOR_SEPARATOR}===================================================================${COLOR_RESET}" echo -e "${COLOR_YELLOW}CONSENSUS dependencies build actions...${COLOR_RESET}" echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}FINISH${COLOR_SEPARATOR} =======================================${COLOR_RESET}" diff --git a/libBLS b/libBLS index 4b9259418..cb8c0d1f6 160000 --- a/libBLS +++ b/libBLS @@ -1 +1 @@ -Subproject commit 4b9259418c8cd71804100e787b070a76530189d7 +Subproject commit cb8c0d1f626e789d1259be94d0b9bf235f19a741 From e189dff1964051aff7a2ffa4223c5c1c2bd357ce Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Fri, 29 Nov 2024 18:01:39 +0000 Subject: [PATCH 02/14] skaled 2053 fix base build --- DockerfileBase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DockerfileBase b/DockerfileBase index 52b634741..7ed2ea650 100644 --- a/DockerfileBase +++ b/DockerfileBase @@ -7,7 +7,7 @@ RUN apt-get update RUN sudo apt-add-repository universe; apt-get update; \ apt-get install -yq libprocps-dev gcc-11 g++-11 valgrind gawk sed libffi-dev ccache libgoogle-perftools-dev \ yasm texinfo autotools-dev automake python3 python3-pip \ - cmake libtool pkg-config autoconf wget git \ + cmake libtool pkg-config autoconf wget git unzip \ libhiredis-dev redis-server openssl libssl-dev doxygen idn2 libgcrypt20-dev \ libargtable2-dev libgnutls28-dev # python python-pip From d46d5f959c50ba9290e8a115dd9d1c1959c524a9 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Fri, 29 Nov 2024 18:26:36 +0000 Subject: [PATCH 03/14] skale 2053 fix github actions jobs --- .github/workflows/build.yml | 2 +- .github/workflows/dockerimage.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be0cd1274..fe6070e5f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,7 @@ jobs: sudo apt-add-repository universe; \ sudo apt-get update; sudo apt-get install -y apt-utils libprocps-dev \ gcc-11 g++-11 valgrind gawk sed libffi-dev ccache libunwind-dev libgoogle-perftools-dev yasm texinfo \ - autotools-dev autogen automake autoconf m4 shtool pkg-config gawk nasm \ + autotools-dev autogen automake autoconf m4 shtool pkg-config gawk nasm unzip \ python3 python3-pip libtool libgcrypt20-dev # python python-pip # python-is-python3 diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index d6c288da2..13a199211 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -74,7 +74,7 @@ jobs: sudo apt-get install -y software-properties-common; sudo apt-add-repository universe; \ sudo apt-get update; sudo apt-get install -y software-properties-common apt-utils libprocps-dev \ gcc-11 g++-11 valgrind gawk sed libffi-dev ccache libunwind-dev libgoogle-perftools-dev yasm texinfo \ - autotools-dev autogen automake autoconf m4 shtool pkg-config sed gawk yasm nasm \ + autotools-dev autogen automake autoconf m4 shtool pkg-config sed gawk yasm nasm unzip \ python3 python3-pip python-is-python3 \ libtool build-essential \ libgcrypt20-dev From be1a5c8f2bd40e0a431c771cbbe7fdddcea6699d Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Mon, 2 Dec 2024 12:59:57 +0000 Subject: [PATCH 04/14] skaled 2053 update libbls --- libBLS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libBLS b/libBLS index cb8c0d1f6..aea45c3fc 160000 --- a/libBLS +++ b/libBLS @@ -1 +1 @@ -Subproject commit cb8c0d1f626e789d1259be94d0b9bf235f19a741 +Subproject commit aea45c3fc666b0ba1d224a3eaac04df5a54d369a From 51ebddfee3304da34c89cbdba4e98cc2eed32cb8 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Mon, 2 Dec 2024 14:14:05 +0000 Subject: [PATCH 05/14] skaled 2053 update libbls --- libBLS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libBLS b/libBLS index aea45c3fc..82d7bd8d7 160000 --- a/libBLS +++ b/libBLS @@ -1 +1 @@ -Subproject commit aea45c3fc666b0ba1d224a3eaac04df5a54d369a +Subproject commit 82d7bd8d78f1df8c8df58c9b00d6fc9576eccfb2 From 979444fdb351fc7298e7e28d31bc131f6298bff9 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Tue, 3 Dec 2024 16:38:54 +0000 Subject: [PATCH 06/14] skaled 2053 update libBLS --- libBLS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libBLS b/libBLS index 82d7bd8d7..23d324fdb 160000 --- a/libBLS +++ b/libBLS @@ -1 +1 @@ -Subproject commit 82d7bd8d78f1df8c8df58c9b00d6fc9576eccfb2 +Subproject commit 23d324fdb0c4432e5461bc017a56194609eaf08c From e0928976ca1b475aad2ac305d605183b0f5b7cf7 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 5 Dec 2024 18:01:56 +0000 Subject: [PATCH 07/14] skaled 2053 fix json libs build --- deps/build.sh | 4 ++-- deps/clean.sh | 1 + libBLS | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/deps/build.sh b/deps/build.sh index 223318440..4d1e54c0b 100755 --- a/deps/build.sh +++ b/deps/build.sh @@ -289,8 +289,8 @@ setup_variable WITH_GNU_TLS "no" setup_variable WITH_GPGERROR "no" setup_variable WITH_GCRYPT "no" setup_variable WITH_MICRO_HTTP_D "no" -setup_variable WITH_JSONCPP "no" -setup_variable WITH_JSONRPCCPP "no" +setup_variable WITH_JSONCPP "yes" +setup_variable WITH_JSONRPCCPP "yes" setup_variable WITH_CRYPTOPP "yes" setup_variable WITH_FF "no" diff --git a/deps/clean.sh b/deps/clean.sh index 3448785eb..70f2d93a4 100755 --- a/deps/clean.sh +++ b/deps/clean.sh @@ -136,6 +136,7 @@ rm -rf ./gmp-6.1.2 rm -rf ./libff rm -rf ./pbc rm -rf ./libsodium +rm -rf ./leveldb echo "Done (all clean)." #finish diff --git a/libBLS b/libBLS index 23d324fdb..9a497b0f9 160000 --- a/libBLS +++ b/libBLS @@ -1 +1 @@ -Subproject commit 23d324fdb0c4432e5461bc017a56194609eaf08c +Subproject commit 9a497b0f92f55c22580bb546987479a8aaabfb64 From a989014f25b0cc738cce737c1ff53be95c12f9a9 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Thu, 5 Dec 2024 18:28:30 +0000 Subject: [PATCH 08/14] skaled 2053 fix json libs build --- deps/build.sh | 8 ++++---- libBLS | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deps/build.sh b/deps/build.sh index 4d1e54c0b..ae8b8861a 100755 --- a/deps/build.sh +++ b/deps/build.sh @@ -253,10 +253,10 @@ setup_variable() { #setup_variable "WITH_SOMETHING" "yeah!!!" #echo "WITH_SOMETHING outside is " $WITH_SOMETHING -setup_variable WITH_ZLIB "no" +setup_variable WITH_ZLIB "yes" setup_variable WITH_BLAKE3 "yes" setup_variable WITH_OPENSSL "no" -setup_variable WITH_CURL "no" +setup_variable WITH_CURL "yes" setup_variable WITH_LZMA "no" setup_variable WITH_SSH "no" setup_variable WITH_SODIUM "yes" @@ -276,7 +276,7 @@ setup_variable WITH_SOURCEY "no" setup_variable WITH_BOOST "no" setup_variable WITH_PUPNP "no" -setup_variable WITH_ARGTABLE2 "no" +setup_variable WITH_ARGTABLE2 "yes" # # notice: nettle and gnutls are needed for microhttpd on ubuntu 18.04 @@ -288,7 +288,7 @@ setup_variable WITH_GNU_TLS "no" # setup_variable WITH_GPGERROR "no" setup_variable WITH_GCRYPT "no" -setup_variable WITH_MICRO_HTTP_D "no" +setup_variable WITH_MICRO_HTTP_D "yes" setup_variable WITH_JSONCPP "yes" setup_variable WITH_JSONRPCCPP "yes" setup_variable WITH_CRYPTOPP "yes" diff --git a/libBLS b/libBLS index 9a497b0f9..2cd0b7a72 160000 --- a/libBLS +++ b/libBLS @@ -1 +1 @@ -Subproject commit 9a497b0f92f55c22580bb546987479a8aaabfb64 +Subproject commit 2cd0b7a7241b6af7a2e6f072a0c95db7afb00601 From c9a1e965a3cd2bfa77b0ccbc04c431534012a874 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Fri, 20 Dec 2024 17:58:03 +0000 Subject: [PATCH 09/14] update libbls --- libBLS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libBLS b/libBLS index 4a5c980bc..0a32137e8 160000 --- a/libBLS +++ b/libBLS @@ -1 +1 @@ -Subproject commit 4a5c980bc48379587e42667af42ea1af1ff612e9 +Subproject commit 0a32137e84acf7f5f9f66356d7bfb579258e1f38 From b82b751ab693b5b6eb57f46a7da884720231eb80 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Mon, 30 Dec 2024 15:04:38 +0000 Subject: [PATCH 10/14] skaled 2053 fix leveldb build --- deps/build.sh | 72 +++++++++++++++++++++++++++++++++++++++++++++------ deps/clean.sh | 2 ++ 2 files changed, 66 insertions(+), 8 deletions(-) diff --git a/deps/build.sh b/deps/build.sh index ae8b8861a..edca0aacf 100755 --- a/deps/build.sh +++ b/deps/build.sh @@ -297,6 +297,8 @@ setup_variable WITH_FF "no" setup_variable WITH_GMP "no" setup_variable WITH_PBC "no" +setup_variable WITH_CRC32 "yes" +setup_variable WITH_SNAPPY "yes" setup_variable WITH_LEVELDB "yes" if [ -z "${PARALLEL_COUNT}" ]; @@ -602,11 +604,9 @@ echo -e "${COLOR_VAR_NAME}WITH_CRYPTOPP${COLOR_DOTS}..........${COLOR_VAR_DESC}L echo -e "${COLOR_VAR_NAME}WITH_GMP${COLOR_DOTS}...............${COLOR_VAR_DESC}LibGMP${COLOR_DOTS}.................................${COLOR_VAR_VAL}$WITH_GMP${COLOR_RESET}" echo -e "${COLOR_VAR_NAME}WITH_FF${COLOR_DOTS}................${COLOR_VAR_DESC}LibFF${COLOR_DOTS}..................................${COLOR_VAR_VAL}$WITH_FF${COLOR_RESET}" echo -e "${COLOR_VAR_NAME}WITH_PBC${COLOR_DOTS}...............${COLOR_VAR_DESC}LibPBC${COLOR_DOTS}.................................${COLOR_VAR_VAL}$WITH_PBC${COLOR_RESET}" -echo -e "${COLOR_VAR_NAME}WITH_LEVELDB${COLOR_DOTS}...........${COLOR_VAR_DESC}LibLevelDB${COLOR_DOTS}.........................${COLOR_VAR_VAL}$WITH_LEVELDB${COLOR_RESET}" - -# -# -# +echo -e "${COLOR_VAR_NAME}WITH_CRC32${COLOR_DOTS}.............${COLOR_VAR_DESC}LibCrc32${COLOR_DOTS}...............................${COLOR_VAR_VAL}$WITH_CRC32${COLOR_RESET}" +echo -e "${COLOR_VAR_NAME}WITH_SNAPPY${COLOR_DOTS}............${COLOR_VAR_DESC}LibSnappy${COLOR_DOTS}..............................${COLOR_VAR_VAL}$WITH_SNAPPY${COLOR_RESET}" +echo -e "${COLOR_VAR_NAME}WITH_LEVELDB${COLOR_DOTS}...........${COLOR_VAR_DESC}LibLevelDB${COLOR_DOTS}.............................${COLOR_VAR_VAL}$WITH_LEVELDB${COLOR_RESET}" cd "$SOURCES_ROOT" @@ -2377,6 +2377,62 @@ if [ "$WITH_BLAKE3" = "yes" ]; then fi fi +if [ "$WITH_CRC32" = "yes" ]; +then + echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}LibCrc32${COLOR_SEPARATOR} ===========================================${COLOR_RESET}" + if [ ! -f "$INSTALL_ROOT/lib/libcrc32c.a" ]; + then + env_restore + cd "$SOURCES_ROOT" + if [ ! -d "crc32c" ]; + then + echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" + git clone https://github.com/google/crc32c.git --recursive + fi + cd crc32c + git checkout 1.0.5 + echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}" + mkdir -p build + cd build + $CMAKE "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \ + -DCRC32C_BUILD_BENCHMARKS=OFF -DCRC32C_BUILD_TESTS=OFF -DCRC32C_USE_GLOG=OFF .. + echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}" + $MAKE ${PARALLEL_MAKE_OPTIONS} + $MAKE ${PARALLEL_MAKE_OPTIONS} install + cd "$SOURCES_ROOT" + else + echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}" + fi +fi + +if [ "$WITH_SNAPPY" = "yes" ]; +then + echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}LibSnappy${COLOR_SEPARATOR} ===========================================${COLOR_RESET}" + if [ ! -f "$INSTALL_ROOT/lib/libsnappy.a" ]; + then + env_restore + cd "$SOURCES_ROOT" + if [ ! -d "snappy" ]; + then + echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" + git clone https://github.com/google/snappy.git --recursive + fi + cd snappy + git checkout 1.1.7 + echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}" + mkdir -p build + cd build + $CMAKE "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \ + -DSNAPPY_BUILD_TESTS=OFF .. + echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}" + $MAKE ${PARALLEL_MAKE_OPTIONS} + $MAKE ${PARALLEL_MAKE_OPTIONS} install + cd "$SOURCES_ROOT" + else + echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}" + fi +fi + if [ "$WITH_LEVELDB" = "yes" ]; then echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}LEVELDB${COLOR_SEPARATOR} ===========================================${COLOR_RESET}" @@ -2387,15 +2443,15 @@ then if [ ! -d "leveldb" ]; then echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" - git clone https://github.com/google/leveldb.git --recursive + git clone https://github.com/skalenetwork/leveldb.git --recursive fi cd leveldb - git checkout 1.22 + git checkout skale echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}" mkdir -p build cd build $CMAKE "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \ - -DLEVELDB_BUILD_BENCHMARKS=OFF -DLEVELDB_BUILD_TESTS=OFF .. + -DCMAKE_PREFIX_PATH="$INSTALL_ROOT" -DLEVELDB_BUILD_BENCHMARKS=OFF -DLEVELDB_BUILD_TESTS=OFF .. echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}" $MAKE ${PARALLEL_MAKE_OPTIONS} $MAKE ${PARALLEL_MAKE_OPTIONS} install diff --git a/deps/clean.sh b/deps/clean.sh index 70f2d93a4..4d01ca378 100755 --- a/deps/clean.sh +++ b/deps/clean.sh @@ -136,6 +136,8 @@ rm -rf ./gmp-6.1.2 rm -rf ./libff rm -rf ./pbc rm -rf ./libsodium +rm -rf ./crc32c +rm -rf ./snappy rm -rf ./leveldb echo "Done (all clean)." From c5ea3264eda81c187032c7587b0be34e8de8ceb9 Mon Sep 17 00:00:00 2001 From: Oleh Date: Tue, 31 Dec 2024 12:38:05 +0000 Subject: [PATCH 11/14] skaled-2053 update libbls --- libBLS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libBLS b/libBLS index 0a32137e8..937650311 160000 --- a/libBLS +++ b/libBLS @@ -1 +1 @@ -Subproject commit 0a32137e84acf7f5f9f66356d7bfb579258e1f38 +Subproject commit 93765031109834811379f90383c79189c80b1bb5 From e472ada29fcc27c3db714c5f5656603866b1676d Mon Sep 17 00:00:00 2001 From: Oleh Date: Tue, 31 Dec 2024 13:11:43 +0000 Subject: [PATCH 12/14] skaled-2053 fix build --- CMakeLists.txt | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70aab7590..8829e97fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.10) - option(COVERAGE "Build with code coverage support" OFF) if (COVERAGE) message(STATUS "**********************") @@ -21,12 +20,6 @@ if (NOT DEFINED DEPS_INSTALL_ROOT) endif () message(INFO "---- DEPS_INSTALL_ROOT in consensus is: ${DEPS_INSTALL_ROOT}") -#include("cmake/HunterGate.cmake") -#include("cmake/precompiledheader.cmake") - - -#HunterGate(URL "https://github.com/ruslo/hunter/archive/v0.23.76.tar.gz" SHA1 "c7b60993e841850e2c449afd454f5d5aa4ec04e4") - option( CONSENSUS_PROFILING "Build for profiling" OFF ) if( SKALED_PROFILING ) set( CONSENSUS_PROFILING ON ) @@ -63,16 +56,11 @@ include_directories("${DEPS_INSTALL_ROOT}/include" "${DEPS_INSTALL_ROOT}/include link_directories("${DEPS_INSTALL_ROOT}/lib") set(CMAKE_PREFIX_PATH "${DEPS_INSTALL_ROOT}") -# zeromq - -#find_package(оч CONFIG REQUIRED) - #leveldb +find_package( Snappy CONFIG REQUIRED ) +find_package( Crc32c CONFIG REQUIRED ) find_package(leveldb CONFIG REQUIRED) -#set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wreturn-type -Winit-self") - - set(CMAKE_CXX_STANDARD 17) execute_process( COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gcc_ver_query.sh OUTPUT_VARIABLE GXX_MAJOR_VERSION ) message( STATUS "-------- GXX_MAJOR_VERSION is ${GXX_MAJOR_VERSION}" ) From 494fd62a17a5ac75375e97a17f53eb05d3690f6e Mon Sep 17 00:00:00 2001 From: Oleh Date: Tue, 31 Dec 2024 14:16:40 +0000 Subject: [PATCH 13/14] skaled-2053 fix build --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8829e97fe..2d5b6b7e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,9 +57,10 @@ link_directories("${DEPS_INSTALL_ROOT}/lib") set(CMAKE_PREFIX_PATH "${DEPS_INSTALL_ROOT}") #leveldb +find_package(leveldb CONFIG REQUIRED) + find_package( Snappy CONFIG REQUIRED ) find_package( Crc32c CONFIG REQUIRED ) -find_package(leveldb CONFIG REQUIRED) set(CMAKE_CXX_STANDARD 17) execute_process( COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gcc_ver_query.sh OUTPUT_VARIABLE GXX_MAJOR_VERSION ) From c9dc92b5028c77e62729c3a271bb7eebdb8729d8 Mon Sep 17 00:00:00 2001 From: Oleh Date: Tue, 31 Dec 2024 14:43:40 +0000 Subject: [PATCH 14/14] skaled-2053 fix build --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d5b6b7e2..5a73f4104 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,6 +198,8 @@ SET(LINK_LIBRARIES ${BOOST_LIBS_FOR_CONSENSUS} ${LIB_NAME_cryptopp} leveldb + snappy + crc32c "${DEPS_INSTALL_ROOT}/lib/libjsonrpccpp-client.a" "${DEPS_INSTALL_ROOT}/lib/libjsonrpccpp-server.a" "${DEPS_INSTALL_ROOT}/lib/libmicrohttpd.a"