diff --git a/.drone.jsonnet b/.drone.jsonnet deleted file mode 100644 index 3ef10a0a4..000000000 --- a/.drone.jsonnet +++ /dev/null @@ -1,420 +0,0 @@ -# Copyright 2022, 2023 Peter Dimov -# Distributed under the Boost Software License, Version 1.0. -# https://www.boost.org/LICENSE_1_0.txt - -local library = "decimal"; - -local triggers = -{ - branch: [ "master", "develop", "feature/*" ] -}; - -local ubsan = { UBSAN: '1', UBSAN_OPTIONS: 'print_stacktrace=1' }; -local asan = { ASAN: '1' }; - -local linux_pipeline(name, image, environment, packages = "", sources = [], arch = "amd64") = -{ - name: name, - kind: "pipeline", - type: "docker", - trigger: triggers, - platform: - { - os: "linux", - arch: arch - }, - steps: - [ - { - name: "everything", - image: image, - privileged: true, - environment: environment, - commands: - [ - 'set -e', - 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -', - ] + - (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + - (if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) + - [ - 'export LIBRARY=' + library, - './.drone/drone.sh', - ] - } - ] -}; - -local macos_pipeline(name, environment, xcode_version = "12.2", osx_version = "catalina", arch = "amd64") = -{ - name: name, - kind: "pipeline", - type: "exec", - trigger: triggers, - platform: { - "os": "darwin", - "arch": arch - }, - node: { - "os": osx_version - }, - steps: [ - { - name: "everything", - environment: environment + { "DEVELOPER_DIR": "/Applications/Xcode-" + xcode_version + ".app/Contents/Developer" }, - commands: - [ - 'export LIBRARY=' + library, - './.drone/drone.sh', - ] - } - ] -}; - -local windows_pipeline(name, image, environment, arch = "amd64") = -{ - name: name, - kind: "pipeline", - type: "docker", - trigger: triggers, - platform: - { - os: "windows", - arch: arch - }, - "steps": - [ - { - name: "everything", - image: image, - environment: environment, - commands: - [ - 'cmd /C .drone\\\\drone.bat ' + library, - ] - } - ] -}; - -[ - - linux_pipeline( - "Linux 18.04 GCC 8 32/64", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++-8', CXXSTD: '03,11,14,17', ADDRMD: '32,64' }, - "g++-8-multilib", - ), - - linux_pipeline( - "Linux 20.04 GCC 9* 32/64", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, - ), - - linux_pipeline( - "Linux 20.04 GCC 9* ARM64", - "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' }, - arch="arm64", - ), - - linux_pipeline( - "Linux 20.04 GCC 9* ARM64 - ASAN", - "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' } + asan, - arch="arm64", - ), - - linux_pipeline( - "Linux 20.04 GCC 9* S390x", - "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' }, - arch="s390x", - ), - - linux_pipeline( - "Linux 20.04 GCC 10 32/64", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '32,64' }, - "g++-10-multilib", - ), - - linux_pipeline( - "Linux 22.04 GCC 11* 32/64", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, - ), - - linux_pipeline( - "Linux 22.04 GCC 12 32 ASAN 03", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03', ADDRMD: '32' } + asan, - "g++-12-multilib", - ), - - linux_pipeline( - "Linux 22.04 GCC 12 32 ASAN 11", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11', ADDRMD: '32' } + asan, - "g++-12-multilib", - ), - - linux_pipeline( - "Linux 22.04 GCC 12 32 ASAN 14", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '14', ADDRMD: '32' } + asan, - "g++-12-multilib", - ), - - linux_pipeline( - "Linux 22.04 GCC 12 32 ASAN 17", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '17', ADDRMD: '32' } + asan, - "g++-12-multilib", - ), - - linux_pipeline( - "Linux 22.04 GCC 12 32 ASAN 20", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '20', ADDRMD: '32' } + asan, - "g++-12-multilib", - ), - - linux_pipeline( - "Linux 22.04 GCC 12 32 ASAN 2b", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '2b', ADDRMD: '32' } + asan, - "g++-12-multilib", - ), - - linux_pipeline( - "Linux 22.04 GCC 12 64 ASAN", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '64' } + asan, - "g++-12-multilib", - ), - - linux_pipeline( - "Linux 24.04 GCC 13 32/64", - "cppalliance/droneubuntu2404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,23', ADDRMD: '32,64', CXXFLAGS: "-fexcess-precision=fast" }, - "g++-13-multilib", - ), - - linux_pipeline( - "Linux 24.04 GCC 13 GNU 32/64", - "cppalliance/droneubuntu2404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,23', ADDRMD: '32,64', CXXFLAGS: "-fexcess-precision=fast", CXXSTDDIALECT: "gnu" }, - "g++-13-multilib", - ), - - linux_pipeline( - "Linux 24.04 GCC 14 32", - "cppalliance/droneubuntu2404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,23', ADDRMD: '32', CXXFLAGS: "-fexcess-precision=fast" }, - "g++-14-multilib", - ), - - linux_pipeline( - "Linux 24.04 GCC 14 64", - "cppalliance/droneubuntu2404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,23', ADDRMD: '64', CXXFLAGS: "-fexcess-precision=fast" }, - "g++-14-multilib", - ), - - linux_pipeline( - "Linux 24.04 GCC 14 GNU 32", - "cppalliance/droneubuntu2404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,23', ADDRMD: '32', CXXFLAGS: "-fexcess-precision=fast", CXXSTDDIALECT: "gnu" }, - "g++-14-multilib", - ), - - linux_pipeline( - "Linux 24.04 GCC 14 GNU 64", - "cppalliance/droneubuntu2404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,23', ADDRMD: '64', CXXFLAGS: "-fexcess-precision=fast", CXXSTDDIALECT: "gnu" }, - "g++-14-multilib", - ), - - linux_pipeline( - "Linux 18.04 GCC 7* 32 03", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03', ADDRMD: '32' }, - "nload", - ), - - linux_pipeline( - "Linux 18.04 GCC 7* 32 11", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11', ADDRMD: '32' }, - "nload", - ), - - linux_pipeline( - "Linux 18.04 GCC 7* 32 14", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '14', ADDRMD: '32' }, - "nload", - ), - - linux_pipeline( - "Linux 18.04 GCC 7* 32 17", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '17', ADDRMD: '32' }, - "nload", - ), - - linux_pipeline( - "Linux 18.04 GCC 7* 64 03", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03', ADDRMD: '64' }, - "nload", - ), - - linux_pipeline( - "Linux 18.04 GCC 7* 64 11", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11', ADDRMD: '64' }, - "nload", - ), - - linux_pipeline( - "Linux 18.04 GCC 7* 64 14", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '14', ADDRMD: '64' }, - "nload", - ), - - linux_pipeline( - "Linux 18.04 GCC 7* 64 17", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '17', ADDRMD: '64' }, - "nload", - ), - - linux_pipeline( - "Linux 18.04 Clang 6.0", - "cppalliance/droneubuntu1804:1", - { TOOLSET: 'clang', COMPILER: 'clang++-6.0', CXXSTD: '03,11,14,17' }, - "clang-6.0", - ), - - linux_pipeline( - "Linux 20.04 Clang 7", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-7', CXXSTD: '03,11,14,17' }, - "clang-7", - ), - - linux_pipeline( - "Linux 20.04 Clang 8", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-8', CXXSTD: '03,11,14,17' }, - "clang-8", - ), - - linux_pipeline( - "Linux 20.04 Clang 9", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-9', CXXSTD: '03,11,14,17,2a' }, - "clang-9", - ), - - linux_pipeline( - "Linux 20.04 Clang 10", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-10', CXXSTD: '03,11,14,17,2a' }, - "clang-10", - ), - - linux_pipeline( - "Linux 20.04 Clang 11", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-11', CXXSTD: '03,11,14,17,2a' }, - "clang-11", - ), - - linux_pipeline( - "Linux 20.04 Clang 12", - "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-12', CXXSTD: '03,11,14,17,2a' }, - "clang-12", - ), - - linux_pipeline( - "Linux 22.04 Clang 13", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '03,11,14,17,20' }, - "clang-13", - ), - - linux_pipeline( - "Linux 22.04 Clang 14 UBSAN", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' } + ubsan, - "clang-14", - ), - - linux_pipeline( - "Linux 22.04 Clang 14 ASAN", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' } + asan, - "clang-14", - ), - - linux_pipeline( - "Linux 22.04 Clang 15", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '03,11,14,17,20,2b' }, - "clang-15", - ["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"], - ), - - linux_pipeline( - "Linux 22.04 Clang 16", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '03,11,14,17,20,2b' }, - "clang-16", - ["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"], - ), - - linux_pipeline( - "Linux 24.04 Clang 17", - "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' }, - "clang-17", - ["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"], - ), - - linux_pipeline( - "Linux 24.04 Clang 18", - "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' }, - "clang-18", - ["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"], - ), - - macos_pipeline( - "MacOS 12.4 Xcode 13.4.1 UBSAN", - { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + ubsan, - xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64", - ), - - macos_pipeline( - "MacOS 12.4 Xcode 13.4.1 ASAN", - { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + asan, - xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64", - ), - - windows_pipeline( - "Windows VS2019 msvc-14.2", - "cppalliance/dronevs2019", - { TOOLSET: 'msvc-14.2', CXXSTD: '14,17,20,latest' }, - ), - - windows_pipeline( - "Windows VS2022 msvc-14.3", - "cppalliance/dronevs2022:1", - { TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' }, - ), -] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 841fab66f..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,732 +0,0 @@ -# Copyright 2021-2022 Andrey Semashev -# Copyright 2023 Matt Borland -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) - -name: CI - -on: - pull_request: - push: - branches: - - master - - develop - - feature/** - -concurrency: - group: ${{format('{0}:{1}', github.repository, github.ref)}} - cancel-in-progress: true - -env: - GIT_FETCH_JOBS: 8 - NET_RETRY_COUNT: 5 - DEFAULT_BUILD_VARIANT: debug,release - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true - -jobs: - posix: - defaults: - run: - shell: bash - - strategy: - fail-fast: false - matrix: - include: - - toolset: gcc-7 - cxxstd: "03,11,14,17" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:18.04 - install: - - g++-7-multilib - - toolset: gcc-8 - cxxstd: "03,11,14,17,2a" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:18.04 - install: - - g++-8-multilib - - toolset: gcc-9 - cxxstd: "03,11,14,17,2a" - address_model: 32,64 - os: ubuntu-20.04 - install: - - g++-9-multilib - - toolset: gcc-9 - cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,2a-gnu" - address_model: 32,64 - os: ubuntu-20.04 - install: - - g++-9-multilib - - toolset: gcc-10 - cxxstd: "03,11,14,17,20" - address_model: 32,64 - os: ubuntu-20.04 - install: - - g++-10-multilib - - toolset: gcc-11 - cxxstd: "03,11,14,17,20,23" - address_model: 32,64 - os: ubuntu-22.04 - install: - - g++-11-multilib - - toolset: gcc-12 - cxxstd: "03,11,14,17,20,23" - address_model: 32,64 - os: ubuntu-22.04 - install: - - g++-12-multilib - # Disabled for now. 22.04 dropped support and 24.04 has internal errors - #- toolset: gcc-13 - # cxxstd: "03,11,14,17,20,23" - # address_model: 32,64 - # os: ubuntu-24.04 - # install: - # - g++-13-multilib - # cxxflags: -Wno-uninitialized - - toolset: gcc-12 - cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,23-gnu" - address_model: "32" - os: ubuntu-22.04 - install: - - g++-12-multilib - - toolset: gcc-12 - cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,23-gnu" - address_model: "64" - os: ubuntu-22.04 - install: - - g++-12-multilib - - name: 32-bit UBSAN - toolset: gcc-12 - cxxstd: "03,11,14,17,20,23" - address_model: "32" - ubsan: 1 - os: ubuntu-22.04 - install: - - g++-12-multilib - - name: 64-bit UBSAN - toolset: gcc-12 - cxxstd: "03,11,14,17,20,23" - address_model: "64" - ubsan: 1 - os: ubuntu-22.04 - install: - - g++-12-multilib - - # Linux, clang - - toolset: clang - compiler: clang++-6.0 - cxxstd: "03,11,14,17" - os: ubuntu-latest - container: ubuntu:18.04 - install: - - clang-6.0 - - toolset: clang - compiler: clang++-7 - cxxstd: "03,11,14,17" - os: ubuntu-latest - container: ubuntu:18.04 - install: - - clang-7 - # Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode - - toolset: clang - compiler: clang++-8 - cxxstd: "03,11,14,17,2a" - os: ubuntu-latest - container: ubuntu:18.04 - install: - - clang-8 - - g++-7 - gcc_toolchain: 7 - - toolset: clang - compiler: clang++-9 - cxxstd: "03,11,14,17,2a" - os: ubuntu-20.04 - install: - - clang-9 - - toolset: clang - compiler: clang++-10 - cxxstd: "03,11,14,17,20" - os: ubuntu-20.04 - install: - - clang-10 - - toolset: clang - compiler: clang++-11 - cxxstd: "03,11,14,17" - os: ubuntu-22.04 - install: - - clang-11 - - toolset: clang - compiler: clang++-12 - cxxstd: "03,11,14,17" - os: ubuntu-22.04 - install: - - clang-12 - - toolset: clang - compiler: clang++-13 - cxxstd: "03,11,14,17" - os: ubuntu-22.04 - install: - - clang-13 - - toolset: clang - compiler: clang++-14 - cxxstd: "03,11,14,17" - os: ubuntu-22.04 - install: - - clang-14 - - toolset: clang - compiler: clang++-14 - cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu" - os: ubuntu-22.04 - install: - - clang-14 - - toolset: clang - compiler: clang++-15 - cxxstd: "03,11,14,17,20" - os: ubuntu-22.04 - install: - - clang-15 - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - - toolset: clang - compiler: clang++-15 - cxxstd: "03,11,14,17,20,2b" - os: ubuntu-22.04 - install: - - clang-15 - - libc++-15-dev - - libc++abi-15-dev - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - cxxflags: -stdlib=libc++ - linkflags: -stdlib=libc++ - - toolset: clang - compiler: clang++-16 - cxxstd: "03,11,14,17,20,2b" - os: ubuntu-22.04 - install: - - clang-16 - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - - toolset: clang - compiler: clang++-17 - cxxstd: "03,11,14,17,20,2b" - os: ubuntu-22.04 - install: - - clang-17 - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - - name: UBSAN - toolset: clang - compiler: clang++-14 - cxxstd: "03,11,14,17,20,2b" - cxxflags: -stdlib=libc++ - linkflags: -stdlib=libc++ - ubsan: 1 - os: ubuntu-22.04 - install: - - clang-14 - - libc++-14-dev - - libc++abi-14-dev - - - toolset: clang - cxxstd: "03,11,14,17,20,2b" - os: macos-12 - - toolset: clang - cxxstd: "03,11,14,17,20,2b" - os: macos-13 - - toolset: clang - cxxstd: "03,11,14,17,20,2b" - os: macos-14 - - timeout-minutes: 180 - runs-on: ${{matrix.os}} - container: ${{matrix.container}} - - steps: - - name: Setup environment - run: | - if [ -f "/etc/debian_version" ] - then - echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV - export DEBIAN_FRONTEND=noninteractive - fi - if [ -n "${{matrix.container}}" ] - then - echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV - if [ -f "/etc/debian_version" ] - then - apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ] - then - PYTHON_PACKAGE="python-is-python3" - else - PYTHON_PACKAGE="python" - fi - apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake - fi - fi - git config --global pack.threads 0 - - uses: actions/checkout@v3 - - - name: Install packages - if: matrix.install - run: | - declare -a SOURCE_KEYS SOURCES - if [ -n "${{join(matrix.source_keys, ' ')}}" ] - then - SOURCE_KEYS=("${{join(matrix.source_keys, '" "')}}") - fi - if [ -n "${{join(matrix.sources, ' ')}}" ] - then - SOURCES=("${{join(matrix.sources, '" "')}}") - fi - for key in "${SOURCE_KEYS[@]}" - do - for i in {1..$NET_RETRY_COUNT} - do - echo "Adding key: $key" - wget -O - "$key" | sudo apt-key add - && break || sleep 2 - done - done - if [ ${#SOURCES[@]} -gt 0 ] - then - APT_ADD_REPO_COMMON_ARGS=("-y") - APT_ADD_REPO_SUPPORTED_ARGS="$(apt-add-repository --help | perl -ne 'if (/^\s*-n/) { print "n"; } elsif (/^\s*-P/) { print "P"; } elsif (/^\s*-S/) { print "S"; } elsif (/^\s*-U/) { print "U"; }')" - if [ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*n*}" ] - then - APT_ADD_REPO_COMMON_ARGS+=("-n") - fi - APT_ADD_REPO_HAS_SOURCE_ARGS="$([ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*P*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*S*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*U*}" ] && echo 1 || echo 0)" - for source in "${SOURCES[@]}" - do - for i in {1..$NET_RETRY_COUNT} - do - APT_ADD_REPO_ARGS=("${APT_ADD_REPO_COMMON_ARGS[@]}") - if [ $APT_ADD_REPO_HAS_SOURCE_ARGS -ne 0 ] - then - case "$source" in - "ppa:"*) - APT_ADD_REPO_ARGS+=("-P") - ;; - "deb "*) - APT_ADD_REPO_ARGS+=("-S") - ;; - *) - APT_ADD_REPO_ARGS+=("-U") - ;; - esac - fi - APT_ADD_REPO_ARGS+=("$source") - echo "apt-add-repository ${APT_ADD_REPO_ARGS[@]}" - sudo -E apt-add-repository "${APT_ADD_REPO_ARGS[@]}" && break || sleep 2 - done - done - fi - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y ${{join(matrix.install, ' ')}} locales - sudo locale-gen de_DE.UTF-8 - sudo update-locale - - name: Setup GCC Toolchain - if: matrix.gcc_toolchain - run: | - GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain" - echo "GCC_TOOLCHAIN_ROOT=\"$GCC_TOOLCHAIN_ROOT\"" >> $GITHUB_ENV - MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" - mkdir -p "$GCC_TOOLCHAIN_ROOT" - ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include" - ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin" - mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET" - ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" - - name: Setup Boost - run: | - echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY - LIBRARY=${GITHUB_REPOSITORY#*/} - echo LIBRARY: $LIBRARY - echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV - echo GITHUB_BASE_REF: $GITHUB_BASE_REF - echo GITHUB_REF: $GITHUB_REF - REF=${GITHUB_BASE_REF:-$GITHUB_REF} - REF=${REF#refs/heads/} - echo REF: $REF - BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true - echo BOOST_BRANCH: $BOOST_BRANCH - BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null) - echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV - echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV - DEPINST_ARGS=() - GIT_VERSION="$(git --version | sed -e 's/git version //')" - GIT_HAS_JOBS=1 - if [ -f "/etc/debian_version" ] - then - if $(dpkg --compare-versions "$GIT_VERSION" lt 2.8.0) - then - GIT_HAS_JOBS=0 - fi - else - declare -a GIT_VER=(${GIT_VERSION//./ }) - declare -a GIT_MIN_VER=(2 8 0) - for ((i=0; i<${#GIT_VER[@]}; i++)) - do - if [ -z "${GIT_MIN_VER[i]}" ] - then - GIT_MIN_VER[i]=0 - fi - if [ "${GIT_VER[i]}" -lt "${GIT_MIN_VER[i]}" ] - then - GIT_HAS_JOBS=0 - break - fi - done - fi - if [ "$GIT_HAS_JOBS" -ne 0 ] - then - DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS") - fi - cd .. - git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" - cd boost-root - mkdir -p libs/$LIBRARY - cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY - git submodule update --init tools/boostdep - DEPINST_ARGS+=("$LIBRARY") - python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}" - if [ -z "${{matrix.cmake_tests}}" ] - then - ./bootstrap.sh - ./b2 headers - if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ] - then - echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam - if [ -n "$GCC_TOOLCHAIN_ROOT" ] - then - echo -n " : \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam - fi - echo " ;" >> ~/user-config.jam - fi - fi - - name: Run tests - if: matrix.cmake_tests == '' - run: | - cd ../boost-root - B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}" "link=static,shared") - if [ -n "${{matrix.build_variant}}" ] - then - B2_ARGS+=("variant=${{matrix.build_variant}}") - else - B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") - fi - if [ -n "${{matrix.threading}}" ] - then - B2_ARGS+=("threading=${{matrix.threading}}") - fi - if [ -n "${{matrix.ubsan}}" ] - then - export UBSAN_OPTIONS="print_stacktrace=1" - B2_ARGS+=("cxxflags=-fsanitize=undefined -fno-sanitize-recover=undefined" "linkflags=-fsanitize=undefined -fuse-ld=gold" "define=UBSAN=1" "debug-symbols=on" "visibility=global") - fi - if [ -n "${{matrix.cxxflags}}" ] - then - B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") - fi - if [ -n "${{matrix.linkflags}}" ] - then - B2_ARGS+=("linkflags=${{matrix.linkflags}}") - fi - if [ -n "${{matrix.address_model}}" ] - then - B2_ARGS+=("address-model=${{matrix.address_model}}") - fi - B2_ARGS+=("libs/$LIBRARY/test") - ./b2 "${B2_ARGS[@]}" cxxflags="-Wall -Wextra -Werror" - - windows: - strategy: - fail-fast: false - matrix: - include: - - toolset: msvc-14.2 - cxxstd: "14,17,20,latest" - addrmd: "32" - os: windows-2019 - # B2 does not work with MSVC 17.10. Once it's updated we can re-enable these tests - # Still covered in drone - #- toolset: msvc-14.3 - # cxxstd: "14,17,20,latest" - # addrmd: "32" - # os: windows-2022 - - toolset: msvc-14.2 - cxxstd: "14,17,20,latest" - addrmd: "64" - os: windows-2019 - #- toolset: msvc-14.3 - # cxxstd: "14,17,20,latest" - # addrmd: "64" - # os: windows-2022 - #- toolset: clang-win - # cxxstd: "14,17,latest" - # addrmd: "32" - # os: windows-2022 - #- toolset: clang-win - # cxxstd: "14,17,latest" - # addrmd: "64" - # os: windows-2022 - - toolset: gcc - cxxstd: "03,11,14,17,2a" - addrmd: "64" - os: windows-2019 - - runs-on: ${{matrix.os}} - - steps: - - uses: actions/checkout@v3 - - - name: Setup Boost - shell: cmd - run: | - echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% - for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi - echo LIBRARY: %LIBRARY% - echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% - echo GITHUB_BASE_REF: %GITHUB_BASE_REF% - echo GITHUB_REF: %GITHUB_REF% - if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% - set BOOST_BRANCH=develop - for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master - echo BOOST_BRANCH: %BOOST_BRANCH% - cd .. - git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ - git submodule update --init tools/boostdep - python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% - cmd /c bootstrap - b2 -d0 headers - - - name: Run tests - shell: cmd - run: | - cd ../boost-root - b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release link=static,shared embed-manifest-via=linker - - posix-cmake-subdir: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-20.04 - - os: ubuntu-22.04 - - os: macos-12 - - os: macos-13 - - os: macos-14 - - runs-on: ${{matrix.os}} - - steps: - - uses: actions/checkout@v3 - - - name: Install packages - if: matrix.install - run: sudo apt install ${{matrix.install}} - - - name: Setup Boost - run: | - echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY - LIBRARY=${GITHUB_REPOSITORY#*/} - echo LIBRARY: $LIBRARY - echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV - echo GITHUB_BASE_REF: $GITHUB_BASE_REF - echo GITHUB_REF: $GITHUB_REF - REF=${GITHUB_BASE_REF:-$GITHUB_REF} - REF=${REF#refs/heads/} - echo REF: $REF - BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true - echo BOOST_BRANCH: $BOOST_BRANCH - cd .. - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - mkdir -p libs/$LIBRARY - cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY - git submodule update --init tools/boostdep - python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY - - - name: Use library with add_subdirectory - run: | - cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test - mkdir __build__ && cd __build__ - cmake .. - cmake --build . - ctest --output-on-failure --no-tests=error - - posix-cmake-install: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-20.04 - - os: ubuntu-22.04 - - os: macos-12 - - os: macos-13 - - os: macos-14 - - runs-on: ${{matrix.os}} - - steps: - - uses: actions/checkout@v3 - - - name: Install packages - if: matrix.install - run: sudo apt install ${{matrix.install}} - - - name: Setup Boost - run: | - echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY - LIBRARY=${GITHUB_REPOSITORY#*/} - echo LIBRARY: $LIBRARY - echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV - echo GITHUB_BASE_REF: $GITHUB_BASE_REF - echo GITHUB_REF: $GITHUB_REF - REF=${GITHUB_BASE_REF:-$GITHUB_REF} - REF=${REF#refs/heads/} - echo REF: $REF - BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true - echo BOOST_BRANCH: $BOOST_BRANCH - cd .. - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - mkdir -p libs/$LIBRARY - cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY - git submodule update --init tools/boostdep - python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY - - - name: Configure - run: | - cd ../boost-root - mkdir __build__ && cd __build__ - cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local .. - - - name: Install - run: | - cd ../boost-root/__build__ - cmake --build . --target install - - - name: Use the installed library - run: | - cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__ - cmake -DCMAKE_INSTALL_PREFIX=~/.local .. - cmake --build . - ctest --output-on-failure --no-tests=error - - posix-cmake-test: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-20.04 - - os: ubuntu-22.04 - - os: macos-12 - - os: macos-13 - - os: macos-14 - - runs-on: ${{matrix.os}} - - steps: - - uses: actions/checkout@v3 - - - name: Install packages - if: matrix.install - run: sudo apt install ${{matrix.install}} - - - name: Setup Boost - run: | - echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY - LIBRARY=${GITHUB_REPOSITORY#*/} - echo LIBRARY: $LIBRARY - echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV - echo GITHUB_BASE_REF: $GITHUB_BASE_REF - echo GITHUB_REF: $GITHUB_REF - REF=${GITHUB_BASE_REF:-$GITHUB_REF} - REF=${REF#refs/heads/} - echo REF: $REF - BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true - echo BOOST_BRANCH: $BOOST_BRANCH - cd .. - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - mkdir -p libs/$LIBRARY - cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY - git submodule update --init tools/boostdep - python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY - - - name: Configure - run: | - cd ../boost-root - mkdir __build__ && cd __build__ - cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON .. - - - name: Build tests - run: | - cd ../boost-root/__build__ - cmake --build . --target tests - - - name: Run tests - run: | - cd ../boost-root/__build__ - ctest --output-on-failure --no-tests=error - - MSYS2: - defaults: - run: - shell: msys2 {0} - strategy: - fail-fast: false - matrix: - include: - - { sys: MINGW32, compiler: gcc, cxxstd: '03,11,17,20' } - - { sys: MINGW64, compiler: gcc, cxxstd: '03,11,17,20' } - - runs-on: windows-latest - - steps: - - uses: actions/checkout@v3 - - - name: Setup MSYS2 environment - uses: msys2/setup-msys2@v2 - with: - msystem: ${{matrix.sys}} - update: true - install: git python - pacboy: gcc:p cmake:p ninja:p - - - name: Fetch Boost.CI - uses: actions/checkout@v3 - with: - repository: boostorg/boost-ci - ref: master - path: boost-ci-cloned - - name: Get CI scripts folder - run: | - # Copy ci folder if not testing Boost.CI - [[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci . - rm -rf boost-ci-cloned - - - name: Setup Boost - env: - B2_COMPILER: ${{matrix.compiler}} - B2_CXXSTD: ${{matrix.cxxstd}} - B2_SANITIZE: ${{matrix.sanitize}} - B2_STDLIB: ${{matrix.stdlib}} - run: ci/github/install.sh - - - name: Run tests - run: ci/build.sh diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index e8c1b6780..000000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,73 +0,0 @@ -# ------------------------------------------------------------------------------ -# Copyright Matt Borland 2023 - 2024. -# Copyright Christopher Kormanyos 2023 - 2024. -# Distributed under the Boost Software License, -# Version 1.0. (See accompanying file LICENSE_1_0.txt -# or copy at http://www.boost.org/LICENSE_1_0.txt) -# ------------------------------------------------------------------------------ - -name: codecov -on: - push: - branches: - - master - - develop - - feature/** - pull_request: - types: [opened, synchronize, reopened] -jobs: - gcc-gcov-native: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - standard: [ c++20 ] - compiler: [ g++ ] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: '0' - - name: update-tools - run: | - sudo apt install lcov locales - sudo locale-gen de_DE.UTF-8 - sudo update-locale - - - name: clone-submods-bootstrap-headers-boost-develop - run: | - git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - cd ../boost-root - git submodule update --init tools - git submodule update --init libs/assert - git submodule update --init libs/config - git submodule update --init libs/core - git submodule update --init libs/math - git submodule update --init libs/multiprecision - git submodule update --init libs/predef - git submodule update --init libs/static_assert - git submodule update --init libs/test - ./bootstrap.sh - ./b2 headers - - name: gcc-gcov-native - run: | - cd test/cover - echo "build and run gcov/lcov/genhtml" - echo "make prepare -f make_gcov_01_generic.gmk MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}" - echo - make prepare -f make_gcov_01_generic.gmk MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }} - echo - echo "make gcov -f make_gcov_01_generic.gmk --jobs=8 MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}" - echo - make gcov -f make_gcov_01_generic.gmk --jobs=8 MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }} - echo - - name: upload-codecov - uses: codecov/codecov-action@v4 - with: - plugin: gcov - file: ${{ runner.workspace }}/decimal/test/cover/coverage.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - verbose: false diff --git a/.github/workflows/cuda-b2.yml b/.github/workflows/cuda-b2.yml new file mode 100644 index 000000000..1aef46132 --- /dev/null +++ b/.github/workflows/cuda-b2.yml @@ -0,0 +1,256 @@ +# Copyright 2021-2022 Andrey Semashev +# Copyright 2023 Matt Borland +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) + +name: CUDA-B2 + +on: + pull_request: + push: + branches: + - master + - develop + - feature/** + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + GIT_FETCH_JOBS: 8 + NET_RETRY_COUNT: 5 + DEFAULT_BUILD_VARIANT: release + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true + +jobs: + posix: + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + include: + - toolset: nvcc + cxxstd: "17" + address_model: 64 + os: ubuntu:22.04 + + timeout-minutes: 120 + runs-on: gpu-runner-1 + + steps: + - uses: Jimver/cuda-toolkit@v0.2.16 + id: cuda-toolkit + with: + cuda: '12.5.0' + method: 'network' + sub-packages: '["nvcc"]' + + - name: Output CUDA information + run: | + echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"+ + echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}" + nvcc -V + + - name: Setup environment + run: | + if [ -f "/etc/debian_version" ] + then + echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV + export DEBIAN_FRONTEND=noninteractive + fi + if [ -n "${{matrix.container}}" ] + then + echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV + if [ -f "/etc/debian_version" ] + then + apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ] + then + PYTHON_PACKAGE="python-is-python3" + else + PYTHON_PACKAGE="python" + fi + apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake + fi + fi + git config --global pack.threads 0 + - uses: actions/checkout@v3 + + - name: Install packages + if: matrix.install + run: | + declare -a SOURCE_KEYS SOURCES + if [ -n "${{join(matrix.source_keys, ' ')}}" ] + then + SOURCE_KEYS=("${{join(matrix.source_keys, '" "')}}") + fi + if [ -n "${{join(matrix.sources, ' ')}}" ] + then + SOURCES=("${{join(matrix.sources, '" "')}}") + fi + for key in "${SOURCE_KEYS[@]}" + do + for i in {1..$NET_RETRY_COUNT} + do + echo "Adding key: $key" + wget -O - "$key" | sudo apt-key add - && break || sleep 2 + done + done + if [ ${#SOURCES[@]} -gt 0 ] + then + APT_ADD_REPO_COMMON_ARGS=("-y") + APT_ADD_REPO_SUPPORTED_ARGS="$(apt-add-repository --help | perl -ne 'if (/^\s*-n/) { print "n"; } elsif (/^\s*-P/) { print "P"; } elsif (/^\s*-S/) { print "S"; } elsif (/^\s*-U/) { print "U"; }')" + if [ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*n*}" ] + then + APT_ADD_REPO_COMMON_ARGS+=("-n") + fi + APT_ADD_REPO_HAS_SOURCE_ARGS="$([ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*P*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*S*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*U*}" ] && echo 1 || echo 0)" + for source in "${SOURCES[@]}" + do + for i in {1..$NET_RETRY_COUNT} + do + APT_ADD_REPO_ARGS=("${APT_ADD_REPO_COMMON_ARGS[@]}") + if [ $APT_ADD_REPO_HAS_SOURCE_ARGS -ne 0 ] + then + case "$source" in + "ppa:"*) + APT_ADD_REPO_ARGS+=("-P") + ;; + "deb "*) + APT_ADD_REPO_ARGS+=("-S") + ;; + *) + APT_ADD_REPO_ARGS+=("-U") + ;; + esac + fi + APT_ADD_REPO_ARGS+=("$source") + echo "apt-add-repository ${APT_ADD_REPO_ARGS[@]}" + sudo -E apt-add-repository "${APT_ADD_REPO_ARGS[@]}" && break || sleep 2 + done + done + fi + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y ${{join(matrix.install, ' ')}} locales + sudo locale-gen de_DE.UTF-8 + sudo update-locale + - name: Setup GCC Toolchain + if: matrix.gcc_toolchain + run: | + GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain" + echo "GCC_TOOLCHAIN_ROOT=\"$GCC_TOOLCHAIN_ROOT\"" >> $GITHUB_ENV + MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" + mkdir -p "$GCC_TOOLCHAIN_ROOT" + ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include" + ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin" + mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET" + ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null) + echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV + echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV + DEPINST_ARGS=() + GIT_VERSION="$(git --version | sed -e 's/git version //')" + GIT_HAS_JOBS=1 + if [ -f "/etc/debian_version" ] + then + if $(dpkg --compare-versions "$GIT_VERSION" lt 2.8.0) + then + GIT_HAS_JOBS=0 + fi + else + declare -a GIT_VER=(${GIT_VERSION//./ }) + declare -a GIT_MIN_VER=(2 8 0) + for ((i=0; i<${#GIT_VER[@]}; i++)) + do + if [ -z "${GIT_MIN_VER[i]}" ] + then + GIT_MIN_VER[i]=0 + fi + if [ "${GIT_VER[i]}" -lt "${GIT_MIN_VER[i]}" ] + then + GIT_HAS_JOBS=0 + break + fi + done + fi + if [ "$GIT_HAS_JOBS" -ne 0 ] + then + DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS") + fi + cd .. + git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" + cd boost-root + mkdir -p libs/$LIBRARY + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + DEPINST_ARGS+=("$LIBRARY") + python3 tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}" + if [ -z "${{matrix.cmake_tests}}" ] + then + ./bootstrap.sh + ./b2 headers + if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam + if [ -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n " : \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam + fi + echo " ;" >> ~/user-config.jam + fi + fi + - name: Create user-config + run: | + echo "using nvcc : : ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}/bin/nvcc ;" > $HOME/user-config.jam + - name: Run tests + if: matrix.cmake_tests == '' + run: | + cd ../boost-root + B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}" "link=static") + if [ -n "${{matrix.build_variant}}" ] + then + B2_ARGS+=("variant=${{matrix.build_variant}}") + else + B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") + fi + if [ -n "${{matrix.threading}}" ] + then + B2_ARGS+=("threading=${{matrix.threading}}") + fi + if [ -n "${{matrix.ubsan}}" ] + then + export UBSAN_OPTIONS="print_stacktrace=1" + B2_ARGS+=("cxxflags=-fsanitize=undefined -fno-sanitize-recover=undefined" "linkflags=-fsanitize=undefined -fuse-ld=gold" "define=UBSAN=1" "debug-symbols=on" "visibility=global") + fi + if [ -n "${{matrix.cxxflags}}" ] + then + B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") + fi + if [ -n "${{matrix.linkflags}}" ] + then + B2_ARGS+=("linkflags=${{matrix.linkflags}}") + fi + if [ -n "${{matrix.address_model}}" ] + then + B2_ARGS+=("address-model=${{matrix.address_model}}") + fi + B2_ARGS+=("libs/$LIBRARY/test") + ./b2 "${B2_ARGS[@]}" diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml deleted file mode 100644 index 4487018fe..000000000 --- a/.github/workflows/fuzz.yml +++ /dev/null @@ -1,289 +0,0 @@ -# Copyright 2021-2022 Andrey Semashev -# Copyright 2024 Matt Borland -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) - -name: Fuzz - -on: - pull_request: - push: - branches: - - master - - develop - - feature/** - -env: - GIT_FETCH_JOBS: 8 - NET_RETRY_COUNT: 5 - DEFAULT_BUILD_VARIANT: debug,release - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true - -jobs: - posix: - defaults: - run: - shell: bash - - strategy: - fail-fast: false - matrix: - include: - - # Linux, clang - # https://llvm.org/docs/LibFuzzer.html#fuzzer-usage - - toolset: clang - compiler: clang++-12 - cxxstd: "14,17,20" - os: ubuntu-22.04 - install: - - clang-12 - - toolset: clang - compiler: clang++-13 - cxxstd: "14,17,20" - os: ubuntu-22.04 - install: - - clang-13 - - toolset: clang - compiler: clang++-14 - cxxstd: "14,17,20" - os: ubuntu-22.04 - install: - - clang-14 - - toolset: clang - compiler: clang++-14 - cxxstd: "14-gnu,17-gnu,20-gnu" - os: ubuntu-22.04 - install: - - clang-14 - - toolset: clang - compiler: clang++-15 - cxxstd: "14,17,20" - os: ubuntu-22.04 - install: - - clang-15 - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - - toolset: clang - compiler: clang++-16 - cxxstd: "14,17,20" - os: ubuntu-22.04 - install: - - clang-16 - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - - toolset: clang - compiler: clang++-17 - cxxstd: "14,17,20" - os: ubuntu-22.04 - install: - - clang-17 - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - - - timeout-minutes: 60 - runs-on: ${{matrix.os}} - container: ${{matrix.container}} - - steps: - - name: Setup environment - run: | - if [ -f "/etc/debian_version" ] - then - echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV - export DEBIAN_FRONTEND=noninteractive - fi - if [ -n "${{matrix.container}}" ] - then - echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV - if [ -f "/etc/debian_version" ] - then - apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ] - then - PYTHON_PACKAGE="python-is-python3" - else - PYTHON_PACKAGE="python" - fi - apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake - fi - fi - git config --global pack.threads 0 - - uses: actions/checkout@v4 - - - name: Install packages - if: matrix.install - run: | - declare -a SOURCE_KEYS SOURCES - if [ -n "${{join(matrix.source_keys, ' ')}}" ] - then - SOURCE_KEYS=("${{join(matrix.source_keys, '" "')}}") - fi - if [ -n "${{join(matrix.sources, ' ')}}" ] - then - SOURCES=("${{join(matrix.sources, '" "')}}") - fi - for key in "${SOURCE_KEYS[@]}" - do - for i in {1..$NET_RETRY_COUNT} - do - echo "Adding key: $key" - wget -O - "$key" | sudo apt-key add - && break || sleep 2 - done - done - if [ ${#SOURCES[@]} -gt 0 ] - then - APT_ADD_REPO_COMMON_ARGS=("-y") - APT_ADD_REPO_SUPPORTED_ARGS="$(apt-add-repository --help | perl -ne 'if (/^\s*-n/) { print "n"; } elsif (/^\s*-P/) { print "P"; } elsif (/^\s*-S/) { print "S"; } elsif (/^\s*-U/) { print "U"; }')" - if [ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*n*}" ] - then - APT_ADD_REPO_COMMON_ARGS+=("-n") - fi - APT_ADD_REPO_HAS_SOURCE_ARGS="$([ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*P*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*S*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*U*}" ] && echo 1 || echo 0)" - for source in "${SOURCES[@]}" - do - for i in {1..$NET_RETRY_COUNT} - do - APT_ADD_REPO_ARGS=("${APT_ADD_REPO_COMMON_ARGS[@]}") - if [ $APT_ADD_REPO_HAS_SOURCE_ARGS -ne 0 ] - then - case "$source" in - "ppa:"*) - APT_ADD_REPO_ARGS+=("-P") - ;; - "deb "*) - APT_ADD_REPO_ARGS+=("-S") - ;; - *) - APT_ADD_REPO_ARGS+=("-U") - ;; - esac - fi - APT_ADD_REPO_ARGS+=("$source") - echo "apt-add-repository ${APT_ADD_REPO_ARGS[@]}" - sudo -E apt-add-repository "${APT_ADD_REPO_ARGS[@]}" && break || sleep 2 - done - done - fi - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y ${{join(matrix.install, ' ')}} locales - sudo locale-gen de_DE.UTF-8 - sudo update-locale - - name: Setup GCC Toolchain - if: matrix.gcc_toolchain - run: | - GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain" - echo "GCC_TOOLCHAIN_ROOT=\"$GCC_TOOLCHAIN_ROOT\"" >> $GITHUB_ENV - MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" - mkdir -p "$GCC_TOOLCHAIN_ROOT" - ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include" - ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin" - mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET" - ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" - - name: Setup Boost - run: | - echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY - LIBRARY=${GITHUB_REPOSITORY#*/} - echo LIBRARY: $LIBRARY - echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV - echo GITHUB_BASE_REF: $GITHUB_BASE_REF - echo GITHUB_REF: $GITHUB_REF - REF=${GITHUB_BASE_REF:-$GITHUB_REF} - REF=${REF#refs/heads/} - echo REF: $REF - BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true - echo BOOST_BRANCH: $BOOST_BRANCH - BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null) - echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV - echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV - DEPINST_ARGS=() - GIT_VERSION="$(git --version | sed -e 's/git version //')" - GIT_HAS_JOBS=1 - if [ -f "/etc/debian_version" ] - then - if $(dpkg --compare-versions "$GIT_VERSION" lt 2.8.0) - then - GIT_HAS_JOBS=0 - fi - else - declare -a GIT_VER=(${GIT_VERSION//./ }) - declare -a GIT_MIN_VER=(2 8 0) - for ((i=0; i<${#GIT_VER[@]}; i++)) - do - if [ -z "${GIT_MIN_VER[i]}" ] - then - GIT_MIN_VER[i]=0 - fi - if [ "${GIT_VER[i]}" -lt "${GIT_MIN_VER[i]}" ] - then - GIT_HAS_JOBS=0 - break - fi - done - fi - if [ "$GIT_HAS_JOBS" -ne 0 ] - then - DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS") - fi - cd .. - git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" - cd boost-root - mkdir -p libs/$LIBRARY - cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY - git submodule update --init tools/boostdep - DEPINST_ARGS+=("$LIBRARY") - python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}" - if [ -z "${{matrix.cmake_tests}}" ] - then - ./bootstrap.sh - ./b2 headers - if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ] - then - echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam - if [ -n "$GCC_TOOLCHAIN_ROOT" ] - then - echo -n " : \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam - fi - echo " ;" >> ~/user-config.jam - fi - fi - - name: Run tests - if: matrix.cmake_tests == '' - run: | - cd ../boost-root/libs/$LIBRARY/fuzzing - B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}" "link=static,shared") - if [ -n "${{matrix.build_variant}}" ] - then - B2_ARGS+=("variant=${{matrix.build_variant}}") - else - B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") - fi - if [ -n "${{matrix.threading}}" ] - then - B2_ARGS+=("threading=${{matrix.threading}}") - fi - if [ -n "${{matrix.ubsan}}" ] - then - export UBSAN_OPTIONS="print_stacktrace=1" - B2_ARGS+=("cxxflags=-fsanitize=undefined -fno-sanitize-recover=undefined" "linkflags=-fsanitize=undefined -fuse-ld=gold" "define=UBSAN=1" "debug-symbols=on" "visibility=global") - fi - if [ -n "${{matrix.cxxflags}}" ] - then - B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") - fi - if [ -n "${{matrix.linkflags}}" ] - then - B2_ARGS+=("linkflags=${{matrix.linkflags}}") - fi - if [ -n "${{matrix.address_model}}" ] - then - B2_ARGS+=("address-model=${{matrix.address_model}}") - fi - ../../../b2 "${B2_ARGS[@]}" diff --git a/.github/workflows/metal.yml b/.github/workflows/metal.yml deleted file mode 100644 index b0c426136..000000000 --- a/.github/workflows/metal.yml +++ /dev/null @@ -1,54 +0,0 @@ -# ------------------------------------------------------------------------------ -# Copyright Matt Borland 2023. -# Copyright Christopher Kormanyos 2023. -# Distributed under the Boost Software License, -# Version 1.0. (See accompanying file LICENSE_1_0.txt -# or copy at http://www.boost.org/LICENSE_1_0.txt) -# ------------------------------------------------------------------------------ - -name: metal -on: - push: - branches: - - master - - develop - - feature/** - pull_request: - types: [opened, synchronize, reopened] -jobs: - benchmark_single-stm32f429-qemu: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: '0' - - name: update-tools - run: | - sudo apt install libncurses5 libpython2.7 - mkdir -p emu_env && cd emu_env - wget --no-check-certificate https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 - tar -xf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 - wget --no-check-certificate https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/download/v7.1.0-1/xpack-qemu-arm-7.1.0-1-linux-x64.tar.gz - tar -xzf xpack-qemu-arm-7.1.0-1-linux-x64.tar.gz - working-directory: ./test/metal/ - - name: build benchmark_single-stm32f429 - run: | - mkdir -p bin - emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-g++ -std=c++17 -Wall -Wextra -Wpedantic -Os -g -gdwarf-2 -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -fno-inline-functions -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I../../include -DBOOST_DECIMAL_DISABLE_CLIB -DAPP_BENCHMARK_STANDALONE_MAIN app_benchmark_non_std_decimal.cpp ./target/micros/stm32f429/make/single/crt.cpp ./target/micros/stm32f429/make/single/mcal_gcc_cxx_completion_with_stdlib.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -Wl,--print-memory-usage -o ./bin/app_benchmark_non_std_decimal.elf - emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-objcopy ./bin/app_benchmark_non_std_decimal.elf -O ihex ./bin/app_benchmark_non_std_decimal.hex - ls -la ./bin/app_benchmark_non_std_decimal.elf ./bin/app_benchmark_non_std_decimal.hex ./bin/app_benchmark_non_std_decimal.map - working-directory: ./test/metal/ - - name: emulate-target stm32f429 - run: | - ./emu_env/xpack-qemu-arm-7.1.0-1/bin/qemu-system-gnuarmeclipse --verbose --mcu STM32F429ZI --nographic --gdb tcp::9999 -d unimp,guest_errors & - working-directory: ./test/metal/ - - name: run-test-on-target - run: | - ./emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gdb-py ./bin/app_benchmark_non_std_decimal.elf -x ./target/build/test_app_benchmarks_emulator.py - qemu_result=$? - echo "qemu_result" "$qemu_result" - echo "qemu_result" "$qemu_result" | grep 'qemu_result 0' - working-directory: ./test/metal/ diff --git a/.github/workflows/qemu.yml b/.github/workflows/qemu.yml deleted file mode 100644 index 7b77f22ad..000000000 --- a/.github/workflows/qemu.yml +++ /dev/null @@ -1,206 +0,0 @@ -# Copyright 2020-2021 Peter Dimov -# Copyright 2021 Andrey Semashev -# Copyright 2021 Alexander Grund -# Copyright 2022 James E. King III -# Copyright 2024 Matt Borland -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) ---- -name: qemu - -on: - pull_request: - push: - branches: - - master - - develop - - bugfix/** - - feature/** - - fix/** - - pr/** - -env: - GIT_FETCH_JOBS: 8 - NET_RETRY_COUNT: 5 - B2_CI_VERSION: 1 - B2_VARIANT: release - B2_LINK: static - LCOV_BRANCH_COVERAGE: 0 - CODECOV_NAME: Github Actions - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true - -jobs: - posix: - defaults: - run: - shell: bash - - strategy: - fail-fast: false - matrix: - include: - # multiarch testing - - { name: PPC64LE-GCC, multiarch: yes, - compiler: gcc, cxxstd: '14', os: ubuntu-22.04, ccache: no, distro: alpine, edition: edge, arch: ppc64le } - - { name: PPC64LE-Clang, multiarch: yes, - compiler: clang, cxxstd: '14', os: ubuntu-22.04, ccache: no, distro: alpine, edition: edge, arch: ppc64le } - - - timeout-minutes: 360 - runs-on: ${{matrix.os}} - container: ${{matrix.container}} - env: {B2_USE_CCACHE: 1} - - steps: - - name: Setup environment - run: | - if [ -f "/etc/debian_version" ]; then - echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV - export DEBIAN_FRONTEND=noninteractive - fi - if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then - apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common curl - # Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80 - curl -sSL --retry ${NET_RETRY_COUNT:-5} 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xE1DD270288B4E6030699E45FA1715D88E1DF1F24' | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/git-core_ubuntu_ppa.gpg - for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done - apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - osver=$(lsb_release -sr | cut -f1 -d.) - pkgs="g++ git" - # Ubuntu 22+ has only Python 3 in the repos - if [ -n "$osver" ] && [ "$osver" -ge "22" ]; then - pkgs+=" python-is-python3 libpython3-dev" - else - pkgs+=" python libpython-dev" - fi - apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs locales - sudo locale-gen de_DE.UTF-8 - sudo update-locale - fi - # For jobs not compatible with ccache, use "ccache: no" in the matrix - if [[ "${{ matrix.ccache }}" == "no" ]]; then - echo "B2_USE_CCACHE=0" >> $GITHUB_ENV - fi - git config --global pack.threads 0 - if [[ "${{matrix.container}}" == "ubuntu:16.04" ]] || [[ "${{matrix.container}}" == "ubuntu:18.04" ]]; then - # Ubuntu 16/18 can't run Node 20, so stick to older actions: https://github.com/actions/checkout/issues/1590 - echo "GHA_USE_NODE_20=false" >> $GITHUB_ENV - echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV - else - echo "GHA_USE_NODE_20=true" >> $GITHUB_ENV - fi - - - uses: actions/checkout@v3 - if: env.GHA_USE_NODE_20 == 'false' - with: - # For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary' - fetch-depth: ${{ matrix.coverage && '0' || '1' }} - - uses: actions/checkout@v4 - if: env.GHA_USE_NODE_20 == 'true' - with: - # For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary' - fetch-depth: ${{ matrix.coverage && '0' || '1' }} - - - name: Cache ccache - uses: actions/cache@v3 - if: env.B2_USE_CCACHE && env.GHA_USE_NODE_20 == 'false' - with: - path: ~/.ccache - key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}} - restore-keys: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}- - - - name: Cache ccache - uses: actions/cache@v4 - if: env.B2_USE_CCACHE && env.GHA_USE_NODE_20 == 'true' - with: - path: ~/.ccache - key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}} - restore-keys: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}- - - - name: Fetch Boost.CI - uses: actions/checkout@v3 - if: env.GHA_USE_NODE_20 == 'false' - with: - repository: boostorg/boost-ci - ref: master - path: boost-ci-cloned - - - name: Fetch Boost.CI - uses: actions/checkout@v4 - if: env.GHA_USE_NODE_20 == 'true' - with: - repository: boostorg/boost-ci - ref: master - path: boost-ci-cloned - - - name: Get CI scripts folder - run: | - # Copy ci folder if not testing Boost.CI - [[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci . - rm -rf boost-ci-cloned - - - name: Install packages - if: startsWith(matrix.os, 'ubuntu') - run: | - SOURCE_KEYS=(${{join(matrix.source_keys, ' ')}}) - SOURCES=(${{join(matrix.sources, ' ')}}) - # Add this by default - SOURCE_KEYS+=('http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1E9377A2BA9EF27F') - SOURCES+=(ppa:ubuntu-toolchain-r/test) - - ci/add-apt-keys.sh "${SOURCE_KEYS[@]}" - # Initial update before adding sources required to get e.g. keys - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - ci/add-apt-repositories.sh "${SOURCES[@]}" - - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - if [[ -z "${{matrix.install}}" ]]; then - pkgs="${{matrix.compiler}}" - pkgs="${pkgs/gcc-/g++-}" - else - pkgs="${{matrix.install}}" - fi - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs - - - name: Setup GCC Toolchain - if: matrix.gcc_toolchain - run: | - GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain" - echo "GCC_TOOLCHAIN_ROOT=$GCC_TOOLCHAIN_ROOT" >> $GITHUB_ENV - if ! command -v dpkg-architecture; then - apt-get install -y dpkg-dev - fi - MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" - mkdir -p "$GCC_TOOLCHAIN_ROOT" - ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include" - ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin" - mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET" - ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" - - - name: Setup multiarch - if: matrix.multiarch - env: - BDDE_DISTRO: ${{matrix.distro}} - BDDE_EDITION: ${{matrix.edition}} - BDDE_ARCH: ${{matrix.arch}} - run: ci/github/setup_bdde.sh - - - name: Setup Boost - env: - B2_ADDRESS_MODEL: ${{matrix.address-model}} - B2_COMPILER: ${{matrix.compiler}} - B2_CXXSTD: ${{matrix.cxxstd}} - B2_SANITIZE: ${{matrix.sanitize}} - B2_STDLIB: ${{matrix.stdlib}} - # More entries can be added in the same way, see the B2_ARGS assignment in ci/enforce.sh for the possible keys. - B2_DEFINES: 'BOOST_DECIMAL_QEMU_TEST' - # Variables set here (to non-empty) will override the top-level environment variables, e.g. - # B2_VARIANT: ${{matrix.variant}} - # Set the (B2) target(s) to build, defaults to the test folder of the current library - # Can alternatively be done like this in the build step or in the build command of the build step, e.g. `run: B2_TARGETS=libs/$SELF/doc ci/build.sh` - # B2_TARGETS: libs/foo/test//bar - run: source ci/github/install.sh - - - name: Run tests - if: '!matrix.coverity' - run: ci/build.sh diff --git a/.github/workflows/tidy.yml b/.github/workflows/tidy.yml deleted file mode 100644 index 22575d239..000000000 --- a/.github/workflows/tidy.yml +++ /dev/null @@ -1,74 +0,0 @@ -# ------------------------------------------------------------------------------ -# Copyright Matt Borland 2023. -# Copyright Christopher Kormanyos 2023. -# Distributed under the Boost Software License, -# Version 1.0. (See accompanying file LICENSE_1_0.txt -# or copy at http://www.boost.org/LICENSE_1_0.txt) -# ------------------------------------------------------------------------------ - -name: tidy -on: - push: - branches: - - master - - develop - - feature/** - pull_request: - types: [opened, synchronize, reopened] -jobs: - clang-tidy-native: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - standard: [ c++14 ] - compiler: [ g++ ] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: '0' - - name: update-tools - run: sudo apt install clang-tidy - - name: clone-submods-bootstrap-headers-boost-develop - run: | - git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - cd ../boost-root - git submodule update --init tools - git submodule update --init libs/assert - git submodule update --init libs/config - git submodule update --init libs/core - git submodule update --init libs/math - git submodule update --init libs/multiprecision - git submodule update --init libs/predef - git submodule update --init libs/static_assert - git submodule update --init libs/test - ./bootstrap.sh - ./b2 headers - - name: clang-tidy-native - run: | - cd test/tidy - echo - echo "exercise clang-tidy" - echo "make prepare -f make_tidy_01_generic.gmk MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}" - echo - make prepare -f make_tidy_01_generic.gmk MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }} - echo - echo "make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}" - echo - make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }} - echo - echo "print tidy result for quick.cpp only" - cat tmp/quick.tidy_txt - - name: quality-gate-clang-tidy - run: | - cd test/tidy - echo - echo "quality-gate-clang-tidy not yet implemented" - ls -la tmp/all.tidy_txt - ls -la tmp/quick.tidy_txt - echo - echo "word-count on tmp/quick.tidy_txt" - cat tmp/quick.tidy_txt | grep warning | wc diff --git a/CMakeLists.txt b/CMakeLists.txt index bd802dcba..23d823324 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,14 @@ target_include_directories(boost_decimal INTERFACE include) target_compile_features(boost_decimal INTERFACE cxx_std_14) +if(ENABLE_CUDA) + enable_language(CUDA) + set(CMAKE_CUDA_EXTENSIONS OFF) + if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) + set(CMAKE_CUDA_ARCHITECTURES native) + endif() +endif() + if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") add_subdirectory(test) diff --git a/include/boost/decimal/decimal32_fast.hpp b/include/boost/decimal/decimal32_fast.hpp index c1c4e9ccb..5cd74a616 100644 --- a/include/boost/decimal/decimal32_fast.hpp +++ b/include/boost/decimal/decimal32_fast.hpp @@ -432,7 +432,7 @@ BOOST_DECIMAL_CXX20_CONSTEXPR decimal32_fast::decimal32_fast(Float val) noexcept # pragma GCC diagnostic pop #endif -constexpr auto direct_init(std::uint_fast32_t significand, std::uint_fast8_t exponent, bool sign = false) noexcept -> decimal32_fast +BOOST_DECIMAL_HOST_DEVICE constexpr auto direct_init(std::uint_fast32_t significand, std::uint_fast8_t exponent, bool sign = false) noexcept -> decimal32_fast { decimal32_fast val; val.significand_ = significand; @@ -442,27 +442,27 @@ constexpr auto direct_init(std::uint_fast32_t significand, std::uint_fast8_t exp return val; } -constexpr auto signbit(decimal32_fast val) noexcept -> bool +BOOST_DECIMAL_HOST_DEVICE constexpr auto signbit(decimal32_fast val) noexcept -> bool { return val.sign_; } -constexpr auto isinf(decimal32_fast val) noexcept -> bool +BOOST_DECIMAL_HOST_DEVICE constexpr auto isinf(decimal32_fast val) noexcept -> bool { return val.significand_ == detail::d32_fast_inf; } -constexpr auto isnan(decimal32_fast val) noexcept -> bool +BOOST_DECIMAL_HOST_DEVICE constexpr auto isnan(decimal32_fast val) noexcept -> bool { return val.significand_ == detail::d32_fast_qnan || val.significand_ == detail::d32_fast_snan; } -constexpr auto issignaling(decimal32_fast val) noexcept -> bool +BOOST_DECIMAL_HOST_DEVICE constexpr auto issignaling(decimal32_fast val) noexcept -> bool { return val.significand_ == detail::d32_fast_snan; } -constexpr auto isnormal(decimal32_fast val) noexcept -> bool +BOOST_DECIMAL_HOST_DEVICE constexpr auto isnormal(decimal32_fast val) noexcept -> bool { if (val.exponent_ <= static_cast(detail::precision_v - 1)) { @@ -472,7 +472,7 @@ constexpr auto isnormal(decimal32_fast val) noexcept -> bool return (val.significand_ != 0) && isfinite(val); } -constexpr auto isfinite(decimal32_fast val) noexcept -> bool +BOOST_DECIMAL_HOST_DEVICE constexpr auto isfinite(decimal32_fast val) noexcept -> bool { return val.significand_ < detail::d32_fast_snan; } diff --git a/include/boost/decimal/detail/config.hpp b/include/boost/decimal/detail/config.hpp index 7f6d26841..8fa19a5d3 100644 --- a/include/boost/decimal/detail/config.hpp +++ b/include/boost/decimal/detail/config.hpp @@ -306,4 +306,11 @@ typedef unsigned __int128 uint128_t; # define BOOST_DECIMAL_FAST_MATH #endif +#ifdef __NVCC__ +#define BOOST_DECIMAL_HOST_DEVICE __host__ __device__ +#else +#define BOOST_DECIMAL_HOST_DEVICE +#endif + + #endif // BOOST_DECIMAL_DETAIL_CONFIG_HPP