Blame INSTALL.txt

Packit Service a1973e
/* 
Packit Service a1973e
* File:    INSTALL.txt
Packit Service a1973e
* CVS:     $Id$
Packit Service a1973e
* Author:  Kevin London
Packit Service a1973e
*          london@cs.utk.edu
Packit Service a1973e
* Mods:    Dan Terpstra
Packit Service a1973e
*          terpstra@cs.utk.edu
Packit Service a1973e
* Mods:    Philip Mucci
Packit Service a1973e
*          mucci@cs.utk.edu
Packit Service a1973e
* Mods:    <your name here>
Packit Service a1973e
*          <your email address>
Packit Service a1973e
*/
Packit Service a1973e
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
HOW TO INSTALL PAPI ONTO YOUR SYSTEM
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Packit Service a1973e
On some of the systems that PAPI supports, you can install PAPI right 
Packit Service a1973e
out of the box without any additional setup. Others require drivers or 
Packit Service a1973e
patches to be installed first.
Packit Service a1973e
Packit Service a1973e
The general installation steps are below, but first find your particular 
Packit Service a1973e
Operating System's section for any additional steps that may be necessary.
Packit Service a1973e
NOTE: the configure and make files are located in the papi/src directory.
Packit Service a1973e
Packit Service a1973e
General Installation
Packit Service a1973e
Packit Service a1973e
1.	% ./configure
Packit Service a1973e
	% make
Packit Service a1973e
Packit Service a1973e
2.	Check for errors. 
Packit Service a1973e
Packit Service a1973e
	a) Run a simple test case: (This will run ctests/zero)
Packit Service a1973e
Packit Service a1973e
	% make test
Packit Service a1973e
Packit Service a1973e
	If you get good counts, you can optionally run all the test programs
Packit Service a1973e
	with the included test harness. This will run the tests in quiet mode, 
Packit Service a1973e
	which will print PASSED, FAILED, or SKIPPED. Tests are SKIPPED if the
Packit Service a1973e
	functionality being tested is not supported by that platform.
Packit Service a1973e
Packit Service a1973e
	% make fulltest (This will run ./run_tests.sh)
Packit Service a1973e
Packit Service a1973e
	To run the tests in verbose mode:
Packit Service a1973e
Packit Service a1973e
	% ./run_tests.sh -v
Packit Service a1973e
Packit Service a1973e
3.	Create a PAPI binary distribution or install PAPI directly.
Packit Service a1973e
Packit Service a1973e
	a) To install PAPI libraries and header files from the build tree:
Packit Service a1973e
Packit Service a1973e
	% make install
Packit Service a1973e
Packit Service a1973e
	b) To install PAPI manual pages from the build tree:
Packit Service a1973e
Packit Service a1973e
	% make install-man
Packit Service a1973e
Packit Service a1973e
	c) To install PAPI test programs from the build tree:
Packit Service a1973e
Packit Service a1973e
	% make install-tests
Packit Service a1973e
Packit Service a1973e
	d) To install all of the above in one step from the build tree:
Packit Service a1973e
Packit Service a1973e
	% make install-all
Packit Service a1973e
Packit Service a1973e
	e) To create a binary kit, papi-<arch>.tgz:
Packit Service a1973e
Packit Service a1973e
	% make dist
Packit Service a1973e
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
MORE ABOUT CONFIGURE OPTIONS
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Packit Service a1973e
There is an extensive array of options available from the configure 
Packit Service a1973e
command-line. These can differ significantly from version to versions of
Packit Service a1973e
PAPI. For complete details on the command-line options, use:
Packit Service a1973e
	% ./configure --help
Packit Service a1973e
Packit Service a1973e
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
DOCUMENTATION BY DOXYGEN
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Packit Service a1973e
PAPI now ships with documentation generated by doxygen.
Packit Service a1973e
Documentation for the public apis can be created by running 
Packit Service a1973e
doxygen from the doc directory. 
Packit Service a1973e
Packit Service a1973e
More complete documentation of all internal apis and structures can be 
Packit Service a1973e
generated with: 
Packit Service a1973e
	% doxygen Doxyfile-html
