Hi Danyang, I had trouble configuring PETSc on MacOS Monterey with ifort when using mpich (which I was building myself). I tracked it down to an errant "-Wl,-flat_namespace” option in the mpif90 wrapper. I rebuilt mpich with the "--enable-two-level-namespace” configuration option and the problem went away. I don’t know if there’s a similar issue with openmpi but you could check the corresponding mpif90 wrapper (mpif90 -show) whether "-Wl,-flat_namespace” is present or not. If so, perhaps passing "--enable-two-level-namespace” to PETSc configure might fix the problem (although I don’t know how you would set this flag *just* for building openmpi).
Samar > On Jan 12, 2022, at 9:41 PM, Danyang Su <danyang...@gmail.com> wrote: > > Hi All, > > I got an error in PETSc configuration on macOS Monterey with Intel oneAPI > using the following options: > > > ./configure --with-cc=icc --with-cxx=icpc --with-fc=ifort > --with-blas-lapack-dir=/opt/intel/oneapi/mkl/2022.0.0/lib/ --with-debugging=1 > PETSC_ARCH=macos-intel-dbg --download-mumps --download-parmetis > --download-metis --download-hypre --download-superlu --download-hdf5=yes > --download-openmpi > > > Error with downloaded OpenMPI: Cannot compile/link FC with > /Users/danyangsu/Soft/PETSc/petsc-3.16.3/macos-intel-dbg/bin/mpif90. > > > Any suggestions for that? > > > There is no problem if I use GNU compiler and MPICH. > > > Thanks, > > > Danyang