Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 9fa2c71

Browse files
committed
2 parents 6718175 + 3ce5705 commit 9fa2c71

File tree

937 files changed

+315835
-2632038
lines changed

Some content is hidden

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

937 files changed

+315835
-2632038
lines changed

.clang-format

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,43 @@
1-
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
1+
---
2+
Language: Cpp
23
BasedOnStyle: WebKit
3-
ColumnLimit: 80
4-
AlignTrailingComments: true
5-
FixNamespaceComments: true
6-
ReflowComments: true
7-
BinPackParameters: false
8-
AllowAllParametersOfDeclarationOnNextLine: true
94
AlignAfterOpenBracket: AlwaysBreak
5+
AlignTrailingComments:
6+
Kind: Always
7+
OverEmptyLines: 0
8+
BinPackParameters: false
9+
BreakArrays: false
1010
BreakBeforeBinaryOperators: NonAssignment
11-
SortIncludes: false
12-
CommentPragmas: '^@.+'
1311
BreakStringLiterals: false
12+
ColumnLimit: 80
13+
CommentPragmas: '^@.+'
14+
FixNamespaceComments: true
15+
# Regroup includes with a priority system
16+
IncludeBlocks: Regroup
17+
IncludeCategories:
18+
# by default, the main header of a cpp will get priority 0
19+
# regex here are sorted by search pattern, not by sort priority
20+
- Regex: "^<ipc\/[^/]*>" # this libraries
21+
Priority: 2 # internal library group
22+
SortPriority: 2
23+
CaseSensitive: true
24+
- Regex: "^<ipc\/.*\/.*>" # this libraries
25+
Priority: 2 # internal library group
26+
SortPriority: 3
27+
CaseSensitive: true
28+
- Regex: "^<(.*\\.h[px]*)|(Eigen\/.*)>"
29+
Priority: 4 # libraries (because they end in .h)
30+
SortPriority: 4
31+
CaseSensitive: false
32+
- Regex: "^<.*"
33+
Priority: 5 # system (without .h, because that is captured by the other group)
34+
SortPriority: 5
35+
CaseSensitive: false
36+
- Regex: ".*" # catch-all for internal files
37+
Priority: 1 # internal file group
38+
SortPriority: 1
39+
CaseSensitive: true
1440
PackConstructorInitializers: CurrentLine
41+
RemoveEmptyLinesInUnwrappedLines: true
42+
SortIncludes: CaseInsensitive
43+
...

