Spack 1.0.1 Configuration Guide for Fugaku

This guide provides step-by-step instructions to configure Spack 1.0.1 on the Fugaku supercomputer, allowing users to install packages in their own directories while reusing system-installed packages.

Prerequisites

  • Access to Fugaku supercomputer

  • Valid user account and project allocation

Step 1: Identify Your User, Project and the Disk Volume to store data

Run the following command to get your user ID and project group:

id

Example output:

uid=00000(u11111) gid=00000(hp251111) groups=00000(hp251111),00000(trial),00000(fugaku)

From this output, identify:

  • User: u11111

  • Project: hp251111

Run the following command to get your disk volume:

accountd

Example output:

GROUP           VOLUME                       LIMIT             USAGE         AVAILABLE           FILES  USE_RATE
hp251111        V0XYZ                         1200             859             261                848     25.4%

From this output, identify:

  • Volume: V0XYZ

Step 2: Set Environment Variables

Replace YOUR_USER, YOUR_PROJECT and YOUR_VOLUME with the values from Step 1:

export MY_USER=YOUR_USER
export MY_PROJECT=YOUR_PROJECT
export MY_VOLUME=YOUR_VOLUME

Example:

export MY_USER=u11111
export MY_PROJECT=hp251111
export MY_VOLUME=V0XYZ

Step 3: Clone Spack Repository

Create working directory and clone the RIKEN-RCCS Spack repository:

mkdir -p /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp
cd /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp

Clone and checkout the Fugaku branch:

git clone https://github.com/RIKEN-RCCS/spack.git
cd spack
git checkout fugaku-v1.0.1

Verify you are on the correct branch:

git branch

Expected output:

  develop
* fugaku-v1.0.1

Step 4: Create Working Directories

mkdir -p /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack/opt/spack
mkdir -p /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack-stage
mkdir -p /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack-cache
mkdir -p /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack-misc-cache

Step 5: Create Configuration Directory

mkdir -p ~/.spack-custom-config

Step 6: Create config.yaml

This file defines where Spack will install packages and store cache files:

cat > ~/.spack-custom-config/config.yaml << EOF
config:
  install_tree:
    root: /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack/opt/spack
  build_stage: /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack-stage
  source_cache: /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack-cache
  misc_cache: /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack-misc-cache
EOF

Verify the file was created correctly:

cat ~/.spack-custom-config/config.yaml

Step 7: Create upstreams.yaml

This file allows Spack to reuse packages already installed on the system:

cat > ~/.spack-custom-config/upstreams.yaml << 'EOF'
upstreams:
  spack-public-instance:
    install_tree: /vol0004/apps/oss/spack/opt/spack
EOF

Verify the file:

cat ~/.spack-custom-config/upstreams.yaml

Step 8: Create repos.yaml

This file configures Fugaku-specific package repositories:

cat > ~/.spack-custom-config/repos.yaml << 'EOF'
repos:
  fugaku.rccs: /vol0004/apps/oss/spack/var/spack/fugaku-packages/repos/spack_repo/fugaku/rccs
  fugaku.rist: /vol0004/apps/oss/spack/var/spack/fugaku-packages/repos/spack_repo/fugaku/rist
  fugaku.update: /vol0004/apps/oss/spack/var/spack/fugaku-packages/repos/spack_repo/fugaku/update
  fugaku.local: /vol0004/apps/oss/spack/var/spack/fugaku-packages/repos/spack_repo/fugaku/local
EOF

Verify the file:

cat ~/.spack-custom-config/repos.yaml

Step 9: Activate Spack

Load Spack into your current session:

source /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack/share/spack/setup-env.sh

Verify Spack is loaded:

spack --version

Expected output:

1.0.1 (4a2301a1363cf80f22070299294cc57d67bae4b5)

Step 10: Verify Configuration

Check that Spack reads your custom configuration:

spack config blame config | head -10

Expected: Paths should show ~/.spack-custom-config/config.yaml

spack config blame upstreams

Expected: Should show ~/.spack-custom-config/upstreams.yaml

spack config blame repos

Expected: Should show ~/.spack-custom-config/repos.yaml

Step 11: Test Installation

Note

The first spack spec command will be slow as it downloads the package index and bootstraps the clingo solver. This only happens once.

Test the spec command:

spack spec zlib

Install a test package:

spack install htop

Verify the package was installed in your directory:

spack location -i htop

Expected output should contain your path:

/YOUR_VOLUME/mdt1/data/YOUR_PROJECT/YOUR_USER/tmp/spack/opt/spack/...

Step 12: Make Configuration Persistent

Add Spack to your .bashrc so it loads automatically in future sessions:

cat >> ~/.bashrc << EOF

# Load Spack Fugaku
export MY_USER=${MY_USER}
export MY_PROJECT=${MY_PROJECT}
export MY_VOLUME=${MY_VOLUME}
source /${MY_VOLUME}/mdt1/data/${MY_PROJECT}/${MY_USER}/tmp/spack/share/spack/setup-env.sh
EOF

Verify it was added:

tail -5 ~/.bashrc

Summary

Files Created

File

Purpose

~/.spack-custom-config/config.yaml

Install paths and cache directories

~/.spack-custom-config/upstreams.yaml

Reuse system-installed packages

~/.spack-custom-config/repos.yaml

Fugaku-specific package repositories

Directory Structure

/<VOLUME>/mdt1/data/<PROJECT>/<USER>/tmp/
├── spack/                    # Cloned Spack repository
│   └── opt/spack/           # Your installed packages
├── spack-stage/             # Build directory
├── spack-cache/             # Source downloads
└── spack-misc-cache/        # Miscellaneous cache

Usage

After completing the setup, you can install packages with:

spack install <package_name>

Load installed packages with:

spack load <package_name>

List your installed packages:

spack find

Troubleshooting

Issue

Solution

spack: command not found

Run source command from Step 9

Permission denied

Verify your project directory path in Steps 2-4

Slow spack spec

Normal on first run; subsequent runs will be faster