Skip to content

Latest commit

 

History

History
126 lines (80 loc) · 4.51 KB

installation.md

File metadata and controls

126 lines (80 loc) · 4.51 KB

Installation

Anaconda-Server Badge AUR

PineAPPL is written in Rust, but besides Rust it also offers interfaces for the most popular programming languages: C and C++, Fortran and Python. Furthermore the program pineappl can be installed that will allow you to perform many operations on grids in your favorite shell: the command-line interface (CLI).

Simply pick the interface(s) you're planning to use and follow the corresponding instructions below. If you don't know which interfaces you'll likely use, here are a few guidelines:

  • if you're planning to use PineAPPL within the NNPDF fitting framework, you'll need the Python interface;
  • if you want to run a Monte Carlo to generate PineAPPL grids, you'll need the C interface;
  • if you want to quickly produce predictions, plots and small analyses install the CLI.

C, C++ and Fortran: the CAPI

You first need to install Rust and cargo, see the instructions below.

  1. Then install cargo-c, which is required for the next step:

    cargo install cargo-c
    

    It is possible that the installation fails if your Rust compiler is too old. In that case update Rust or try installing an older version of cargo-c:

    cargo install cargo-c --version 0.7.3
    
  2. Now install pineappl_capi, PineAPPL's C API:

    cd pineappl_capi
    cargo cinstall --release --prefix=${prefix}
    cd ..
    

    where ${prefix} points to the desired installation directory.

  3. Finally, you need to set the environment variables PKG_CONFIG_PATH and LD_LIBRARY_PATH to the right directories. Adding

    export LD_LIBRARY_PATH=${prefix}/lib:$LD_LIBRARY_PATH
    export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:$PKG_CONFIG_PATH
    

    to your ~/.bashrc should do the trick (remember to replace ${prefix} with the correct directory). You can check PKG_CONFIG_PATH by running

    pkg-config pineappl_capi --libs
    

    which should print the library flags needed to link against the C API. If there's no output or an error, double-check that PKG_CONFIG_PATH is in the environment and that it points to a directory containing the pineappl_capi.pc file.

CLI: pineappl for your shell

You need to install Rust first (see below). Then simply run

cargo install pineappl_cli

anywhere and you are done; this will automatically download the most-recently released version from crates.io.

Optional: fastNLO converter

If you'd like to convert fastNLO tables to PineAPPL grids, make sure to install fastNLO first and add the switch --features=fastnlo during the CLI's installation, for instance:

cargo install --features=fastnlo pineappl_cli

Optional: FK table converter

If you'd like to convert NNPDF's legacy FK tables to PineAPPL grids, add the switch --features=fktable during the CLI's installation, for instance:

cargo install --features=fktable pineappl_cli

If you want both fastnlo and fktables add a comma:

cargo install --features=fastnlo,fktable pineappl_cli

Alternative: development version

To use the most recent version available run

cargo install --git https://github.com/N3PDF/pineappl.git

Instead, if you plan to make changes to the source code it's better to checkout this repository and run

cargo install --path pineappl_cli

inside it.

Python

PyPI version Anaconda-Server Badge AUR

To install the Python interface, run

pip install pineappl

For more documentation and more information see its README.

Rust

You will need the Rust compiler and its build system cargo. If cargo is already installed, make sure it is recent enough:

cargo --version

This should show a version that is at least 1.56.1. If you do not have cargo or if it is too old, go to https://www.rust-lang.org/tools/install and follow the instructions there.

The Rust crate is called pineappl.