Skip to content

Commit

Permalink
Merge pull request #199 from skalenetwork/197-support-of-ubuntu-2204
Browse files Browse the repository at this point in the history
197 support of ubuntu 2004
  • Loading branch information
olehnikolaiev authored Mar 20, 2023
2 parents f9fcfd0 + b646f8b commit 5264c5d
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
source: '.'
exclude: './CMakeFiles ./cmake ./deps ./build ./node ./python'
extensions: 'h,hpp,hxx,cpp,cxx,cc,ipp'
clangFormatVersion: 10
clangFormatVersion: 14
12 changes: 6 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
main_job:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
env:
NIGHTLY_BUILD_FLAGS: "valgrind --leak-check=yes"

Expand All @@ -20,10 +20,10 @@ jobs:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
# - name: Set up Python 3.6
# uses: actions/setup-python@v1
# with:
# python-version: 3.6
- name: Update apt
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
./scripts/run_tools_test.sh
linux_build_with_emscripten:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:
shell: bash
jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Extract repo name
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:
shell: bash
jobs:
linux_build_and_test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Extract repo name
Expand Down Expand Up @@ -55,15 +55,15 @@ jobs:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y gcc-9 g++-9 clang-format-10 gawk sed shtool \
libffi-dev yasm texinfo flex bison libgnutls28-dev python3.6 gcc-multilib git
sudo apt-get install -y gcc-9 g++-9 gawk sed shtool \
libffi-dev yasm texinfo flex bison libgnutls28-dev python3 gcc-multilib git
sudo apt-get update -qq
sudo apt-get install -y python3-pip
pip3 install --upgrade pip
sudo python3.6 -m pip install --upgrade pip
sudo python3.6 -m pip install pyopenssl ndg-httpsclient pyasn1
sudo python3.6 -m pip install requests[security]
sudo python3.6 -m pip install codecov --ignore-installed
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install pyopenssl ndg-httpsclient pyasn1
sudo python3 -m pip install requests[security]
sudo python3 -m pip install codecov --ignore-installed
- name: Get newest lcov
run: |
echo "Removing previous lcov version..."
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
./dkg_attack
linux_build_with_emscripten:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

strategy:
matrix:
Expand All @@ -199,16 +199,16 @@ jobs:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y gcc-9 g++-9 clang-format-6.0 gawk sed shtool \
sudo apt-get install -y gcc-9 g++-9 gawk sed shtool \
libffi-dev yasm texinfo flex bison \
python3.6 gcc-multilib
sudo apt-get update -qq
sudo apt-get install -y python3-pip
pip3 install --upgrade pip
sudo python3.6 -m pip install --upgrade pip
sudo python3.6 -m pip install pyopenssl ndg-httpsclient pyasn1
sudo python3.6 -m pip install requests[security]
sudo python3.6 -m pip install codecov --ignore-installed
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install pyopenssl ndg-httpsclient pyasn1
sudo python3 -m pip install requests[security]
sudo python3 -m pip install codecov --ignore-installed
- name: Install NODE JS
uses: actions/setup-node@v2
Expand Down
113 changes: 58 additions & 55 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ set( HUNTER_ENABLED OFF )

option(BUILD_TESTS "Build tests" ON)
option(BUILD_WITH_FPIC "Build with -fPIC" OFF)
option(BUILD_UTILS "Build utils" ON)

option( BLS_PROFILING "Build for profiling" OFF )
if( SKALED_PROFILING OR CONSENSUS_PROFILING )
Expand Down Expand Up @@ -179,63 +180,65 @@ target_link_libraries(bls PRIVATE ff ${CRYPTOPP_LIBRARY} ${GMPXX_LIBRARY} ${GMP_

add_subdirectory(threshold_encryption)

add_executable(dkg_keygen tools/dkg_key_gen.cpp)
target_include_directories(dkg_keygen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if (EMSCRIPTEN)
target_compile_options(dkg_keygen PRIVATE -s DISABLE_EXCEPTION_CATCHING=1)
set_target_properties(dkg_keygen PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1")
if (BUILD_UTILS)
add_executable(dkg_keygen tools/dkg_key_gen.cpp)
target_include_directories(dkg_keygen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if (EMSCRIPTEN)
target_compile_options(dkg_keygen PRIVATE -s DISABLE_EXCEPTION_CATCHING=1)
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})

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})

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})

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})

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})

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})

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})
endif()

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

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})

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})

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})

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})

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})

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})

if(BUILD_TESTS)
add_executable(bls_unit_test test/unit_tests_bls.cpp)
target_include_directories(bls_unit_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
2 changes: 1 addition & 1 deletion cmake/BlsFindClangFormat.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if( ( NOT DEFINED BLS_CLANG_FORMAT_BIN_NAME ) OR ( "${BLS_CLANG_FORMAT_BIN_NAME}
#
unset( BLS_CLANG_FORMAT_FOUND )
unset( BLS_CLANG_FORMAT_BIN_NAME )
set( VARIANTS_OF_BLS_CLANG_FORMAT_BIN_NAME clang-format-10 )
set( VARIANTS_OF_BLS_CLANG_FORMAT_BIN_NAME clang-format-14 )
foreach( BLS_CLANG_FORMAT_WALK_VAR IN LISTS VARIANTS_OF_BLS_CLANG_FORMAT_BIN_NAME )
execute_process( COMMAND bash -c "which ${BLS_CLANG_FORMAT_WALK_VAR}" OUTPUT_VARIABLE BLS_CLANG_FORMAT_BIN_NAME )
if( ( DEFINED BLS_CLANG_FORMAT_BIN_NAME ) AND ( NOT "${BLS_CLANG_FORMAT_BIN_NAME}" STREQUAL "" ) )
Expand Down
Loading

0 comments on commit 5264c5d

Please sign in to comment.