Skip to content

Add WRF-style executable checks to WPS compile script#287

Open
HathewayWill wants to merge 3 commits into
wrf-model:developfrom
HathewayWill:master
Open

Add WRF-style executable checks to WPS compile script#287
HathewayWill wants to merge 3 commits into
wrf-model:developfrom
HathewayWill:master

Conversation

@HathewayWill
Copy link
Copy Markdown

Summary

This PR updates the WPS compile script to perform WRF-style executable checks after compilation. The script now verifies that each requested target produced the expected .exe file and reports a clear success or failure message for each build target.

Changes

  • Added per-target executable checks after each WPS build step.
  • Added final executable summary checks for all requested targets.
  • Added explicit tracking of expected executables for wps, util, and individual compile targets.
  • Added failure reporting for missing executable files or missing symbolic links.
  • Updated the script to exit with a nonzero status if any requested executable is missing.
  • Preserved the existing WPS target-selection logic and build commands.

Motivation

Previously, the WPS compile script could finish without clearly reporting whether all requested executables were successfully created. This made it easier to miss failed builds, especially when compiling multiple targets such as geogrid, ungrib, metgrid, and utilities.

This change makes the WPS compile output more consistent with the WRF build output, where expected executables are checked and a clear success or failure message is printed.

Testing

Tested compilation of a WPS utility target and confirmed that the updated script reports successful executable creation, including the linked executable path.

Example successful output:

--->                  int2nc.exe successfully built                  <---

TYPE: enhancement

KEYWORDS: WPS, AOCC, flang, clang, AMD, x86_64, configure, dmpar, serial

SOURCE: Will H ([affiliation])

DESCRIPTION OF CHANGES:
Problem:
WPS does not currently provide a configure option for building on AMD Linux x86_64 systems with the AMD Optimizing C/C++ and Fortran Compiler suite. Users who want to build WPS with AOCC flang, AOCC clang, AMD LibM, OpenMP, and AOCC/LLVM optimization options must manually edit the generated configure.wps file or maintain a local configuration stanza.

This also makes WPS inconsistent with AOCC-based WRF builds, where AOCC-specific compiler and linker options can be selected through the configure system.

Solution:
Added a new WPS architecture stanza for:

  AMD Linux x86_64, AOCC flang compiler with AOCC clang

The new stanza supports the following WPS build modes:

  serial
  serial_NO_GRIB2
  dmpar
  dmpar_NO_GRIB2

The stanza defines AOCC flang as the serial Fortran compiler, AOCC clang as the serial C compiler, and the MPI compiler wrappers for distributed-memory builds. It also adds AOCC-oriented Fortran, C, preprocessing, archive, and link flags, including AMD Zen tuning, OpenMP, AMD LibM vector library support, byte swapping, and AOCC/LLVM link-time optimization options.

The AOCC vectorization option used in LDFLAGS follows the spelling documented in the AOCC 4.0 User Guide:

  -vectorize-non-contiguous-memory-aggressively

No WPS algorithms, data processing behavior, or scientific results are changed. This change only adds a supported configure path for AOCC builds.

ISSUE:
N/A

LIST OF MODIFIED FILES:
M	arch/configure.defaults

TESTS CONDUCTED:
1. Build/configure validation:
   [Replace with actual test result.]

   Suggested validation:
   - Run ./clean -a
   - Run ./configure
   - Select the new AOCC flang/clang option for serial and/or dmpar
   - Confirm that configure.wps is generated with flang, clang, mpifort, and mpicc as expected
   - Run ./compile
   - Confirm that the expected WPS executables are produced, such as geogrid.exe, ungrib.exe, and metgrid.exe

2. Jenkins tests:
   Not run locally. To be verified by the WPS automated test suite.

RELEASE NOTE:
Added a WPS configure option for AMD Linux x86_64 systems using AOCC flang and AOCC clang. The new stanza supports serial, serial_NO_GRIB2, dmpar, and dmpar_NO_GRIB2 builds, and includes AOCC-oriented optimization, OpenMP, AMD LibM, and AMD Zen tuning flags. The AOCC vectorization option follows the spelling documented in the AMD AOCC User Guide, Publication #57222, Revision wrf-model#4.0, November 2022.
removing zen3 architecture requirement
## Summary

This PR updates the WPS `compile` script to perform WRF-style executable checks after compilation. The script now verifies that each requested target produced the expected `.exe` file and reports a clear success or failure message for each build target.

## Changes

- Added per-target executable checks after each WPS build step.
- Added final executable summary checks for all requested targets.
- Added explicit tracking of expected executables for `wps`, `util`, and individual compile targets.
- Added failure reporting for missing executable files or missing symbolic links.
- Updated the script to exit with a nonzero status if any requested executable is missing.
- Preserved the existing WPS target-selection logic and build commands.

## Motivation

Previously, the WPS `compile` script could finish without clearly reporting whether all requested executables were successfully created. This made it easier to miss failed builds, especially when compiling multiple targets such as `geogrid`, `ungrib`, `metgrid`, and utilities.

This change makes the WPS compile output more consistent with the WRF build output, where expected executables are checked and a clear success or failure message is printed.

## Testing

Tested compilation of a WPS utility target and confirmed that the updated script reports successful executable creation, including the linked executable path.

Example successful output:

```text
--->                  int2nc.exe successfully built                  <---
@HathewayWill
Copy link
Copy Markdown
Author

@weiwangncar I'm sure I did this wrong can you please check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant