Installation from sourceΒΆ
If you intend to work on the NNPDF code, then building from source is the recommended installation procedure. However, you can still use conda to get all the dependecies and setup the validphys and C++ development environment. Further information is available in the vp-guide. Note that the binary-bootstrap.sh
should be downloaded and run as explained above, if the user has not already done so.
Create an NNPDF developer environment
nnpdf-dev
and install all relevant dependencies usingconda create -n nnpdf-dev conda activate nnpdf-dev conda install --only-deps nnpdf
Note that the user should be in the conda environment
nnpdf-dev
whenever they wish to work on NNPDF code. The conda environment can be exited usingconda deactivate
.Install the appropriate C++ compilers using
conda install gxx_linux-64
macOS users should replace
gxx_linux-64
withclangxx_osx-64
.Ensure that the NNPDF repositories
nnpdf
andapfel
are in thennpdfgit
directory. These are required to be able to run fits and can be obtained respectively bygit clone git@github.com:NNPDF/nnpdf.git git clone https://github.com/scarrazza/apfel.git
Obtain the dependencies of the code you want to build. Where to find those depends on the particular code. For example, something linking to
libnnpdf
will likely requirepkg-config
. Projects based onautotools
(those that have a./configure
script) will additionally requireautomake
andlibtool
. Similarly projects based oncmake
will require installing thecmake
package. In the case ofnnpdf
itself, the build dependencies can be found in<nnpdf git root>/conda-recipe/meta.yaml
. We have to install the remaining ones manually:conda install pkg-config swig=3.0.10 cmake
We now need to make the installation prefix point to our
nnpdf-dev
environment, this can be done using:$CONDA_PREFIX==~/miniconda3/envs/nnpdf-dev/
this assumes
miniconda3
is installed in the default place which is the home directory.Navigate to the
nnpdf
directory obtained from the Github repository and create a folder calledconda-bld
bynnpdf$ mkdir conda-bld nnpdf$ cd conda-bld
Note that it is important that for the following step to be executed while the user is in the
nnpdf-dev
conda environment. The project can be built using:nnpdf/conda-bld$ cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
When the user wishes to work on the NNPDF code, they should do so in, for example,
'/nnpdfgit/nnpdf/libnnpdf'
. To compile the code navigate to theconda-bld
directory created above and runmake make install