<div>Yes, the problem came from the compatibility between xcode, version of MacOS.</div><div><br></div><div>At first, my MacOS system is 15.1. Then, I upgraded it to 15.5. And the issues occured because I forgot to upgrade the xcode </div><div>(not only upgrade, but need to reinstall). This is the reason why there were issues between MPI and gcc. So, I reinstalled the xcode,</div><div>but there were a bug that the name of the sdk (updration modified the name of MacOS15.1.sdk as MacOS15.5.sdk ) such that the vtk</div><div>petsc linking cannot find the correct openGL path. I solved the issue just directly change the name back to MacOS15.1.sdk </div><div><br></div><div><br></div><div><sign signid="99"><div><font><br></font><font><br></font><font><br></font><font><br></font><div style="color:#909090;font-family:Arial Narrow;font-size:12px"></div></div><div style="font-size:14px;font-family:Verdana;color:#000;" class="signRealArea"><div><div class="logo" style="width:305px;height:35px;line-height:35px;margin:20px 0 0 0;"><img src="https://exmail.qq.com/cgi-bin/viewfile?type=logo&domain=mail.sustech.edu.cn" onerror=""></div><div class="c_detail" style="margin:10px 0 0 0;"><h4 class="name" style="margin:0;font-size:14px;font-weight:bold;line-height:28px;zoom:1;">David Jiawei LUO LIANG</h4><p class="position" style="margin:0;line-height:22px;color:#a0a0a0;"></p><p class="department" style="margin:0;line-height:22px;color:#a0a0a0;">南方科技大学/学生/研究生/2024</p><p class="phone" style="margin:0;line-height:22px;color:#a0a0a0;"></p><p class="addr" style="margin:0;line-height:22px;color:#a0a0a0;">广东省深圳市南山区学苑大道1088号</p></div></div></div></sign></div><div> </div><div><includetail><div> </div><div> </div><div style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div id="menu_sender"><b>From: </b> "Satish Balay"<balay.anl@fastmail.org>;</div><div><b>Date: </b> Mon, Jun 9, 2025 10:53 PM</div><div><b>To: </b> "Matthew Knepley"<knepley@gmail.com>; <wbr></div><div><b>Cc: </b> "David Jiawei LUO LIANG"<12431140@mail.sustech.edu.cn>; "petsc-dev"<petsc-dev@mcs.anl.gov>; <wbr></div><div><b>Subject: </b> Re: [petsc-dev] Petsc cannot be configure</div></div><div> </div><div style="position:relative;"><div id="tmpcontent_res"></div>

