Skip to content

Commit fb213b5

Browse files
committed
doc: update build-from-source
1 parent 87f979a commit fb213b5

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed

doc/build-from-source.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ Cloud](https://www.clever-cloud.com) for providing <https://foss.heptapod.net>!
4141

4242
## Installing from the repository
4343

44-
### Simple installation from source
44+
We describe few methods to install Fluidsim from source. Most developers should adopt
45+
[the method using PDM](#setup-dev-env).
4546

46-
We recommend to create a clean virtual environment, for example with:
47+
### Simple installation from source with Pip
48+
49+
When using Pip, we recommend to create a clean virtual environment, for example with:
4750

4851
```sh
4952
cd fluidsim
@@ -172,19 +175,21 @@ Note that Fluidsim builds are not sensible to the [`~/.pythranrc` file](pythranr
172175
173176
```
174177

178+
(setup-dev-env)=
179+
175180
### Setup a full developer environment with editable installation
176181

177182
Let us first present the tools used for Fluidsim development.
178183

179-
- [PDM] is a modern Python package and dependency manager,
184+
- [Pip] is the official package installer for Python,
180185

181-
- [Meson] is an open source build system (in particular used by Scipy),
186+
- [PDM] is a modern Python package and dependency manager,
182187

183188
- [Nox] is a command-line tool that automates testing in multiple Python environments,
184189

185-
- [Pytest] is the most popular testing framework for Python,
190+
- [Meson] is an open source build system (in particular used by Scipy),
186191

187-
- [pip] is the official package installer for Python,
192+
- [Pytest] is the most popular testing framework for Python,
188193

189194
- [Pythran] is an ahead of time compiler for a subset of the Python language, with a
190195
focus on scientific computing,
@@ -196,6 +201,11 @@ Fluidsim is built with [Meson]. We use [PDM] for Fluidsim development. [Pytest]
196201
are used for testing. We use [Pythran] through [Transonic] to accelerate some numerical
197202
kernels written in Python.
198203

204+
```{note}
205+
Most dependencies (Meson, Pytest, Pythran, Transonic, ...) will be installed by PDM.
206+
The developers just have to install manually PDM (and potentially Nox).
207+
```
208+
199209
#### Standard Python from Python.org
200210

201211
We present here how one can build Fluidsim from source like the main developers and
@@ -214,15 +224,33 @@ pipx install pdm -U
214224

215225
Installing in editable mode is a bit particular with Meson, since editable installations
216226
are incompatible with isolated builds, meaning that all build dependencies have to be
217-
installed in the main virtual environment! Fortunatelly, it's not too difficult with
218-
[PDM]. From the root directory of the repository, just run:
227+
installed in the main virtual environment! Fortunatelly, it's simple with [PDM].
228+
229+
##### Build-install Fluidimage with PDM
230+
231+
```{warning}
232+
You should not run the following commands from a virtual environment not related to Fluidimage.
233+
234+
No need to manually create a dedicated environment since PDM is going to do it for you.
235+
Just deactivate all Python environments.
236+
```
237+
238+
From the root directory of the repository, just run:
239+
240+
```sh
241+
pdm sync --clean -v
242+
```
243+
244+
This command creates a virtual environment, installs all build and runtime dependencies,
245+
and finally build/install Fluidsim from source.
246+
247+
Alternativelly, one can split this process in two steps. First, install all dependencies:
219248

220249
```sh
221-
pdm install --no-self
250+
pdm sync --no-self --clean
222251
```
223252

224-
This command creates a virtual environment and installs all build and runtime
225-
dependencies. You can then activate this environment and build/install Fluidsim with:
253+
You can then activate the environment and build/install Fluidsim with:
226254

227255
```sh
228256
. .venv/bin/activate

0 commit comments

Comments
 (0)