[petsc-users] compiling PETSc using c++ compiler

Sam Guo sam.guo at cd-adapco.com
Tue Oct 6 18:44:51 CDT 2020


Hi Satish,
   I am using our internal makefile to make PETSc. When I use PETSc
makefile, it works. Hence it must be our compiling flags responsible for
the error. I'll look into it.
   I want to experiment c++ compiler to see if I can compile real and
complex versions to different symbols (I've created another thread for this
topic.) but it seems c++ compiler does not help and I still get same
symbols.

Thanks,
Sam

On Tue, Oct 6, 2020 at 3:35 PM Satish Balay <balay at mcs.anl.gov> wrote:

> And BTW: --with-clanguage=cxx is not needed for using PETSc from
> c++. It primarily exists for debugging purposes [or some corner cases
> where C build of PETSc does not work from c++ code]
>
> Satish
>
> On Tue, 6 Oct 2020, Satish Balay via petsc-users wrote:
>
> > Can you send the complete logs for this build [configure.log, make.log]?
> >
> > Satish
> >
> > On Tue, 6 Oct 2020, Sam Guo wrote:
> >
> > > Dear PETSc dev team,
> > >   When I compile PETSc using
> > > --with-cc=gcc --with-cxx=g++ --with-clanguage=cxx,
> > > I got following error:
> > > ../../../petsc/src/sys/objects/pinit.c: In function ‘PetscInitialize’:
> > > ../../../petsc/src/sys/objects/pinit.c:913:21: error: expected
> declaration
> > > specifiers or ‘...’ before numeric constant
> > >   913 |     PetscComplex ic(0.0,1.0);
> > >       |                     ^~~
> > > ../../../petsc/src/sys/objects/pinit.c:913:25: error: expected
> declaration
> > > specifiers or ‘...’ before numeric constant
> > >   913 |     PetscComplex ic(0.0,1.0);
> > >       |                         ^~~
> > > ../../../petsc/src/sys/objects/pinit.c:914:15: error: ‘ic’ undeclared
> > > (first use in this function)
> > >   914 |     PETSC_i = ic;
> > >       |               ^~
> > > ../../../petsc/src/sys/objects/pinit.c:914:15: note: each undeclared
> > > identifier is reported only once for each function it appears in
> > >
> > >  Thanks,
> > > Sam
> > >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201006/50ead1bd/attachment.html>


More information about the petsc-users mailing list