Packit Service a1973e
Packit Service a1973e
Doxygen documentation for the currently released version of PAPI is also
Packit Service a1973e
available on the website.
Packit Service a1973e
Packit Service a1973e
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Operating System Specific Installation Steps (In Alphabetical Order by OS)
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Packit Service a1973e
AIX - IBM POWER5 and POWER6 and POWER7
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
PAPI is supported on AIX 5.x for POWER5 and POWER6.
Packit Service a1973e
PAPI is also tested on AIX 6.1 for POWER7.
Packit Service a1973e
Use ./configure to select the desired make options for your system, 
Packit Service a1973e
specifying the --with_bitmode=32 or --with-bitmode=64 to select wordlength.
Packit Service a1973e
32 bits is the default.
Packit Service a1973e
Packit Service a1973e
1.	On AIX 5.x, the bos.pmapi is a product level fileset (part of the OS).
Packit Service a1973e
	However, it is not installed by default. Consult your sysadmin to 
Packit Service a1973e
	make sure it is installed. 
Packit Service a1973e
2.	Follow the general instructions for installing PAPI.
Packit Service a1973e
Packit Service a1973e
WARNING: PAPI requires XLC version 6 or greater.
Packit Service a1973e
Your version can be determined by running 'lslpp -a -l | grep -i xlc'.
Packit Service a1973e
Packit Service a1973e
BG/P
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
BG/P is a cross-compiled environment. The machine on which PAPI is compiled
Packit Service a1973e
is not the machine on which PAPI runs. To compile PAPI on BG/P, specify the
Packit Service a1973e
BG/P environment as shown below:
Packit Service a1973e
Packit Service a1973e
	% ./configure --with-OS=bgp
Packit Service a1973e
	% make
Packit Service a1973e
	
Packit Service a1973e
NOTE: ./configure might fail if the cross compiler is not in your path.
Packit Service a1973e
	 If that is the case, just add it to your path and everything should work:
Packit Service a1973e
Packit Service a1973e
	% export PATH=$PATH:/bgsys/drivers/ppcfloor/gnu-linux/bin
Packit Service a1973e
Packit Service a1973e
By default this will make a subset of tests in the ctests directory and all
Packit Service a1973e
 tests in the ftests directory.
Packit Service a1973e
Packit Service a1973e
There is an additional C test program provided for the BG/P environment
Packit Service a1973e
that exercises the specific BG/P events and demonstrates how to
Packit Service a1973e
intermix the PAPI and BG/P UPC native calls. This test program is built with
Packit Service a1973e
the normal make sequence and can be found in the ctests/bgp directory.
Packit Service a1973e
Packit Service a1973e
The testing targets in the make file will not work in the BG/P environment.
Packit Service a1973e
Since BG/P supports multiple queuing systems, you must manually execute
Packit Service a1973e
individual programs in the ctests and ftests directories to check for successful
Packit Service a1973e
library creation. You can also manually edit the run_tests.sh script to
Packit Service a1973e
automate testing for your installation.
Packit Service a1973e
Packit Service a1973e
Most papi utilities work for BGP, including papi_avail, papi_native_avail, and
Packit Service a1973e
papi_command_line. Many ctests pass for BGP, but many others produce errors due
Packit Service a1973e
to the non-traditional architecture of BGP. In particular, PAPI_TOT_CYC always
Packit Service a1973e
seems to produce 0 counts, although papi_get_virt_usec and papi_get_real_usec
Packit Service a1973e
appear to work.
Packit Service a1973e
Packit Service a1973e
The IBM RedPaper: http://www.redbooks.ibm.com/abstracts/redp4256.html provides
Packit Service a1973e
further discussion about PAPI on BGP along with other performance issues.
Packit Service a1973e
Packit Service a1973e
BG/Q
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Five new components have been added to PAPI to support hardware performance 
Packit Service a1973e
monitoring for the BG/Q platform; in particular the BG/Q network, the I/O system,
Packit Service a1973e
the Compute Node Kernel in addition to the processing core. There are no specific
Packit Service a1973e
component configure scripts for L2unit, IOunit, NWunit, CNKunit. In order to
Packit Service a1973e
configure PAPI for BG/Q, use the following configure options at the papi/src level:
Packit Service a1973e
% ./configure --prefix=< your_choice >  \
Packit Service a1973e
			  --with-OS=bgq  \
Packit Service a1973e
			  --with-bgpm_installdir=/bgsys/drivers/ppcfloor  \
Packit Service a1973e
			  CC=/bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc64-bgq-linux-gcc  \
Packit Service a1973e
			  F77=/bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc64-bgq-linux-gfortran  \
