Hi,  PETSc team, <br>I wrote a C++ code dealing with electromagnetic problems, which can smoothly call PETSc complied by using &quot;<font color="#ff0000">
--with-scalar-type=complex --with-clanguage=cxx&quot; </font>.<br>To improve the performances of the C++ code, I changed the complex number of type from std::complex&lt;double&gt; to double _Complex (C99 standard, roughly 30~50 times faster compared to std::complex&lt;double&gt;). But when I find that the C99 complex number head file &lt;complex.h&gt; will lead to the following kinds of errors&quot;<br>
<br>/usr/include/c++/4.3/complex:57: error: expected identifier before ‘__complex__’<br>/usr/include/c++/4.3/complex:58: error: expected identifier before ‘__complex__’<br>/usr/include/c++/4.3/complex:58: error: expected unqualified-id before ‘&lt;’ token<br>
/usr/include/c++/4.3/complex:59: error: expected identifier before ‘__complex__’<br>/usr/include/c++/4.3/complex:59: error: expected unqualified-id before ‘&lt;’ token<br>/usr/include/c++/4.3/complex:60: error: expected identifier before ‘__complex__’<br>
/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:157: error: expected unqualified-id before ‘__complex__’<br>/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:306: error: ‘PetscScalar’ does not name a type<br>
/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:339: error: ‘PetscScalar’ does not name a type<br>/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:469: warning: ‘PetscGlobalSum’ initialized and declared ‘extern’<br>
/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:469: error: ‘PetscScalar’ was not declared in this scope<br>/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:469: error: expected primary-expression before ‘,’ token<br>
/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:469: error: ‘PetscScalar’ was not declared in this scope<br>/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:469: error: expected primary-expression before ‘,’ token<br>
/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:469: error: expected primary-expression before ‘)’ token<br>/home/Zhengyong/packages/petsc-3.1-p1/include/petscmath.h:469: error: initializer expression list treated as compound expression<br>
<br><br>Could you please give me some idea to deal with these problems? <br><br>Kind regards,<br>Zhengyong Ren<br clear="all"><br>-- <br>Zhengyong Ren<br>AUG Group, Institute of Geophysics<br>Department of Geosciences, ETH Zurich<br>
NO H 47 Sonneggstrasse 5<br>CH-8092, Zürich, Switzerland<br>Tel: +41 44 633 37561<br>e-mail: <a href="mailto:zhengyong.ren@aug.ig.erdw.ethz.ch">zhengyong.ren@aug.ig.erdw.ethz.ch</a><br>Gmail: <a href="mailto:renzhengyong@gmail.com">renzhengyong@gmail.com</a><br>