compiler-switching

Switch between NAG, gfortran, and Intel Fortran compilers for MAPL builds.

43|25|Updated Jul 3, 2019
One-click install
npx skills add https://github.com/GEOS-ESM/MAPL --skill compiler-switching
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compiler-switching
Source: https://github.com/GEOS-ESM/MAPL/tree/main/.opencode/skills/compiler-switching
Command: npx skills add https://github.com/GEOS-ESM/MAPL --skill compiler-switching

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a clear, safe, and repeatable process for switching between different Fortran compilers (NAG, gfortran, Intel) when building the MAPL software, preventing common build and runtime errors.

Core Features & Use Cases

  • Compiler Isolation: Enforces the use of separate build directories for each compiler to avoid binary incompatibility.
  • Module Management: Guides users on safely loading and purging compiler-specific environment modules.
  • Configuration Guidance: Offers examples for using mapl-config.yaml or environment variables for compiler settings.
  • Troubleshooting: Addresses common issues like "undefined reference" errors, module mismatches, and incorrect compiler detection.
  • Use Case: A developer needs to build MAPL for a project that requires testing with both gfortran and Intel compilers. This Skill ensures they can switch between them without introducing subtle bugs or build failures.

Quick Start

Follow the safe compiler switch workflow by creating separate build directories for each compiler and building MAPL within each.

Frequently Asked Questions about compiler-switching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely switch between Fortran compilers for a MAPL build?

To safely switch Fortran compilers for a MAPL build, you must use separate build directories for each compiler to prevent binary incompatibility. Never mix different compilers in the same build directory.

Why does switching Fortran compilers in the same build directory cause undefined reference errors?

Switching Fortran compilers in the same build directory causes undefined reference errors due to binary incompatibility and module conflicts between different compiler toolchains. You must use isolated build directories for each compiler.

Can I use environment modules to manage Fortran compiler switching for MAPL?

Yes, you can use environment modules to manage Fortran compiler switching for MAPL by safely loading and purging compiler-specific modules. This ensures correct environment variables and runtime library paths are configured for each build.

What is the best way to configure Fortran compiler settings when building MAPL?

The best way to configure Fortran compiler settings when building MAPL is by using a `mapl-config.yaml` file or defining specific environment variables. This ensures build configurations are correctly applied for NAG, gfortran, or Intel compilers.

How do I fix incorrect Fortran compiler detection and runtime library path issues in MAPL?

To fix incorrect Fortran compiler detection and runtime library path issues in MAPL, verify that all previous environment modules are purged before loading the new compiler. Ensure your build directory strictly matches the currently loaded compiler environment.