Packit Service a1973e
			  --with-components="bgpm/L2unit bgpm/CNKunit bgpm/IOunit bgpm/NWunit"
Packit Service a1973e
Packit Service a1973e
CLE - Cray XT and XE Opteron
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
The Cray XT/XE is a cross-compiled environment. You must specify the
Packit Service a1973e
perfmon version to configure as shown below.
Packit Service a1973e
Packit Service a1973e
Before running configure to create the makefile that supports a Cray XT/XE CLE
Packit Service a1973e
build of PAPI, execute the following module commands:
Packit Service a1973e
    % module purge
Packit Service a1973e
    % module load gcc
Packit Service a1973e
Note: do not load the programming environment module (e.g. PrgEnv-gnu)
Packit Service a1973e
but the compiler module (e.g. gcc) as shown above.
Packit Service a1973e
Packit Service a1973e
Check CLE compute nodes for the version of perfmon2 that it supports:
Packit Service a1973e
    % aprun -b -a xt cat /sys/kernel/perfmon/version
Packit Service a1973e
Packit Service a1973e
and use this version when configuring PAPI for a perfmon2 substrate:
Packit Service a1973e
    % configure CFLAGS="-D__crayxt" \
Packit Service a1973e
	--with-perfmon=2.82 --prefix=<install-dir> \
Packit Service a1973e
	--with-virtualtimer=times --with-tls=__thread \
Packit Service a1973e
	--with-walltimer=cycle --with-ffsll --with-shared-lib=no \
Packit Service a1973e
	--with-static-tools
Packit Service a1973e
Packit Service a1973e
Configure PAPI for a perf events substrate:
Packit Service a1973e
    % configure CFLAGS="-D__crayxt" \
Packit Service a1973e
        --with-perf-events --with-pe-incdir=<perf-events-hdr-dir> \
Packit Service a1973e
        --with-assumed-kernel=2.6.34 --prefix=<install-dir> \
Packit Service a1973e
        --with-virtualtimer=times --with-tls=__thread \
Packit Service a1973e
        --with-walltimer=cycle --with-ffsll --with-shared-lib=no \
Packit Service a1973e
        --with-static-tools
Packit Service a1973e
Packit Service a1973e
Invoke the make accordingly:
Packit Service a1973e
    % make CONFIG_PFMLIB_ARCH_CRAYXT=y CONFIG_PFMLIB_SHARED=n
Packit Service a1973e
    % make CONFIG_PFMLIB_ARCH_CRAYXT=y CONFIG_PFMLIB_SHARED=n install
Packit Service a1973e
Packit Service a1973e
The testing targets in the makefile will not work in the XT/XE CLE environment.
Packit Service a1973e
It is necessary to log into an interactive session and run the tests
Packit Service a1973e
manually through the job submission system. For example, instead of:
Packit Service a1973e
    % make test
Packit Service a1973e
use:
Packit Service a1973e
    % aprun -n1 ctests/zero
Packit Service a1973e
and instead of:
Packit Service a1973e
    % make fulltest
Packit Service a1973e
use:
Packit Service a1973e
    % ./run_cat_tests.sh
