[petsc-users] Problem compiling with g++. Uses gcc instead of g++

Jed Brown jedbrown at mcs.anl.gov
Thu Dec 5 10:23:14 CST 2013


Christophe Ortiz <christophe.ortiz at ciemat.es> writes:

> Hi all,
>
> Since I would like to use classes, I am moving my C code to C++. I compiled
> PETSc with g++ using the following options for the configure:
>
> --with-mpi=0 --with-fc=ifort --with-cxx=g++ --with-debugging=1
> --with-scalar-type=real --with-precision=double --download-f-blas-lapack
>
> It did not complain, everything went smooth.
>
> Then to compile I use:
>
> diffusion_c: diffusion.o chkopts
>         -${CLINKER} -o diffusion_c diffusion.o ${PETSC_TS_LIB}
>         ${RM} diffusion.o
>
>
> I declared a simple class at the beginning of the file and it complains.
> When I compile I get:
>
> gcc -o diffusion.o -c -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing
> -Wno-unknown-pragmas -g3 -fno-inline -O0
> -I/home/u5751/petsc-3.4.1/include
> -I/home/u5751/petsc-3.4.1/ifort-gpp-nompi-double-blas-debug/include
> -I/home/u5751/petsc-3.4.1/include/mpiuni
>  -D__INSDIR__=src/ts/examples/tutorials/ diffusion.c
>
> diffusion.c:49: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
> before ‘defect’

Name your source file diffusion.cxx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131205/3a2f817a/attachment.pgp>


More information about the petsc-users mailing list