Skip to content

Commit 6fc7230

Browse files
committed
Add documentation
1 parent b04580b commit 6fc7230

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,24 @@ sure they work on all supported architectures, not only your favorite one!
2323
We use a shared copyright model that enables all contributors to maintain the
2424
copyright on their contributions. Stated otherwise, there's no copyright
2525
assignment.
26+
27+
# Working locally with Pixi
28+
29+
An optional [Pixi](https://pixi.sh) configuration is available to setup dependencies
30+
and run tasks in Conda environments.
31+
It single executable is easily installable from system package managers or through
32+
direct download.
33+
34+
The most useful task is `test`, which will automatically download packages and re-run
35+
the build steps as needed.
36+
It can run a a mix of configurations with different compilers (configured in different
37+
environments) and target architectures (configured as CMake presets).
38+
For instance, to test the SSE2 environment with the Clang 21 compiler:
39+
40+
```sh
41+
pixi run -e clang-21 test dev-sse2
42+
```
43+
44+
All available environments can be found with ``pixi info`` and are stored in the ``.pixi``
45+
local folder.
46+
All available tasks can be listed with ``pixi task list``.

pixi.toml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,30 @@ cmake -B build/$PIXI_ENVIRONMENT_NAME/{{ preset }} -G Ninja \
9797
"""
9898
inputs = ["**/CMakeLists.txt", "**/*.cmake.in", "cmake/"]
9999
outputs = ["build/$PIXI_ENVIRONMENT_NAME/{{ preset }}/CMakeCache.txt"]
100+
description = """
101+
Run the CMake configuration step with a given preset. \
102+
Build folders are stored in `build/` subdirectories.\
103+
"""
100104

101105
[feature.cmd.tasks.build]
102106
args = ["preset"]
103107
cmd = "cmake --build build/$PIXI_ENVIRONMENT_NAME/{{ preset }} --parallel"
104108
depends-on = [{ task = "configure", args = ["{{ preset }}"] }]
109+
# No caching configured here since CMake will do it better
110+
description = """
111+
Run the compilation steps in parallel via CMake. \
112+
CMake will detect files that have changed and need rebuilding.\
113+
"""
105114

106115
[feature.cmd.tasks.test]
107116
args = [{ arg = "preset", default = "debug-native" }]
108117
cmd = "./build/$PIXI_ENVIRONMENT_NAME/{{ preset }}/test/test_xsimd"
109118
depends-on = [{ task = "build", args = ["{{ preset }}"] }]
119+
description = """
120+
Run the test suite for the given preset (launch recompilation as needed). \
121+
The preset can be used to test an older micro architecture on a machine (e.g. \
122+
testing SSE4.2 on a AVX2 machine).\
123+
"""
110124

111125
# A dev feature and environment that contains LSP, formatters etc.
112126
[feature.dev.dependencies]
@@ -128,6 +142,7 @@ lldb = "*"
128142
cmd = "find . -name '*.[ch]pp' | xargs clang-format -i"
129143
inputs = ["**/*.*pp"]
130144
outputs = ["**/*.*pp"]
145+
description = "Run clang-format on the codebase."
131146

132147
[feature.dev.tasks.init-lsp]
133148
cmd = "ln -sf build/dev/debug-native/compile_commands.json"
@@ -137,9 +152,13 @@ depends-on = [
137152
], environment = "dev" },
138153
]
139154
outputs = ["compile_commands.json"]
155+
description = "Initialize the compilation database for clangd."
156+
157+
[feature.dev.tasks.fmt-taplo]
158+
cmd = "taplo fmt"
159+
description = "Format the TOML files."
140160

141161
[feature.dev.tasks]
142-
fmt-taplo = "taplo fmt"
143162
fmt = { depends-on = ["fmt-clang", "fmt-taplo"] }
144163

145164
[environments]

0 commit comments

Comments
 (0)