lhapdf is hosted by Hepforge, IPPP Durham

Installation (4.1 onwards)

First download the required gzipped tar file (eg lhapdf-v.r.p.tar.gz) from the downloads section (either with or without the PDFsets as required). Then do the following:-

tar -xvzf lhapdf-v.r.p.tar.gz to unpack this into the directory lhapdf-v.r.p.

cd lhapdf-v.r.p to change directory (v.r.p = version.revision.patch, eg 5.3.1).

If you have root priviledge and want the installed files to go by default into /usr/local then do:

./configure

If you do not have root priviledge and/or want the files installed into a different directory then do:

./configure --prefix=/path/to/directory note: this should be a different directory to the 'lhapdf-v.r.p' directory, otherwise the install step will not work.

If you want to install a memory light version to work with mainly single pdfs then use:

./configure --prefix=/path/to/directory --enable-low-memory

If you want to install with as max number of set different from the default of 3 then use:

./configure --prefix=/path/to/directory --with-max-num-pdfsets=N

From version 5.8.0 onwards there is the additional configuration option to limit the virtual memory footprint of LHAPDF by building with only the code for selected PDFs as follows: ./configure --prefix=/path/to/directory -enable-pdfsets=LIST where LIST is a comma separated list chosen from:
mrst mrst06 mrst98 mrstqed cteq grv nnpdf gjr h1 zeus h1 hera alekhin botje fermi hkn pions photons

Note that -ve values in the list take precedence and exclude the selected PDF set.

Any of the above configuration options can of course be combined to tailor the build to your requirements.

Then do:

make
make install

The following directories/files should now have been installed in your selected installation directory.

lib/libLHAPDF.a, lib/libLHAPDF.so etc.
The static (.a) and dynamic (.so etc.) LHAPDF (and LHAGLUE) libraries. These are the compiled FORTRAN routines to link against your program. See the shared libraries page for more detail on compiling against these libraries.
share/lhapdf/PDFsets/ (5.7.0 and earlier only)
The directory containing all the PDF parameter/grid data sets. Note that all the available sets are downloaded in the full tar file, or they can be selected individually after installation. In the latter case they should be put into this directory.
From 5.7.1 onwards the grid files are not included in the distribution and can be downloaded using the '/bin/lhapdf-getdata' script. The default expected location is share/lhapdf/PDFsets but they can be locate anywhere using the 'LHAPATH' environmental variable.
bin/lhapdf-config
A script (which must be in the users execution path) used by the LHAPDF routine "InitPDFsetByName" to determine the correct path to the PDF data sets.
bin/lhapdf-getdata (from 5.7.1 onwards)
A script to download the PDF grid files as required.

From version 5.3.0 onwards additionally the following files are installed:

lib/libLHAPDFWrap.a.
The static C++ wrapper library
lib/libLHAPDFWrap.so
The dynamic C++ wrapper library
share/lhapdf/PDFsets.index
A text file detailing the LHaglue PDF numbers and, where applicable, the old PDFLIB equivalent numbers as well as the max and min ranges of X and Q**2.

If you wish to install the various components into different directories than above, the following options to ./configure (as well as --prefix=) can be used:

--bindir=DIR --datadir=DIR --libdir=DIR

Note that DIR are absolute paths to the required directories and lhapdf-config will automatically handle these paths. More details are given in the INSTALL file in the downloaded package.