Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skaled/2053 remove hunter #218

Merged
merged 10 commits into from
Dec 31, 2024
34 changes: 13 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ find_library( GMP_LIBRARY NAMES "gmp" PATHS "${DEPS_INSTALL_ROOT}/lib" )
find_library( GMPXX_LIBRARY NAMES "gmpxx" PATHS "${DEPS_INSTALL_ROOT}/lib" )
find_library( CRYPTOPP_LIBRARY NAMES "crypto" PATHS "${DEPS_INSTALL_ROOT}/lib" )

set( HUNTER_ENABLED OFF )

option(BUILD_TESTS "Build tests" ON)
option(BUILD_WITH_FPIC "Build with -fPIC" OFF)
option(BUILD_UTILS "Build utils" ON)
Expand Down Expand Up @@ -158,13 +156,7 @@ add_library(bls ${sourses_bls} ${headers_bls})

include_directories(${Boost_INCLUDE_DIRS})

if( SKALE_HAVE_BOOST_FROM_HUNTER )
set( BOOST_LIBS_4_BLS Boost::program_options )
else()
set( BOOST_LIBS_4_BLS boost_program_options )
endif()

set(WITH_PROCPS OFF)
set (WITH_PROCPS OFF)

set(BLS_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
Expand All @@ -188,55 +180,55 @@ if (BUILD_UTILS)
set_target_properties(dkg_keygen PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1")
endif()

target_link_libraries(dkg_keygen PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(dkg_keygen PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} boost_program_options)

add_executable(dkg_glue tools/dkg_glue.cpp)
target_include_directories(dkg_glue PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if (EMSCRIPTEN)
target_compile_options(dkg_glue PRIVATE -s DISABLE_EXCEPTION_CATCHING=1)
set_target_properties(dkg_glue PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1")
endif()
target_link_libraries(dkg_glue PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(dkg_glue PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} boost_program_options)

add_executable(sign_bls tools/sign_bls.cpp)
target_include_directories(sign_bls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if (EMSCRIPTEN)
target_compile_options(sign_bls PRIVATE -s DISABLE_EXCEPTION_CATCHING=1)
set_target_properties(sign_bls PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1")
endif()
target_link_libraries(sign_bls PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(sign_bls PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} boost_program_options)

add_executable(hash_g1 tools/hash_g1.cpp)
target_include_directories(hash_g1 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if (EMSCRIPTEN)
target_compile_options(hash_g1 PRIVATE -s DISABLE_EXCEPTION_CATCHING=1)
set_target_properties(hash_g1 PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1")
endif()
target_link_libraries(hash_g1 PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(hash_g1 PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} boost_program_options)

add_executable(bls_glue tools/bls_glue.cpp)
target_include_directories(bls_glue PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if (EMSCRIPTEN)
target_compile_options(bls_glue PRIVATE -s DISABLE_EXCEPTION_CATCHING=1)
set_target_properties(bls_glue PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1")
endif()
target_link_libraries(bls_glue PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(bls_glue PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} boost_program_options)

add_executable(verify_bls tools/verify_bls.cpp)
target_include_directories(verify_bls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if (EMSCRIPTEN)
target_compile_options(verify_bls PRIVATE -s DISABLE_EXCEPTION_CATCHING=1)
set_target_properties(verify_bls PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1")
endif()
target_link_libraries(verify_bls PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(verify_bls PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} boost_program_options)

add_executable(generate_key_system tools/generate_key_system.cpp)
target_include_directories(generate_key_system PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if (EMSCRIPTEN)
target_compile_options(generate_key_system PRIVATE -s DISABLE_EXCEPTION_CATCHING=1)
set_target_properties(generate_key_system PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1")
endif()
target_link_libraries(generate_key_system PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(generate_key_system PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} boost_program_options)
endif()

if(BUILD_TESTS)
Expand All @@ -248,7 +240,7 @@ if(BUILD_TESTS)
else()
target_compile_options(bls_unit_test PRIVATE -Wno-format-overflow)
endif()
target_link_libraries(bls_unit_test PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(bls_unit_test PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} boost_program_options)

add_test(NAME bls_tests COMMAND bls_unit_test)

Expand All @@ -260,7 +252,7 @@ if(BUILD_TESTS)
else()
target_compile_options(dkg_unit_test PRIVATE -Wno-format-overflow)
endif()
target_link_libraries(dkg_unit_test PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(dkg_unit_test PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} boost_program_options)

add_test(NAME dkg_tests COMMAND dkg_unit_test)

Expand All @@ -272,13 +264,13 @@ if(BUILD_TESTS)
else()
target_compile_options(bls_test PRIVATE -Wno-format-overflow)
endif()
target_link_libraries(bls_test PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(bls_test PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} boost_program_options)

add_test(NAME bls_test COMMAND bls_test)

add_executable(dkg_attack test/dkg_attack.cpp)
target_include_directories(dkg_attack PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(dkg_attack PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(dkg_attack PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} boost_program_options)

add_test(NAME dkg_attack COMMAND dkg_attack)

Expand All @@ -290,7 +282,7 @@ if(BUILD_TESTS)
else()
target_compile_options(utils_unit_test PRIVATE -Wno-format-overflow)
endif()
target_link_libraries(utils_unit_test PRIVATE bls te ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(utils_unit_test PRIVATE bls te ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} boost_program_options)

add_test(NAME utils_tests COMMAND utils_unit_test)

Expand Down
43 changes: 23 additions & 20 deletions deps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,20 @@ export CXXFLAGS="$CXXFLAGS -fPIC"
WITH_OPENSSL="yes"

WITH_BOOST="yes"
WITH_ZLIB="no"
WITH_ARGTABLE2="no"
WITH_JSONRPC="no"
WITH_JSONRPCCPP="no"
WITH_CURL="no"
WITH_MICRO_HTTP_D="no"
WITH_ZLIB="yes"
WITH_ARGTABLE2="yes"
WITH_JSONRPC="yes"
WITH_JSONRPCCPP="yes"
WITH_CURL="yes"
WITH_MICRO_HTTP_D="yes"
if [ "$SKALED_DEPS_CHAIN" = "1" ];
then
WITH_BOOST="no"
else
WITH_ZLIB="yes"
WITH_ARGTABLE2="yes"
WITH_JSONRPC="yes"
WITH_JSONRPCCPP="yes"
WITH_CURL="yes"
WITH_MICRO_HTTP_D="yes"
WITH_JSONRPC="no"
WITH_JSONRPCCPP="no"
WITH_CURL="no"
WITH_MICRO_HTTP_D="no"
WITH_ZLIB="no"
WITH_ARGTABLE2="no"
fi

WITH_FF="yes"
Expand Down Expand Up @@ -587,8 +585,13 @@ then
if [[ "${WITH_EMSCRIPTEN}" -eq 1 ]];
then
BOOST_LIBRARIES="program_options"
else
else
BOOST_LIBRARIES="system,thread,filesystem,regex,atomic,program_options"
if [ "$SKALED_DEPS_CHAIN" = "1" ];
then
BOOST_LIBRARIES="${BOOST_LIBRARIES},context,iostreams,fiber,log,chrono"
fi

fi
eval ./bootstrap.sh --prefix="$INSTALL_ROOT" --with-libraries="$BOOST_LIBRARIES"

Expand Down Expand Up @@ -884,10 +887,10 @@ then
cd curl/build
$MAKE ${PARALLEL_MAKE_OPTIONS}
$MAKE ${PARALLEL_MAKE_OPTIONS} install
if [ "$DEBUG" = "1" ];
then
mv "$INSTALL_ROOT/lib/libcurl-d.a" "$INSTALL_ROOT/lib/libcurl.a" &> /dev/null
fi
# if [ "$DEBUG" = "1" ];
# then
# mv "$INSTALL_ROOT/lib/libcurl-d.a" "$INSTALL_ROOT/lib/libcurl.a" &> /dev/null
# fi
cd ..
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_SAVED
export PKG_CONFIG_PATH_SAVED=
Expand Down Expand Up @@ -990,7 +993,6 @@ then
echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}"
unzip -o "$PREDOWNLOADED_ROOT/libjson-rpc-cpp.zip"
cp -r libjson-rpc-cpp-develop libjson-rpc-cpp

echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}"
cd libjson-rpc-cpp
mkdir -p build
Expand All @@ -1015,6 +1017,7 @@ then
-DARGTABLE_INCLUDE_DIR="$SOURCES_ROOT/argtable2/src" \
-DARGTABLE_LIBRARY="$INSTALL_ROOT/lib/libargtable2${DEBUG_D}.a" \
-DJSONCPP_INCLUDE_DIR="$INSTALL_ROOT/include" \
-DJSONCPP_LIBRARY="$INSTALL_ROOT/lib/libjsoncpp.a" \
..
cd ..
else
Expand Down
1 change: 1 addition & 0 deletions deps/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ rm -rf ./zlib
rm -rf ./argtable2
rm -rf ./curl
rm -rf ./libmicrohttpd
rm -rf ./boost
echo "Done (all clean)."

#finish
Expand Down
Loading