PAPI_library_init(3)
π PAPI_library_init(3) β from the PAPI manual, bestie π
π NAME π
PAPI_library_init β initialize the PAPI library. That's the whole assignment, and honestly? iconic. π
β¨ SYNOPSIS β¨
okay so this page's synopsis is short and sweet: it hands you straight to the Detailed Description below. No extra signature line, just the full tea. π
π¦ Detailed Description π¦
π Parameters π
versionβ upon initialization, PAPI checks the argument against the internal value ofPAPI_VER_CURRENTwhen the library was compiled. This guards against portability problems when updating the PAPI shared libraries on your system. π‘οΈ
π Return values π
PAPI_EINVALβpapi.his different from the version used to compile the PAPI library.PAPI_ENOMEMβ insufficient memory to complete the operation.PAPI_ECMPβ this component does not support the underlying hardware.PAPI_ESYSβ a system or C library call failed inside PAPI, see theerrnovariable.
PAPI_library_init() initializes the PAPI library. PAPI_is_initialized() does the check for initialization. It must be called before any low level PAPI functions can be used.
π¨ thread bestie check: if your application is making use of threads,PAPI_thread_initmust also be called prior to making any calls to the library other thanPAPI_library_init().
π§ Examples π§
okay bestie, here's the exact code from the page β copy it verbatim, no improvising:
int retval;
retval = PAPI_library_init(PAPI_VER_CURRENT);
if (retval != PAPI_VER_CURRENT && retval > 0) {
fprintf(stderr,"PAPI library version mismatch!\en");
exit(1); }
if (retval < 0)
handle_error(retval);
retval = PAPI_is_initialized();
if (retval != PAPI_LOW_LEVEL_INITED)
handle_error(retval)
π See also π
PAPI_thread_initPAPI
π Author π
Generated automatically by Doxygen for PAPI from the source code.
π Footer check: PAPI manual version 7.2.0.0, dated Wed Jun 25 2025 19:30:48, page PAPI_library_init(3). Bye bestie, mwah! π
π¦ where this page comes from
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- ubuntu resolute: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- ubuntu stonking: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms