<div dir="ltr">Thanks, it turns out there was another installation of PETSc, and it was linking with the wrong one. It builds now.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 18, 2024 at 12:03 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div> The PETSc petsclog.h (included by petscsys.h) uses C macro magic to log calls to MPI routines. This is how the symbol is getting into your code. But normally <div>if you use PetscInitialize() and link to the PETSc library the symbol would get resolved.</div><div><br></div><div> If that part of the code does not need PETSc at all you can not include petscsys.h and instead include mpi.h otherwise you need to track down why when your code gets linked against PETSc libraries that symbol is not resolved.</div><div><br></div><div> Barry</div><div><br id="m_616764386617801318lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jan 18, 2024, at 11:55 AM, Aaron Scheinberg <<a href="mailto:alscheinberg@gmail.com" target="_blank">alscheinberg@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Hello,<div><br></div><div>I'm getting this error when linking:</div><div><br></div><div><div style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(107,77,83);background-color:rgb(255,241,230)"><span style="font-variant-ligatures:no-common-ligatures">undefined reference to `petsc_allreduce_ct_th'</span></div><br>The instances are regular MPI_Allreduces in my code that are not located in parts of the code related to PETSc, so I'm wondering what is happening to involve PETSc here? Can I configure it to avoid that? I consulted google, the FAQ and skimmed other documentation but didn't see anything. Thanks!</div><div><br></div><div>Aaron</div></div>
</div></blockquote></div><br></div></div></blockquote></div>