== Basic build ==

1. Edit config.mk. Follow the comments there.
   Optionally you can change compiler settings in include_[GCC|ICC].mk.
   Please note that only the default compiler flags are supported and tested.
2. make
(2.a make likwid-bench  (if you want to build and install likwid-bench)
3. make install (this is required for likwid-pin and if you use the accessDaemon)
4. setup access to the msr device files (see end of this document)

Only the default flags set are tested. As it is not possible to test all
compiler setting variants the Intel icc compiler is only build tested. A basic
function test is done for the icc binary. The only variant fully tested is gcc
with default compiler flags. It is therefore recommended to use gcc with the
default flags. If you want to use and build the Fortran interface you can mix
GCC with the Intel Fortran Compiler. More information on this can be found in
the WIKI.

*NOTICE*

All generated files are located in the [GCC|ICC] build directory.
This includes the dependency files, object files and also the
generated source files and the pas and assembly files for likwid-bench.
If you debug your likwid-bench benchmarks you can look at all 
intermediate build files and also the final assembly code.

== Known problems ==

On very old systems with old kernels (< 2.6.7) or old glibc versions likwid
is build with reduced funtionality. This includes missing support for NUMA
and pinning. 

== Additional Targets ==

make clean     -  clean the object directory
make distclean -  clean also the executables/libraries
make uninstall -  delete installed files

== Build likwid-bench ==

To build likwid-bench you have to explicitly call:

make likwid-bench

This is because likwid-bench does not compile on 32bit systems.

== Build  accessDaemon ==

To build the accessDaemon:

1. Edit config.mk and configure path in ACCESSDAEMON variable. 
2. Set the desired default ACCESSMODE. You can overwrite this on the command line.
2. make will also build the accessDaemon
3. Install with
   make install

With the standard  make install target the daemon will also be installed in
${PREFIX}/bin . Don't forget to copy the dameon if you configured a different
path in ACCESSDAEMON.

== Setup of msr module ==

likwid-perfctr, likwid-powermeter and likwid-features require the Linux msr kernel module. This module
is part of most standard distro kernels. You have to be root to do the initial setup.

1. Check if the msr module is loaded with  'lsmod | grep msr' . There should be an output.
2. It the module is not loaded load it with  'modprobe msr' . For automatic loading at startup
consult your distros documentation how to do so.
3. Adopt access rights on the msr device files for normal user. To allow everybody access you can 
use 'chmod o+rw /dev/cpu/*/msr' . This is only recommended on save single user desktop systems.

As a general access to the msr registers is not desired on security sensitive
systems you can either implement a more sophisticated access rights settings
with e.g. setgid. A common solution used on many other device files, e.g. for
audio, is to introduce a group and make a chown on the msr device files to that
group. Now if you execute likwid-perfctr with setgid on that group the
executing user can use the tool but cannot directly write or read the msr
device files.

A secure solution is to use the accessDaemon, which encapsulates the access to
the msr device files and performs a address check for allowed registers. For
more information how to setup and use this solution have a look at the WIKI
page:

http://code.google.com/p/likwid/wiki/MSRDaemon

If you have still problems please let me know on the likwid mailing list:

http://groups.google.com/group/likwid-users





