Skip to content

pdidev/spack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDI spack repository

This is a spack repository with recipes for PDI and its plugins. It can be installed in a few simple steps:

  1. setup spack,
  2. (optional): reuse already installed packages,
  3. (optional): setup a non-default compiler,
  4. install.

Step #1: Setup

To use it, you should first setup spack:

# 1. Get and enable Spack
git clone https://github.com/spack/spack.git
. spack/share/spack/setup-env.sh
# 2. Get and enable this spack repo
git clone https://github.com/pdidev/spack.git spack/var/spack/repos/pdi
spack repo add spack/var/spack/repos/pdi

Step #2 (optional): reuse already installed packages

Option #2.1: Reuse already installed packages on super-computers that use spack

You can tell your local spack instance that there is an upstream spack instance by editing spack/etc/spack/defaults/upstreams.yaml.

upstreams:
  name-of-spack-instance:
    install_tree: /path/to/spack/opt/spack

This will let spack use the already installed packages when it sees fit, (which is almost never). You can however force spack to use already installed package by using the flag --reuse when calling spack install.

For example on Ruche, you can do:

cat<<EOF > spack/etc/spack/defaults/upstreams.yaml
upstreams:
  ruche-system:
    install_tree: /gpfs/softs/spack/opt/spack/
EOF

Option #2.2: Reuse already installed packages on super-computers that does not use spack

If there are packages already present on the machine that you want spack to use e.g. MPI, you can specify them as externals through the packages.yaml file found in either in a Spack installation’s etc/spack/ or a user’s ~/.spack/ directory. Here’s an example of an external configuration:

packages:
  openmpi:
    externals:
    - spec: "[email protected]%[email protected] arch=linux-debian7-x86_64"
      prefix: /opt/openmpi-1.4.3
    - spec: "[email protected]%[email protected] arch=linux-debian7-x86_64+debug"
      prefix: /opt/openmpi-1.4.3-debug
    - spec: "[email protected]%[email protected] arch=linux-debian7-x86_64"
      prefix: /opt/openmpi-1.6.5-intel

Is it recommended to only put MPI implementations, CMake and openssl as externals and let spack take care of the rest.

Step #3 (optional): setup a non-default compiler

For compilers, you can specify them in the user's ~/.spack/linux/compilers.yaml.

compilers:
- compiler:
    spec: [email protected]
    paths:
      cc: /usr/bin/gcc
      cxx: /usr/bin/g++
      f77: /usr/bin/gfortran
      fc: /usr/bin/gfortran
    flags: {}
    operating_system: centos7
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []

This can be done automatically by calling spack compiler find when the compilers are loaded. This is needed if you want to use the Intel compilers.

For example on Ruche, you can do:

spack load [email protected]
spack compiler find
spack unload [email protected]

Step #4: Installation

You can install PDI and most of its plugins using the following instructions after you've done the setup:

# Install PDI and most of its plugins
spack install pdiplugin-decl-hdf5 pdiplugin-decl-netcdf pdiplugin-mpi pdiplugin-pycall pdiplugin-serialize pdiplugin-set-value pdiplugin-trace pdiplugin-user-code

If you only need some of the plugins, you can adapt the last line.