N-Docs LogoN-Docs
System Administration

EasyBuild Modules Compiling

Complete guide to EasyBuild recipe commands, module compilation, and checksum management

EasyBuild Modules Compiling

Overview

EasyBuild automates the installation of scientific software modules on computing clusters. It simplifies complex builds, ensures reproducibility, and manages dependencies automatically.

This guide provides commands, workflow examples, recipe structures, and checksum management.

Basic Build Commands

# Build a recipe
eb MySoftware-1.0.0-foss-2023a.eb

# Build with dependencies (Robot mode)
eb MySoftware-1.0.0-foss-2023a.eb --robot

# Robot mode with current directory as search path
eb -r . MySoftware-1.0.0-foss-2023a.eb

# Build ignoring checksums (use with caution)
eb -r . --ignore-checksums path/MySoftware-1.0.0-foss-2023a.eb

# Dry run
eb MySoftware-1.0.0-foss-2023a.eb --dry-run

# Build multiple recipes
eb *.eb --robot

Running EasyBuild Modules

1. Select Software

Example: GROMACS.

2. Build the Module

eb -r . path/GROMACS-2023.1-foss-2023a.eb
  • . = starting search path for dependencies
  • -r = Robot mode

3. Load Module

module load GROMACS/2023.1-foss-2023a

4. Verify Installation

Check that the software is installed correctly:

gmx --version

Recipe Creation Commands

# Create new recipe from template
eb --new-recipe MySoftware 1.0.0

# Copy existing recipe as template
cp existing-recipe.eb MySoftware-1.0.0-foss-2023a.eb

# Search for existing recipes
eb --search MySoftware

# Find recipe files
find $EASYBUILD_CONFIGFILES -name "*MySoftware*"

Checksums (Verify Source Integrity)

1. Generate Checksums Automatically

eb MySoftware-1.0.0-foss-2023a.eb --generate-checksums
  • Calculates MD5, SHA1, and SHA256 for sources.
  • Copy the SHA256 (recommended) to the checksums field.

2. Add Checksums to Recipe

sources = ['v%(version)s.tar.gz']
checksums = ['d2c7e8b2c4e5f0e5f5e5d5b8f0a7d2b8f0c7e5d5b2c7d2c7e5d5b8f0a7d2b8f0']

✅ Always include checksums for reproducibility and security.

Debugging Commands

# Build with debug output
eb MySoftware-1.0.0-foss-2023a.eb --debug

# Stop at specific step
eb MySoftware-1.0.0-foss-2023a.eb --stop=configure
eb MySoftware-1.0.0-foss-2023a.eb --stop=build
eb MySoftware-1.0.0-foss-2023a.eb --stop=install

# Keep build directory
eb MySoftware-1.0.0-foss-2023a.eb --stop=build --try-update-deps

# Force rebuild
eb MySoftware-1.0.0-foss-2023a.eb --force --rebuild

# Skip sanity check
eb MySoftware-1.0.0-foss-2023a.eb --skip-test-step

Testing Commands

# Test existing installation
eb MySoftware-1.0.0-foss-2023a.eb --sanity-check-only

# Run tests during build
eb MySoftware-1.0.0-foss-2023a.eb --run-all-tests

# Extended dry run with tests
eb MySoftware-1.0.0-foss-2023a.eb --extended-dry-run

Dependency Management

# Check dependencies
eb MySoftware-1.0.0-foss-2023a.eb --dry-run --robot

# Missing dependencies only
eb MySoftware-1.0.0-foss-2023a.eb --missing-modules

# Resolve dependencies automatically
eb MySoftware-1.0.0-foss-2023a.eb --robot --dry-run

# Build dependencies only
eb MySoftware-1.0.0-foss-2023a.eb --robot --stop=ready

Validation Commands

# Recipe syntax
eb MySoftware-1.0.0-foss-2023a.eb --check-syntax

# Validate checksums
eb MySoftware-1.0.0-foss-2023a.eb --check-checksums

# Check for conflicts
eb MySoftware-1.0.0-foss-2023a.eb --check-conflicts

Information Commands

# Show recipe details
eb MySoftware-1.0.0-foss-2023a.eb --show-config

# List toolchains
eb --list-toolchains

# List easyblocks
eb --list-easyblocks

# Show software list
eb --software-list | grep -i mysoftware

Build Path Management

# Use temporary build directory
eb MySoftware-1.0.0-foss-2023a.eb --tmpdir=/tmp/eb_build

# Specify build directory
eb MySoftware-1.0.0-foss-2023a.eb --buildpath=/scratch/build

# Clean build directory after success
eb MySoftware-1.0.0-foss-2023a.eb --cleanup-builddir

Advanced Commands

