Skip to content

Commit 9ca5f2f

Browse files
Wentzellclaude
andcommitted
restructure project to align with cppdlr layout
- Rename project from nddlr to cppdlr2d - Move sources from src/ to c++/cppdlr2d/ - Add aggregator header cppdlr2d.hpp - Add deps/ with external_dependency mechanism - Add share/ with CMake config and install support - Move tests to test/c++/ - Update all includes to use <cppdlr2d/cppdlr2d.hpp> - Add .clang-format, .clang-tidy, LICENSE.txt (Apache 2.0) - Require explicit CMAKE_INSTALL_PREFIX Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9fea1b4 commit 9ca5f2f

38 files changed

Lines changed: 1092 additions & 109 deletions

.clang-format

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
BasedOnStyle: LLVM
2+
3+
AccessModifierOffset: 0
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveAssignments: true
6+
AlignConsecutiveDeclarations: false
7+
AlignEscapedNewlinesLeft: false
8+
AlignOperands: false
9+
AlignTrailingComments: true
10+
AllowAllParametersOfDeclarationOnNextLine: false
11+
AllowShortBlocksOnASingleLine: true
12+
AllowShortCaseLabelsOnASingleLine: true
13+
AllowShortFunctionsOnASingleLine: All
14+
AllowShortIfStatementsOnASingleLine: true
15+
AllowShortLoopsOnASingleLine: true
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: false
18+
BinPackArguments: true
19+
BinPackParameters: true
20+
BreakBeforeBinaryOperators: NonAssignment
21+
BreakBeforeBraces: Attach
22+
BreakBeforeTernaryOperators: false
23+
BreakConstructorInitializersBeforeComma: false
24+
BreakStringLiterals: false
25+
ColumnLimit: 150
26+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
27+
ConstructorInitializerIndentWidth: 3
28+
ContinuationIndentWidth: 3
29+
Cpp11BracedListStyle: true
30+
DerivePointerBinding : false
31+
IndentCaseLabels: true
32+
IndentWidth: 2
33+
Language: Cpp
34+
MaxEmptyLinesToKeep: 1
35+
NamespaceIndentation : All
36+
PointerAlignment: Right
37+
ReflowComments: false
38+
SortIncludes: false
39+
SpaceAfterControlStatementKeyword: true
40+
SpaceBeforeAssignmentOperators: true
41+
SpaceInEmptyParentheses: false
42+
SpacesInParentheses: false
43+
Standard: Cpp11
44+
TabWidth: 2
45+
UseTab: Never

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Checks: '-*,modernize-*,cppcoreguidelines-*,-modernize-use-trailing-return-type'
2+
HeaderFilterRegex: 'cppdlr2d'

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: Bug report
5+
labels: bug
6+
7+
---
8+
9+
### Prerequisites
10+
11+
* Please check that a similar issue isn't already filed
12+
13+
### Description
14+
15+
[Description of the issue]
16+
17+
### Steps to Reproduce
18+
19+
1. [First Step]
20+
2. [Second Step]
21+
3. [and so on...]
22+
23+
or paste a minimal code example to reproduce the issue.
24+
25+
**Expected behavior:** [What you expect to happen]
26+
27+
**Actual behavior:** [What actually happens]
28+
29+
### Versions
30+
31+
Please provide:
32+
- cppdlr2d version/commit hash
33+
- Compiler and version
34+
- OS and version
35+
36+
### Formatting
37+
38+
Please use markdown in your issue message. A useful summary of commands can be found [here](https://guides.github.com/pdfs/markdown-cheatsheet-online.pdf).
39+
40+
### Additional Information
41+
42+
Any additional information, configuration or data that might be necessary to reproduce the issue.

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: Feature request
5+
labels: feature
6+
7+
---
8+
9+
### Summary
10+
11+
One paragraph explanation of the feature.
12+
13+
### Motivation
14+
15+
Why is this feature of general interest?
16+
17+
### Implementation
18+
19+
What user interface do you suggest?
20+
21+
### Formatting
22+
23+
Please use markdown in your issue message. A useful summary of commands can be found [here](https://guides.github.com/pdfs/markdown-cheatsheet-online.pdf).

.github/workflows/build.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ main, unstable, '[0-9]+.[0-9]+.x' ]
6+
pull_request:
7+
branches: [ main, unstable, '[0-9]+.[0-9]+.x' ]
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
env:
12+
CMAKE_C_COMPILER_LAUNCHER: ccache
13+
CMAKE_CXX_COMPILER_LAUNCHER: ccache
14+
CCACHE_COMPILERCHECK: content
15+
CCACHE_BASEDIR: ${{ github.workspace }}
16+
CCACHE_DIR: ${{ github.workspace }}/.ccache
17+
CCACHE_MAXSIZE: 500M
18+
CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime
19+
CCACHE_COMPRESS: "1"
20+
CCACHE_COMPRESSLEVEL: "1"
21+
22+
jobs:
23+
build:
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
include:
29+
- {os: ubuntu-24.04, cxx: g++}
30+
- {os: ubuntu-24.04, cxx: clang++}
31+
32+
runs-on: ${{ matrix.os }}
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- uses: actions/cache/restore@v4
38+
with:
39+
path: ${{ env.CCACHE_DIR }}
40+
key: ccache-${{ matrix.os }}-${{ matrix.cxx }}-${{ github.run_id }}-${{ github.run_attempt }}
41+
restore-keys: |
42+
ccache-${{ matrix.os }}-${{ matrix.cxx }}-
43+
44+
- name: Set cxx variables
45+
run: |
46+
if [[ ${{ matrix.os }} == 'macos-15' && ${{ matrix.cxx }} == 'g++' ]]; then
47+
echo "CXX=g++-15" >> $GITHUB_ENV
48+
else
49+
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
50+
fi
51+
52+
- name: Install ubuntu dependencies
53+
if: ${{ contains(matrix.os, 'ubuntu') }}
54+
run: >
55+
sudo apt-get update &&
56+
sudo apt-get install lsb-release wget software-properties-common &&
57+
sudo apt-get install
58+
ccache
59+
cmake
60+
ninja-build
61+
clang
62+
g++
63+
hdf5-tools
64+
libblas-dev
65+
libc++-dev
66+
libc++abi-dev
67+
libomp-dev
68+
libhdf5-dev
69+
libopenblas-dev
70+
libopenmpi-dev
71+
openmpi-bin
72+
openmpi-common
73+
74+
- name: Install homebrew dependencies
75+
if: ${{ contains(matrix.os, 'macos') }}
76+
run: |
77+
brew update
78+
brew install ccache gcc llvm hdf5 open-mpi openblas
79+
echo "PATH=$(brew --prefix llvm)/bin:$(brew --prefix gcc)/bin:$PATH" >> $GITHUB_ENV
80+
echo "SDKROOT=$(xcrun --show-sdk-path)" >> $GITHUB_ENV
81+
echo "LDFLAGS=-L$(brew --prefix llvm)/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind" >> $GITHUB_ENV
82+
83+
- name: Add clang CXXFLAGS
84+
if: ${{ matrix.cxx == 'clang++' }}
85+
run: |
86+
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
87+
88+
- name: Build cppdlr2d
89+
run: |
90+
cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/install
91+
cmake --build build --verbose
92+
93+
- name: Test cppdlr2d
94+
env:
95+
OPENBLAS_NUM_THREADS: "1"
96+
run: |
97+
cd build
98+
ctest -j2 --output-on-failure
99+
100+
- name: ccache statistics
101+
if: always()
102+
run: ccache -sv
103+
104+
- uses: actions/cache/save@v4
105+
if: always()
106+
with:
107+
path: ${{ env.CCACHE_DIR }}
108+
key: ccache-${{ matrix.os }}-${{ matrix.cxx }}-${{ github.run_id }}-${{ github.run_attempt }}

.gitignore

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
dlr2d_if_data
1+
# Build directories
2+
build/
3+
build_*/
4+
5+
# IDE
6+
.vscode/
7+
.idea/
8+
*.swp
9+
*.swo
10+
11+
# Compiled files
12+
*.o
13+
*.a
14+
*.so
15+
*.dylib
16+
17+
# Data files
18+
dlr2d_if_data/
19+
programs/dlr2d_if_data/
20+
21+
# Generated
22+
compile_commands.json

0 commit comments

Comments
 (0)