Skip to content

Commit 7715ab1

Browse files
Add alternative development using nix
1 parent 8222159 commit 7715ab1

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

docs/installation.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,40 @@ If you'd like to convert NNPDF's legacy FK tables to PineAPPL grids, add the swi
196196

197197
#### Alternative: development version
198198

199-
To use the most recent version available run
199+
An alternative way to easily get started with building `pineappl` is to use
200+
[nix-shell](https://nixos.wiki/wiki/Development_environment_with_nix-shell).
201+
`nix-shell` is a powerful tool from the [Nix](https://nixos.org/) ecosystem
202+
that provides a reproducible development environment without modifying the
203+
system's global state. It is especially convenient when building `pineappl_cli`
204+
with the various features such as `APPLgrid` or `fastNLO`.
205+
206+
The interactive nix-based shell and its package manager can be easily installed
207+
using the OS' package manager by following the instructions on
208+
[this page](https://nixos.org/download/#download-nix).
209+
210+
To use `nix-shell`, simply create a `shell.nix` file in the working directory with
211+
the following contents:
212+
```nix
213+
with import <nixpkgs> {}; {
214+
qpidEnv = stdenvNoCC.mkDerivation {
215+
name = "build-pineappl";
216+
buildInputs = [
217+
gcc
218+
gfortran
219+
lhapdf
220+
cargo
221+
cargo-c
222+
];
223+
};
224+
}
225+
```
226+
This will provide all the necessary dependencies to build `pineappl` as well as its
227+
C-/Fortran APIs and CLI version. Finally, to invoke the shell, simply run:
228+
```
229+
nix-shell
230+
```
231+
232+
When building the `pineappl_cli`, in order to use the most recent version available run
200233

201234
cargo install --locked --git https://github.com/NNPDF/pineappl.git pineappl_cli
202235

0 commit comments

Comments
 (0)