<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Danyang,<div class=""><br class=""></div><div class="">Just to reiterate, the presence of -Wl,-flat_namespace *is* the problem. I got rid of it by configuring mpich with --enable-two-level-namespace. I reported this problem to the PETSc </div><div class="">folks a few weeks ago and they were going to patch MPICH.py (under config/BuildSystem/config/packages) to pass this flag. So you could try configuring with —download-mpich </div><div class="">(or build your own mpich, which is pretty straightforward). If you’re wedded to openmpi, you could patch up OpenMPI.py yourself (maybe --enable-two-level-namespace is called </div><div class="">something else for openmpi).</div><div class=""><br class=""></div><div class="">Best,</div><div class=""><br class=""></div><div class="">Samar</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 13, 2022, at 6:01 AM, Danyang Su <<a href="mailto:danyang.su@gmail.com" class="">danyang.su@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Samar,<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thanks for your suggestion. Unfortunately, it does not work. I checked the mpif90 wrapper and the option "-Wl,-flat_namespace” is present.<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">(base)<span class="Apple-converted-space"> </span></span><b class=""><span style="font-size: 8.5pt; font-family: "Segoe UI Symbol", sans-serif; color: rgb(57, 192, 38);" class="">➜</span></b><b class=""><span style="font-size: 8.5pt; font-family: Menlo; color: rgb(57, 192, 38);" class=""> <span class="Apple-converted-space"> </span></span></b><b class=""><span style="font-size: 8.5pt; font-family: Menlo; color: rgb(56, 185, 199);" class="">bin</span></b><span style="font-size: 8.5pt; font-family: Menlo;" class=""><span class="Apple-converted-space"> </span>./mpif90 -show<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">ifort -I/Users/danyangsu/Soft/PETSc/petsc-3.16.3/macos-intel-dbg/include -Wl,-flat_namespace -Wl,-commons,use_dylibs -I/Users/danyangsu/Soft/PETSc/petsc-3.16.3/macos-intel-dbg/lib -L/Users/danyangsu/Soft/PETSc/petsc-3.16.3/macos-intel-dbg/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thanks anyway,<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Danyang<o:p class=""></o:p></div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 12pt;" class="">From:<span class="Apple-converted-space"> </span></span></b><span style="font-size: 12pt;" class="">Samar Khatiwala <<a href="mailto:samar.khatiwala@earth.ox.ac.uk" class="">samar.khatiwala@earth.ox.ac.uk</a>><br class=""><b class="">Date:<span class="Apple-converted-space"> </span></b>Wednesday, January 12, 2022 at 2:01 PM<br class=""><b class="">To:<span class="Apple-converted-space"> </span></b>Danyang Su <<a href="mailto:danyang.su@gmail.com" class="">danyang.su@gmail.com</a>><br class=""><b class="">Cc:<span class="Apple-converted-space"> </span></b>PETSc <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>><br class=""><b class="">Subject:<span class="Apple-converted-space"> </span></b>Re: [petsc-users] PETSc configuration error on macOS Monterey with Intel oneAPI<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Danyang,<o:p class=""></o:p></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">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” <o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">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 <o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">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 <o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">"--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).<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Samar<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><br class=""><br class=""><o:p class=""></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="" type="cite"><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On Jan 12, 2022, at 9:41 PM, Danyang Su <<a href="mailto:danyang.su@gmail.com" style="color: blue; text-decoration: underline;" class="">danyang.su@gmail.com</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><p class="p1" style="margin-right: 0cm; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><span class="s1">Hi All,</span><o:p class=""></o:p></p><p class="p1" style="margin-right: 0cm; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><span class="s1">I got an error in PETSc configuration on macOS Monterey with Intel oneAPI using the following options:</span><o:p class=""></o:p></p><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="s1"> </span><o:p class=""></o:p></div></div><p class="p1" style="margin-right: 0cm; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><span class="s1">./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</span><o:p class=""></o:p></p><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="s1"> </span><o:p class=""></o:p></div></div><p class="p1" style="margin-right: 0cm; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><span class="s1">Error with downloaded OpenMPI: Cannot compile/link FC with /Users/danyangsu/Soft/PETSc/petsc-3.16.3/macos-intel-dbg/bin/mpif90.</span><o:p class=""></o:p></p><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="s1"> </span><o:p class=""></o:p></div></div><p class="p1" style="margin-right: 0cm; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><span class="s1">Any suggestions for that?</span><o:p class=""></o:p></p><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="s1"> </span><o:p class=""></o:p></div></div><p class="p1" style="margin-right: 0cm; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><span class="s1">There is no problem if I use GNU compiler and MPICH.</span><o:p class=""></o:p></p><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="s1"> </span><o:p class=""></o:p></div></div><p class="p1" style="margin-right: 0cm; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><span class="s1">Thanks,</span><o:p class=""></o:p></p><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="s1"> </span><o:p class=""></o:p></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="s1">Danyang</span></div></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></div></body></html>