Skip to content

Commit 11a0b9a

Browse files
committed
Initial commit: output from xeus-cookiecutter
0 parents  commit 11a0b9a

39 files changed

+2904
-0
lines changed

.clang-format

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
BasedOnStyle: Mozilla
2+
3+
AccessModifierOffset: '-4'
4+
AlignAfterOpenBracket: BlockIndent
5+
AlignEscapedNewlines: Left
6+
AllowAllArgumentsOnNextLine: false
7+
AllowAllParametersOfDeclarationOnNextLine: false
8+
AllowShortBlocksOnASingleLine: false
9+
AllowShortCaseLabelsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: false
11+
AllowShortIfStatementsOnASingleLine: false
12+
# Forbid one line lambdas because clang-format makes a weird split when
13+
# single instructions lambdas are too long.
14+
AllowShortLambdasOnASingleLine: Empty
15+
AllowShortLoopsOnASingleLine: false
16+
AlwaysBreakAfterDefinitionReturnType: None
17+
AlwaysBreakAfterReturnType: None
18+
AlwaysBreakTemplateDeclarations: Yes
19+
BinPackArguments: false
20+
BinPackParameters: false
21+
BreakBeforeBinaryOperators: NonAssignment
22+
BreakBeforeBraces: Allman
23+
BreakBeforeTernaryOperators: true
24+
BreakConstructorInitializers: BeforeComma
25+
BreakInheritanceList: AfterComma
26+
BreakStringLiterals: false
27+
ColumnLimit: '110'
28+
ConstructorInitializerIndentWidth: '4'
29+
ContinuationIndentWidth: '4'
30+
Cpp11BracedListStyle: true
31+
DerivePointerAlignment: false
32+
DisableFormat: false
33+
EmptyLineAfterAccessModifier: Always
34+
EmptyLineBeforeAccessModifier: Always
35+
ExperimentalAutoDetectBinPacking: true
36+
IndentCaseLabels: true
37+
IndentWidth: '4'
38+
IndentWrappedFunctionNames: false
39+
InsertBraces: true
40+
InsertTrailingCommas: Wrapped
41+
KeepEmptyLinesAtTheStartOfBlocks: false
42+
LambdaBodyIndentation: Signature
43+
Language: Cpp
44+
MaxEmptyLinesToKeep: '2'
45+
NamespaceIndentation: All
46+
ObjCBlockIndentWidth: '4'
47+
ObjCSpaceAfterProperty: false
48+
ObjCSpaceBeforeProtocolList: false
49+
PackConstructorInitializers: Never
50+
PenaltyBreakAssignment: 100000
51+
PenaltyBreakBeforeFirstCallParameter: 0
52+
PenaltyBreakComment: 10
53+
PenaltyBreakOpenParenthesis: 0
54+
PenaltyBreakTemplateDeclaration: 0
55+
PenaltyExcessCharacter: 10
56+
PenaltyIndentedWhitespace: 0
57+
PenaltyReturnTypeOnItsOwnLine: 10
58+
PointerAlignment: Left
59+
QualifierAlignment: Custom # Experimental
60+
QualifierOrder: [inline, static, constexpr, const, volatile, type]
61+
ReflowComments: true
62+
SeparateDefinitionBlocks: Always
63+
SortIncludes: CaseInsensitive
64+
SortUsingDeclarations: true
65+
SpaceAfterCStyleCast: true
66+
SpaceAfterTemplateKeyword: true
67+
SpaceBeforeAssignmentOperators: true
68+
SpaceBeforeParens: ControlStatements
69+
SpaceInEmptyParentheses: false
70+
SpacesBeforeTrailingComments: '2'
71+
SpacesInAngles: false
72+
SpacesInCStyleCastParentheses: false
73+
SpacesInContainerLiterals: false
74+
SpacesInParentheses: false
75+
SpacesInSquareBrackets: false
76+
Standard: c++14
77+
TabWidth: '4'
78+
UseTab: Never

