Reading time: | 15 min |
Last updated: | 4 Oct 2023 |
Reading time: |
15 min |
Last updated: |
4 Oct 2023 |
This guide is intended to get you up and running with this tool quickly with the most common settings. For a thorough review of all options, refer to the official documentation.
Performance Application Programming Interface (PAPI) provides a consistent library of functions for accessing performance counters from an application.
You can use PAPI in your source code to access performance counters and profile specific sections of your application.
PAPI is available as source code on GitHub.
This article provides concise instructions to download, build, and install PAPI on Arm Linux distributions.
Confirm you are using an Arm machine by running:
uname -m
The output should be:
aarch64
If you see a different result, you are not using an Arm computer running 64-bit Linux.
You need gcc
and make
to build PAPI.
Use the Linux package manager to install the required software packages on your Linux distribution.
For Debian based distributions (including Ubuntu) run:
sudo apt update -y
sudo apt install -y make gcc
git clone https://github.com/icl-utk-edu/papi/
cd papi/src
./configure && make
sudo make install
#include <papi.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
// Initialize the PAPI library and print the version
int ver = PAPI_library_init(PAPI_VER_CURRENT);
printf("PAPI version is %d.%d\n", PAPI_VERSION_MAJOR(ver), PAPI_VERSION_MINOR(ver));
exit(0);
}
gcc -o papi-test papi-test.c -Wl,-rpath /usr/local/lib -lpapi
./papi-test
The output will be similar to:
PAPI version is 7.0
Your version may be slightly different but that is fine.
You are now ready to use PAPI in your own applications.
How would you rate the overall quality of this tool quick-install guide?
What is the primary reason for your feedback ?
Thank you. We're grateful for your feedback on how to improve this tool quick-install guide.