Hello everyone,
I've been trying to build libmesh with "complex" enabled, but I always get some error messages concerning the type PetscScalar.
I configured Petsc-2.3.2-p10 using "--with-scalar-type=complex"  and I also used the same gcc and g++ (version 4.1) for compiling Petsc and libmesh.
The error messages I get are as follows:

$ make
Compiling C++ (in optimized mode) src/base/dof_map.C...
Compiling C++ (in optimized mode) src/base/dof_map_constraints.C...
Compiling C++ (in optimized mode) src/base/dof_object.C...
Compiling C++ (in optimized mode) src/base/libmesh.C...
In file included from /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/backward/complex.h:31,
                 from /home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:48,
                 from /home/loris/soft/petsc-2.3.2-p10/include/petsc.h:257,
                 from src/base/libmesh.C:43:
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:65: error: expected initializer before ‘PetscScalar’
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:141: error: ‘PetscScalar’ does not name a type
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:172: error: ‘PetscScalar’ does not name a type
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:296: warning: ‘PetscGlobalSum’ initialized and declared ‘extern’
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:296: error: ‘PetscScalar’ was not declared in this scope
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:296: error: expected primary-expression before ‘,’ token
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:296: error: ‘PetscScalar’ was not declared in this scope
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:296: error: expected primary-expression before ‘,’ token
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:296: error: expected primary-expression before ‘)’ token
/home/loris/soft/petsc-2.3.2-p10/include/petscmath.h:296: error: initializer expression list treated as compound expression
/home/loris/soft/petsc-2.3.2-p10/include/petscviewer.h:333: error: ‘PetscScalar’ has not been declared
/home/loris/soft/petsc-2.3.2-p10/include/petscviewer.h:334: error: ‘PetscScalar’ has not been declared
/home/loris/soft/petsc-2.3.2-p10/include/petscviewer.h:341: error: ‘PetscScalar’ has not been declared
/home/loris/soft/petsc-2.3.2-p10/include/petscviewer.h:344: error: ‘PetscScalar’ has not been declared
/home/loris/soft/petsc-2.3.2-p10/include/petscoptions.h:17: error: ‘PetscScalar’ has not been declared
/home/loris/soft/petsc-2.3.2-p10/include/petscoptions.h:146: error: ‘PetscScalar’ has not been declared
/home/loris/soft/petsc-2.3.2-p10/include/petscoptions.h:146: error: ‘PetscScalar’ has not been declared
/home/loris/soft/petsc-2.3.2-p10/include/private/petscimpl.h:278: error: ISO C++ forbids declaration of ‘PetscScalar’ with no type
/home/loris/soft/petsc-2.3.2-p10/include/private/petscimpl.h:278: error: expected ‘;’ before ‘*’ token
/home/loris/soft/petsc-2.3.2-p10/include/petsc.h:1424: error: ‘PetscScalar’ has not been declared
/home/loris/soft/petsc-2.3.2-p10/include/petscmatlab.h:30: error: ‘PetscScalar’ has not been declared
/home/loris/soft/petsc-2.3.2-p10/include/petscmatlab.h:31: error: ‘PetscScalar’ has not been declared
make: *** [src/base/libmesh.i686-pc-linux-gnu.opt.o] Error 1


Has anyone some advise how to solve this problem? Or can anyone tell me which compilers, petsc version, configuration options... he used to successfully build libmesh with complex enabled?
Thank you

best regards loris 
 -- 
DI Loris Nagler
Institute of Applied Mechanics              Tel: +43/(0)316/873-7606
Graz University of Technology               Fax: +43/(0)316/873-7641
Technikerstr. 4/II                          e-mail: loris.nagler@TUGraz.at
8010 Graz

http://www.mech.TUGraz.at