== Basics ==

Installation should be the usual procedure of configure, make, and
make install.  Below, we describe how to compile it for XeonPhi (MIC).

MassiveThreads has been successfully compiled with:

 * gcc on x86_64
 * icc on x86_64
 * gcc in MPSS on XoenPhi (cross compilation)
 * icc in MPSS on XoenPhi (cross compilation)
 * gcc on Fujitsu FX10 (SPARC)

== Installation for x86 ==

  ./configure
  make
  make install

should just work

== Installation for XeonPhi (a.k.a. KNC, Intel MIC) ==

There are two ways to compile it for MIC.  One is by using gcc
packaged in MPSS; the other is by using Intel C compiler (icc).
The former is free, but currently does not support vectorization
on MIC.  

=== Using gcc (MPSS) ===

 * Install MPSS (http://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss)
 * Once you install it, you should have $(MPSS)/linux-k1om-4.7/bin/x86_64-k1om-linux-gcc, where MPSS is the directory you install it in.
 * include $(MPSS)/linux-k1om-4.7/bin so configure can find it. e.g.

  $ export PATH=~/linux-k1om-4.7/bin:$PATH

 * then run configure with the appropriate --host and --build argument to let it know it's a cross compilation

  $ ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-k1om-linux

 * it should find $(MPSS)/linux-k1om-4.7/bin/x86_64-k1om-linux-gcc as the C comipler

 * rest of the steps is the same.

  $ make
  $ make install

=== Using icc ===

 * include the directory in which you find icc in your PATH. e.g.,

  $ export PATH=/opt/intel/composer_xe_2013.0.079/bin/intel64:$PATH

 * make sure your icc supports -mmic option

  $ icc -help | grep mmic
  -mmic     build an application that runs natively on Intel(R) MIC Architecture
  export PATH=~/linux-k1om-4.7/bin:$PATH

 * just add CC=icc and CFLAGS=-mmic when you run configure.  it should find icc as the C compiler.

  $ CC=icc CFLAGS=-mmic ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-k1om-linux
 
 * rest of the steps is the same.

  $ make
  $ make install

== Installation for FX10 (SPARCv9 architecture) ==
  
 * Enter interactive mode on one computing node
   
  $ pjsub --interact

 * Enable GCC-4.6.1 on FX10
  
  $ module unload TCSuite
  $ module load GCC/4.6.1
  $ module load gdb/6.6

 * rest of the steps is the same.
  
  $ ./configure
  $ make
  $ make install