Also use latest petsc version<br><br>There have been issues since xcode v15 - and various versions of pkgs (petsc, mpich etc) - required different workarounds.<br><br>Latest petsc, mpich should work well with latest xcode - without requiring these workarounds.<br><br>[and this MPICH is likely compiled with older xcode version - and hence is having issues with currently used xcode<br><br>Satish<br><br>-------<br>Executing: /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpicc --version<br>stdout:<br>Apple clang version 16.0.0 (clang-1600.0.26.6)<br>Target: arm64-apple-darwin24.1.0<br><br>Executing: /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpicc -show<br>stdout: gcc -Wl,-ld_classic -Wl,-commons,use_dylibs -I/Users/lawkawai/lib/mpich-4.2.3-opt/include -L/Users/lawkawai/lib/mpich-4.2.3-opt/lib -lmpi -lpmpi<br><br><br>On Mon, 9 Jun 2025, Matthew Knepley wrote:<br><br>> It appears that MPICH 4.2.3 is incompatible with C++ clang. You can have<br>> PETSc download and build the latest MPICH using<br>> <br>>   --download-mpich<br>> <br>>   Thanks,<br>> <br>>      Matt<br>> <br>> On Mon, Jun 9, 2025 at 6:05 AM David Jiawei LUO LIANG <<br>> 12431140@mail.sustech.edu.cn> wrote:<br>> <br>> > Ok, the configure.log is attached.<br>> > I try again configuration without cxx<br>> ><br>> > *➜* ./configure --with-cxx=0 --with-pic --with-make-np=4<br>> > --with-mpi-compilers=1 --with-mpi-dir=/Users/lawkawai/lib/mpich-4.2.3-opt/<br>> > --with-scalar-type=real --with-precision=double --download-mumps<br>> > --download-scalapack --download-metis --download-hdf5 --download-slepc<br>> > --download-hypre --with-debugging=no<br>> > --prefix=/Users/lawkawai/codes/HPC_class/HW5/lib/petsc-3.22.1-opt<br>> ><br>> ><br>> > =============================================================================================<br>> ><br>> >                          Configuring PETSc to compile on your system<br>> ><br>> ><br>> > =============================================================================================<br>> ><br>> > TESTING: configureExternalPackagesDir from<br>> > config.framework(config/BuildSystem/config/framework.py:1092)<br>> ><br>> ><br>> > *********************************************************************************************<br>> ><br>> >            UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for<br>> > details):<br>> ><br>> ><br>> > ---------------------------------------------------------------------------------------------<br>> ><br>> >                 Package hypre requested requires C++ but compiler turned<br>> > off.<br>> ><br>> ><br>> > *********************************************************************************************<br>> ><br>> > bu I need hypre, and it needs C++ to compile<br>> > ----------------------------------------<br>> > Sorry, I attached the wrong configure.log.<br>> > This is the right configure.log for the MPI & C++ errors<br>> ><br>> ><br>> ><br>> > David Jiawei LUO LIANG<br>> ><br>> > 南方科技大学/学生/研究生/2024<br>> ><br>> > 广东省深圳市南山区学苑大道1088号<br>> ><br>> ><br>> ><br>> > ------------------ Original ------------------<br>> > *From: * "Matthew Knepley"<knepley@gmail.com>;<br>> > *Date: * Mon, Jun 9, 2025 05:44 PM<br>> > *To: * "Jose E. Roman"<jroman@dsic.upv.es>;<br>> > *Cc: * "David Jiawei LUO LIANG"<12431140@mail.sustech.edu.cn>;<br>> > "petsc-dev"<petsc-dev@mcs.anl.gov>;<br>> > *Subject: * Re: [petsc-dev] Petsc cannot be configure<br>> ><br>> > Yes, send the configure log.<br>> ><br>> > It seems that you did not build the C++ bindings for MPICH. You can shut<br>> > of C++ in PETSc using<br>> ><br>> >   --with-cxx=0<br>> ><br>> >   Thanks,<br>> ><br>> >      Matt<br>> ><br>> > On Mon, Jun 9, 2025 at 5:42 AM Jose E. Roman via petsc-dev <<br>> > petsc-dev@mcs.anl.gov> wrote:<br>> ><br>> >> You should always attach the configure.log file.<br>> >><br>> >> Thanks.<br>> >> Jose<br>> >><br>> >><br>> >> > El 9 jun 2025, a las 11:14, David Jiawei LUO LIANG <<br>> >> 12431140@mail.sustech.edu.cn> escribió:<br>> >> ><br>> >> > ./configure --with-x=0 -with-pic --with-make-np=4<br>> >> --with-mpi-compilers=1 --with-mpi-dir=/Users/lawkawai/lib/mpich-4.2.3-opt/<br>> >> --with-scalar-type=real --with-precision=double --with-mumps=1<br>> >> --download-mumps --with-scalapack=1 --download-scalapack --with-blacs=1<br>> >> --download-blacs --download-fblaslapack --download-metis --download-hdf5<br>> >> --with-debugging=no --download-slepc<br>> >> --prefix=/Users/lawkawai/lib/petsc-3.23.3-opt<br>> >> > the error:<br>> >> ><br>> >> =============================================================================================<br>> >> >                          Configuring PETSc to compile on your system<br>> >> ><br>> >> =============================================================================================<br>> >> ><br>> >> =============================================================================================<br>> >> >                                      ***** WARNING *****<br>> >> >   Found environment variable: FFLAGS=-w -fallow-argument-mismatch -O2.<br>> >> Ignoring it! Use<br>> >> >   "./configure FFLAGS=$FFLAGS" if you really want to use this value<br>> >> ><br>> >> =============================================================================================<br>> >> ><br>> >> =============================================================================================<br>> >> >                                      ***** WARNING *****<br>> >> >   Using default C optimization flags "-g -O3". You might consider<br>> >> manually setting optimal<br>> >> >   optimization flags for your system with COPTFLAGS="optimization<br>> >> flags" see<br>> >> >   config/examples/arch-*-opt.py for examples<br>> >> ><br>> >> =============================================================================================<br>> >> ><br>> >> =============================================================================================<br>> >> >                                      ***** WARNING *****<br>> >> >   Using default Cxx optimization flags "-g -O3". You might consider<br>> >> manually setting<br>> >> >   optimal optimization flags for your system with<br>> >> CXXOPTFLAGS="optimization flags" see<br>> >> >   config/examples/arch-*-opt.py for examples<br>> >> ><br>> >> =============================================================================================<br>> >> ><br>> >> =============================================================================================<br>> >> >                                      ***** WARNING *****<br>> >> >   Using default FC optimization flags "-g -O". You might consider<br>> >> manually setting optimal<br>> >> >   optimization flags for your system with FOPTFLAGS="optimization<br>> >> flags" see<br>> >> >   config/examples/arch-*-opt.py for examples<br>> >> ><br>> >> =============================================================================================<br>> >> ><br>> >> =============================================================================================<br>> >> >                                      ***** WARNING *****<br>> >> >   You have a version of GNU make older than 4.0. It will work, but may<br>> >> not support all the<br>> >> >   parallel testing options. You can install the latest GNU make with<br>> >> your package manager,<br>> >> >   such as Brew or MacPorts, or use the --download-make option to get<br>> >> the latest GNU make<br>> >> ><br>> >> =============================================================================================<br>> >> > TESTING: CxxMPICheck from<br>> >> config.packages.MPI(config/BuildSystem/config/packages/MPI.py:673)<br>> >> ><br>> >> *********************************************************************************************<br>> >> >            UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log<br>> >> for details):<br>> >> ><br>> >> ---------------------------------------------------------------------------------------------<br>> >> >                        C++ error! MPI_Finalize() could not be located!<br>> >> ><br>> >> *********************************************************************************************<br>> >> ><br>> >> ><br>> >> > Iam sure my mpich is good, it has been tested.  But the petsc configure<br>> >> still fail.<br>> >> ><br>> >> > David Jiawei LUO LIANG南方科技大学/学生/研究生/2024广东省深圳市南山区学苑大道1088号<br>> >> ><br>> >><br>> >><br>> ><br>> > --<br>> > What most experimenters take for granted before they begin their<br>> > experiments is infinitely more interesting than any results to which their<br>> > experiments lead.<br>> > -- Norbert Wiener<br>> ><br>> > https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ajgkAkDpjBBVmlczaLVO6Kdl1Oe_nfZxVLQC3_tHVIz3FFvUj13xyOiYSoRLmAaJMmU_JFljVPKtMtoN0TdH$ <br>> > <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ajgkAkDpjBBVmlczaLVO6Kdl1Oe_nfZxVLQC3_tHVIz3FFvUj13xyOiYSoRLmAaJMmU_JFljVPKtMtD7BqAw$ ><br>> ><br>> <br>> <br>> <br>


</div></div><!--<![endif]--></includetail></div>