The function ecbuild_remove_fortran_flags() uses an incorrect REGEX to remove flags from the Fortran_FLAGS variables. Specifying flag -g will remove the leading -g from any flag that starts that way. e.g., the intel flag -gcc-name=gcc-9.3.0 -> cc-name=gcc-9.3.0 -> BOOM.
This PR fixes the regex to preserve all other flags except the exact matched flag.
The function
ecbuild_remove_fortran_flags()
uses an incorrect REGEX to remove flags from the Fortran_FLAGS variables. Specifying flag-g
will remove the leading-g
from any flag that starts that way. e.g., the intel flag-gcc-name=gcc-9.3.0
->cc-name=gcc-9.3.0
-> BOOM.This PR fixes the regex to preserve all other flags except the exact matched flag.
Test script for improved REGEX.
Run as:
Output: