<div><div dir="auto">Old versions of petsc had 3 args for this function, latest version expects 4 (as the compiler error indicates).</div></div><div dir="auto"><br></div><div dir="auto">When in doubt as to what these args are, please refer to the extensive man pages. You can find them all here</div><div dir="auto"><br></div><div dir="auto"><div><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/singleindex.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/singleindex.html</a></div><br></div><div dir="auto"><br></div><div dir="auto">The page you want for this func is here</div><div dir="auto"><br></div><div dir="auto"><div><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsHasName.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsHasName.html</a></div><br></div><div dir="auto"><br></div><div dir="auto">Tip: It is wise to avoid performing a google search of the function name. It can bring you to the man page for an old version of petsc sometimes and this can lead to confusion. Best go directly to the URL above (or access the pages through the petsc web page) to ensure you are looking at the appropriate man pages</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Thanks</div><div dir="auto">Dave</div><div dir="auto"><br></div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Fri 17. Apr 2020 at 09:43, huabel via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div>Dear PETSc users,</div><div><br></div><div>I’m learn some base for PETSc , compile file <span style="font-family:Menlo;font-size:11px">src/benchmarks/</span><span style="font-family:Menlo;font-size:11px">PetscMalloc.c , get next error. (</span><font face="Menlo"><span style="font-size:11px">Use PETSc 3.13.0)</span></font></div><div><br></div><div>>pwd</div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">src/benchmarks</span></div></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">>mpicc PetscMalloc.c </span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><b>PetscMalloc.c:53:49: </b></span><span style="font-variant-ligatures:no-common-ligatures;color:#b42419"><b>error: </b></span><span style="font-variant-ligatures:no-common-ligatures"><b>too few arguments to function call, expected 4, have 3</b></span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  ierr = PetscOptionsHasName(NULL,"-malloc",&flg);CHKERRQ(ierr);</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(47,180,29)"><span style="font-variant-ligatures:no-common-ligatures"><b>         ~~~~~~~~~~~~~~~~~~~                    ^</b></span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><b>/usr/local/include/petscoptions.h:18:1: note: </b>'PetscOptionsHasName' declared here</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">PETSC_EXTERN PetscErrorCode PetscOptionsHasName(PetscOptions,const char[],const char[],PetscBool*);</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(47,180,29)"><span style="font-variant-ligatures:no-common-ligatures"><b>^</b></span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><b>/usr/local/include/petscsys.h:106:24: note: </b>expanded from macro 'PETSC_EXTERN'</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">#  define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(47,180,29)"><span style="font-variant-ligatures:no-common-ligatures"><b>                       ^</b></span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">1 error generated.</span></div></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures"> Thanks.</span></div><div><span style="font-variant-ligatures:no-common-ligatures">   Abel </span></div></div></blockquote></div></div>