Clone wiki

papi / Downloading-and-Installing-PAPI

Downloading and Installing PAPI

Clone the PAPI repository the first time with the following command:

git clone

This creates a complete copy of the papi git repository in a folder called 'papi'.

To make sure your copy is up to date with the repository:

cd papi
git pull

To install PAPI on your system:

  • Find the section in INSTALL.txt that pertains to your hardware and operating system.
  • Follow the directions to install required components and build the PAPI libraries.
  • Run the test suite when you are finished to verify that everything went ok. NOTE: Although we make every attempt to get all tests to PASS or SKIP on all platforms, there are occasional instances of FAILures due to excessively tight compliance thresholds or platform idiosyncrasies. Don't panic if one or two tests FAIL. Contact us with complete output and we'll see what we can do.


1) Install PAPI

cd papi/src
./configure --prefix=$PWD/install
make && make install

2) Run 'papi_avail'

cd install/bin

3) If 2. works, run some tests under papi/src/ctests, for example:

cd papi/src/ctests

4) Before running PAPI with your own code, do the following:

export PAPI_DIR=<you location where PAPI is installed>
export PATH=${PAPI_DIR}/bin:$PATH

5) Instrument your code with PAPI, see PAPI Counter Interfaces.

6) Compile and run your own code. Don't forget to give it the correct path to the PAPI header and PAPI lib in your Makefile.


gcc hello_world.c -I/${PAPI_DIR}/include -L/${PAPI_DIR}/lib -o hello_world -lpapi