.github/ISSUE_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
* xeus-cookiecutter version:
2+
* Operating System:
3+
4+
### Description
5+
6+
Describe what you were trying to get done.
7+
Tell us what happened, what went wrong, and what you expected to happen.
8+
9+
### What I Did
10+
11+
```
12+
Paste the command(s) you ran and the output.
13+
If there was a crash, please include the traceback here.
14+
```

.github/workflows/main.yml

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
unix:
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, macos-latest]
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: install mamba
26+
uses: mamba-org/provision-with-micromamba@main
27+
with:
28+
environment-file: environment-dev.yml
29+
environment-name: xeus-cpp
30+
31+
- name: install cxx compiler
32+
shell: bash -l {0}
33+
run: |
34+
$HOME/micromamba-bin/micromamba install cxx-compiler -c conda-forge -y
35+
36+
- name: cmake configure
37+
shell: bash -l {0}
38+
run: |
39+
mkdir -p bld
40+
cd bld
41+
cmake .. \
42+
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
43+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
44+
45+
- name: build
46+
shell: bash -l {0}
47+
run: |
48+
cd bld
49+
make -j8
50+
51+
- name: install
52+
shell: bash -l {0}
53+
run: |
54+
cd bld
55+
make install
56+
57+
- name: test
58+
shell: bash -l {0}
59+
run: |
60+
cd test
61+
pytest . --reruns 5
62+
63+
win:
64+
65+
runs-on: ${{ matrix.os }}
66+
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
os: [ windows-latest]
71+
72+
steps:
73+
- uses: actions/checkout@v2
74+
75+
- name: install mamba
76+
uses: mamba-org/provision-with-micromamba@main
77+
with:
78+
environment-file: environment-dev.yml
79+
environment-name: xeus-cpp
80+
81+
- name: micromamba shell hook
82+
shell: powershell
83+
run: |
84+
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root
85+
86+
- name: cmake configure
87+
shell: cmd
88+
run: |
89+
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
90+
mkdir -p bld
91+
cd bld
92+
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DXEUS_BUILD_TESTS=ON -DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" -DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%"
93+
94+
- name: build
95+
shell: cmd
96+
run: |
97+
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
98+
cd bld
99+
set CL=/MP
100+
nmake install
101+
102+
- name: test
103+
shell: cmd
104+
run: |
105+
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
106+
cd test
107+
pytest . --reruns 5
108+
109+
emscripten_wasm_docker:
110+
runs-on: ubuntu-20.04
111+
112+
strategy:
113+
fail-fast: false
114+
matrix:
115+
container: ["emscripten/emsdk:2.0.34", "emscripten/emsdk:3.1.3", "emscripten/emsdk:latest"]
116+
117+
118+
container: ${{ matrix.container}}
119+
120+
steps:
121+
- uses: actions/checkout@v2
122+
123+
- name: Verify emscripten
124+
run: emcc -v
125+
126+
- name: "install xtl"
127+
run: |
128+
mkdir -p /opt/xtl/build
129+
git clone https://github.com/xtensor-stack/xtl.git /opt/xtl/src
130+
cd /opt/xtl/src
131+
git checkout 0.7.2
132+
cd /opt/xtl/build
133+
emcmake cmake ../src/ -DCMAKE_INSTALL_PREFIX=/custom_sysroot
134+
emmake make -j2 install
135+
136+
- name: "install nlohmann-json"
137+
run: |
138+
mkdir -p /opt/nlohmannjson/build
139+
git clone https://github.com/nlohmann/json.git /opt/nlohmannjson/src
140+
cd /opt/nlohmannjson/src
141+
git checkout v3.9.0
142+
cd /opt/nlohmannjson/build
143+
emcmake cmake ../src/ -DJSON_BuildTests=OFF -DCMAKE_INSTALL_PREFIX=/custom_sysroot
144+
emmake make -j2 install
145+
146+
- name: "install xeus"
147+
run: |
148+
mkdir -p /opt/xeus/build
149+
git clone https://github.com/jupyter-xeus/xeus.git /opt/xeus/src
150+
cd /opt/xeus/build
151+
emcmake cmake ../src \
152+
-DXEUS_EMSCRIPTEN_WASM_BUILD=ON \
153+
-DCMAKE_INSTALL_PREFIX=/custom_sysroot\
154+
-Dxtl_DIR=/custom_sysroot/share/cmake/xtl \
155+
-Dnlohmann_json_DIR=/custom_sysroot/lib/cmake/nlohmann_json
156+
157+
emmake make -j2
158+
emmake make -j2 install
159+
160+
- name: "install xeus-lite"
161+
run: |
162+
mkdir -p /opt/xeus-lite/build
163+
git clone https://github.com/jupyter-xeus/xeus-lite.git /opt/xeus-lite/src
164+
cd /opt/xeus-lite/build
165+
emcmake cmake ../src \
166+
-DXEUS_EMSCRIPTEN_WASM_BUILD=ON \
167+
-DCMAKE_INSTALL_PREFIX=/custom_sysroot \
168+
-Dxtl_DIR=/custom_sysroot/share/cmake/xtl \
169+
-Dnlohmann_json_DIR=/custom_sysroot/lib/cmake/nlohmann_json \
170+
-Dxeus_DIR=/custom_sysroot/lib/cmake/xeus
171+
emmake make -j2
172+
emmake make -j2 install
173+
174+
- name: cmake configure rendered project
175+
shell: bash -l {0}
176+
run: |
177+
mkdir -p bld
178+
cd bld
179+
emcmake cmake .. \
180+
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
181+
-Dxtl_DIR=/custom_sysroot/share/cmake/xtl \
182+
-Dnlohmann_json_DIR=/custom_sysroot/lib/cmake/nlohmann_json \
183+
-Dxeus_DIR=/custom_sysroot/lib/cmake/xeus \
184+
-Dxeus-lite_DIR=/custom_sysroot/lib/cmake/xeus-lite \
185+
-DCMAKE_INSTALL_PREFIX=/custom_sysroot
186+
187+
- name: build rendered project
188+
shell: bash -l {0}
189+
run: |
190+
cd bld
191+
emmake make -j2
192+
193+
- name: install rendered project
194+
shell: bash -l {0}
195+
run: |
196+
cd bld
197+
make install
198+
199+
emscripten_wasm:
200+
201+
runs-on: ubuntu-latest
202+
203+
strategy:
204+
fail-fast: false
205+
matrix:
206+
emsdk_ver: ["2.0.34", "3.1.3"]
207+
208+
steps:
209+
- uses: actions/checkout@v2
210+
211+
- name: Install mamba
212+
uses: mamba-org/provision-with-micromamba@main
213+
with:
214+
environment-file: environment-wasm-build.yml
215+
environment-name: xeus-cpp-wasm-build
216+
217+
- name: Setup emsdk
218+
shell: bash -l {0}
219+
run: |
220+
emsdk install ${{matrix.emsdk_ver}}
221+
222+
- name: Build xeus-cpp
223+
shell: bash -l {0}
224+
run: |
225+
emsdk activate ${{matrix.emsdk_ver}}
226+
source $CONDA_EMSDK_DIR/emsdk_env.sh
227+
micromamba create -f environment-wasm-host.yml --platform=emscripten-32
228+
229+
mkdir build
230+
pushd build
231+
232+
export EMPACK_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
233+
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
234+
export CMAKE_PREFIX_PATH=$PREFIX
235+
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
236+
237+
emcmake cmake \
238+
-DCMAKE_BUILD_TYPE=Release \
239+
-DCMAKE_PREFIX_PATH=$PREFIX \
240+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
241+
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
242+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
243+
..
244+
make -j5

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
*.wasm
34+
35+
# Jupyter
36+
.ipynb_checkpoints/
37+
38+
# Generated kernelspec
39+
share/jupyter/kernels/xcpp/kernel.json
40+
41+
# Build directory
42+
build/
43+
44+
bld

0 commit comments

Comments
 (0)