# Use specific Python/toolchain version
eb MySoftware-1.0.0-foss-2023a.eb --try-toolchain=GCC,12.3.0

# Update toolchain
eb MySoftware-1.0.0-foss-2023a.eb --try-update-deps

# Different installation path
eb MySoftware-1.0.0-foss-2023a.eb --installpath=/opt/software

# Parallel builds
eb MySoftware-1.0.0-foss-2023a.eb --parallel=8

Environment Setup

# EasyBuild paths
export EASYBUILD_CONFIGFILES=/path/to/config
export EASYBUILD_BUILDPATH=/tmp/easybuild
export EASYBUILD_INSTALLPATH=/opt/easybuild
export EASYBUILD_SOURCEPATH=/opt/easybuild/sources

# Module environment
module use /opt/easybuild/modules/all
module load EasyBuild

Recipe Example Structure

Basic EasyBuild Recipe (.eb file)

easyblock = 'AutotoolsMake'
name = 'example-software'
version = '1.0'
homepage = 'https://example.com'
description = "Example software package"

toolchain = {'name': 'GCC', 'version': '9.3.0'}

sources = [SOURCE_TAR_GZ]
source_urls = ['https://example.com/downloads/']

dependencies = [('GCC', '9.3.0')]

patches = [
    ('patch1.patch', 1),
    ('patch2.patch', 1)
]

preconfigopts = './configure --prefix=$EBROOTEXAMPLE_SOFTWARE'

buildopts = 'VERBOSE=1'

postinstallcmds = [
    'echo "Example software installation complete."'
]

sanity_check_paths = {
    'files': ['bin/example-software'],
    'dirs': ['lib', 'include']
}

moduleclass = 'tools'

CMake Recipe

easyblock = 'CMakeMake'
name = 'MySoftware'
version = '1.0.0'
toolchain = {'name': 'foss', 'version': '2023a'}
source_urls = ['https://github.com/user/repo/archive/']
sources = ['v%(version)s.tar.gz']
checksums = ['sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']
configopts = '-DCMAKE_BUILD_TYPE=Release'
sanity_check_paths = {'files': ['bin/mysoftware'], 'dirs': []}
moduleclass = 'tools'

Python Package Recipe

easyblock = 'PythonPackage'
name = 'MySoftware'
version = '1.0.0'
toolchain = {'name': 'foss', 'version': '2023a'}
source_urls = [PYPI_SOURCE]
sources = [SOURCELOWER_TAR_GZ]
checksums = ['sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']
dependencies = [('Python', '3.11.3')]
use_pip = True
download_dep_fail = True
sanity_pip_check = True
moduleclass = 'tools'

EasyBlock Types

The easyblock variable specifies the build method:

  • AutotoolsMake - For Autotools-based packages
  • CMakeMake - For CMake-based packages
  • PythonPackage - For Python packages
  • MakeFile - For simple Makefile packages
  • ConfigureMake - For configure + make packages

Common Workflow

# 1. Create recipe
eb --new-recipe MySoftware 1.0.0

# 2. Edit recipe file
vim MySoftware-1.0.0-foss-2023a.eb

# 3. Check syntax
eb MySoftware-1.0.0-foss-2023a.eb --check-syntax

# 4. Generate checksums
eb MySoftware-1.0.0-foss-2023a.eb --generate-checksums

# 5. Dry run
eb MySoftware-1.0.0-foss-2023a.eb --dry-run --robot

# 6. Build
eb MySoftware-1.0.0-foss-2023a.eb --robot

# 7. Test installation
eb MySoftware-1.0.0-foss-2023a.eb --sanity-check-only

Troubleshooting Commands

# Check build log
tail -f /tmp/eb-*/easybuild-MySoftware-*.log

# Find build directory
find /tmp -name "*MySoftware*" -type d

# Check module availability
module avail MySoftware

# Debug failed build
eb MySoftware-1.0.0-foss-2023a.eb --debug --stop=configure

# Clean failed build
eb MySoftware-1.0.0-foss-2023a.eb --force --cleanup-builddir

What's Next?

Master EasyBuild with these progressive steps:

Learning Timeline - Module Building

  1. Basic Commands - Simple eb builds
  2. Recipe Creation - Write your first .eb file
  3. Next: Handle complex dependencies
  4. Then: Custom easyblocks and patches
  5. Advanced: Toolchain development
  6. Expert: Contributing to EasyBuild community

Skill Progression

  • Beginner: Use existing recipes with eb --robot
  • Intermediate: Modify recipes and handle dependencies
  • Advanced: Create custom easyblocks and toolchains
  • Expert: Contribute recipes to the community

References and Resources

Documentation

  • High-Performance Computing (HPC)
  • Environment Modules
  • Lmod
  • Software Development
  • Computational Science
  • Build Automation