configuring petsc with following command on zsh
./configure \
--CC=/opt/homebrew/Cellar/mpich/4.1.2/bin/mpicc
--CXX=/opt/homebrew/Cellar/mpich/4.1.2/bin/mpicxx
--FC=opt/homebrew/Cellar/mpich/4.1.2/bin/mpif90
--PETSC_ARCH=$PETSC_ARCH
--with-debugging=1
--download-hypre=1
--with-x=0
make -j4
make -j4 test
As you can see, default brew installation path has already been changed to /opt/homebrew/ where link files can be found (here I specified actual location of compiler. Unfortunately, the message I get is the following:
=============================================================================================
Configuring PETSc to compile on your system
TESTING: checkCCompiler from config.setCompilers(config/BuildSystem/config/setCompilers.py:1420)
UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):
C compiler you provided with -CC=/opt/homebrew/Cellar/mpich/4.1.2/bin/mpicc cannot be found or does not work. If the above linker messages do not indicate failure of the compiler you can rerun with the option --ignoreLinkOutput=1