I have a petsc build on OSX with PETSC_ARCH=gcc-9.2.0^openmpi-3.1.1. The '^' character in the folder name seems to cause a call to echo in ${petsc_config_makefile} return bad data. Investigating a little more, it seems the behavior of 'echo' is notoriously non-portable, especially when used with flags and variables that contain dashes.
Problem in FindPETSc.cmake Line 159:
\t-@echo -n \${\${VARIABLE}}
I have a petsc build on OSX with PETSC_ARCH=gcc-9.2.0^openmpi-3.1.1. The '^' character in the folder name seems to cause a call to echo in ${petsc_config_makefile} return bad data. Investigating a little more, it seems the behavior of 'echo' is notoriously non-portable, especially when used with flags and variables that contain dashes.
Problem in FindPETSc.cmake Line 159: \t-@echo -n \${\${VARIABLE}}
Proposed solution: \t-@printf '%s' \${\${VARIABLE}}
The proposed solution solves my build error, I just wasn't sure if it would cause any issues with other build configurations.