[petsc-users] error: too few arguments to function call (PetscOptionsHasName)

Dave May dave.mayhem23 at gmail.com
Fri Apr 17 03:10:32 CDT 2020


Old versions of petsc had 3 args for this function, latest version expects
4 (as the compiler error indicates).

When in doubt as to what these args are, please refer to the extensive man
pages. You can find them all here

https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/singleindex.html


The page you want for this func is here

https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsHasName.html


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


Thanks
Dave



On Fri 17. Apr 2020 at 09:43, huabel via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Dear PETSc users,
>
> I’m learn some base for PETSc , compile file src/benchmarks/PetscMalloc.c
> , get next error. (Use PETSc 3.13.0)
>
> >pwd
> src/benchmarks
>
> >mpicc PetscMalloc.c
> *PetscMalloc.c:53:49: **error: **too few arguments to function call,
> expected 4, have 3*
>   ierr = PetscOptionsHasName(NULL,"-malloc",&flg);CHKERRQ(ierr);
> *         ~~~~~~~~~~~~~~~~~~~                    ^*
> */usr/local/include/petscoptions.h:18:1: note: *'PetscOptionsHasName'
> declared here
> PETSC_EXTERN PetscErrorCode PetscOptionsHasName(PetscOptions,const
> char[],const char[],PetscBool*);
> *^*
> */usr/local/include/petscsys.h:106:24: note: *expanded from macro
> 'PETSC_EXTERN'
> #  define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
> *                       ^*
> 1 error generated.
>
>  Thanks.
>    Abel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200417/131e5bae/attachment.html>


More information about the petsc-users mailing list