.devcontainer/Dockerfile

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM ubuntu:22.04
2+
3+
# Set environment variables
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
ENV CCACHE_DIR=/home/devuser/.ccache
6+
ENV CCACHE_MAXSIZE=1G
7+
ENV CXX_STANDARD=17
8+
9+
# Update package lists
10+
RUN apt-get update
11+
12+
# Install essential packages
13+
RUN apt-get install -y --no-install-recommends \
14+
build-essential \
15+
git \
16+
wget \
17+
curl \
18+
fish \
19+
zsh \
20+
ninja-build \
21+
ccache \
22+
libeigen3-dev \
23+
libtbb-dev \
24+
libspdlog-dev \
25+
python3 \
26+
python3-pip \
27+
python3-dev \
28+
libgmp-dev \
29+
libssl-dev \
30+
libncurses5-dev \
31+
libncursesw5-dev \
32+
libxml2-dev \
33+
libjsoncpp-dev \
34+
libz3-dev \
35+
sudo \
36+
software-properties-common \
37+
lsb-release \
38+
gnupg \
39+
&& rm -rf /var/lib/apt/lists/*
40+
41+
# Create a new user with sudo privileges
42+
RUN useradd -m devuser \
43+
&& echo "devuser:password" | chpasswd \
44+
&& usermod -aG sudo devuser \
45+
&& echo "devuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
46+
&& mkdir -p $CCACHE_DIR \
47+
&& chown devuser:devuser $CCACHE_DIR
48+
49+
# Set up Python tools
50+
RUN pip3 install --upgrade pip setuptools wheel pre-commit
51+
52+
# Add Kitware APT repository for CMake
53+
RUN wget -qO- https://apt.kitware.com/keys/kitware-archive-latest.asc | \
54+
gpg --dearmor -o /usr/share/keyrings/kitware-archive-keyring.gpg
55+
56+
RUN echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | \
57+
tee /etc/apt/sources.list.d/kitware.list > /dev/null
58+
59+
# Update package lists and install CMake
60+
RUN apt-get update
61+
RUN apt-get install -y cmake
62+
63+
# Verify CMake installation
64+
RUN cmake --version
65+
66+
# Install LLVM/Clang and Clang-Format version 18
67+
RUN wget -q https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
68+
RUN chmod +x /tmp/llvm.sh
69+
RUN /tmp/llvm.sh 18 || true
70+
71+
RUN apt-get update && apt-get install -y clang-18 clang-tools-18 clang-format-18
72+
73+
RUN clang-18 --version
74+
RUN clang++-18 --version
75+
RUN clang-format-18 --version
76+
77+
# 12. Set the default user and working directory
78+
USER devuser
79+
80+
WORKDIR /home/devuser/workspace
81+
82+
CMD ["bash"]

.devcontainer/devcontainer.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
3+
"name": "IPCToolkit C++ Development Container",
4+
"build": {
5+
"dockerfile": "Dockerfile",
6+
"context": ".."
7+
},
8+
"customizations": {
9+
"vscode": {
10+
"settings": {
11+
"terminal.integrated.shell.linux": "/bin/fish",
12+
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
13+
"C_Cpp.default.intelliSenseMode": "gcc-x64",
14+
"C_Cpp.default.compilerPath": "/usr/bin/clang++-18",
15+
"C_Cpp.clang_format_path": "/usr/bin/clang-format-18",
16+
"C_Cpp.clang_format_style": "file",
17+
"cmake.configureOnOpen": true,
18+
"cmake.buildDirectory": "${workspaceFolder}/build",
19+
"python.pythonPath": "/usr/bin/python3",
20+
"python.linting.enabled": true,
21+
"python.linting.pylintEnabled": true,
22+
"python.formatting.provider": "black",
23+
"prettier.requireConfig": true
24+
},
25+
"extensions": [
26+
"ms-vscode.cpptools",
27+
"ms-vscode.cmake-tools",
28+
"xaver.clang-format",
29+
"ms-python.python",
30+
"ms-azuretools.vscode-docker",
31+
"eamodio.gitlens",
32+
"esbenp.prettier-vscode",
33+
"mhutchie.git-graph",
34+
"twxs.cmake",
35+
"jeff-hykin.better-cpp-syntax",
36+
"vadimcn.vscode-lldb",
37+
"cschlosser.doxdocgen",
38+
"ms-python.vscode-pylance",
39+
"mutantdino.resourcemonitor",
40+
"randomfractalsinc.vscode-data-preview",
41+
"oderwat.indent-rainbow",
42+
"formulahendry.code-runner",
43+
"donjayamanne.git-extension-pack"
44+
]
45+
}
46+
},
47+
"postCreateCommand": "pre-commit install",
48+
"remoteUser": "devuser",
49+
"mounts": [
50+
"source=${localWorkspaceFolder}/.ccache,target=/home/devuser/.ccache,type=bind,consistency=cached"
51+
],
52+
"forwardPorts": [],
53+
"remoteEnv": {
54+
"CCACHE_DIR": "/home/devuser/.ccache",
55+
"CCACHE_MAXSIZE": "1G"
56+
},
57+
"workspaceFolder": "/home/devuser/workspace",
58+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/devuser/workspace,type=bind,consistency=cached"
59+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# These files should be ignored from GitHub's language statistics.
22
python/example.ipynb linguist-vendored
3+
notebooks/*.ipynb linguist-vendored

.github/pull_request_template.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Fixes # (issue)
99
Please delete options that are not relevant.
1010

1111
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] Enhancement (non-breaking change which improves existing functionality)
1213
- [ ] New feature (non-breaking change which adds functionality)
1314
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
1415
- [ ] This change requires a documentation update
@@ -21,10 +22,10 @@ Please describe the tests that you ran to verify your changes. Provide instructi
2122
- [ ] Test B
2223

2324
**Test Configuration**:
24-
* OS and version:
25-
* Compile and version:
25+
* OS and Version:
26+
* Compiler and Version:
2627

27-
# Checklist:
28+
# Checklist
2829

2930
- [ ] I have followed the project [style guide](https://ipctk.xyz/style_guide.html)
3031
- [ ] My code follows the clang-format style guidelines of this project
@@ -34,5 +35,4 @@ Please describe the tests that you ran to verify your changes. Provide instructi
3435
- [ ] My changes generate no new warnings
3536
- [ ] I have added tests that prove my fix is effective or that my feature works
3637
- [ ] New and existing unit tests pass locally with my changes
37-
- [ ] Any dependent changes have been merged and published in downstream modules
38-
38+
- [ ] Any dependent changes have been merged and published in downstream modules
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: clang-format Check
2+
on:
3+
push:
4+
paths:
5+
- '.github/workflows/clang-format-check.yml'
6+
- '.clang-format'
7+
- 'src/**'
8+
- 'tests/src/**'
9+
- 'python/src/**'
10+
pull_request:
11+
paths:
12+
- '.github/workflows/clang-format-check.yml'
13+
- '.clang-format'
14+
- 'src/**'
15+
- 'tests/src/**'
16+
- 'python/src/**'
17+
jobs:
18+
formatting-check:
19+
name: Formatting Check
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
path:
24+
- 'src'
25+
- 'tests/src'
26+
- 'python/src'
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: clang-format style check
30+
uses: jidicula/[email protected]
31+
with:
32+
clang-format-version: '20'
33+
check-path: ${{ matrix.path }}

.github/workflows/continuous.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ jobs:
6060
if: runner.os == 'Windows'
6161
uses: seanmiddleditch/gha-setup-ninja@master
6262

63+
- name: Get number of CPU cores
64+
uses: SimenB/[email protected]
65+
id: cpu-cores
66+
6367
- name: Cache Build
6468
id: cache-build
6569
uses: actions/cache@v4
@@ -95,14 +99,16 @@ jobs:
9599
96100
- name: Build (Linux/macOS)
97101
if: runner.os != 'Windows'
98-
run: cd build; make -j2; ccache --show-stats
102+
run: |
103+
cmake --build build -j ${{ steps.cpu-cores.outputs.count }}
104+
ccache --show-stats
99105
100106
- name: Build (Windows)
101107
if: runner.os == 'Windows'
102108
shell: cmd
103109
run: |
104110
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
105-
cmake --build build -j2 && ccache --show-stats
111+
cmake --build build -j ${{ steps.cpu-cores.outputs.count }} && ccache --show-stats
106112
107113
- name: Tests
108-
run: cd build; ctest --verbose -j2
114+
run: cd build; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }}

.github/workflows/coverage.yml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
name: Coverage
22

33
on:
4-
# push:
5-
# branches: [main]
6-
# pull_request:
7-
# paths:
8-
# - '.github/workflows/coverage.yml'
9-
# - 'cmake/**'
10-
# - 'src/**'
11-
# - 'tests/**'
12-
# - 'CMakeLists.txt'
4+
push:
5+
branches: [main]
6+
pull_request:
7+
paths:
8+
- '.github/workflows/coverage.yml'
9+
- 'cmake/**'
10+
- 'src/**'
11+
- 'tests/**'
12+
- 'CMakeLists.txt'
13+
- 'codecov.yml'
1314

1415
jobs:
1516
Coverage:
@@ -28,6 +29,10 @@ jobs:
2829
sudo apt-get install ccache lcov
2930
echo 'CACHE_PATH=~/.cache/ccache' >> "$GITHUB_ENV"
3031
32+
- name: Get number of CPU cores
33+
uses: SimenB/[email protected]
34+
id: cpu-cores
35+
3136
- name: Cache Build
3237
id: cache-build
3338
uses: actions/cache@v4
@@ -51,21 +56,23 @@ jobs:
5156
-DCMAKE_BUILD_TYPE=Release \
5257
5358
- name: Build
54-
run: cd build; make -j2; ccache --show-stats
59+
run: |
60+
cmake --build build -j ${{ steps.cpu-cores.outputs.count }}
61+
ccache --show-stats
5562
5663
- name: Run Coverage
5764
run: |
5865
cd build
59-
ctest --verbose --output-on-failure
60-
lcov --directory . --capture --output-file coverage.info
61-
lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' '*tests/*' --output-file coverage.info
66+
ctest --verbose -j ${{ steps.cpu-cores.outputs.count }}
67+
lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent,format,gcov
68+
lcov --remove coverage.info --ignore-errors unused '/usr/*' "$HOME/.cache/*" "*tests/*" --output-file coverage.info
6269
6370
- name: Upload coverage reports to Codecov
64-
uses: codecov/codecov-action@v3
65-
env:
66-
token: ${{ secrets.CODECOV_TOKEN }}
67-
files: coverage.info
71+
uses: codecov/codecov-action@v3.1.6
72+
with:
73+
fail_ci_if_error: true
74+
files: build/coverage.info
6875
flags: unittests
6976
name: ipc-toolkit
70-
fail_ci_if_error: true
71-
verbose: true
77+
token: ${{ secrets.CODECOV_TOKEN }}
78+
verbose: true

0 commit comments

Comments
 (0)