-
Notifications
You must be signed in to change notification settings - Fork 4
354 lines (353 loc) · 19.5 KB
/
soft_double.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# ------------------------------------------------------------------------------
# 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++, clang++ ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- 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++, clang++ ]
standard: [ c++14 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- 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++, clang++ ]
standard: [ c++14 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- 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.4
- 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++20 ]
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++20 ]
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