Skip to content

Enhance CMake error messaging for missing FYPP preprocessor  #1136

@srinjoy933

Description

@srinjoy933

hey @jvdp1 @jalvesz
The current build configuration process in stdlib utilizes a check for the fypp preprocessor, which is essential for generating Fortran source code from templates. Currently, if the fypp executable is not found in the system PATH, the build terminates with a generic error message directing the user to the documentation. While technically correct, this creates a significant bottleneck for new contributors, particularly those working on Windows environments where Python's Scripts directory (containing fypp.exe) is frequently omitted from the system PATH by default.

I recently encountered this exact issue while setting up the development environment on a Windows 11 machine. Despite having successfully installed fypp via pip, the CMake configuration failed repeatedly because the executable was located in a non-standard roaming directory. Navigating this "silent failure" required several manual overrides and a deep dive into the stdlib.cmake logic, which could discourage potential GSoC applicants or first-time contributors from proceeding with the project.

The proposed solution:
To implement more robust "Defensive Programming" within the preprocess function and the main CMakeLists.txt. Instead of a simple failure message, the build system should provide actionable technical guidance. This includes explicitly suggesting a check for the Python Scripts folder, providing the exact pip install command, and documenting the -DFYPP_EXECUTABLE flag as a manual override. By transforming this fatal error into a diagnostic tool, we can significantly reduce the "Time-to-First-Build" for new developers and ensure a smoother onboarding experience for the community.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions