<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="">Satish;<div class=""><br class=""></div><div class="">Thank you for the masterful demonstration.</div><div class=""><br class=""></div><div class="">One of the alternatives caught my eye:   —with-cxx=0 (I remember I had to do that ages ago on my macOS Darwin machine.</div><div class=""><br class=""></div><div class="">I cleared *FLAGS and successfully completed make && make check as suggested;</div><div class=""><br class=""></div><div class="">#=======================================================================</div><div class="">It may be moot now. Here is the requested OS, compiler information:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">cat /etc/os-release</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139); min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">NAME="Red Hat Enterprise Linux"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">VERSION="8.8 (Ootpa)"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">ID="rhel"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">ID_LIKE="fedora"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">VERSION_ID="8.8"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">PLATFORM_ID="platform:el8"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">PRETTY_NAME="Red Hat Enterprise Linux 8.8 (Ootpa)"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">ANSI_COLOR="0;31"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">HOME_URL="<a href="https://urldefense.us/v3/__https://www.redhat.com/__;!!G_uCfscf7eWS!Z9OsinaKusqhhdPuDCNknHJq6f6UGZt17SofPYc-BvWQvrlqpeDbEEucEHNxioN04anLOPsjW0v_aCHG5RpV-0tjnQ$" class="">https://www.redhat.com/</a>"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">DOCUMENTATION_URL="<a href="https://urldefense.us/v3/__https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8__;!!G_uCfscf7eWS!Z9OsinaKusqhhdPuDCNknHJq6f6UGZt17SofPYc-BvWQvrlqpeDbEEucEHNxioN04anLOPsjW0v_aCHG5Roh1jkm1w$" class="">https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8</a>"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">BUG_REPORT_URL="<a href="https://urldefense.us/v3/__https://bugzilla.redhat.com/__;!!G_uCfscf7eWS!Z9OsinaKusqhhdPuDCNknHJq6f6UGZt17SofPYc-BvWQvrlqpeDbEEucEHNxioN04anLOPsjW0v_aCHG5RpG5qdUaQ$" class="">https://bugzilla.redhat.com/</a>"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139); min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">REDHAT_BUGZILLA_PRODUCT_VERSION=8.8</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">REDHAT_SUPPORT_PRODUCT_VERSION="8.8"</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures; background-color: #e0e409" class="">clang</span><span style="font-variant-ligatures: no-common-ligatures" class=""> version 20.0.0git (<a href="https://urldefense.us/v3/__https://github.com/llvm/llvm-project.git__;!!G_uCfscf7eWS!Z9OsinaKusqhhdPuDCNknHJq6f6UGZt17SofPYc-BvWQvrlqpeDbEEucEHNxioN04anLOPsjW0v_aCHG5RoxqM2a5g$" class="">https://github.com/llvm/llvm-project.git</a> 48d0ef1a07993139e1acf65910704255443103a5)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Target: x86_64-unknown-linux-gnu</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Thread model: posix</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">InstalledDir: /tmp/build_release/bin</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Clang version: 20.0.0git</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">LLVM version: LLVM version 20.0.0git (48d0ef1a07993139e1acf65910704255443103a5<unknown encoding></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">C++ standard:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Host target: x86_64-unknown-linux-gnu</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Supported targets:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  Registered Targets:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    x86    - 32-bit X86: Pentium-Pro and above</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    x86-64 - 64-bit X86: EM64T and AMD64</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">flang version 20.0.0git (<a href="https://urldefense.us/v3/__https://github.com/llvm/llvm-project.git__;!!G_uCfscf7eWS!Z9OsinaKusqhhdPuDCNknHJq6f6UGZt17SofPYc-BvWQvrlqpeDbEEucEHNxioN04anLOPsjW0v_aCHG5RoxqM2a5g$" class="">https://github.com/llvm/llvm-project.git</a> 48d0ef1a07993139e1acf65910704255443103a5)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Target: x86_64-unknown-linux-gnu</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Thread model: posix</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">InstalledDir: /tmp/build_release/bin</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Flang version: 20.0.0git</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Host target: x86_64-unknown-linux-gnu</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Fortran compiler: GNU Fortran (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Compiler path: /usr/bin/gfortran</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Version:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  -std=<standard>          Assume that the input sources are for <standard>.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Default flags: No default flags information available</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Target: x86_64-redhat-linux</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#=======================================================================</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">Thank you again.</div><div class=""><br class=""></div></span></div></span></div><blockquote type="cite" class=""><div class="">On Feb 20, 2025, at 2:44 PM, Satish Balay <<a href="mailto:balay.anl@fastmail.org" class="">balay.anl@fastmail.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">A couple of alternates (if mixing compiler versions can't be avoided):<br class=""><br class="">- don't need to use petsc from fortran:<br class="">[balay@frog petsc]$ ./configure --with-cc=clang --with-cxx=clang++ --with-fc=0 --with-mpi=0 --download-f2cblaslapack && make && make check<br class=""><br class="">- don't use c++:<br class="">[balay@frog petsc]$ ./configure --with-cc=clang --with-cxx=0 --with-fc=gfortran --with-mpi=0 && make && make check<br class=""><br class="">- add in v14 -lstdc++ location ahead in the search path - so that even when -lgfortran is found in v11,  v14 -lstdc++ gets picked up correctly.<br class="">[balay@frog petsc]$ ./configure LDFLAGS=-L/opt/rh/gcc-toolset-14/root/usr/lib/gcc/x86_64-redhat-linux/14/ --with-cc=clang --with-cxx=clang++ --with-fc=gfortran --with-mpi=0 && make && make check<br class=""><br class="">Satish<br class=""><br class="">On Thu, 20 Feb 2025, Satish Balay wrote:<br class=""><br class=""><blockquote type="cite" class="">Ok - I see this issue on CentOS [Stream/9].<br class=""><br class="">What I have is:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class=""></blockquote></blockquote></blockquote>[balay@frog petsc]$ clang --version<br class="">clang version 19.1.7 (CentOS 19.1.7-1.el9)<br class="">Target: x86_64-redhat-linux-gnu<br class="">Thread model: posix<br class="">InstalledDir: /usr/bin<br class="">Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg<br class="">[balay@frog petsc]$ gfortran --version<br class="">GNU Fortran (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5)<br class="">Copyright (C) 2021 Free Software Foundation, Inc.<br class="">This is free software; see the source for copying conditions.  There is NO<br class="">warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br class=""><<<<<br class=""><br class="">Now I build:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class=""></blockquote></blockquote></blockquote>[balay@frog petsc]$ ./configure --with-cc=clang --with-cxx=clang++ --with-fc=gfortran --with-mpi=0 && make && make check<br class=""><snip><br class="">*********************************************************************************<br class="">clang -fPIC -Wall -Wwrite-strings -Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion -fstack-protector -Qunused-arguments -fvisibility=hidden -Wall -Wwrite-strings -Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion -fstack-protector -Qunused-arguments -fvisibility=hidden -g3 -O0  -I/home/balay/petsc/include -I/home/balay/petsc/arch-linux-c-debug/include     -Wl,-export-dynamic ex19.c  -Wl,-rpath,/home/balay/petsc/arch-linux-c-debug/lib -L/home/balay/petsc/arch-linux-c-debug/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/11 -L/usr/lib/gcc/x86_64-redhat-linux/11 -lpetsc -llapack -lblas -lm -lX11 -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lstdc++ -o ex19<br class="">/opt/rh/gcc-toolset-14/root//usr/lib/gcc/x86_64-redhat-linux/14/../../../../bin/ld: /home/balay/petsc/arch-linux-c-debug/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_cold(char*, unsigned long, char const*, unsigned long, unsigned long)'<br class=""><snip><br class=""><<<<<br class=""><br class="">Ok some v11 compiler libraries are getting mixed up (likely from -lgfortran) causing grief.<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class=""></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>[root@frog ~]# yum remove gcc-toolset-14-runtime<br class="">Dependencies resolved.<br class="">================================================================================<br class=""> Package                          Arch     Version           Repository    Size<br class="">================================================================================<br class="">Removing:<br class=""> gcc-toolset-14-runtime           x86_64   14.0-1.el9        @appstream    11 k<br class="">Removing dependent packages:<br class=""> clang                            x86_64   19.1.7-1.el9      @appstream   181 k<br class=""> clang-tools-extra                x86_64   19.1.7-1.el9      @appstream    69 M<br class=""> gcc-toolset-14-binutils          x86_64   2.41-3.el9        @appstream    27 M<br class="">Removing unused dependencies:<br class=""> clang-libs                       x86_64   19.1.7-1.el9      @appstream   413 M<br class=""> clang-resource-filesystem        x86_64   19.1.7-1.el9      @appstream    15 k<br class=""> compiler-rt                      x86_64   19.1.7-1.el9      @appstream    37 M<br class=""> gcc-toolset-14-gcc               x86_64   14.2.1-7.1.el9    @appstream   122 M<br class=""> gcc-toolset-14-gcc-c++           x86_64   14.2.1-7.1.el9    @appstream    39 M<br class=""> gcc-toolset-14-libstdc++-devel   x86_64   14.2.1-7.1.el9    @appstream    22 M<br class=""> libomp                           x86_64   19.1.7-1.el9      @appstream   1.9 M<br class=""> libomp-devel                     x86_64   19.1.7-1.el9      @appstream    31 M<br class=""><br class="">Transaction Summary<br class="">================================================================================<br class="">Remove  12 Packages<br class=""><br class="">Freed space: 763 M<br class="">Is this ok [y/N]: <br class=""><<<<<<br class=""><br class="">So this install of clang depends-on/requires gcc-toolset-14-gcc. Also gfortran-14 is missing. Try installing it.<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class=""></blockquote></blockquote></blockquote></blockquote>[root@frog ~]# yum install gcc-toolset-14-gcc-gfortran<br class=""><<<<<br class=""><br class="">Now retry build:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class=""></blockquote></blockquote></blockquote>[balay@frog petsc]$ ./configure --with-cc=clang --with-cxx=clang++ --with-fc=gfortran --with-mpi=0 && make && make check<br class=""><snip><br class="">Running PETSc check examples to verify correct installation<br class="">Using PETSC_DIR=/home/balay/petsc and PETSC_ARCH=arch-linux-c-debug<br class="">C/C++ example src/snes/tutorials/ex19 run successfully with 1 MPI process<br class="">Fortran example src/snes/tutorials/ex5f run successfully with 1 MPI process<br class="">Completed PETSc check examples<br class="">[balay@frog petsc]$ <br class=""><<<<<br class=""><br class="">Hm - Using gfortran-11 here [with gfortran-14 installed] somehow worked! But perhaps its better to use gfortran-14 [as this install of clang requires g++-14]<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class=""></blockquote></blockquote></blockquote></blockquote>[balay@frog petsc]$ export PATH=/opt/rh/gcc-toolset-14/root/usr/bin:$PATH<br class="">[balay@frog petsc]$ gfortran --version<br class="">GNU Fortran (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)<br class="">Copyright (C) 2024 Free Software Foundation, Inc.<br class="">This is free software; see the source for copying conditions.  There is NO<br class="">warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br class=""><br class="">[balay@frog petsc]$ ./configure --with-cc=clang --with-cxx=clang++ --with-fc=gfortran --with-mpi=0 && make && make check<br class=""><snip><br class="">    CLINKER arch-linux-c-debug/lib/libpetsc.so.3.22.3<br class="">=========================================<br class="">Now to check if the libraries are working do:<br class="">make PETSC_DIR=/home/balay/petsc PETSC_ARCH=arch-linux-c-debug check<br class="">=========================================<br class="">Running PETSc check examples to verify correct installation<br class="">Using PETSC_DIR=/home/balay/petsc and PETSC_ARCH=arch-linux-c-debug<br class="">C/C++ example src/snes/tutorials/ex19 run successfully with 1 MPI process<br class="">Fortran example src/snes/tutorials/ex5f run successfully with 1 MPI process<br class="">Completed PETSc check examples<br class="">[balay@frog petsc]$ <br class=""><<<<<br class=""><br class="">So that worked!<br class=""><br class="">Satish<br class=""><br class=""><br class="">On Thu, 20 Feb 2025, Satish Balay wrote:<br class=""><br class=""><blockquote type="cite" class="">Actually, simpler:<br class=""><br class=""> ./configure --with-cc=clang --with-cxx=clang++ --with-fc=gfortran  --with-mpi=0 --download-fblaslapack="$(DIR_SRC)/fblaslapack-$(FBLASLAPACK_VERSION).tar.gz" && make && make check<br class=""><br class=""><blockquote type="cite" class="">/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../bin/ld<br class=""></blockquote><br class="">Hm - there was in issue with some (clang versions?) incompatibilities with gcc-12 - I think using gcc-11 (system default in that use case) worked. I'm not sure if you are seeing the same issue here.<br class=""><br class="">Satish<br class=""><br class="">On Thu, 20 Feb 2025, Satish Balay wrote:<br class=""><br class=""><blockquote type="cite" class=""><br class="">Any particular reason to use these flags? What clang version? OS?<br class=""><br class="">Best if you can send build logs [perhaps to petsc-maint]<br class=""><br class="">Can you try a simpler build and see if it works:<br class=""><br class="">./configure --with-mpi-dir=/PATH_TO/models/src/v2021.03-2.0.3-llvm --download-fblaslapack="$(DIR_SRC)/fblaslapack-$(FBLASLAPACK_VERSION).tar.gz" && make && make check<br class="">or:<br class="">./configure --with-cc=clang --with-cxx=clang++ --with-fc=gfortran --download-mpich="$(DIR_SRC)/mpich-$(MPICH_VERSION).tar.gz" --download-fblaslapack="$(DIR_SRC)/fblaslapack-$(FBLASLAPACK_VERSION).tar.gz" && make && make check<br class=""><br class="">Satish<br class=""><br class="">On Thu, 20 Feb 2025, Michael Schaferkotter wrote:<br class=""><br class=""><blockquote type="cite" class="">build petsc-3.20.3 with llvm, clang, clang++, gfortran <br class=""><br class="">CFLAGS='-std=c++11'<br class="">CXXFLAGS='-std=c++11 -D_GLIBCXX_USE_CXX11_ABI=1'<br class="">LDLIBS += -lstdc++<br class=""><br class="">$PETSC_ARCH     arch-linux-c-opt<br class="">MPIF90  = ./models/src/v2021.03-2.0.3-llvm/bin/mpif90<br class="">MPICC   = ./models/src/v2021.03-2.0.3-llvm/bin/mpicc<br class="">CLANG   = clang<br class="">FC   = gfortran<br class=""><br class=""><br class="">Petsc libraries are built;<br class="">/models/src/v2021.03-2.0.3-llvm/lib/libpetsc.so@<br class="">/models/src/v2021.03-2.0.3-llvm/lib/libpetsc.so.3.020@<br class="">/models/src/v2021.03-2.0.3-llvm/lib/libpetsc.so.3.020.3*<br class=""><br class=""><br class="">The configure is this:<br class="">        cd $(PETSC_SRC) && unset CXX CC FC F77 && $(PYTHON2) ./configure --prefix=$(PREFIX) \<br class="">  --with-cc=clang \<br class="">  --with-cxx=clang++ \<br class="">  --with-fc=gfortran \<br class="">  --download-mpich="$(DIR_SRC)/mpich-$(MPICH_VERSION).tar.gz" \<br class="">  --download-fblaslapack="$(DIR_SRC)/fblaslapack-$(FBLASLAPACK_VERSION).tar.gz" \<br class="">  --download-sowing \<br class="">  --with-debugging=$(PETSC_DBG) \<br class="">  --with-shared-libraries=1 \<br class=""> CFLAGS='-std=c11' \<br class="">  CXXFLAGS='-std=c++11 -D_GLIBCXX_USE_CXX11_ABI=1' \<br class="">  CPPFLAGS='-D_GLIBCXX_USE_CXX11_ABI=1' \<br class="">  LDFLAGS='-L$(LLVM_LIB)' \<br class="">  LIBS='-lstdc++’ \<br class="">  --COPTFLAGS=$(COPTFLAGS) --CXXOPTFLAGS=$(CXXOPTFLAGS) --FOPTFLAGS=$(FOPTFLAGS)<br class=""><br class=""><br class="">Here is the make:<br class=""><br class="">        $(MAKE) -C $(PETSC_SRC) PETSC_DIR=$(PETSC_SRC) PETSC_ARCH=$(PETSC_ARCH) all<br class=""><br class=""><br class="">Check-petsc is:<br class=""><br class="">        $(MAKE) -C $(PETSC_SRC) PETSC_DIR=$(PETSC_SRC) PETSC_ARCH=$(PETSC_ARCH) test<br class=""><br class="">Here is the log file for test:<br class=""><br class="">make[1]: Entering directory '/models/src/v2021.03-2.0.3-llvm/build/petsc/petsc-3.20.3'<br class="">/usr/bin/python3 /models/src/v2021.03-2.0.3-llvm/build/petsc/petsc-3.20.3/config/gmakegentest.py --petsc-dir=/models/src/v2021.03-2.0.3-llvm/build/petsc/petsc-3.20.3 --petsc-arch=arch-linux-c-opt --testdir=./arch-linux-c-opt/tests --srcdir /models/src/v2021.03-2.0.3-llvm/build/petsc/petsc-3.20.3/src --pkg-pkgs "sys vec mat dm ksp snes ts tao"<br class="">Using MAKEFLAGS: iw -- PETSC_ARCH=arch-linux-c-opt PETSC_DIR=/models/src/v2021.03-2.0.3-llvm/build/petsc/petsc-3.20.3<br class="">         CC arch-linux-c-opt/tests/sys/classes/draw/tests/ex1.o<br class="">    CLINKER arch-linux-c-opt/tests/sys/classes/draw/tests/ex1<br class="">/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../bin/ld: arch-linux-c-opt/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'<br class="">/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../bin/ld: arch-linux-c-opt/lib/libpetsc.so: undefined reference to `std::__throw_bad_array_new_length()'<br class="">clang: error: linker command failed with exit code 1 (use -v to see invocation)<br class="">make[1]: [gmakefile.test:273: arch-linux-c-opt/tests/sys/classes/draw/tests/ex1] Error 1 (ignored)<br class=""><br class=""><br class="">There are many errors of the ilk: <br class=""><br class="">std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()<br class=""><br class="">[lib]$ nm -A libpetsc.so | grep basic_ostringstream<br class="">libpetsc.so:                 U _ZNKSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv@GLIBCXX_3.4.21<br class="">libpetsc.so:                 U _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev<br class="">libpetsc.so:                 U _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev@GLIBCXX_3.4.21<br class=""><br class=""><br class="">I/m new to llvm and this is the first time to compile petsc.3.20.3 with llvm compilers.<br class=""><br class="">Clearly something is amiss.<br class=""><br class="">Any ideas appreciated.<br class=""><br class="">Michael<br class=""><br class=""><br class=""><br class=""></blockquote><br class=""></blockquote></blockquote></blockquote></div></div></blockquote></div><br class=""></div></div></body></html>