[petsc-users] ``--with-clanguage=c++" turns on "PETSC_HAVE_COMPLEX"?

Fande Kong fdkong.jd at gmail.com
Fri May 3 20:53:45 CDT 2019


It looks like mpicxx from openmpi does not handle this correctly. I
switched to mpich, and it works now.

However there is till some warnings:

*clang-6.0: warning: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated [-Wdeprecated]*
*         CXX arch-linux2-c-opt-memory/obj/dm/impls/plex/glexg.o*
*         CXX arch-linux2-c-opt-memory/obj/dm/impls/plex/petscpartmatpart.o*
*clang-6.0: warning: treating 'c' input as 'c++' when in C++ mode, this
behavior is dep*

Fande,


On Fri, May 3, 2019 at 7:29 PM Balay, Satish <balay at mcs.anl.gov> wrote:

> >>>>>>>>
> Executing: mpicxx -show
>
>                     stdout: clang
> -I/Users/kongf/projects/openmpi-2.1.1_installed/include
> -L/Users/kongf/projects/openmpi-2.1.1_installed/lib -lmpi
> <<<<
>
> Hm - I think this [specifying a C compiler as c++] is the trigger of this
> problem.
>
> configure checks if the c++ compiler supports complex. This test was
> successful [as it was done with .cxx file - and presumably clang switches
> to c++ mocd for a .cxx file.
>
> However PETSc sources a .c - so its likely compiling PETSc as C -  so
> things are now inconsistant - and broken..
>
> Note:
> PETSC_HAVE_COMPLEX => compilers support complex - so define a complex
> datatype
> PETSC_USE_COMPLEX => build PETSc with PetscScalar=complex
>
>
> Satish
>
> On Fri, 3 May 2019, Fande Kong via petsc-users wrote:
>
> > Hi All,
> >
> > Comping PETSc with ``--with-clanguage=c"  works fine. But I could not
> > compile PETSc with "--with-clanguage=c++" since the flag
> > "PETSC_HAVE_COMPLEX" was wrongly set on by this option.
> >
> > */Users/kongf/projects/petsc/src/sys/objects/pinit.c:913:21: error:
> > expected parameter declarator*
> > *    PetscComplex ic(0.0,1.0);*
> > *                    ^*
> > */Users/kongf/projects/petsc/src/sys/objects/pinit.c:913:21: error:
> > expected ')'*
> > */Users/kongf/projects/petsc/src/sys/objects/pinit.c:913:20: note: to
> match
> > this '('*
> > *    PetscComplex ic(0.0,1.0);*
> > *                   ^*
> > */Users/kongf/projects/petsc/src/sys/objects/pinit.c:914:13: error:
> > assigning to 'PetscComplex' (aka '_Complex double') from incompatible
> type
> > 'PetscComplex ()' (aka '_Complex double ()')*
> > *    PETSC_i = ic;*
> > *            ^ ~~*
> > *3 errors generated.*
> > *make[2]: *** [arch-linux2-c-opt-memory/obj/sys/objects/pinit.o] Error 1*
> > *make[2]: *** Waiting for unfinished jobs....*
> > *make[2]: Leaving directory `/Users/kongf/projects/petsc'*
> > *make[1]: *** [gnumake] Error 2*
> > *make[1]: Leaving directory `/Users/kongf/projects/petsc'*
> > ***************************ERROR**************************************
> > *  Error during compile, check
> > arch-linux2-c-opt-memory/lib/petsc/conf/make.log*
> > *  Send it and arch-linux2-c-opt-memory/lib/petsc/conf/configure.log to
> > petsc-maint at mcs.anl.gov <petsc-maint at mcs.anl.gov>*
> > **********************************************************************
> >
> > The make and configure logs are attached.
> >
> > Fande,
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190503/02751fb6/attachment.html>


More information about the petsc-users mailing list