Installing IgProf

Installing IgProf via yum /apt (experimental)

For user of Centos7 / CERN Centos 7 / Ubuntu 14.04 we now provide experimental binary repositories, courtesy of

For YUM (e.g. Centos7) based systems you can use:

curl -o /etc/yum.repos.d/igprof.repo
yum update
yum install igprof

For APT (e.g. Ubuntu) based systems you can use:

echo "deb trusty main" | sudo tee -a /etc/apt/sources.list
apt-get update
apt-get install igprof

If you have any problem, please open an issue.

Building IgProf from sources

Building igprof requires recent libatomic_ops and libunwind, plus recent autotools and cmake 2.8.x or later for the build itself, but not running. The recipe below includes a temporary build of cmake, but if your system supplies it, you can safely omit building cmake.

We have verified igprof works on the following platforms, where we routinely use it ourselves. There is a reasonable probability igprof will work out of the box on other relatively recent linux distributions, but we have not verified this.

If you are a docker fan, you can try to use the prebuild docker image at igprof/igprof.

The build recipe itself is:

# Set up one environment variable to simplify the build recipe;
# no need to 'export' this, it's just a shortcut for path names.
INSTAREA=/x/y/z   # Wherever you want to install the software

# Get the source tarballs for libatomic_ops, libunwind and igprof
wget -Oigprof-$IGPROF_VERSION.tar.gz$IGPROF_VERSION.tar.gz

# Get a recent version of cmake

# Build libatomic
gtar xzvf libatomic_ops-$LIBATOMIC_VERSION.tar.gz
cd libatomic_ops-$LIBATOMIC_VERSION
./configure --prefix=$INSTAREA
make -j 10 install
cd ../

# Build libunwind
gtar xzf libunwind-$LIBUNWIND_VERSION.tar.gz
./configure CPPFLAGS="-I$INSTAREA/include" CFLAGS="-g -O3" --prefix=$INSTAREA --disable-block-signals
make -j 10 install
cd ../

# Build cmake
gtar xzf cmake-$CMAKE_VERSION.tar.gz
mkdir -p $INSTAREA/tmpcmake
./configure --prefix=$INSTAREA/tmpcmake --parallel=10
make -j 10
make -j 10 install
cd ../
export PATH=$INSTAREA/tmpcmake/bin:$PATH

# Build igprof
gtar xzf igprof-$IGPROF_VERSION.tar.gz
# In case you want to develop:
# git clone
# cd igprof
make -j 10
make -j 10 install
cd ../

# Clean up the temporary cmake build
rm -fR $INSTAREA/tmpcmake

At this point should be able to set up PATH and LD_LIBRARY_PATH to point to the $INSTAREA and begin to use igprof. Here is a simple example (used as a tutorial to demonstrate problems) which you can use quickly to verify that igprof is set up:

// Store in a file
// Compile: c++ -o vvvi-build-and-copy -ldl -lpthread
#include <vector>
#include <string>
#include <dlfcn.h>

int main (int, char **)
  union { void *ptr; void (*dump)(const char *tofile); } u;
  u.ptr = dlsym(0, "igprof_dump_now");

  typedef std::vector<int> VI;
  typedef std::vector<VI> VVI;
  std::vector<VVI> vvvi, vvvi2;
  for (int i = 0, j, k; i < 10; ++i)
    for (vvvi.push_back(VVI()), j = 0; j < 10; ++j)
      for (vvvi.back().push_back(VI()), k = 0; k < 10; ++k)

  if (u.dump) u.dump("|gzip -9c > ig-vvvi-build.gz");

  vvvi2 = vvvi;
  if (u.dump) u.dump("|gzip -9c > ig-vvvi-copy.gz");
  return vvvi2.size();

If you run:

igprof -mp -z -o ig-vvvi-build-and-copy.gz ./vvvi-build-and-copy

You should see that three profile statistics files have been written:

You can produce a report (for example) from the end-of-job profile statistics with:

igprof-analyse -d -v -g -r MEM_TOTAL ig-vvvi-build-and-copy.gz > vvvibc.res

If you then look at vvvibc.res, you should see something like:

Flat profile (cumulative >= 1%)

% total     Total     Calls  Function
  100.0    42'934     1'091  <spontaneous> [1]
  100.0    42'934     1'091  _start [2]
  100.0    42'934     1'091  __libc_start_main [3]
  100.0    42'934     1'091  main [4]
<... and so on ...>

If you have gotten to this point, your igprof installation should be set up correctly and you should proceed to the full documentation of how to run igprof.