diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1a14d975..a31e50ff 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,7 +8,7 @@ on: jobs: main_job: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: NIGHTLY_BUILD_FLAGS: "valgrind --leak-check=yes" @@ -31,39 +31,39 @@ jobs: - name: Install packages run: | sudo apt-get install -y software-properties-common - sudo apt-get install -y gcc-9 g++-9 - - name: use g++-9 by default + sudo apt-get install -y gcc-11 g++-11 + - name: use g++-11 by default run: | - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11 - name: Install more packages run: | sudo apt-get install -y gawk sed shtool \ - libffi-dev yasm texinfo flex bison libgnutls28-dev libc6-dbg gcc-multilib + libffi-dev yasm texinfo libgnutls28-dev libc6-dbg gcc-multilib sudo snap install valgrind --classic python -m pip install --upgrade pip pip install coincurve - name: Build dependencies run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all cd deps ./build.sh - name: Configure all run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all mkdir -p build && cd build cmake .. - name: Build all run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all cd build make -j$(nproc) @@ -92,7 +92,7 @@ jobs: ./scripts/run_tools_test.sh linux_build_with_emscripten: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: @@ -111,9 +111,8 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y gcc-9 g++-9 gawk sed shtool \ - libffi-dev yasm texinfo flex bison \ - python3.6 lcov gcc-multilib + sudo apt-get install -y gcc-11 g++-11 gawk sed shtool \ + libffi-dev yasm texinfo python3.6 lcov gcc-multilib sudo apt-get update -qq sudo apt-get install -y python3-pip pip3 install --upgrade pip @@ -128,8 +127,8 @@ jobs: - name: Build dependencies run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all cd deps ./build.sh WITH_EMSCRIPTEN=1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3489fb38..4608d984 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ defaults: shell: bash jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Extract repo name @@ -32,45 +32,45 @@ jobs: - name: Install packages run: | sudo apt-get install -y software-properties-common - sudo apt-get install -y gcc-9 g++-9 - - name: use g++-9 by default + sudo apt-get install -y gcc-11 g++-11 + - name: use g++-11 by default run: | - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11 - name: Install more packages run: | sudo apt-get update - sudo apt-get install -y clang-format-6.0 gawk sed shtool \ - libffi-dev yasm texinfo flex bison libgnutls28-dev gcc-multilib + sudo apt-get install -y gawk sed shtool \ + libffi-dev yasm texinfo libgnutls28-dev gcc-multilib - name: Build dependencies run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all cd deps ./build.sh - name: Configure run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all mkdir -p build && cd build cmake .. - name: Build run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all cd build make -j$(nproc) - name: Build dependencies wasm run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all cd deps ./clean.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dd2b9cd..e377ddc6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ defaults: shell: bash jobs: linux_build_and_test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Extract repo name run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / @@ -27,20 +27,20 @@ jobs: - name: install packages run: | sudo apt-get install -y software-properties-common - sudo apt-get install -y gcc-9 g++-9 - - name: Use g++-9 and gcov-9 by default + sudo apt-get install -y gcc-11 g++-11 + - name: Use g++-11 and gcov-11 by default run: > echo "Updating all needed alternatives" - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11 - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 9 + sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-11 11 - sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 9 + sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-11 11 - sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9 9 + sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-11 11 echo "Checking alternative for gcc" @@ -77,8 +77,8 @@ jobs: run: > sudo apt-get update - 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 install -y gawk sed shtool \ + libffi-dev yasm texinfo libgnutls28-dev python3 gcc-multilib git sudo apt-get update -qq sudo apt-get install -y python3-pip @@ -123,24 +123,23 @@ jobs: lcov --version - name: Build dependencies run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all - export CMAKE_BUILD_FLAGS="-DCOVERAGE=ON" cd deps ./build.sh - name: Configure all run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all CMAKE_BUILD_FLAGS="-DCOVERAGE=ON" mkdir -p build && cd build cmake $CMAKE_BUILD_FLAGS .. - name: Build all run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all CMAKE_BUILD_FLAGS="-DCOVERAGE=ON" cd build @@ -177,7 +176,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.info osx_build_and_test: - runs-on: macos-11 + runs-on: macos-12 steps: - name: Extract repo name run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / @@ -213,7 +212,7 @@ jobs: ./threshold_encryption/te_test ./dkg_attack linux_build_with_emscripten: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: node-version: @@ -232,9 +231,7 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y gcc-9 g++-9 gawk sed shtool \ - libffi-dev yasm texinfo flex bison \ - python3 gcc-multilib + sudo apt-get install -y gcc-11 g++-11 gawk sed shtool libffi-dev yasm texinfo python3 gcc-multilib sudo apt-get update -qq sudo apt-get install -y python3-pip pip3 install --upgrade pip @@ -247,8 +244,8 @@ jobs: node-version: ${{ matrix.node-version }} - name: Build dependencies run: | - export CC=gcc-9 - export CXX=g++-9 + export CC=gcc-11 + export CXX=g++-11 export TARGET=all cd deps ./build.sh WITH_EMSCRIPTEN=1 diff --git a/README.md b/README.md index 6ec2adda..6a6d5a91 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ cd .. ## Building from source on Mac ```shell -brew install flex bison libtool automake cmake pkg-config yasm +brew install libtool automake cmake pkg-config yasm # Configure the project and create a build directory. cmake -H. -Bbuild @@ -81,8 +81,8 @@ Ensure that the required packages are installed by executing: ```shell sudo apt-get update -sudo apt-get install -y automake cmake build-essential libprocps-dev libtool\ - pkg-config yasm texinfo autoconf flex bison clang-format-6.0 +sudo apt-get install -y automake cmake build-essential libgnutls28-dev libtool\ + pkg-config yasm texinfo autoconf clang-format-14 ``` Configure the project build with the following commands. diff --git a/deps/build.sh b/deps/build.sh index 2810378e..e6e5a9e5 100755 --- a/deps/build.sh +++ b/deps/build.sh @@ -56,7 +56,6 @@ then fi if [ "$UNIX_SYSTEM_NAME" = "Darwin" ]; then - #export NUMBER_OF_CPU_CORES=$(system_profiler | awk '/Number Of CPUs/{print $4}{next;}') export NUMBER_OF_CPU_CORES=$(sysctl -n hw.ncpu) # required -> brew install coreutils export READLINK=/usr/local/bin/greadlink @@ -81,25 +80,15 @@ cd "$WORKING_DIR_NEW" argc=$# argv=($@) for (( j=0; j /dev/null source "${SOURCES_ROOT}/saved_environment_pre_configured.txt" fi } @@ -659,9 +617,6 @@ then echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}Open SSL${COLOR_SEPARATOR} =====================================${COLOR_RESET}" if [ ! -f "$INSTALL_ROOT/lib/libssl.a" ]; then - ## openssl - ## https://www.openssl.org/ - ## https://wiki.openssl.org/index.php/Compilation_and_Installation ## (required for libff) env_restore cd "$SOURCES_ROOT" @@ -770,12 +725,12 @@ then if [ ! -f "$INSTALL_ROOT/lib/libff.a" ]; then env_restore - cd "$SOURCES_ROOT" - if [ ! -d "libff" ]; - then - echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" - eval git clone https://github.com/scipr-lab/libff.git --recursive # libff - fi + cd "$SOURCES_ROOT" + if [ ! -d "libff" ]; + then + echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" + eval git clone https://github.com/scipr-lab/libff.git --recursive # libff + fi cd libff echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}" eval git fetch @@ -854,7 +809,7 @@ then if [ ! -d "argtable2" ]; then echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" - git clone https://github.com/jonathanmarvens/argtable2.git + git clone https://github.com/jonathanmarvens/argtable2.git echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}" cd argtable2 mkdir -p build @@ -884,7 +839,6 @@ then else if [ ! -f "$INSTALL_ROOT/lib/libcurl.a" ]; then - # https://github.com/curl/curl env_restore cd "$SOURCES_ROOT" export PKG_CONFIG_PATH_SAVED=$PKG_CONFIG_PATH @@ -895,33 +849,23 @@ then then echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" git clone https://github.com/curl/curl.git - cd curl - git checkout curl-8_2_1 - cd .. + cd curl + git checkout curl-8_2_1 + cd .. echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}" tar -czf curl-from-git.tar.gz ./curl else echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}" tar -xzf curl-from-git.tar.gz fi - # - # l_sergiy: moved into $PREDOWNLOADED_ROOT - # - # # echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}" - # # tar -xzf $PREDOWNLOADED_ROOT/curl-from-git.tar.gz - # - # - # echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}" cd curl mkdir -p build cd build - #$CMAKE "${CMAKE_CROSSCOMPILING_OPTS}" -DBUILD_CURL_EXE=OFF -DBUILD_TESTING=OFF -DCMAKE_USE_LIBSSH2=OFF -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCURL_STATICLIB=ON -DOPENSSL_CRYPTO_LIBRARY="$INSTALL_ROOT/lib/libcrypto.a" -DOPENSSL_INCLUDE_DIR="$INSTALL_ROOT/include" -DOPENSSL_SSL_LIBRARY="$INSTALL_ROOT/lib/libssl.a" CMAKE_C_COMPILER_WORKS=ON CMAKE_CXX_COMPILER_WORKS=ON .. - cmake "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DOPENSSL_ROOT_DIR="$SOURCES_ROOT/openssl" -DBUILD_CURL_EXE=OFF -DBUILD_TESTING=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_LDAP=ON -DCURL_STATICLIB=ON -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" .. + cmake "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DOPENSSL_ROOT_DIR="$SOURCES_ROOT/openssl" -DBUILD_CURL_EXE=OFF -DBUILD_TESTING=OFF -DCURL_USE_LIBSSH2=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_LDAP=ON -DCURL_STATICLIB=ON -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" .. echo " " >> lib/curl_config.h echo "#define HAVE_POSIX_STRERROR_R 1" >> lib/curl_config.h echo " " >> lib/curl_config.h - ### Set HAVE_POSIX_STRERROR_R to 1 in build/lib/curl_config.h cd ../.. fi echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}" @@ -992,13 +936,9 @@ then cd "$SOURCES_ROOT" if [ ! -d "jsoncpp" ]; then - # - #echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" - #git clone git@github.com:open-source-parsers/jsoncpp.git - # echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}" tar -xzf "$PREDOWNLOADED_ROOT/jsoncpp.tar.gz" - # + echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}" cd jsoncpp mkdir -p build @@ -1035,14 +975,10 @@ then cd "$SOURCES_ROOT" if [ ! -d "libjson-rpc-cpp" ]; then - # - #echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}" - #git clone git@github.com:cinemast/libjson-rpc-cpp.git - # 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 @@ -1090,8 +1026,6 @@ echo -e " " echo -e " " echo -e " " -#env_restore -#cd "$CUSTOM_BUILD_ROOT" cd "$WORKING_DIR_OLD" env_restore_original exit 0