Skip to content

Commit 35a5d23

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/fixed-point-multiplication-for-integral-conversion
2 parents d00b330 + cc25f9b commit 35a5d23

File tree

135 files changed

+5933
-2542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+5933
-2542
lines changed

.clang-format

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,28 @@ AccessModifierOffset: -2
1010
# AcrossEmptyLines: false
1111
# AcrossComments: false
1212
# AlignCompound: false
13+
# AlignFunctionPointers: false
1314
# PadOperators: true
1415
# AlignConsecutiveBitFields:
1516
# Enabled: false
1617
# AcrossEmptyLines: false
1718
# AcrossComments: false
1819
# AlignCompound: false
20+
# AlignFunctionPointers: false
1921
# PadOperators: false
2022
# AlignConsecutiveDeclarations:
2123
# Enabled: false
2224
# AcrossEmptyLines: false
2325
# AcrossComments: false
2426
# AlignCompound: false
27+
# AlignFunctionPointers: false
2528
# PadOperators: false
2629
# AlignConsecutiveMacros:
2730
# Enabled: false
2831
# AcrossEmptyLines: false
2932
# AcrossComments: false
3033
# AlignCompound: false
34+
# AlignFunctionPointers: false
3135
# PadOperators: false
3236
# AlignConsecutiveShortCaseStatements:
3337
# Enabled: false
@@ -41,8 +45,10 @@ AccessModifierOffset: -2
4145
# OverEmptyLines: 0
4246
# AllowAllArgumentsOnNextLine: true
4347
# AllowAllParametersOfDeclarationOnNextLine: true
48+
# AllowBreakBeforeNoexceptSpecifier: Never
4449
# AllowShortBlocksOnASingleLine: Never
4550
# AllowShortCaseLabelsOnASingleLine: false
51+
# AllowShortCompoundRequirementOnASingleLine: true
4652
# AllowShortEnumsOnASingleLine: true
4753
# AllowShortFunctionsOnASingleLine: All
4854
# AllowShortIfStatementsOnASingleLine: WithoutElse
@@ -76,7 +82,8 @@ BraceWrapping:
7682
# SplitEmptyFunction: true
7783
SplitEmptyRecord: false
7884
# SplitEmptyNamespace: true
79-
# BreakAfterAttributes: Never
85+
# BreakAdjacentStringLiterals: true
86+
# BreakAfterAttributes: Leave
8087
# BreakAfterJavaFieldAnnotations: false
8188
# BreakArrays: true
8289
# BreakBeforeBinaryOperators: None
@@ -160,6 +167,7 @@ MaxEmptyLinesToKeep: 2
160167
# PenaltyBreakComment: 300
161168
# PenaltyBreakFirstLessLess: 120
162169
# PenaltyBreakOpenParenthesis: 0
170+
# PenaltyBreakScopeResolution: 500
163171
# PenaltyBreakString: 1000
164172
# PenaltyBreakTemplateDeclaration: 10
165173
# PenaltyExcessCharacter: 1000000
@@ -207,6 +215,7 @@ QualifierAlignment: Left
207215
# RequiresExpressionIndentation: OuterScope
208216
# SeparateDefinitionBlocks: Leave
209217
# ShortNamespaceLines: 1
218+
# SkipMacroDefinitionBody: false
210219
# SortIncludes: CaseSensitive
211220
# SortJavaStaticImport: Before
212221
SortUsingDeclarations: false
@@ -228,6 +237,7 @@ SpaceBeforeParensOptions:
228237
# AfterFunctionDeclarationName: false
229238
# AfterIfMacros: true
230239
# AfterOverloadedOperator: false
240+
# AfterPlacementOperator: true
231241
AfterRequiresInClause: true
232242
# AfterRequiresInExpression: false
233243
# BeforeNonEmptyParentheses: false

