Page 1 of 1

Compile and use PAPI on MAC OSX 10.10.3

PostPosted: Fri Feb 13, 2015 12:03 am
by Technophobe01
Dear PAPI,

I am interesting in getting pointers on how to configure and compile PAPI on Mac OS X 10.10.3.

Has anyone done this, or have any recommendations on the correct steps to do this?

Any help would be much appreciated.

Note: I saw the following comment in the INSTALL.txt..

Other Platforms
PAPI can be compiled and installed on most platforms that have GNU compilers
regardless of operating system or hardware. This includes, for example,
Macintosh systems running recent versions of OSX. However, PAPI can only
provide access to the CPU hardware counters on platforms that are directly
supported. Unsupported platforms will run, buttony provide basic timing
functions, and potential access to some non-cpu components.

Re: Compile and use PAPI on MAC OSX 10.10.3

PostPosted: Fri Feb 13, 2015 1:59 pm
by Technophobe01
I have been able to compile Papi on MacOSX 10.10.3...

Install and setup MacPorts
Install gnu fortran

>sudo port selfupdate
>sudo port outdated
>sudo port upgrade outdated
>sudo port install gcc49
Select gcc 4.9

>port select --list gcc
>sudo port select --set gcc mp-gcc49
>cd ~/dev/papi-5.4.0/src
>cd ctests
>mvim omptough.c zero_shmem.c
#include <malloc.h>
#include <malloc/malloc.h>
save / exit
>./ (edited)

Compile is different from run fully but it does compile and execute and pass baseline tests. Appreciate comments or thoughts on execution etc.

Machine Spec:
Model Name: MacBook Pro
Model Identifier: MacBookPro10,1
Processor Name: Intel Core i7
Processor Speed: 2.7 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Memory: 16 GB

Re: Compile and use PAPI on MAC OSX 10.10.3

PostPosted: Fri Feb 13, 2015 4:10 pm
by yarkhan
When you tried to, did you get any tests that passed?

There was recently a discussion about building PAPI on a Mac (Feb 9 2015) on the papi_devel mailing list.
This may provide some insight ... 06879.html
This was in response to the message ... 06877.html

Quoting Philip Mucci
> Sadly, PAPI has never been ported to MacOS. It -has- been ported to BSD (thanks to Harald S!) , however, I don’t think the counter access methods
> are the same on OS X. I looked at this a number of years ago, so my knowledge is likely dated. Back then, you used CHUD API calls…
> And honestly, the Mac performance tools are so good (IMHO), that it wasn’t clear that PAPI (and some PAPI-based tools) were going to bring
> something valuable to the table.
> All that said, my guess is that it wouldn’t be much work to adapt the BSD code to run on OSX using some different API calls if you’re feeling
> ambitious...

Quoting Vince Weaver
> we at one point (relatively) recently fixed up OSX support enough so PAPI
> compiles and runs.
> The issue is there is no hardware counter support. So you are limited to
> using interfaces that will work w/o HW counters, which is not much.
> Our initial intent was maybe to provide support for things like reading
> RAPL counters that do MSR directly, but I don't think we ever got around
> to porting that code.
> Vince