Skip to content

Commit e1a9313

Browse files
authored
Merge pull request #1 from ipc-sim/main
Update CMake and add clang-format
2 parents 1557450 + 2117898 commit e1a9313

26 files changed

+1373
-1173
lines changed

.clang-format

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
2+
BasedOnStyle: WebKit
3+
ColumnLimit: 80
4+
AlignTrailingComments: true
5+
FixNamespaceComments: true
6+
ReflowComments: true
7+
BinPackParameters: false
8+
AllowAllParametersOfDeclarationOnNextLine: true
9+
AlignAfterOpenBracket: AlwaysBreak
10+
BreakBeforeBinaryOperators: NonAssignment
11+
SortIncludes: false
12+
# BreakStringLiterals: false

.github/workflows/continuous.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
env:
9+
CTEST_OUTPUT_ON_FAILURE: ON
10+
CTEST_PARALLEL_LEVEL: 2
11+
12+
jobs:
13+
####################
14+
# Linux / macOS
15+
####################
16+
17+
Unix:
18+
name: ${{ matrix.name }} (${{ matrix.config }})
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, macos-latest]
24+
config: [Debug, Release]
25+
include:
26+
- os: macos-latest
27+
name: macOS
28+
- os: ubuntu-latest
29+
name: Linux
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/[email protected]
33+
with:
34+
fetch-depth: 10
35+
36+
- name: Dependencies (Linux)
37+
if: runner.os == 'Linux'
38+
run: |
39+
sudo apt-get install ccache
40+
echo 'CACHE_PATH=~/.cache/ccache' >> "$GITHUB_ENV"
41+
42+
- name: Dependencies (macOS)
43+
if: runner.os == 'macOS'
44+
run: |
45+
brew install ccache
46+
echo 'CACHE_PATH=~/Library/Caches/ccache' >> "$GITHUB_ENV"
47+
48+
- name: Cache Build
49+
id: cache-build
50+
uses: actions/[email protected]
51+
with:
52+
path: ${{ env.CACHE_PATH }}
53+
key: ${{ runner.os }}-${{ matrix.config }}-cache
54+
55+
- name: Prepare ccache
56+
run: |
57+
ccache --max-size=1.0G
58+
ccache -V && ccache --show-stats && ccache --zero-stats
59+
60+
- name: Configure
61+
run: |
62+
mkdir -p build
63+
cd build
64+
cmake .. \
65+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
66+
-DSIMPLE_BVH_WITH_UNIT_TESTS=ON \
67+
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
68+
69+
- name: Build
70+
run: cd build; make -j2; ccache --show-stats
71+
72+
- name: Tests
73+
run: cd build; ctest --verbose
74+
75+
####################
76+
# Windows
77+
####################
78+
79+
Windows:
80+
runs-on: windows-latest
81+
strategy:
82+
fail-fast: false
83+
matrix:
84+
config: [Debug, Release]
85+
steps:
86+
- name: Checkout repository
87+
uses: actions/[email protected]
88+
with:
89+
fetch-depth: 10
90+
91+
- name: Install Ninja
92+
uses: seanmiddleditch/gha-setup-ninja@master
93+
94+
- name: Set env variable for sccache
95+
run: |
96+
echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV}
97+
98+
- name: Cache build
99+
id: cache-build
100+
uses: actions/[email protected]
101+
with:
102+
path: ${{ env.appdata }}\Mozilla\sccache
103+
key: ${{ runner.os }}-${{ matrix.config }}-cache
104+
105+
- name: Prepare sccache
106+
run: |
107+
iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1' -outfile 'install.ps1'
108+
.\install.ps1 -RunAsAdmin
109+
scoop install sccache --global
110+
# Scoop modifies the PATH so we make it available for the next steps of the job
111+
echo "${env:PATH}" >> ${env:GITHUB_PATH}
112+
113+
- name: Configure and build
114+
shell: cmd
115+
run: |
116+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
117+
cmake -G Ninja ^
118+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
119+
-DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
120+
-DSIMPLE_BVH_WITH_UNIT_TESTS=ON ^
121+
-B build ^
122+
-S .
123+
cmake --build build -j1
124+
125+
- name: Tests
126+
run: cd build; ctest --verbose -j2

.gitignore

