General instructions are for GNU compiler and OpenMPI. For using other compiler/MPI use corresponding entries from the table below.

Compiler MPI
GNU gcc g++ mpicc mpicxx Open-MPI
Intel icc icpc mpiicc mpiicpc Intel-MPI
IBM bgxlc bgxlc++ mpixlcc mpixlcxx IBM-MPI


The script ‘‘ can be used to automatically download libraries from and install them on your machine. To run it first make it executable then execute it.

$ chmod +x 
$ ./

After installing all the libraries successfully you can compile tarang. For that go to ‘tarang’ folder and issue the following commands. (In the last command replace ‘n’ with number of processors in your computer.)

cd ..
mkdir build
cd build
CXX=mpicxx cmake ../tarang/trunk
make -j n

It works for python2 as well as python3. For advanced usage see

$ ./ --help

If you use the above script,  the following procedure need not be followed.


Environment Variables : The following environment variables need to be set before compiling tarang. (You may append these lines to $HOME/.bashrc)

export PATH=$HOME/local/bin:$PATH
export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig:$PKG_CONFIG_PATH
export HDF5_ROOT=$HOME/local
export CPATH=$HOME/local/include/:$CPATH
export MANPATH=$HOME/local/share/man/:$MANPATH

CMake : Download CMake library from here

CC=gcc CXX=g++ ./configure --prefix=$HOME/local
make install

Blitz++ : Download Blitz++ library from here

CC=gcc CXX=g++ ./configure --prefix=$HOME/local
make install

YAML-cpp : Download YAML-cpp library from here [Download yamp-ccp version 0.3.0 , higher versions are presently not compatible.]

make install

MPICH : Download MPICH library from here
For Mac OSX additional arguments might be needed to be supplied to configure.
64bit: CFLAGS=-m64 CXXFLAGS=-m64 FFLAGS=-m64 FCFLAGS=-m64
32bit: CFLAGS=-m32 CXXFLAGS=-m32 FFLAGS=-m32 FCFLAGS=-m32

CC=gcc CXX=g++ ./configure --prefix=$HOME/local
make install

FFTW : Download FFTW library from here

fftw – double

MPICC=mpicc CC=mpicc CXX=mpicxx ./configure --prefix=$HOME/local --enable-mpi --enable-openmp
make install

fftw – float

MPICC=mpicc CC=mpicc CXX=mpicxx ./configure --prefix=$HOME/local --enable-mpi --enable-float --enable-openmp
make install

NOTE: for intel compilers use

MPICXX=mpiicpc MPICC=mpiicc CC=mpiicc CXX=mpiicpc ./configure --prefix=$HOME/local --enable-mpi --enable-openmp

FFTK : Download FFTK library from here

CC=mpicc CXX=mpicxx cmake -DCMAKE_INSTALL_PREFIX=$HOME/local
make install

HDF5 : Download HDF5 library from here

CC=mpicc CXX=mpicxx ./configure --prefix=$HOME/local --enable-parallel --without-zlib
make install

H5SI : Note–Only for new tarang
Download H5SI library from here

CXX=mpicxx cmake . -DCMAKE_INSTALL_PREFIX=$HOME/local
make install

To compile Tarang Unzip tarang. Make a directory build just outside tarang folder and cd to it. If the above environment variables are not set, open trunk/CMakeLists.txt and change SET(INCLUDE_DIRS …) and SET(LIBRARY_DIRS …) as per your systems mpi and CUDA (If using GPU versions of the code) and pass argument ‘-DFIND_LIBRARIES=OFF’ to cmake.

CXX=mpicxx cmake ../tarang/trunk/

To setup Tarang using eclipseMake build directory in the tarang folder (has to be a sibling of trunk as required by Eclipse CDT4 CMake Generator).

CXX=mpicxx cmake ../trunk/ -DCMAKE_BUILD_TYPE=DEBUG -G"Eclipse CDT4 - Unix Makefiles"