Loading...
Searching...
No Matches
4. Building and Installing StarPU

Depending on the level of customization required for the library installation, we offer several solutions.

1. Basic Installation or Evaluation: If you are looking to simply try out the library, assess its performance on simple cases, run examples, or use the latest stable version, we recommend the following options:
   - For Linux Debian or Ubuntu distributions, consider using the latest StarPU Debian package (see Installing a Binary Package).
   - For macOS, you can opt for Brew and follow the steps in Installing a Source Package.
   - Using an already installed module on a cluster, as explained in Using a Module
2. Customization for Specific Needs: If you intend to use StarPU but require modifications, such as switching to another version (git branch), changing the default MPI, utilizing a preferred compiler, or altering source code, consider these options:
   - Guix or Spack can be useful, as these package managers allow dynamic changes during source-based builds. Refer to Installing a Source Package for details.
   - Alternatively, you can directly build from the source using the native build system of the library (Makefile, GNU autotools). Instructions can be found in Building from Source.
3. Experiment Reproducibility: If your focus is on experiment reproducibility, we recommend using Guix. Refer to Installing a Source Package for guidance.

Whichever solution you choose, you can utilize the tool `bin/starpu_config` to view all the configuration parameters used during StarPU installation.

Please refer to the provided documentation for specific installation steps and details for each solution.

# 4.1 Installing a Binary Package

One of the StarPU developers being a Debian Developer, the packages are well integrated and very up-to-date. To see which packages are available, simply type:

    $ apt-cache search starpu

To install what you need, type for example:

    $ sudo apt-get install libstarpu-dev

# 4.2 Installing a Source Package

StarPU is available from different package managers.

- Guix https://gitlab.inria.fr/guix-hpc/guix-hpc
- Spack https://github.com/spack/spack/
- Brew https://gitlab.inria.fr/solverstack/brew-repo

Documentation on how to install StarPU with these package managers is directly available from the links specified above. We give below a brief overview of the spack installation.

## 4.2.1 Installing the Spack Package

Here is a quick guide to install StarPU with spack.

    $ git clone git@github.com:spack/spack.git
    $ source ./spack/share/spack/setup-env.sh # if you use bash or zsh
    $ spack install starpu

By default, the latest release will be installed, one can choose to install a specific release or even the master version.

    $ spack install starpu@master
    $ spack install starpu@1.3.5

We strongly advise reading the detailed reference manual at https://spack.readthedocs.io/en/latest/getting_started.html

## 4.2.2 Using a Module

On some clusters, StarPU is provided as a module, for example on the Jean Zay cluster. The information is available at http://www.idris.fr/jean-zay/cpu/jean-zay-cpu-starpu.html

# 4.3 Building from Source

StarPU can be built and installed by the standard means of the GNU autotools. The following chapter is intended to briefly remind how these tools can be used to install StarPU.

## 4.3.1 Optional Dependencies

The `hwloc` (http://www.open-mpi.org/software/hwloc) topology discovery library is not mandatory to use StarPU, but strongly recommended. It allows for topology aware scheduling, which improves performance. `hwloc` is available in major free operating system distributions, and for most operating systems. Make sure to not only install a `hwloc` or `libhwloc` package, but also `hwloc-devel` or `libhwloc-dev` to have `hwloc` headers etc.

If `libhwloc` is installed in a standard location, no option is required, it will be detected automatically, otherwise --with-hwloc=<directory> should be used to specify its location.

If `libhwloc` is not available on your system, the option --without-hwloc should be explicitly given when calling the script `configure`.

## 4.3.2 Getting Sources

StarPU's sources can be obtained from the download page of the StarPU website (https://starpu.gitlabpages.inria.fr/files/).

All releases and the development tree of StarPU are freely available on StarPU SCM server under the LGPL license. Some releases are available under the BSD license.

The latest release can be downloaded from the StarPU download page (https://starpu.gitlabpages.inria.fr/files/).

The latest nightly snapshot can be downloaded from the StarPU website (https://starpu.gitlabpages.inria.fr/files/testing/).

And finally, the current development version is also accessible via git. It should only be used if you need the very latest changes (i.e. less than a day old!).

    $ git clone git@gitlab.inria.fr:starpu/starpu.git

## 4.3.3 Configuring StarPU

Running `autogen.sh` is not necessary when using the tarball releases of StarPU. However, when using the source code from the git repository, you first need to generate the script `configure` and the different Makefiles. This requires the availability of `autoconf` and `automake` >= 2.60.

    $ ./autogen.sh

You then need to configure StarPU. Details about options that are useful to give to `configure` are given in Compilation Configuration.

    $ ./configure

If `configure` does not detect some software or produces errors, please make sure to post the contents of the file `config.log` when reporting the issue.

By default, the files produced during the compilation are placed in the source directory. As the compilation generates a lot of files, it is advised to put them all in a separate directory. It is then easier to clean up, and this allows to compile several configurations out of the same source tree. To do so, simply enter the directory where you want the compilation to produce its files, and invoke the script `configure` located in the StarPU source directory.

    $ mkdir build
    $ cd build
    $ ../configure

By default, StarPU will be installed in `/usr/local/bin`, `/usr/local/lib`, etc. You can specify an installation prefix other than `/usr/local` using the option `–prefix`, for instance:

    $ ../configure --prefix=$HOME/starpu

## 4.3.4 Building StarPU

    $ make

Once everything is built, you may want to test the result. An extensive set of regression tests is provided with StarPU. Running the tests is done by calling `make check`. These tests are run every night and the result from the main profile is publicly available (https://starpu.gitlabpages/files/testing/master/).

    $ make check

## 4.3.5 Installing StarPU

In order to install StarPU at the location which was specified during configuration:

    $ make install

If you have let StarPU install in `/usr/local/`, you additionally need to run

    $ sudo ldconfig

so the libraries can be found by the system.

Libtool interface versioning information are included in libraries names (`libstarpu-1.4.so`, `libstarpumpi-1.4.so` and `libstarpufft-1.4.so`).