Skip to content

Issue111

Issue111 #1083

Workflow file for this run

# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2020 - 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: soft_double
on:
push:
branches:
- '**'
pull_request:
jobs:
gcc-clang-native:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
compiler: [ g++-11, clang++ ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install g++-11
- name: gcc-clang-native
run: |
echo "compile ./soft_double.exe"
${{ matrix.compiler }} -v
${{ matrix.compiler }} -finline-functions -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -march=native -O3 -std=${{ matrix.standard }} -I. examples/example001_roots_sqrt.cpp examples/example004_bessel_recur.cpp examples/example005_polylog_series.cpp examples/example007_catalan_series.cpp examples/example010_hypergeometric_2f1.cpp examples/example011_trig_trapezoid_integral.cpp examples/example012_exercise_constexpr.cpp test/test.cpp test/test_soft_double.cpp test/test_soft_double_edge_cases.cpp test/test_soft_double_examples.cpp test/test_soft_double_spot_values.cpp -o soft_double.exe
ls -la ./soft_double.exe
./soft_double.exe
cmake-linux:
strategy:
fail-fast: false
matrix:
compiler: [ g++, clang++ ]
include:
- compiler: g++
clang_tidy: ""
container: johnmcfarlane/cnl_ci:gcc-11
- compiler: clang++
clang_tidy: "clang-tidy"
container: johnmcfarlane/cnl_ci:clang-13-libcpp
runs-on: ubuntu-latest
container: ${{matrix.container}}
steps:
- uses: actions/checkout@v4
- name: create build directory
run: mkdir $GITHUB_WORKSPACE/build
- name: build
working-directory: build
run: |
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_CLANG_TIDY="${{matrix.clang_tidy}}" \
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/.github/toolchains/gcc.cmake \
-GNinja \
$GITHUB_WORKSPACE
cmake --build .
- name: test
working-directory: build
run: ctest --verbose --output-on-failure
cmake-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: create build directory
run: mkdir ${{runner.workspace}}/build
- name: build
shell: cmd
working-directory: ${{runner.workspace}}/build
run: |
cmake -DCMAKE_CXX_FLAGS="/W4 /WX /EHsc" -DCMAKE_CXX_STANDARD=20 ..\soft_double
cmake --build . --config Release
- name: test
working-directory: ${{runner.workspace}}/build
run: ctest --verbose --output-on-failure
gnumake-clang-tidy-native:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++20 ]
compiler: [ g++, clang++ ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install clang clang-tidy
- name: gnumake-clang-tidy-12-native
run: |
cd .tidy/make
echo "running clang-tidy"
echo "make prepare -f make_tidy_01_generic.gmk MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}"
echo
make prepare -f make_tidy_01_generic.gmk MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
echo "make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}"
make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
echo
echo "verify empty word count of ./tmp/all.tidy_txt"
wc ./tmp/all.tidy_txt | grep '0 0 0'
gcc-12-clang-14:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
compiler: [ g++-12, clang++-14 ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install g++-12 clang-14
- name: gcc-clang-native
run: |
echo "compile ./soft_double.exe"
${{ matrix.compiler }} -v
${{ matrix.compiler }} -finline-functions -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -march=native -O3 -std=${{ matrix.standard }} -I. examples/example001_roots_sqrt.cpp examples/example004_bessel_recur.cpp examples/example005_polylog_series.cpp examples/example007_catalan_series.cpp examples/example010_hypergeometric_2f1.cpp examples/example011_trig_trapezoid_integral.cpp examples/example012_exercise_constexpr.cpp test/test.cpp test/test_soft_double.cpp test/test_soft_double_edge_cases.cpp test/test_soft_double_examples.cpp test/test_soft_double_spot_values.cpp -o soft_double.exe
ls -la ./soft_double.exe
./soft_double.exe
mingw-winhost-x64:
runs-on: windows-2019
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
compiler: [ g++ ]
standard: [ c++14, c++17, c++2a ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: mingw-winhost-x64
run: |
echo compile ./soft_double.exe
${{ matrix.compiler }} -v
${{ matrix.compiler }} -finline-functions -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -m64 -std=${{ matrix.standard }} -I. examples/example001_roots_sqrt.cpp examples/example004_bessel_recur.cpp examples/example005_polylog_series.cpp examples/example007_catalan_series.cpp examples/example010_hypergeometric_2f1.cpp examples/example011_trig_trapezoid_integral.cpp examples/example012_exercise_constexpr.cpp test/test.cpp test/test_soft_double.cpp test/test_soft_double_edge_cases.cpp test/test_soft_double_examples.cpp test/test_soft_double_spot_values.cpp -o soft_double.exe
dir .\soft_double.exe
.\soft_double.exe
gcc-clang-native-asan:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
compiler: [ g++-11, clang++ ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install g++-11
- name: gcc-clang-native-asan
run: |
echo "compile ./soft_double.exe"
${{ matrix.compiler }} -v
${{ matrix.compiler }} -finline-functions -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -march=native -std=${{ matrix.standard }} -fsanitize=address -fsanitize=leak -I. examples/example001_roots_sqrt.cpp examples/example004_bessel_recur.cpp examples/example005_polylog_series.cpp examples/example007_catalan_series.cpp examples/example010_hypergeometric_2f1.cpp examples/example011_trig_trapezoid_integral.cpp examples/example012_exercise_constexpr.cpp test/test.cpp test/test_soft_double.cpp test/test_soft_double_edge_cases.cpp test/test_soft_double_examples.cpp test/test_soft_double_spot_values.cpp -o soft_double.exe
ls -la ./soft_double.exe
./soft_double.exe
gcc-clang-native-ubsan:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
compiler: [ g++-11, clang++ ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install g++-11
- name: gcc-clang-native-ubsan
run: |
echo "compile ./soft_double.exe"
${{ matrix.compiler }} -v
${{ matrix.compiler }} -finline-functions -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -march=native -std=${{ matrix.standard }} -fsanitize=undefined -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=unreachable -fsanitize=vla-bound -fsanitize=null -fsanitize=return -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=object-size -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=nonnull-attribute -fsanitize=returns-nonnull-attribute -fsanitize=bool -fsanitize=enum -fsanitize=vptr -I. examples/example001_roots_sqrt.cpp examples/example004_bessel_recur.cpp examples/example005_polylog_series.cpp examples/example007_catalan_series.cpp examples/example010_hypergeometric_2f1.cpp examples/example011_trig_trapezoid_integral.cpp examples/example012_exercise_constexpr.cpp test/test.cpp test/test_soft_double.cpp test/test_soft_double_edge_cases.cpp test/test_soft_double_examples.cpp test/test_soft_double_spot_values.cpp -o soft_double.exe
ls -la ./soft_double.exe
./soft_double.exe
apple-gcc-clang-native:
runs-on: macos-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
compiler: [ g++, clang++ ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: apple-gcc-clang-native
run: |
echo "compile ./soft_double.exe"
${{ matrix.compiler }} -v
${{ matrix.compiler }} -finline-functions -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -march=native -O3 -std=${{ matrix.standard }} -I. examples/example001_roots_sqrt.cpp examples/example004_bessel_recur.cpp examples/example005_polylog_series.cpp examples/example007_catalan_series.cpp examples/example010_hypergeometric_2f1.cpp examples/example011_trig_trapezoid_integral.cpp examples/example012_exercise_constexpr.cpp test/test.cpp test/test_soft_double.cpp test/test_soft_double_edge_cases.cpp test/test_soft_double_examples.cpp test/test_soft_double_spot_values.cpp -o soft_double.exe
ls -la ./soft_double.exe
./soft_double.exe
msvc-release-x64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
- name: msvc-release-x64
shell: cmd
working-directory: ./
run: |
MSBuild -m soft_double.sln -p:Configuration=Release -p:Platform=x64 /t:Rebuild
dir %cd%\x64\Release\soft_double.exe
%cd%\x64\Release\soft_double.exe
msvc-release-x64-vs2022:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.3
- name: msvc-release-x64-vs2022
shell: cmd
working-directory: ./
run: |
MSBuild -m soft_double_vs2022.sln -p:Configuration=Release -p:Platform=x64 /t:Rebuild
dir %cd%\x64\Release\soft_double_vs2022.exe
%cd%\x64\Release\soft_double_vs2022.exe
gcc-avr:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++14 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install gcc-avr avr-libc
- name: clone-real-time-cpp
run: |
git clone -b master --depth 1 https://github.com/ckormanyos/real-time-cpp.git ../real-time-cpp-root
working-directory: ./
- name: gcc-avr
run: |
mkdir bin
echo 'compile examples/example010_hypergeometric_2f1.cpp with:'
echo 'avr-g++ -x c++ -std=${{ matrix.standard }} -Os -Werror -Wall -Wextra -Wpedantic -pedantic -Wmain -Wundef -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -Wunused-parameter -Wuninitialized -Wmissing-declarations -Wshadow -Wunreachable-code -Wswitch-default -Wswitch-enum -Wcast-align -Wmissing-include-dirs -Winit-self -Wfloat-equal -Wdouble-promotion -mmcu=atmega328p -mrelax -finline-functions -finline-limit=32 -fsigned-char -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -I. -I../real-time-cpp-root/ref_app/src -I../real-time-cpp-root/ref_app/src/util/STL -DWIDE_INTEGER_STANDALONE_EXAMPLE010_HYPERGEOMETRIC_2F1 examples/example010_hypergeometric_2f1.cpp -Wl,--gc-sections -Wl,-Map,./bin/example010_hypergeometric_2f1.map -o bin/example010_hypergeometric_2f1.elf'
avr-g++ -x c++ -std=${{ matrix.standard }} -Os -Werror -Wall -Wextra -Wpedantic -pedantic -Wmain -Wundef -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -Wunused-parameter -Wuninitialized -Wmissing-declarations -Wshadow -Wunreachable-code -Wswitch-default -Wswitch-enum -Wcast-align -Wmissing-include-dirs -Winit-self -Wfloat-equal -Wdouble-promotion -mmcu=atmega328p -mrelax -finline-functions -finline-limit=32 -fsigned-char -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -I. -I../real-time-cpp-root/ref_app/src -I../real-time-cpp-root/ref_app/src/util/STL -DWIDE_INTEGER_STANDALONE_EXAMPLE010_HYPERGEOMETRIC_2F1 examples/example010_hypergeometric_2f1.cpp -Wl,--gc-sections -Wl,-Map,./bin/example010_hypergeometric_2f1.map -o bin/example010_hypergeometric_2f1.elf
echo
echo 'run objcopy with:'
echo 'avr-objcopy bin/example010_hypergeometric_2f1.elf -O ihex bin/example010_hypergeometric_2f1.hex'
avr-objcopy bin/example010_hypergeometric_2f1.elf -O ihex bin/example010_hypergeometric_2f1.hex
echo
echo 'ls -la bin/example010_hypergeometric_2f1.elf bin/example010_hypergeometric_2f1.map bin/example010_hypergeometric_2f1.hex'
ls -la bin/example010_hypergeometric_2f1.elf bin/example010_hypergeometric_2f1.map bin/example010_hypergeometric_2f1.hex
working-directory: ./
gcc-arm-none-eabi:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++14, c++17, c++2a ]
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 -xvf 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 -xvzf xpack-qemu-arm-7.1.0-1-linux-x64.tar.gz
working-directory: ./
- name: build-example-stm32f429
run: |
mkdir -p bin
emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-g++ -std=${{ matrix.standard }} -Werror -Wall -Wextra -Wpedantic -pedantic -O0 -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 -ftemplate-depth=32 -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I. -DWIDE_INTEGER_STANDALONE_EXAMPLE010_HYPERGEOMETRIC_2F1 examples/example010_hypergeometric_2f1.cpp ./target/micros/stm32f429/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/example010_hypergeometric_2f1.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -o ./bin/example010_hypergeometric_2f1.elf
emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-objcopy ./bin/example010_hypergeometric_2f1.elf -O ihex ./bin/example010_hypergeometric_2f1.hex
ls -la ./bin/example010_hypergeometric_2f1.elf ./bin/example010_hypergeometric_2f1.hex ./bin/example010_hypergeometric_2f1.map
working-directory: ./
- 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: ./
- name: run-test-on-target
run: |
./emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gdb-py ./bin/example010_hypergeometric_2f1.elf -x ./target/build/test_examples_emulator.py
qemu_result=$?
echo "qemu_result" "$qemu_result"
echo "qemu_result" "$qemu_result" | grep 'qemu_result 0'
working-directory: ./
gcc-clang-boost-math-snippets:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++14, c++17, c++2a ]
compiler: [ g++, clang++ ]
suite: [ cyl_bessel_j ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- 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/config
git submodule update --init libs/math
./bootstrap.sh
./b2 headers
- name: gcc-clang-boost-math-snippets
run: |
${{ matrix.compiler }} -v
echo 'compile with ${{ matrix.compiler }} -finline-functions -march=native -mtune=native -O3 -Wall -Wextra -Wpedantic -Wshadow -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -I. -I../boost-root test/test_soft_double_boost_math_${{ matrix.suite }}.cpp -o test_soft_double_boost_math_${{ matrix.suite }}.exe'
${{ matrix.compiler }} -finline-functions -march=native -mtune=native -O3 -Wall -Wextra -Wpedantic -Wshadow -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -I. -I../boost-root test/test_soft_double_boost_math_${{ matrix.suite }}.cpp -o test_soft_double_boost_math_${{ matrix.suite }}.exe
echo 'verify presence of ./test_soft_double_boost_math_${{ matrix.suite }}.exe'
ls -la ./test_soft_double_boost_math_${{ matrix.suite }}.exe
echo 'execute ./test_soft_double_boost_math_${{ matrix.suite }}.exe'
./test_soft_double_boost_math_${{ matrix.suite }}.exe