@@ -43,34 +43,114 @@ cmake -S . -B build
4343cmake --build build
4444```
4545
46- ### Building Specific Releases
46+ ### Building OpenPFC
4747
48- To build a specific release of ` OpenPFC ` with a specific version of ` HeFFTe ` ,
49- use the ` nix build ` command. There are two main build targets:
48+ The build targets follow the pattern:
5049
51- - ` #openpfc-dev ` : The default target, which can also be invoked with `nix
52- build ` . This builds the development version of ` OpenPFC`.
53- - ` #openpfc ` : Builds the release version of ` OpenPFC ` .
50+ ```
51+ #openpfc-<what>-< version>
52+ ```
5453
55- For example:
54+ - ` <what> ` can be one of the following:
55+ - Empty: Builds the full release version.
56+ - ` apps ` : Builds only the apps.
57+ - ` docs ` : Builds only the documentation.
58+ - ` tests ` : Builds only the tests.
59+ - ` examples ` : Builds only the examples.
60+ - ` <version> ` specifies the version number without the ` v ` prefix. Special values:
61+ - ` dev ` : Builds from the local source directory (defaults to ` Debug ` build type).
62+ - ` master ` : Builds the bleeding-edge version from the GitHub repository (defaults to ` Release ` build type).
5663
57- ``` bash
58- nix build # openpfc
59- ```
64+ ### Overriding the Build Type
6065
61- or equivalently for the development version:
66+ By default:
67+ - ` dev ` builds use the ` Debug ` build type.
68+ - All other builds use the ` Release ` build type.
6269
70+ You can override this behavior by passing the ` --arg buildType <type> ` argument, where ` <type> ` can be ` Debug ` or ` Release ` .
71+
72+ For example:
6373``` bash
64- nix build # openpfc-dev
74+ nix build . # openpfc --arg buildType '"Debug"'
6575```
6676
67- When building, tagged versions are used, which are defined in the following files:
77+ ### Examples
78+
79+ Here are some examples of how to use the build targets:
80+
81+ - ** Build the default release version** :
82+ ``` bash
83+ nix build .# openpfc
84+ ```
6885
69- - ` nix/openpfc/versions `
70- - ` nix/heffte/versions `
86+ - ** Build the development version from the source directory** :
87+ ``` bash
88+ nix build .# openpfc-dev
89+ ```
7190
72- This approach allows constructing immutable builds for all versions simply by
73- changing the version numbers in these files.
91+ - ** Build a specific version (e.g., 0.1.1)** :
92+ ``` bash
93+ nix build .# openpfc-0.1.1
94+ ```
95+
96+ - ** Build tests for a specific version (e.g., 0.1.0)** :
97+ ``` bash
98+ nix build .# openpfc-tests-0.1.0
99+ ```
100+
101+ - ** Build documentation for a specific version (e.g., 0.1.1)** :
102+ ``` bash
103+ nix build .# openpfc-docs-0.1.1
104+ ```
105+
106+ - ** Build documentation for the bleeding-edge version** :
107+ ``` bash
108+ nix build .# openpfc-docs-master
109+ ```
110+
111+ - ** Build tests for the development version** :
112+ ``` bash
113+ nix build .# openpfc-tests-dev
114+ ```
115+
116+ - ** Override the build type to Debug for a release version** :
117+ ``` bash
118+ nix build .# openpfc-0.1.1 --arg buildType '"Debug"'
119+ ```
120+
121+ These are all the build targets available in this project so far:
122+
123+ ```
124+ nix build .#openpfc
125+ nix build .#openpfc-0.1.0
126+ nix build .#openpfc-0.1.1
127+ nix build .#openpfc-master
128+ nix build .#openpfc-dev
129+
130+ nix build .#openpfc-tests
131+ nix build .#openpfc-tests-0.1.0
132+ nix build .#openpfc-tests-0.1.1
133+ nix build .#openpfc-tests-master
134+ nix build .#openpfc-tests-dev
135+
136+ nix build .#openpfc-docs
137+ nix build .#openpfc-docs-0.1.0
138+ nix build .#openpfc-docs-0.1.1
139+ nix build .#openpfc-docs-master
140+ nix build .#openpfc-docs-dev
141+
142+ nix build .#openpfc-apps
143+ nix build .#openpfc-apps-0.1.0
144+ nix build .#openpfc-apps-0.1.1
145+ nix build .#openpfc-apps-master
146+ nix build .#openpfc-apps-dev
147+
148+ nix build .#openpfc-examples
149+ nix build .#openpfc-examples-0.1.0
150+ nix build .#openpfc-examples-0.1.1
151+ nix build .#openpfc-examples-master
152+ nix build .#openpfc-examples-dev
153+ ```
74154
75155### Why Use Nix?
76156
0 commit comments