Lines changed: 249 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,249 @@
1-
bin/*
2-
3rdparty
1+
## macOS
2+
default.profraw
3+
4+
# General
5+
.DS_Store
6+
.AppleDouble
7+
.LSOverride
8+
9+
# Icon must end with two \r
10+
Icon
11+
12+
13+
# Thumbnails
14+
._*
15+
16+
# Files that might appear in the root of a volume
17+
.DocumentRevisions-V100
18+
.fseventsd
19+
.Spotlight-V100
20+
.TemporaryItems
21+
.Trashes
22+
.VolumeIcon.icns
23+
.com.apple.timemachine.donotpresent
24+
25+
# Directories potentially created on remote AFP share
26+
.AppleDB
27+
.AppleDesktop
28+
Network Trash Folder
29+
Temporary Items
30+
.apdisk
31+
32+
33+
## C++
34+
35+
# Prerequisites
36+
*.d
37+
38+
# Compiled Object files
39+
*.slo
40+
*.lo
41+
*.o
42+
43+
# Precompiled Headers
44+
*.gch
45+
*.pch
46+
47+
# Compiled Dynamic libraries
48+
*.so
49+
*.dylib
50+
*.dll
51+
52+
# Fortran module files
53+
*.mod
54+
*.smod
55+
56+
# Compiled Static libraries
57+
*.lai
58+
*.la
59+
*.a
60+
*.lib
61+
62+
# Executables
63+
*.exe
64+
*.out
65+
*.app
66+
67+
68+
## CMake
69+
70+
CMakeLists.txt.user
71+
CMakeCache.txt
72+
CMakeFiles
73+
CMakeScripts
74+
Testing
75+
Makefile
76+
cmake_install.cmake
77+
install_manifest.txt
78+
compile_commands.json
79+
CTestTestfile.cmake
80+
_deps
81+
82+
83+
## Build
84+
build*
85+
bin*
86+
87+
## IDES
88+
*.autosave
89+
.idea/
90+
*.code-workspace
91+
*.vscode
92+
93+
## python
94+
# Byte-compiled / optimized / DLL files
95+
__pycache__/
96+
*.py[cod]
97+
*$py.class
98+
99+
# C extensions
100+
*.so
101+
102+
# Distribution / packaging
103+
.Python
104+
build/
105+
develop-eggs/
106+
dist/
107+
downloads/
108+
eggs/
109+
.eggs/
110+
lib/
111+
lib64/
112+
parts/
113+
sdist/
114+
var/
115+
wheels/
116+
pip-wheel-metadata/
117+
share/python-wheels/
118+
*.egg-info/
119+
.installed.cfg
120+
*.egg
121+
MANIFEST
122+
123+
# PyInstaller
124+
# Usually these files are written by a python script from a template
125+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
126+
*.manifest
127+
*.spec
128+
129+
# Installer logs
130+
pip-log.txt
131+
pip-delete-this-directory.txt
132+
133+
# Unit test / coverage reports
134+
htmlcov/
135+
.tox/
136+
.nox/
137+
.coverage
138+
.coverage.*
139+
.cache
140+
nosetests.xml
141+
coverage.xml
142+
*.cover
143+
*.py,cover
144+
.hypothesis/
145+
.pytest_cache/
146+
147+
# Translations
148+
*.mo
149+
*.pot
150+
151+
# Django stuff:
152+
*.log
153+
local_settings.py
154+
db.sqlite3
155+
db.sqlite3-journal
156+
157+
# Flask stuff:
158+
instance/
159+
.webassets-cache
160+
161+
# Scrapy stuff:
162+
.scrapy
163+
164+
# Sphinx documentation
165+
docs/_build/
166+
167+
# PyBuilder
168+
target/
169+
170+
# Jupyter Notebook
171+
.ipynb_checkpoints
172+
173+
# IPython
174+
profile_default/
175+
ipython_config.py
176+
177+
# pyenv
178+
.python-version
179+
180+
# pipenv
181+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
182+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
183+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
184+
# install all needed dependencies.
185+
#Pipfile.lock
186+
187+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
188+
__pypackages__/
189+
190+
# Celery stuff
191+
celerybeat-schedule
192+
celerybeat.pid
193+
194+
# SageMath parsed files
195+
*.sage.py
196+
197+
# Environments
198+
.env
199+
.venv
200+
env/
201+
venv/
202+
ENV/
203+
env.bak/
204+
venv.bak/
205+
206+
# Spyder project settings
207+
.spyderproject
208+
.spyproject
209+
210+
# Rope project settings
211+
.ropeproject
212+
213+
# mkdocs documentation
214+
/site
215+
216+
# mypy
217+
.mypy_cache/
218+
.dmypy.json
219+
dmypy.json
220+
221+
# Pyre type checker
222+
.pyre/
223+
224+
## AUTOGEN!
225+
#comparisons/STIV/src/autogen/*.ipp
226+
#src/autogen/*.ipp
227+
#src/autogen/*.hpp
228+
229+
fixtures/auto_*.json
230+
figures/*.data
231+
data/*.local/
232+
data/linesearch_*.csv
233+
logs/*.csv
234+
logs/**/*.csv
235+
logs/*.log
236+
logs/**/*.log
237+
238+
3rdparty*
239+
240+
241+
## Documentation
242+
docs/*
243+
!/docs/imgs
244+
245+
## Symbolic link to Google Drive folder
246+
results
247+
248+
# Atom beautifier files
249+
.atom-beautify.*

0 commit comments

Comments
 (0)