[petsc-users] petsc-users Digest, Vol 71, Issue 59

Eric Bavier bavier at cray.com
Mon Nov 24 13:43:24 CST 2014

petsc-users-request at mcs.anl.gov writes:

> Message: 2
> Date: Mon, 24 Nov 2014 11:28:41 -0800
> From: Evan Um <evanum at gmail.com>
> To: petsc-users <petsc-users at mcs.anl.gov>
> Subject: [petsc-users] Difference between PETSC and
> Message-ID:
> 	<CAP1yThRAs8h-Gii4DFsWB9YenUgcggdjNEXiyv=44Owb=j+JGQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> Dear PETSC users,
> I tried to compile my PETSC application code with PETSC but error
> messages below. For example, some PETSC types were not identified or
> defined multiple times. The code has #include <petscksp.h>and is compiled
> with 3.5.0 without any error. I wonder if there is a critical change from
> to I don't see any changes in Documentation: Changes: 3.5
> from PETSC webpage. Thanks for your help.
> Regards,
> Evan
> CC  -c -O3  esu_main.cpp
> In file included from /opt/cray/petsc/
>                  from /opt/cray/petsc/
>                  from /opt/cray/petsc/
>                  from /opt/cray/petsc/
>                  from /opt/cray/petsc/
>                  from /opt/cray/petsc/
>                  from esu_driver_csem.h(19),
>                  from esu_main.cpp(19):
> /opt/cray/petsc/
> error: identifier "PETSC_CXX_STATIC_INLINE" is undefined


It looks like you're encountering a known bug in the cray release of
petsc, which affects use of petsc with C++ compilers.  This bug
will be fixed in cray-petsc/  In the meantime, you should be
able to safely add the following two lines before #include <petscksp.h>

#define PETSC_CXX_STATIC_INLINE static inline  
#define PETSC_CXX_RESTRICT __restrict__ 

Eric Bavier, Scientific Libraries, Cray Inc.

More information about the petsc-users mailing list