一键导入
mapl-setup
First-time MAPL development environment setup and configuration
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
First-time MAPL development environment setup and configuration
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Safely switch between NAG, gfortran, and Intel compilers when building MAPL
MAPL Fortran coding standards and style conventions
GitHub workflow, commit conventions, and PR process for MAPL
Build MAPL with NAG, gfortran, or Intel compilers on macOS and Linux
MAPL error handling macros and best practices
Run and debug MAPL tests with pFUnit framework
| name | mapl-setup |
| description | First-time MAPL development environment setup and configuration |
| compatibility | opencode |
Guide you through initial MAPL development environment setup, including:
Use this skill when:
MAPL supports customizable module names via ~/.opencode/mapl-config.yaml. This file allows you to map generic names (like "nag") to your system's actual module names (like "compiler/nag-fortran").
A template configuration file has been created at ~/.opencode/mapl-config.yaml. Edit this file to match your system's module names.
Step 1: List available modules
module avail
Step 2: Search for specific modules
# Find Fortran compilers
module avail 2>&1 | grep -i fortran
module avail 2>&1 | grep -i nag
module avail 2>&1 | grep -i gfortran
module avail 2>&1 | grep -i gcc
# Find MPI implementations
module avail 2>&1 | grep -i mpi
module avail 2>&1 | grep -i openmpi
# Find baselibs
module avail 2>&1 | grep -i baselibs
module avail 2>&1 | grep -i mapl
Step 3: Update your config file
Edit ~/.opencode/mapl-config.yaml with the module names found above:
modules:
nag: "compiler/nag-fortran" # Use the exact name from module avail
gfortran: "gcc/13" # Or gnu-fortran, compiler/gnu, etc.
mpi: "openmpi/4.1" # Or mpi, mpich, intel-mpi
baselibs: "MAPL-baselibs" # Or baselibs, mapl-deps
ifx: "ifx-stack" # For bucy (usually same for everyone)
paths:
mapl_root: "~/swdev/VS/MAPL" # Your MAPL checkout location
build_dir_prefix: "" # Empty for ./nag, or "build-" for ./build-nag
# Test loading NAG compiler
module load nag mpi baselibs # Or use your configured names
module list
# Verify compiler is accessible
which nagfor # Should show path to compiler
nagfor --version
# Test gfortran (if available)
module purge
module load gfortran mpi baselibs
which gfortran
gfortran --version
# Check CMake is available
which cmake
cmake --version # Should be 3.17 or newer
# Check Git
which git
git --version
CRITICAL: Always clarify which base branch to use before starting work.
develop - Legacy MAPL (MAPL 2.x maintenance)
release/MAPL-v3 - MAPL v3 pre-release
When starting new work, create a feature branch following the pattern:
feature/#ISSUE-description
bugfix/#ISSUE-description
hotfix/#ISSUE-description
Where #ISSUE is the GitHub issue number (e.g., feature/#4392-add-opencode-skills).
Always create a GitHub issue first to get the issue number before creating your feature branch.
If you'll be building on the remote bucy server with Intel compilers, set up SSH ControlMaster to avoid repeated PIN entries.
~/.ssh/config:Host bucy bucy.gsfc.nasa.gov
ControlMaster auto
ControlPath ~/.ssh/cm-%r@%h:%p
ControlPersist 8h
ssh -fN bucy # Enter PIN once
This creates a persistent SSH connection that lasts 8 hours. All subsequent SSH commands will reuse this connection without asking for PIN.
See the remote-build skill for complete bucy workflow details.
# Edit your config file
vi ~/.opencode/mapl-config.yaml
# Or use the template directly and test
module load nag mpi baselibs
module list
cd ~/swdev/VS # Or your preferred location
git clone git@github.com:GEOS-ESM/MAPL.git
cd MAPL
# For MAPL 2.x work:
git checkout develop
# For MAPL v3 work:
git checkout release/MAPL-v3
See the mapl-build skill for detailed build instructions.
Quick test:
module load nag mpi baselibs
cmake -B build-test -DCMAKE_BUILD_TYPE=Debug
cmake --build build-test -j 4
Problem: Shell doesn't have module command Solution: Source the modules init script
source /etc/profile.d/modules.sh
# Or add to your ~/.bashrc or ~/.zshrc
Problem: Module names don't match your system
Solution: Use module avail to find exact names, update your config file
Problem: CMake version < 3.17 Solution: Load newer cmake module or install via package manager
module avail cmake # Look for newer version
# Or: brew install cmake (macOS)
Problem: Old build directories from different compilers Solution: Use separate build directories per compiler
rm -rf ./build ./build-test # Remove old directories
# Use: ./nag, ./gfortran, ./intel (see mapl-build skill)
After setup, use these skills for specific tasks:
mapl-build - Build MAPL with different compilersmapl-testing - Run and debug testsfortran-style - Learn MAPL coding standardsgithub-workflow - Understand Git/GitHub conventionsremote-build - Build on bucy with Intel compiler~/.opencode/mapl-config.yaml with your module namesmodule load, module list)develop vs release/MAPL-v3 branch strategy