Question

I want to instrument my UPC program with PAPI APIs to get information on hardware counters during the execution of UPC program.

But i keep getting linking errors for eg, "undefined reference to PAPI_read" undefined reference to PAPI_library_init etc

The command I'm giving is upcc -L/full/path/to/libpapi.a -o upcMatrxMultplction upcMatrxMultplction.o

Any suggestions ?

Does PAPI support UPC compiler ?

Was it helpful?

Solution

-L provides a directory, not a think to link with. you should either provide the /full/path/to/libpapi.a as a link argument (along with *.o), or else use "-L/full/path/to -lpapi". the latter is a bit more conventional.

also, linking can be order-dependent, so I prefer to list all to-link objects first and end the line with -o whatever.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top