Skip to content

Commit

Permalink
skaled-2053-remove-hunter
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Nov 29, 2024
1 parent 72d21fa commit f3fb64e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 33 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 6 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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")


Expand All @@ -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)
Expand Down Expand Up @@ -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")
Expand All @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions DockerfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 38 additions & 6 deletions deps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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}"

#
#
Expand Down Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion libBLS
Submodule libBLS updated 2 files
+12 −20 CMakeLists.txt
+17 −17 deps/build.sh

0 comments on commit f3fb64e

Please sign in to comment.