Packit Service a1973e
after substituting "aprun -n1" for "yod -sz 1" in run_cat_tests.sh.
Packit Service a1973e
Packit Service a1973e
FreeBSD - i386 & amd64
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
PAPI requires FreeBSD 6 or higher to work.
Packit Service a1973e
Packit Service a1973e
Kernel needs some modifications to provide PAPI access to the performance 
Packit Service a1973e
monitoring counters. Simply, add "options HWPMC_HOOKS" and "device hwpmc" in
Packit Service a1973e
the kernel configuration file. For i386 systems, add also "device apic".
Packit Service a1973e
(You can obtain more information in hwpmc(4), see NOTE 1 to check the
Packit Service a1973e
supported HW)
Packit Service a1973e
Packit Service a1973e
After this step, just recompile the kernel and boot it.
Packit Service a1973e
Packit Service a1973e
FreeBSD 7 (or greater) does not ship with a fortran compiler. To compile
Packit Service a1973e
fortan tests you will need to install a fortran compiler first (e.g.
Packit Service a1973e
installing it from /usr/ports/lang/gcc42), and setup the F77 environment
Packit Service a1973e
variable with the compiler you want to use (e.g. gfortran42). 
Packit Service a1973e
Packit Service a1973e
Fortran compilers may issue errors due to "Integer too big for its kind *".
Packit Service a1973e
Add to FFLAGS environment variable a compiler option to use int*8 by default
Packit Service a1973e
(in gfortran42 it is -fdefault-integer-8).
Packit Service a1973e
Packit Service a1973e
Follow the "General Installation" steps.
Packit Service a1973e
Packit Service a1973e
NOTE 1: 
Packit Service a1973e
--
Packit Service a1973e
HWPMC driver supports the following processors: Intel Pentium 2,
Packit Service a1973e
Intel Pentium Pro, Intel Pentium 3, Intel Pentium M, Intel Celeron,
Packit Service a1973e
Intel Pentium 4, AMD K7 (AMD Athlon) and AMD K8 (AMD Athlon64 / Opteron).
Packit Service a1973e
Packit Service a1973e
FreeBSD 8 also adds support for Core/Core2/Core-i[357]/Atom processors.
Packit Service a1973e
There is also a patch for FreeBSD 7/7.1 in http://wiki.freebsd.org/PmcTools
Packit Service a1973e
Packit Service a1973e
Linux - Xeon Phi [MIC, KNC, Knight's Corner]
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Full PAPI support of the MIC card requires MPSS Gold Update 2 or above, and a
Packit Service a1973e
cross-compilation toolchain from Intel, the Intel C compiler is also
Packit Service a1973e
supported.
Packit Service a1973e
Packit Service a1973e
The compiler
Packit Service a1973e
-----------------------------------------------------------------------------
Packit Service a1973e
* Download one of the MPSS full source bundles at
Packit Service a1973e
	[http://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss]
Packit Service a1973e
* Untar the download. 
Packit Service a1973e
* Extract gpl/package-cross-k1om.tar.bz2
Packit Service a1973e
Packit Service a1973e
Building PAPI - gcc cross compiler
Packit Service a1973e
-----------------------------------------------------------------------------
Packit Service a1973e
* Add usr/linux-k1om-4.7/bin or equivalent to your PATH so PAPI can find the
Packit Service a1973e
	cross-build utils. (see above for instructions on acquiring the cross
Packit Service a1973e
	compilation toolchain)
Packit Service a1973e
* You will need to invoke configure with options:
Packit Service a1973e
	> ./configure --with-mic --host=x86_64-k1om-linux --with-arch=k1om
Packit Service a1973e
Packit Service a1973e
	This sets up cross-compilation and sets options needed by PAPI.
Packit Service a1973e
* Run make to build the library.
Packit Service a1973e
Packit Service a1973e
Building PAPI - icc
Packit Service a1973e
-----------------------------------------------------------------------------
Packit Service a1973e
If icc is in your path,
Packit Service a1973e
    > ./configure --with-mic
Packit Service a1973e
You may have to provide additional configuration options... try
Packit Service a1973e
    > ./configure --with-mic --with-ffsll --with-walltimer=cycle --with-tls=__thread --with-virtualtimer=clock_thread_cputime_id 
Packit Service a1973e
This builds a mic native version of the library. 
Packit Service a1973e
Packit Service a1973e
Offload Code
Packit Service a1973e
------------
Packit Service a1973e
To use PAPI in MIC offload code, build a mic-native version of PAPI 
Packit Service a1973e
as detailed above. 
Packit Service a1973e
Packit Service a1973e
The PAPI utility programs can be run on the MIC using the
Packit Service a1973e
micnativeloadex tool provided by Intel.  The MIC events may require
Packit Service a1973e
additional qualifiers to set the exclude_guest and exclude_host bits
Packit Service a1973e
to 0 (eventname:mg=1:mh=1).  For example, get a list of events
Packit Service a1973e
available on the MIC by calling:
Packit Service a1973e
micnativeloadex ./utils/papi_native_avail 
Packit Service a1973e
Then get an event count while setting the appropriate qualifiers
Packit Service a1973e
micnativeloadex ./utils/papi_command_line -a "CPU_CLK_UNHALTED:mg=1:mh=1"
Packit Service a1973e
Packit Service a1973e
To add offload code into your program, wrap the papi.h header as
Packit Service a1973e
follows:
Packit Service a1973e
#pragma offload_attribute (push,target(mic)) 
Packit Service a1973e
#include "papi.h" 
Packit Service a1973e
#pragma offload_attribute (pop)
Packit Service a1973e
Packit Service a1973e
Make PAPI calls from offload code as normal.
Packit Service a1973e
Packit Service a1973e
Finally add -offload-option,mic,ld,$(path_to_papi)/libpapi.a
Packit Service a1973e
to your compile incantation or if that does not recognise papi library try
Packit Service a1973e
-offload-option,mic,compiler,"-lpapi -L<path/to dir containing libpapi.a>" to
Packit Service a1973e
your compile incantation
Packit Service a1973e
Packit Service a1973e
Packit Service a1973e
Packit Service a1973e
Linux - Itanium II & Montecito
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
PAPI on Itanium Linux links to the perfmon library. The library version and 
Packit Service a1973e
the Itanium version are automatically determined by configure.
Packit Service a1973e
If you wish to override the defaults, a number of pfm options are available
Packit Service a1973e
to configure. Use:
Packit Service a1973e
	% ./configure --help
Packit Service a1973e
to learn more about these options.
Packit Service a1973e
Packit Service a1973e
Follow the general installation instructions to complete your installation.
Packit Service a1973e
Packit Service a1973e
PLATFORM NOTES:
Packit Service a1973e
The earprofile test fails under perfmon for Itanium II. It has been
Packit Service a1973e
reconfigured to work on the upcoming perfmon2 interface.
Packit Service a1973e
Packit Service a1973e
Linux - PPC64 (POWER5, POWER5+, POWER6 and PowerPC970)
Packit Service a1973e
****************************************************************************
Packit Service a1973e
Linux/PPC64 requires that the kernel be patched and recompiled with the
Packit Service a1973e
PerfCtr patch if the kernel is version 2.6.30 or older. The required patches 
Packit Service a1973e
and complete installation instructions are provided in the 
Packit Service a1973e
papi/src/perfctr-2.7.x directory. PPC64 is the ONLY platform that REQUIRES 
Packit Service a1973e
use of PerfCtr 2.7.x.
Packit Service a1973e
Packit Service a1973e
*- IF YOU HAVE ALREADY PATCHED YOUR KERNEL AND/OR INSTALLED PERFCTR -*
Packit Service a1973e
Packit Service a1973e
WARNING: You should always use a PerfCtr distribution that has been distributed
Packit Service a1973e
with a version of PAPI or your build will fail. The reason for this is that
Packit Service a1973e
PAPI builds a shared library of the Perfctr runtime, on which libpapi.so
Packit Service a1973e
depends. PAPI also depends on the .a file, which it decomposes into component
Packit Service a1973e
objects files and includes in the libpapi.a file for convenience. If you
Packit Service a1973e
install a new perfctr, even a shared library, YOU MUST REBUILD PAPI to get
Packit Service a1973e
a proper, working libpapi.a.
Packit Service a1973e
Packit Service a1973e
There are several options in configure to allow you to specify your perfctr 
Packit Service a1973e
version and location. Use:
Packit Service a1973e
	% ./configure --help
Packit Service a1973e
to learn more about these options.
Packit Service a1973e
Packit Service a1973e
Follow the general installation instructions to complete your installation.
Packit Service a1973e
Packit Service a1973e
Linux Perf Events ( with kernel 2.6.32 and newer )
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Packit Service a1973e
Performance counter support has been merged as the "Perf Events"
Packit Service a1973e
subsystem as of Linux 2.6.32.  This means that PAPI can be built
Packit Service a1973e
without patching the kernel on new enough systems.
Packit Service a1973e
Packit Service a1973e
Perf Events support is new, and certain functionality does not work.
Packit Service a1973e
If you need any of the functionality listed below, we recommend
Packit Service a1973e
you install the PerfCtr patchset and use that in conjunction with PAPI.
Packit Service a1973e
Packit Service a1973e
   + PAPI requires at least Linux kernel 2.6.32, as the earlier 2.6.31
Packit Service a1973e
     version had some significant API changes.
Packit Service a1973e
   + Kernels before 2.6.33 have extra overhead when determining
Packit Service a1973e
     whether events conflict or not.
Packit Service a1973e
   + Counter multiplexing is handled by PAPI (rather than perf_events) 
Packit Service a1973e
     on kernels before 2.6.33 due to a bug in the kernel perf_events code.
Packit Service a1973e
   + Nehalem EX support requires kernel 2.6.34 or newer.
Packit Service a1973e
   + Pentium 4 support requires kernel 2.6.35 or newer.
Packit Service a1973e
Packit Service a1973e
The PAPI configure script should auto-detect the availability of
Packit Service a1973e
Perf Events on new enough distributions (this mainly requires
Packit Service a1973e
that perf_event.h be available in /usr/include/linux)
Packit Service a1973e
Packit Service a1973e
On older distributions (even ones that include the 2.6.32 kernel) 
Packit Service a1973e
the perf_event.h file might not be there.  One fix is to install
Packit Service a1973e
your distributions linux kernel headers package, which is often
Packit Service a1973e
an optional package not installed by default.
Packit Service a1973e
Packit Service a1973e
If you cannot install the kernel headers, you can obtain the
Packit Service a1973e
perf_event.h file from your kernel and run configure as such:
Packit Service a1973e
   ./configure --with-pe-incdir=INCDIR
Packit Service a1973e
replacing INCDIR with the directory that perf_event.h is in.
Packit Service a1973e
Packit Service a1973e
Packit Service a1973e
Linux PerfCtr (requires patching the kernel)
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
When using Linux kernels before 2.6.32 the kernel must be patched with
Packit Service a1973e
the PerfCtr patch set.  (This patchset can also be used on more recent
Packit Service a1973e
kernels if the support provided by Perf Events is not enough for your
Packit Service a1973e
workload). The required patches and complete installation instructions 
Packit Service a1973e
are provided in the papi/src/perfctr-x.y directory. Please see the INSTALL 
Packit Service a1973e
file in that directory.
Packit Service a1973e
Packit Service a1973e
Do not forget, you also need to build your kernel with APIC support in order
Packit Service a1973e
for hardware overflow to work. This is very important for accurate statistical
Packit Service a1973e
profiling ala gprof via the hardware counters.
Packit Service a1973e
Packit Service a1973e
So, when you configure your kernel to build with PERFCTR as above, make
Packit Service a1973e
sure you turn on APIC support in the "Processor type and features" section.
Packit Service a1973e
This should be enabled by default if you are on an SMP, but it is disabled
Packit Service a1973e
by default on a UP. 
Packit Service a1973e
Packit Service a1973e
In our 2.4.x kernels:
Packit Service a1973e
> grep PIC /usr/src/linux/.config
Packit Service a1973e
/usr/src/linux/.config:CONFIG_X86_GOOD_APIC=y
Packit Service a1973e
/usr/src/linux/.config:CONFIG_X86_UP_APIC=y
Packit Service a1973e
/usr/src/linux/.config:CONFIG_X86_UP_IOAPIC=y
Packit Service a1973e
/usr/src/linux/.config:CONFIG_X86_LOCAL_APIC=y
Packit Service a1973e
/usr/src/linux/.config:CONFIG_X86_IO_APIC=y
Packit Service a1973e
Packit Service a1973e
You can verify the APIC is working after rebooting with the new kernel
Packit Service a1973e
by running the 'perfex -i' command found in the perfctr/examples/perfex
Packit Service a1973e
directory.
Packit Service a1973e
Packit Service a1973e
PAPI on x86 assumes PerfCtr 2.6.x. NOTE: THE VERSIONS OF PERFCTR DO NOT 
Packit Service a1973e
CORRESPOND TO LINUX KERNEL VERSIONS.
Packit Service a1973e
Packit Service a1973e
*- IF YOU HAVE ALREADY PATCHED YOUR KERNEL AND/OR INSTALLED PERFCTR -*
Packit Service a1973e
Packit Service a1973e
WARNING: You should always use a PerfCtr distribution that has been distributed
Packit Service a1973e
with a version of PAPI or your build may fail. Newer versions with backward
Packit Service a1973e
compatibility may also work. PAPI builds a shared library of the Perfctr 
Packit Service a1973e
runtime, on which libpapi.so depends. PAPI also depends on the .a file, 
Packit Service a1973e
which it decomposes into component objects files and includes in the libpapi.a 
Packit Service a1973e
file for convenience. If you install a new PerfCtr, even a shared library, 
Packit Service a1973e
YOU MUST REBUILD PAPI to get a proper, working libpapi.a. 
Packit Service a1973e
Packit Service a1973e
There are several options in configure to allow you to specify your perfctr 
Packit Service a1973e
version and location. Use:
Packit Service a1973e
	% ./configure --help
Packit Service a1973e
to learn more about these options.
Packit Service a1973e
Packit Service a1973e
Follow the general installation instructions to complete your installation.PERFCT
Packit Service a1973e
Packit Service a1973e
*- IF PERFCTR IS INSTALLED BUT PAPI FAILS TO INITIALIZE -*
Packit Service a1973e
Packit Service a1973e
You may be running udev, which is not smart enough to know the permissions of 
Packit Service a1973e
dynamically created devices. To fix this, find your udev/devices directory, 
Packit Service a1973e
often /lib/udev/devices or /etc/udev/devices and perform the following actions:
Packit Service a1973e
Packit Service a1973e
 mknod perfctr c 10 182
Packit Service a1973e
 chmod 644 perfctr
Packit Service a1973e
Packit Service a1973e
On Ubuntu 6.06 (and probably other debian distros),  add a line to 
Packit Service a1973e
/etc/udev/rules.d/40-permissions.rules like this:
Packit Service a1973e
Packit Service a1973e
KERNEL=="perfctr", MODE="0666"
Packit Service a1973e
Packit Service a1973e
On SuSE, you may need to add something like the following to
Packit Service a1973e
/etc/udev/rules.d/50-udev-default.rules:
Packit Service a1973e
 (SuSE does not have the 40-permissions.rules file in it.]
Packit Service a1973e
Packit Service a1973e
# cpu devices
Packit Service a1973e
KERNEL=="cpu[0-9]*",            NAME="cpu/%n/cpuid"
Packit Service a1973e
KERNEL=="msr[0-9]*",            NAME="cpu/%n/msr"
Packit Service a1973e
KERNEL=="microcode",            NAME="cpu/microcode", MODE="0600"
Packit Service a1973e
KERNEL=="perfctr",              NAME="perfctr", MODE="0644"
Packit Service a1973e
Packit Service a1973e
These lines tell udev to always create the device file with the appropriate permissions.
Packit Service a1973e
Use 'perfex -i' from the perfctr distribution to test this fix.
Packit Service a1973e
Packit Service a1973e
PLATFORM NOTES:
Packit Service a1973e
Opteron fails the matrix-hl test because the default definition of PAPI_FP_OPS
Packit Service a1973e
overcounts speculative floating point operations.
Packit Service a1973e
Packit Service a1973e
Solaris 8 - Ultrasparc
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
The only requirement for Solaris is that you must be running version 2.8 or 
Packit Service a1973e
newer.  As long as that requirement is met, no additional steps are required 
Packit Service a1973e
to install PAPI and you can follow the general installation guide.
Packit Service a1973e
Packit Service a1973e
Solaris 10 - UltraSPARC T2/Niagara 2
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
PAPI supports the Niagara 2 on Solaris 10. The substrate offers support for 
Packit Service a1973e
common basic operations like adding/reading/etc and the advanced features 
Packit Service a1973e
multiplexing (see below), overflow handling and profiling. The implementation 
Packit Service a1973e
for Solaris 10 is based on libcpc 2, which offers access to the underlying 
Packit Service a1973e
performance counters. Performance counters for the UltraSPARC architecture 
Packit Service a1973e
are described in the UltraSPARC architecture manual in general with detailed 
Packit Service a1973e
descriptions in the actual processor manual. In case of this substrate the 
Packit Service a1973e
documentation for performance counters can be found at:
Packit Service a1973e
Packit Service a1973e
 - http://www.opensparc.net/publications/specifications/
Packit Service a1973e
Packit Service a1973e
In order to install PAPI on this platform make sure the packages SUNWcpc and
Packit Service a1973e
SUNWcpcu are installed. For the compilation Sun Studio 12 was used while the
Packit Service a1973e
substrate has been developed. GNU GCC has not been tested and would require
Packit Service a1973e
to modify the makefiles Makefile.solaris-niagara2 (32 bit) and
Packit Service a1973e
Makefile.solaris-niagara2-64bit (64 bit).
Packit Service a1973e
Packit Service a1973e
The steps required for installation are as follows:
Packit Service a1973e
Packit Service a1973e
	./configure --with-bitmode=[32|64] --prefix=/is/optional
Packit Service a1973e
	
Packit Service a1973e
		If no --with-bitmode parameter is present a default of
Packit Service a1973e
		32 bit is assumed.
Packit Service a1973e
Packit Service a1973e
		If no --prefix is used, a default of /usr/local is assumed.
Packit Service a1973e
Packit Service a1973e
	make
Packit Service a1973e
	make install
Packit Service a1973e
Packit Service a1973e
If you want to link your application against your installation you should
Packit Service a1973e
make sure to include at least the following linker options:
Packit Service a1973e
Packit Service a1973e
	-lpapi -lcpc
Packit Service a1973e
Packit Service a1973e
PLEASE NOTE: This is the first revision of Niagara 2/libcpc 2/Solaris 10
Packit Service a1973e
support and needs further testing! Contributions, especially for the preset
Packit Service a1973e
definitions, would be very appreciated.
Packit Service a1973e
Packit Service a1973e
MULTIPLEXING: As the Niagara 2 offers no native event to count the cycles
Packit Service a1973e
elapsed, a "synthetic event" was created offering access to the cycle count.
Packit Service a1973e
This event is neither as accurate as the native events, nor it should be
Packit Service a1973e
used for anything else than the multiplexing mode, which needs the cycle
Packit Service a1973e
count in order to work. Therefore multiplexing and the preset PAPI_TOT_CYC
Packit Service a1973e
should be only used with caution. BEWARE OF WRONG COUNTER RESULTS!
Packit Service a1973e
Packit Service a1973e
Windows XP/2000/Server 2003 - Intel Pentium III or AMD Athlon / Opteron
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Please use PAPI 3.7 (http://icl.cs.utk.edu/projects/papi/downloads/papi-3.7.2.tar.gz)
Packit Service a1973e
Packit Service a1973e
The Windows source tree comes with Microsoft Visual Studio Version 8 projects
Packit Service a1973e
to build a graphical shell application, the PAPI library as a DLL, a kernel 
Packit Service a1973e
driver to provide access to the counters, and a collection of C test programs.
Packit Service a1973e
Packit Service a1973e
The WinPMC driver must be installed with administrator privileges. See the 
Packit Service a1973e
winpmc.html file in the papi/win2k/winpmc directory for details on building 
Packit Service a1973e
and installing this driver.
Packit Service a1973e
Packit Service a1973e
The general installation instructions are irrelevant for Windows.
Packit Service a1973e
Packit Service a1973e
Other Platforms
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
PAPI can be compiled and installed on most platforms that have GNU compilers 
Packit Service a1973e
regardless of operating system or hardware. This includes, for example, 
Packit Service a1973e
Macintosh systems running recent versions of OSX. However, PAPI can only 
Packit Service a1973e
provide access to the CPU hardware counters on platforms that are directly 
Packit Service a1973e
supported. Unsupported platforms will run, buttony provide basic timing 
Packit Service a1973e
functions, and potential access to some non-cpu components.
Packit Service a1973e
Packit Service a1973e
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
CREATING AND RUNNING COMPONENTS
Packit Service a1973e
*****************************************************************************
Packit Service a1973e
Packit Service a1973e
Basic instructions on how to create a new component can be found in 
Packit Service a1973e
src/components/README. The components directory contains several components 
Packit Service a1973e
developed by the PAPI team along with a simple yet functional "example" 
Packit Service a1973e
component which can be used as a guide to aid third-party developers. 
Packit Service a1973e
Assuming components are developed according to the specified guidelines, 
Packit Service a1973e
they will function within the PAPI framework without requiring any changes 
Packit Service a1973e
to PAPI source code.
Packit Service a1973e
Packit Service a1973e
Before running any component that requires configuration, the configure 
Packit Service a1973e
script for that component must be executed in order to generate the 
Packit Service a1973e
Makefile which contains the configuration settings. Normally, the script 
Packit Service a1973e
will only need to be executed once. Depending on the component, configure 
Packit Service a1973e
may require that one or more configuration settings be specified by the user.
Packit Service a1973e
Packit Service a1973e
The components to be added to PAPI are specified during the configuration of
Packit Service a1973e
PAPI by adding the --with-components=<component list> command line option to
Packit Service a1973e
configure. For example, to add the acpi, lustre, and net components, the 
Packit Service a1973e
option would be:
Packit Service a1973e
   	% ./configure --with-components="acpi lustre net"
Packit Service a1973e
Packit Service a1973e
Attempting to add a component to PAPI which requires configuration and has 
Packit Service a1973e
not been configured will result in a compilation error because the PAPI 
Packit Service a1973e
build environment will be unable to find the Makefile for that component.