# 1. Installation of OmpSs¶

## 1.1. Preparation¶

You must first choose a directory where you will install OmpSs. In this document this directory will be referred to as TARGET. We recommend you to set an environment variable TARGET with the desired installation directory. For instance:

$export TARGET=$HOME/ompss


## 1.2. Installation of Extrae (optional)¶

This is just a quick summary of the installation of Extrae. For a more detailed information check Extrae Homepage

2. Unpack the tarball and enter the just created directory:

$tar xfz extrae-xxx.tar.gz$ cd extrae-xxx

3. Configure it:

$./configure --prefix=$TARGET


Note

Extrae may have a number of dependences. Do not hesitate to check the Extrae User’s Manual

4. Build and install:

$make$ make install


Now you can proceed to the Installation of Nanos++. Do not forget to pass --with-extrae=$TARGET to Nanos++ configure. ## 1.3. Installation of Nanos++¶ 1. First, make sure that you fulfill all the Nanos++ build requirements. 2. Get the latest Nanos++ tarball (nanox-version-yyyy-mm-dd.tar.gz) from https://pm.bsc.es/ompss-downloads Unpack the file and enter the just created directory: $ tar xfz nanox-version-yyyy-mm-dd.tar.gz
$cd nanox-version  3. Run configure. There are a number of flags that enable or disable different features of Nanos++. Make sure you pass --prefix with the destination directory of your OmpSs installation (in our case TARGET). Important If you want instrumentation support, you must add --with-extrae=dir to your configure-flags (see below), where dir is the directory where you installed Extrae (usually TARGET). Check Nanos++ configure flags for more information about configure-flags. $ ./configure --prefix=$TARGET configure-flags  Note You can pass an empty set of configure-flags. Hint configure prints lots of output, but a small summary of enabled features is printed at the end. You may want to check it to ensure you are correctly passing all the flags 4. Build $ make


This may take some time. You may build in parallel using make -jN where N is the maximum number of threads you want to use for parallel compilation.

5. Install

\$ make install


This will install Nanos++ in TARGET.

Now you can proceed to Installation of Mercurium C/C++/Fortran source-to-source compiler.

### 1.3.1. Nanos++ build requirements¶

There are a number of software requirements to successfully build Nanos++ from the source code.

Important

Additional software is needed if you compile from the git repository. This section details the requirements when building from a tarball (a tar.gz file).

• A supported platform running Linux (i386, x86-64, ARM, PowerPC or IA64).
• GNU C/C++ compiler versions 4.4 or better.

If you want CUDA support:

• CUDA 5.0 or better.

If you want to enable the cluster support in Nanos++ you will need:

• GASNet 1.14.2 or better

### 1.3.2. Nanos++ configure flags¶

By default Nanos++ compiles three versions: performance, debug and instrumentation. Which one is used is usually governed by flags to the Mercurium compiler. You can speedup the build of the library by selectively disabling these versions.

You can also enable a fourth version: instrumentation-debug. That one is probably of little interest to regular users of Nanos++ as it enables debug and instrumentation at the same time.

 --disable-instrumentation Disables generation of instrumentation version --disable-debug Disables generation of debug version --disable-performance Disables generation of performance version --enable-instrumentation-debug Enables generation of instrumentation-debug version

Besides the usual shared memory environment (which is called the SMP device), Nanos++ supports several devices. Such devices are automatically enabled if enough support is detected at the host. You can disable them with the following flags.

 --disable-gpu-arch Disables CUDA support --disable-opencl-arch Disables OpenCL support

Nanos++ includes several plugins that are able to use other software packages. You can enable them using the following flags.

 --with-cuda=dir Directory of CUDA installation. By default it checks /usr/local/cuda. If a suitable installation of CUDA is found, CUDA support is enabled in Nanos++ (unless you disable it) --with-opencl=dir Directory of OpenCL installation. By default it checks /usr. If a suitable installation of OpenCL is found, OpenCL support is enabled in Nanos++ (unless you disable it) --with-opencl-include=dir If you use –with-opencl=dir, configure assumes that dir/include contains the headers. Use this flag to override this assumption. --with-opencl-lib=dir If you use –with-opencl=dir, configure assumes that dir/lib contains the libraries. Use this flag to override this assumption. --with-extrae=dir Directory of Extrae installation. This is mandatory if you want instrumentation. Make sure you have already installed Extrae first. See Installation of Extrae (optional) --with-mpitrace=dir This is a deprecated name for --with-extrae --with-nextsim=dir Directory of NextSim installation --with-ayudame=dir Directory of Ayudame installation --with-hwloc=dir Directory of Portable Hardware Locality (hwloc) installation. This is highly recommended for NUMA setups --with-chapel=dir Directory of Chapel installation --with-mcc=dir Directory of Mercurium compiler. This is only for testing Nanos++ itself and only useful to Nanos++ developers.

## 1.4. Installation of Mercurium C/C++/Fortran source-to-source compiler¶

You can find the build requirements, the configuration flags and the instructions to build Mercurium in the following link: https://github.com/bsc-pm/mcxx/blob/master/README.md

Once you complete all the steps listed in the link above you should be ready to Compile OmpSs programs.