.github/workflows/ci-conan.yml

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,14 @@ jobs:
4444
contracts: ["none", "gsl-lite", "ms-gsl"]
4545
std: [20, 23]
4646
config:
47-
# - {
48-
# name: "MSVC 14.2",
49-
# os: windows-2019,
50-
# compiler: { type: VISUAL, version: 16, cc: "", cxx: "" },
51-
# conan-config: "-c user.mp-units.build:skip_la=True",
52-
# }
53-
# - {
54-
# name: "MSVC 14.3",
55-
# os: windows-2022,
56-
# compiler: { type: MSVC, version: 193, cc: "", cxx: "" },
57-
# conan-config: "",
58-
# }
47+
- {
48+
name: "MSVC 14.4",
49+
os: windows-2022,
50+
compiler: { type: MSVC, version: 194, cc: "", cxx: "" },
51+
cxx_modules: "False",
52+
std_format_support: "True",
53+
conan-config: "",
54+
}
5955
- {
6056
name: "GCC-12",
6157
os: ubuntu-24.04,
@@ -143,6 +139,20 @@ jobs:
143139
std_format_support: "True",
144140
conan-config: "",
145141
}
142+
- {
143+
name: "Clang-18 on Apple M1 (arm64)",
144+
os: macos-14,
145+
compiler:
146+
{
147+
type: CLANG,
148+
version: 18,
149+
cc: "/opt/homebrew/opt/llvm@18/bin/clang-18",
150+
cxx: "/opt/homebrew/opt/llvm@18/bin/clang++",
151+
},
152+
lib: "libc++",
153+
cxx_modules: "False",
154+
std_format_support: "True"
155+
}
146156
- {
147157
name: "Apple Clang 15",
148158
os: macos-13,
@@ -168,7 +178,9 @@ jobs:
168178

169179
steps:
170180
- uses: actions/checkout@v4
171-
- run: echo "cache_id=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_ENV
181+
- name: Generate unique cache id
182+
shell: bash
183+
run: echo "cache_id=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_ENV
172184
- name: Cache Conan data
173185
uses: actions/cache@v4
174186
if: always()
@@ -196,17 +208,22 @@ jobs:
196208
shell: bash
197209
run: |
198210
sudo apt install -y g++-${{ matrix.config.compiler.version }}
199-
- name: Install Clang
200-
if: matrix.config.compiler.type == 'CLANG'
211+
- name: Install Clang with apt
212+
if: matrix.config.compiler.type == 'CLANG' && matrix.config.os != 'macos-14'
201213
shell: bash
202214
working-directory: ${{ env.HOME }}
203215
run: |
204216
wget https://apt.llvm.org/llvm.sh
205217
chmod +x llvm.sh
206218
sudo ./llvm.sh ${{ matrix.config.compiler.version }}
207219
sudo apt install -y clang-tools-${{ matrix.config.compiler.version }}
220+
- name: Install Clang using homebrew
221+
if: matrix.config.compiler.type == 'CLANG' && matrix.config.os == 'macos-14'
222+
shell: bash
223+
run: |
224+
brew install llvm@18
208225
- name: Install Libc++
209-
if: matrix.config.compiler.type == 'CLANG' && matrix.config.lib == 'libc++'
226+
if: matrix.config.compiler.type == 'CLANG' && matrix.config.lib == 'libc++' && matrix.config.os != 'macos-14'
210227
shell: bash
211228
run: |
212229
sudo apt install -y libc++-${{ matrix.config.compiler.version }}-dev libc++abi-${{ matrix.config.compiler.version }}-dev libunwind-${{ matrix.config.compiler.version }}-dev
@@ -237,14 +254,25 @@ jobs:
237254
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.cppstd=.*/compiler.cppstd=${{ matrix.std }}/' ~/.conan2/profiles/default
238255
sed -i.backup '/^\[settings\]$/,/^\[/ s/^build_type=.*/build_type=${{ matrix.build_type }}/' ~/.conan2/profiles/default
239256
conan profile show -pr default
240-
- run: echo "std_format=$([ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
241-
- run: echo "import_std=$([ "${{ matrix.config.cxx_modules }}" == "True" ] && [ "${{ matrix.config.contracts }}" == "none" ] && [ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
257+
- name: Set 'std_format' and 'import_std' environment variables
258+
shell: bash
259+
run: |
260+
echo "std_format=$([ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
261+
echo "import_std=$([ "${{ matrix.config.cxx_modules }}" == "True" ] && [ "${{ matrix.config.contracts }}" == "none" ] && [ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
242262
- name: Create Conan package
263+
if: matrix.config.compiler.type != 'MSVC'
243264
shell: bash
244265
run: |
245266
conan create . --user mpusz --channel ${CHANNEL} --lockfile-out=package.lock \
246267
-b mp-units/* -b missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -c user.mp-units.build:all=True \
247268
-o '&:cxx_modules=${{ matrix.config.cxx_modules }}' -o '&:import_std=${{ env.import_std }}' -o '&:std_format=${{ env.std_format }}' -o '&:contracts=${{ matrix.contracts }}' ${{ matrix.config.conan-config }}
269+
- name: Create Conan package
270+
if: matrix.config.compiler.type == 'MSVC'
271+
shell: bash
272+
run: |
273+
conan create . --user mpusz --channel ${CHANNEL} --lockfile-out=package.lock \
274+
-b mp-units/* -b missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -c user.mp-units.build:all=False \
275+
-o '&:cxx_modules=${{ matrix.config.cxx_modules }}' -o '&:import_std=${{ env.import_std }}' -o '&:std_format=${{ env.std_format }}' -o '&:contracts=${{ matrix.contracts }}' ${{ matrix.config.conan-config }}
248276
- name: Obtain package reference
249277
id: get-package-ref
250278
shell: bash

.github/workflows/ci-test-package-cmake.yml

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,13 @@ jobs:
4545
contracts: ["none", "gsl-lite", "ms-gsl"]
4646
std: [20, 23]
4747
config:
48-
# - {
49-
# name: "MSVC 14.2",
50-
# os: windows-2019,
51-
# compiler: { type: VISUAL, version: 16, cc: "", cxx: "" },
52-
# }
53-
# - {
54-
# name: "MSVC 14.3",
55-
# os: windows-2022,
56-
# compiler: { type: MSVC, version: 193, cc: "", cxx: "" },
57-
# }
48+
- {
49+
name: "MSVC 14.4",
50+
os: windows-2022,
51+
compiler: { type: MSVC, version: 194, cc: "", cxx: "" },
52+
cxx_modules: "False",
53+
std_format_support: "True",
54+
}
5855
- {
5956
name: "GCC-12",
6057
os: ubuntu-24.04,
@@ -136,6 +133,20 @@ jobs:
136133
cxx_modules: "False",
137134
std_format_support: "True"
138135
}
136+
- {
137+
name: "Clang-18 on Apple M1 (arm64)",
138+
os: macos-14,
139+
compiler:
140+
{
141+
type: CLANG,
142+
version: 18,
143+
cc: "/opt/homebrew/opt/llvm@18/bin/clang-18",
144+
cxx: "/opt/homebrew/opt/llvm@18/bin/clang++",
145+
},
146+
lib: "libc++",
147+
cxx_modules: "False",
148+
std_format_support: "True"
149+
}
139150
- {
140151
name: "Apple Clang 15",
141152
os: macos-14,
@@ -165,7 +176,9 @@ jobs:
165176
with:
166177
string: ${{ matrix.build_type }}
167178
- uses: actions/checkout@v4
168-
- run: echo "cache_id=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_ENV
179+
- name: Generate unique cache id
180+
shell: bash
181+
run: echo "cache_id=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_ENV
169182
- name: Cache Conan data
170183
uses: actions/cache@v4
171184
if: always()
@@ -188,17 +201,22 @@ jobs:
188201
shell: bash
189202
run: |
190203
sudo apt install -y g++-${{ matrix.config.compiler.version }}
191-
- name: Install Clang
192-
if: matrix.config.compiler.type == 'CLANG'
204+
- name: Install Clang with apt
205+
if: matrix.config.compiler.type == 'CLANG' && matrix.config.os != 'macos-14'
193206
shell: bash
194207
working-directory: ${{ env.HOME }}
195208
run: |
196209
wget https://apt.llvm.org/llvm.sh
197210
chmod +x llvm.sh
198211
sudo ./llvm.sh ${{ matrix.config.compiler.version }}
199212
sudo apt install -y clang-tools-${{ matrix.config.compiler.version }}
213+
- name: Install Clang using homebrew
214+
if: matrix.config.compiler.type == 'CLANG' && matrix.config.os == 'macos-14'
215+
shell: bash
216+
run: |
217+
brew install llvm@18
200218
- name: Install Libc++
201-
if: matrix.config.compiler.type == 'CLANG' && matrix.config.lib == 'libc++'
219+
if: matrix.config.compiler.type == 'CLANG' && matrix.config.lib == 'libc++' && matrix.config.os != 'macos-14'
202220
shell: bash
203221
run: |
204222
sudo apt install -y libc++-${{ matrix.config.compiler.version }}-dev libc++abi-${{ matrix.config.compiler.version }}-dev libunwind-${{ matrix.config.compiler.version }}-dev
@@ -230,8 +248,11 @@ jobs:
230248
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.cppstd=.*/compiler.cppstd=${{ matrix.std }}/' ~/.conan2/profiles/default
231249
sed -i.backup '/^\[settings\]$/,/^\[/ s/^build_type=.*/build_type=${{ matrix.build_type }}/' ~/.conan2/profiles/default
232250
conan profile show -pr default
233-
- run: echo "std_format=$([ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
234-
- run: echo "import_std=$([ "${{ matrix.config.cxx_modules }}" == "True" ] && [ "${{ matrix.config.contracts }}" == "none" ] && [ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
251+
- name: Set 'std_format' and 'import_std' environment variables
252+
shell: bash
253+
run: |
254+
echo "std_format=$([ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
255+
echo "import_std=$([ "${{ matrix.config.cxx_modules }}" == "True" ] && [ "${{ matrix.config.contracts }}" == "none" ] && [ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
235256
- name: Install Conan dependencies
236257
shell: bash
237258
run: |

.github/workflows/documentation.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ jobs:
5353
git fetch origin gh-pages --depth=1
5454
- name: Installing API reference dependencies
5555
run: |
56+
sudo apt update
57+
sudo apt install latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended lmodern
5658
sudo apt install haskell-stack graphviz nodejs npm ghc cabal-install
57-
npm install split mathjax-full mathjax-node-sre
59+
npm install split mathjax-full mathjax-node-sre mathjax-node-cli
5860
cabal update
59-
- name: Installing MathJax-Node-CLI
60-
run: |
61-
git clone https://github.com/mathjax/mathjax-node-cli --depth=1
62-
echo "${{ github.workspace }}/mathjax-node-cli/bin" >> $GITHUB_PATH
61+
echo "${{ github.workspace }}/node_modules/.bin" >> $GITHUB_PATH
6362
- name: Get git repos with API reference tools
6463
run: |
6564
git clone https://github.com/JohelEGP/jegp.cmake_modules.git --depth=1
@@ -76,6 +75,11 @@ jobs:
7675
- name: Installing pip dependencies
7776
run: |
7877
pip install conan mkdocs-material mkdocs-rss-plugin mkdocs-material[imaging] mkdocs-exclude mike
79-
- name: Building docs
78+
- name: Building docs for a released version
79+
if: startsWith(github.event.ref, 'refs/tags/v')
80+
run: |
81+
mike deploy --push --update-aliases `conan inspect . | sed -n -r 's/version: ([0-9]+.[0-9]+).[0-9]+/\1/p'`
82+
- name: Building docs for a development version
83+
if: ${{!startsWith(github.event.ref, 'refs/tags/v')}}
8084
run: |
81-
mike deploy --push --update-aliases `conan inspect . | sed -n -r 's/version: ([0-9]+.[0-9]+).[0-9]+/\1/p'` latest
85+
mike deploy --push --update-aliases HEAD latest

.gitpod/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ RUN sudo install-packages \
1919
libz-dev
2020

2121
# Install API reference dependencies
22+
RUN sudo install-packages \
23+
latexmk \
24+
texlive-latex-recommended \
25+
texlive-latex-extra \
26+
texlive-fonts-recommended \
27+
lmodern
2228
RUN sudo install-packages \
2329
haskell-stack \
2430
graphviz \
2531
nodejs \
2632
npm \
2733
ghc \
2834
cabal-install
29-
RUN npm install split mathjax-full mathjax-node-sre
35+
RUN npm install split mathjax-full mathjax-node-sre mathjax-node-cli
3036
RUN cabal update
31-
32-
# Install MathJax-Node-CLI
33-
git clone https://github.com/mathjax/mathjax-node-cli --depth=1
34-
echo "export PATH=\"$PWD/mathjax-node-cli/bin:\$PATH\"" >> ~/.bashrc
37+
RUN echo "export PATH=\"~/node_modules/.bin:\$PATH\"" >> ~/.bashrc

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: trailing-whitespace
1212
- id: end-of-file-fixer
1313
- repo: https://github.com/pre-commit/mirrors-clang-format
14-
rev: v17.0.5
14+
rev: v19.1.2
1515
hooks:
1616
- id: clang-format
1717
- repo: https://github.com/cheshirekow/cmake-format-precommit

0 commit comments

Comments
 (0)