Changes between Initial Version and Version 1 of Debugging/LowLevelProfiling/PAPI/Installing


Ignore:
Timestamp:
Nov 3, 2009 11:41:57 AM (6 years ago)
Author:
simonmar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Debugging/LowLevelProfiling/PAPI/Installing

    v1 v1  
     1
     2
     3What follows are some notes I made when I last got PAPI working on Linux.
     4
     5== Installing PAPI ==
     6
     7 * Grab PAPI and the most recent perfctr 2.6.x
     8 * Unpack both under `~/tmp`
     9
     10=== On Ubuntu ===
     11
     12Get the bits needed to build a kernel:
     13
     14 * `sudo apt-get install linux-kernel-devel fakeroot kernel-wedge kernel-package`
     15 * `sudo apt-get build-dep linux-source`
     16 * `sudo apt-get install linux-source`
     17 * This seems to get a slightly out-of-date version, but maybe that's ok
     18
     19Unpack and patch the kernel:
     20
     21 * `cd ~/tmp`
     22 * {{{tar xvjf /usr/src/linux-source-*}}}
     23 * `cd linux-source*`
     24 * Read `$perfctr/INSTALL`
     25 * `$perfctr/update-kernel` Might fail because it can't find the right patch, in which case:
     26 * `$perfctr/update-kernel --patch=2.6.22` (tell it which patch)
     27 * `make menuconfig`
     28 * Turn on `perfctr`-related stuff under "Processor type and features", "Performance-monitoring counters support".
     29   You need both "virtual" and "global" support turned on.
     30
     31Build the kernel:
     32
     33 * {{{make-kpkg --rootcmd fakeroot --initrd --append-to-version=-perfctr kernel-image kernel-headers}}}
     34 * wait a while
     35
     36Install the kernel:
     37
     38 * `cd ..`
     39 * `dpkg -i linux-image-*.deb`
     40 * `dpkg -i linux-headers-*.deb`
     41 * Copy contents of `lib/firmware/$old_kernel` to `/lib/firmware/$new_kernel` (not sure if this is right, but so
     42   far the wireless adaptor still seems fine under the new kernel, so I guess it worked)
     43 * `cd $perfctr`
     44 * {{{cp etc/perfctr.rules /etc/udev/rules.d/99-perfctr.rules}}}
     45 * Boot the new kernel
     46 * I seemed to have `perfctr` built as a module, probably selected that in menuconfig by mistake, so anyway:
     47 * `sudo modprobe perfctr`
     48 * {{{cat /proc/misc | grep perfctr}}} should now show perfctr, and you should have `/dev/perfctr`.
     49
     50Build the perfctr library:
     51
     52 * `cd $perfctr`
     53 * `make PREFIX=$HOME/local`
     54 * `make PREFIX=$HOME/local install`
     55
     56Now to build PAPI:
     57
     58 * `cd $papi`
     59 * The configure script had some trouble detecting the C compiler for me, I had to edit the configure script and re-autoconf it.   Change
     60{{{
     61if test "$OS" != "linux"; then
     62  ...
     63else
     64  AC_PROG_CC
     65  AC_PROG_F77
     66fi
     67}}}
     68to
     69{{{
     70AC_PROG_CC
     71AC_PROG_F77
     72}}}
     73
     74 * `autoconf` 
     75 * We have a choice about whether to use the `libperfctr` in the PAPI distribution, or the one that comes with `perfctr`.  The
     76   latter is probably more correct, but the former also worked for me.
     77 * `./configure --with-perfctr-prefix=$HOME/local` --prefix=$HOME/local
     78 * `make`
     79 * `./run-tests.sh` (I got about 4 failures on Core 2)
     80 * `make install`
     81
     82Now it's all built, with header files in `$HOME/local/include`, libraries in `$HOME/local/lib`.