Spack-Based Package Management and Development Environment
Short-Baseline Neutrino Program | Fermi National Accelerator Laboratory
This repository provides a comprehensive Spack-based software management ecosystem for the ICARUS and SBND experiments, part of Fermilab's Short-Baseline Neutrino (SBN) Program. The SBN Program investigates neutrino oscillations and searches for sterile neutrinos using three liquid argon time projection chamber (LArTPC) detectors located along the Booster Neutrino Beam.
This integrated software environment provides:
- Unified Package Management - Spack-based installation and dependency resolution for DAQ software stacks
- Development Workflows - Streamlined tools for suite and individual package development
- Binary Distribution - Buildcache infrastructure for rapid deployment across experiment computing resources
- Local & Shared Configurations - Flexible database management supporting both collaborative and isolated development
- Quality Assurance - Modular architecture with comprehensive logging, error handling, and verification tools
spack/v1.0.1.sbnd/
│
├── NULL/ # [Submodule] Spack Core
│ ├── bin/spack # Spack command-line interface
│ ├── lib/spack/ # Core Spack libraries
│ ├── var/spack/repos/ # Built-in package recipes
│ └── README.md # Spack documentation
│
├── sbndaq-spack-tools/ # ICARUS/SBND Development Tools
│ ├── README.md # Comprehensive tools documentation
│ ├── modules/ # Modular function libraries
│ │ ├── README.md # Module architecture guide
│ │ ├── logging-functions.sh # Logging and output utilities
│ │ ├── signal-functions.sh # Error handling and cleanup
│ │ ├── config-functions.sh # Configuration file generation
│ │ ├── env-functions.sh # Environment initialization
│ │ ├── pkg-functions.sh # Package management
│ │ ├── build-functions.sh # Build orchestration
│ │ └── suite-functions.sh # DAQ suite-specific workflows
│ │
│ ├── Main Scripts
│ ├── setup-local-spack.sh # Local Spack database configuration
│ ├── newSPACKDevArea.sh # Create DAQ suite development area
│ ├── newSPACKProjArea.sh # Create single package development area
│ ├── build-sbndaq-suite.sh # Build sbndaq-suite packages
│ ├── build-artdaq-suite.sh # Build artdaq-suite packages
│ ├── rsync-build-cache.sh # Binary cache distribution
│ └── tools-spack-devenv.sh # Interactive development helpers
│
├── spack-repos/ # [Submodule] SBN Package Repositories
│ └── sbn-spack/ # ICARUS/SBND package definitions
│ ├── packages/ # Custom package recipes
│ └── README.md # Package repository documentation
│
├── fermi-spack-tools/ # [Submodule] Fermilab Spack Tools
│ └── ... # Fermilab-specific utilities
│
├── spack-mpd/ # [Submodule] Multi-Package Development
│ └── ... # MPD repository management tools
│
├── .gitmodules # Submodule configuration
└── README.md # This file
This repository integrates multiple components via Git submodules:
| Submodule | Repository | Purpose |
|---|---|---|
| NULL | SBNSoftware/spack |
SBN-customized Spack core with experiment-specific patches and configurations |
| spack-repos | SBNSoftware/spack-repos |
ICARUS/SBND package definitions for artdaq, sbndaq, and dependencies |
| fermi-spack-tools | FNALssi/fermi-spack-tools |
Fermilab Scientific Software Infrastructure tools and utilities |
| spack-mpd | eflumerf/spack-mpd |
Multi-package development (MPD) repository management |
Initialize submodules:
git submodule update --init --recursiveBefore beginning, ensure you have:
- Access to ICARUS or SBND computing resources (GPVMs, build nodes, or interactive nodes)
- Git configured with appropriate credentials
- Bash shell (version 4.0+)
- Basic familiarity with command-line operations
Scenario: You need to install DAQ software but don't have write access to the shared Spack database.
Solution: Configure a personal Spack environment with shared package access:
# Navigate to the Spack installation
cd /daq/software/spack_packages/spack/v1.0.1.sbnd
# Initialize local Spack database (creates ~/.spack-local/)
source sbndaq-spack-tools/setup-local-spack.sh
# Verify configuration (recommended)
verify_local_spack
# View available ICARUS/SBND packages
spack list sbndaq
spack list artdaq
# Install packages to your local environment
spack install sbndaq-suite@v1_11_00Benefits:
- No database locking conflicts with other users
- Access to all shared packages via upstreams
- Personal package installations in
~/.spack-local/install/ - Isolated configuration in
~/.spack-local/config/
Documentation: Local Spack Setup Guide
Scenario: You're developing multiple interconnected packages in the ICARUS/SBND DAQ software stack.
Solution: Create a comprehensive development area for the entire DAQ suite:
# Create development environment (example: developer name "ALICE")
./sbndaq-spack-tools/newSPACKDevArea.sh --dev-name ALICE
# Navigate to created environment
cd ~/DAQ_SPACK_DevAreas/DAQ_2025-10-07_ALICE_v1_11_00/DAQInterface
# Activate the Spack environment
source setup_daqinterface_spackenv.sh
# Your development packages are now checked out and ready
# Example: modify source in checked-out packages
cd ../srcs/sbndaq-artdaq
# ... make your changes ...
# Build with your modifications
spack install
**What gets created**:
- Spack environment at `~/DAQ_SPACK_DevAreas/<dev-name>/`
- Development checkouts of artdaq-suite and sbndaq-suite packages
- Configuration files (config.yaml, repos.yaml, upstreams.yaml)
- Activation script (setup.sh)
**Documentation**: [DAQ Suite Development Workflow](sbndaq-spack-tools/README.md#workflow-2-daq-suite-development)
---
### Use Case 3: Release Manager - Build & Distribute Binaries
**Scenario**: You're responsible for building and distributing official software releases.
**Solution**: Use the automated build and distribution scripts:
```bash
# Build sbndaq-suite with all dependencies
./sbndaq-spack-tools/build-sbndaq-suite.sh
# Alternatively, build artdaq-suite
./sbndaq-spack-tools/build-artdaq-suite.sh
# Generate binary cache for distribution
# (buildcache automatically created during build)
# Mirror buildcache to remote repositories
./sbndaq-spack-tools/rsync-build-cache.sh
# Verify buildcache availability
spack buildcache listDocumentation: Build & Publish Workflow
The DAQ software for ICARUS and SBND is organized into interconnected suites:
Purpose: Core DAQ framework developed by Fermilab Scientific Computing Division
Key Packages:
artdaq-core- Core data acquisition framework and data typesartdaq- DAQ application framework and utilitiesartdaq-utilities- Common utilities and toolsartdaq-core-demo- Example DAQ applications
Repository: Built-in Spack packages + SBN extensions
Purpose: ICARUS and SBND-specific DAQ applications and board readers
Key Packages:
sbndaq-artdaq- SBN-specific artdaq extensionssbndaq-artdaq-core- SBN data types and core componentssbndaq- Top-level integration package
Repository: spack-repos/sbn-spack/
| Component | Description | Documentation |
|---|---|---|
| Spack Core | SBN-customized Spack package manager | NULL/README.md · Official Docs |
| Development Tools | ICARUS/SBND workflow automation | sbndaq-spack-tools/README.md |
| Module System | Modular function libraries | sbndaq-spack-tools/modules/README.md |
| Package Repository | SBN package definitions | spack-repos/sbn-spack/README.md |
| Fermi Tools | Fermilab infrastructure integration | fermi-spack-tools/ |
| MPD Tools | Multi-package development utilities | spack-mpd/ |
- SBN Program: https://sbn.fnal.gov/
- ICARUS Experiment: https://icarus.fnal.gov/
- SBND Experiment: https://sbnd.fnal.gov/
- Fermilab Computing: https://computing.fnal.gov/
- artdaq Documentation: https://cdcvs.fnal.gov/redmine/projects/artdaq/wiki
- Spack Official Documentation: https://spack.readthedocs.io/
Create reproducible, isolated environments for DAQ software development without affecting shared installations or other developers.
Install and maintain multiple versions of the same package simultaneously, essential for supporting both ICARUS and SBND with potentially different software versions.
Accelerate deployments using pre-built binary packages, reducing compilation time from hours to minutes.
Automatic resolution of complex dependency chains across artdaq, sbndaq, and third-party packages (ROOT, Boost, etc.).
Supports multiple Linux distributions used across SBN computing infrastructure:
- Scientific Linux 7 (legacy systems)
- AlmaLinux 9 (current standard)
Access shared packages in /daq/software/spack_packages/ while maintaining personal installations, eliminating redundant builds and conserving disk space.
| Variable | Description | Example |
|---|---|---|
SPACK_DIR |
Spack installation directory | /daq/software/spack_packages/spack |
SPACK_VERSION |
Spack version tag | v1.0.1.sbnd |
SPACK_ROOT |
Spack root (auto-set) | $SPACK_DIR/$SPACK_VERSION |
SPACK_USER_CONFIG_PATH |
User configuration directory | ~/.spack-local/config |
SPACK_MICRO_ARCH |
Target microarchitecture | x86_64_v2 |
| Variable | Description | Default |
|---|---|---|
BUILD_THREADS |
Parallel build jobs | 8 |
COMPILER_VERSION |
GCC version | 13.1.0 |
CXX_STANDARD |
C++ standard | c++17 |
| Variable | Description | Default |
|---|---|---|
NON_INTERACTIVE |
Disable prompts | false |
VERBOSE |
Enable verbose output | false |
DEBUG |
Enable debug logging | false |
See: Environment Variables Reference
- Always use local Spack setup if you lack write access to shared database
- Run verification after setup:
verify_local_spack - Use non-interactive mode for automation and CI/CD
- Enable debug logging when troubleshooting
- Review configuration files before running builds
- Test in development area before publishing to buildcache
- Document custom configurations for team members
See: Best Practices Guide
- This README - High-level overview and navigation
- Spack Core Documentation - Spack package manager
- SBN Development Tools - DAQ development workflows
- Module System Documentation - Modular components
- Official Spack Documentation - Comprehensive Spack guide
# Spack help
spack help
spack help --all
spack help --spec
# Local Spack setup help
source sbndaq-spack-tools/setup-local-spack.sh
local_spack_help
# Script usage
./sbndaq-spack-tools/newSPACKDevArea.sh --help
./sbndaq-spack-tools/newSPACKProjArea.sh --helpWhen contributing to this repository:
- Follow existing code style and conventions
- Add appropriate documentation
- Update README files for new features
- Test changes thoroughly
- Include error handling and logging
- Follow module standards for new modules
See: Module Standards
This repository provides the Spack-based development environment for the Short-Baseline Neutrino (SBN) Data Acquisition system.
Spack Version: v1.0.1.sbnd Platform: Linux (Scientific Linux 7, AlmaLinux 9) Architecture: x86_64_v2
For more information about Spack, see the official Spack repository.