How amd/mumps-build works
Main Components
• Core Build System: At the heart is the CMake build system, which manages configuration, external dependency fetching (e.g., the MUMPS tarball, AOCL libraries, Metis, and Boost) and build generation via Ninja.
• MUMPS Source Integration: The project downloads the upstream MUMPS tarball, injects custom CMakeLists (in directories like “cmake” and “PORD”) to patch and integrate the MUMPS source with additional build scripts.
• Dependency Management: CMake modules that search and configure dependencies (FindLAPACK.cmake, FindMETIS.cmake, etc.) and user-specified paths (e.g., paths for AOCL-BLAS, AOCL-LAPACK, Scalapack, Metis, Intel compilers, and Boost).
• CI/CD Pipeline: The .github/workflows directory shows multiple CI configurations (for Windows and oneapi environments) which ensure continuous integration and testing.
• Testing / Examples: Directories such as “test” and “example” house sample codes and test harnesses (like amd_mumps.cpp and simple.c) to verify the solver build and performance.
• Additional Wrappers & Integration: Directories such as “libseq” (for sequential library building) and “matlab” (for MATLAB interface examples) indicate the project supports multiple usage scenarios.
Component Relationships and Interactions
• The CMake front-end acts as the orchestrator that:
• Downloads the MUMPS source tarball.
• Configures external dependencies by referring to user inputs and internal CMake modules.
• Directs the build process using Ninja and integration tests.
• The CI/CD pipelines (defined in the GitHub workflows) automatically trigger build and test jobs to validate configurations and compiler choices.
• External tools (e.g., Intel oneAPI compilers, prebuilt AOCL libraries, Metis from SuiteSparse, and Boost) link into the build process as specified by the user through a rich set of CMake options.
• The test applications and examples layer on top of the built libraries to check for performance (e.g., running an MPI test invocation) and correctness.
Architectural Patterns and Design Principles
• Modular Build Configuration: The project leverages multiple CMake modules and configuration scripts to maintain a clean separation of concerns (i.e., dependency discovery vs. compile-time configuration).
• External Dependency Injection: Instead of bundling MUMPS sources, the system downloads and patches them, making the build process highly configurable.
• Cross-Platform & CI Integration: With dedicated workflows for different platforms (Windows and oneAPI environments), the design ensures the build process is both reproducible and automated.
• Extensibility: The clear separation between core solver integration (“src”, “PORD”) and ancillary functionalities (testing, MATLAB integration, sequential version build in “libseq”) allows for future enhancement without significant refactoring.
Technologies, Frameworks, and Tools
• Build Technology: CMake, Ninja, GitHub Actions.
• Compilers: Intel oneAPI suite (C, C++ and Fortran compilers).
• Libraries: AOCL (BLAS, LAPACK, Scalapack), Boost, external reordering libraries (Metis, optionally Scotch) and MPI.
• Scripting and Packaging: Custom CMake modules and scripts (Python for patching, batch and PowerShell scripts in workflows).
Final Suggestions
• Reinforce connections between the build orchestration (CMake and all its custom modules) and the CI configurations (GitHub workflows), as these are critical to understanding how changes propagate through the system.