Cilk Plus Installation Guide

From SuperTech Wiki

Jump to: navigation, search

Intel provides a suite of tools for programming Cilk-based programs. The tool set contains the Intel compiler ICC, the parallelism checker Cilkview, the race condition reporter Cilkscreen, the binary-level instrumentation gadget Pintool, the fine-level instrumentation tool Cilkprof. Here is a guide to install them on Linux.

  • Installation
  1. Install ICC or GCC: You need a license from Intel® in order to install ICC. A free, open-source version is available in the cilkplus branch of GCC.
    • Installing ICC: These instructions assume your shell is bash and you are installing ICC on a 64-bit machine.
    1. Go to http://software.intel.com/en-us/articles/intel-software-evaluation-center/.
    2. Select "Intel® C++ Composer XE 2011 for Linux" (or any Linux product suite listed as containing "Intel® C++ Composer XE") and download the 64-bit version.
    3. Unpack the downloaded file and run $ /path/to/unpacked/file/install.sh. To allow all users to access ICC on the system, run this install script as root.
    4. Follow the on-screen instructions to install ICC.
    5. To set up your environment variables to use ICC, run $ source /path/to/intel/bin/compilervars.sh intel64.
    • Installing GCC: These instructions walk you through checking out and building the cilkplus branch of GCC. Complete instructions for building GCC from source can be found at http://gcc.gnu.org/install/index.html. These instructions will install GCC into a custom directory, gcc-cilk, so as not to overwrite the existing version of GCC on your system. As a warning, this process takes a while and uses a couple gigabytes of space.
    1. Check out the latest version of the cilkplus branch of gcc by typing $ svn checkout http://gcc.gnu.org/svn/gcc/branches/cilkplus gcc-cilk-src in a terminal.
    2. Create two new directories, gcc-cilk-obj and gcc-cilk, in the same directory containing gcc-cilk-src: $ mkdir gcc-cilk-obj gcc-cilk.
    3. Install gmp, mpfr, and mpc on your system.
    4. Configure GCC as follows:
      $ cd gcc-cilk-obj
      $ ../gcc-cilk-src/configure --prefix=../gcc-cilk --enable-languages=c,c++
      Note: You may want to add --disable-multilib to the configuration options if multilib is not installed on your system. Otherwise, you may encounter errors such as:
      gnu/stubs-32.h: No such file or directory compilation terminated.
    5. Compile GCC: $ make
    6. Install GCC into gcc-cilk: $ make install
    7. The new GCC binary is now in /path/to/gcc-cilk/bin/.
  2. Install Cilkview Cilkscreen: Get it from here: http://software.intel.com/en-us/articles/intel-cilk-plus-software-development-kit/. The include bin directory in PATH.
  3. Install Pintool: Download pintool from here: http://www.pintool.org/downloads.html. Install.
  4. Install Cilkprof: Download “libzca source to provide access to Cilk metadata” and “cilkprof source example of using Cilk metadata” from http://software.intel.com/en-us/articles/download-intel-cilk-plus-software-development-kit/. First go to ZCA/src. Modify Makefile to include path to PIN. Make. Then go to Cilkprof, modify Makefile to include path to PIN. Make. TO BE ADDED: how to get the cilkprof binary
  • Brief Usage
    • Compile with ICC: $ icc cilkprogram.cpp -o cilkprogram
    • Check parallelism: $ cilkview ./cilkprogram
    • Check race condition: $ cilkscreen ./cilkprogram
    • Pintool: TO BE COMPLETED
    • Linux perf tool:
      • Show list of counters: $ perf list
      • check L1 data load miss: $ perf stat -c L1-dcache-load-misses ./cilkprogram
    • Cilkprof: TO BE COMPLETED
Personal tools
Members Only
Off Topic