[petsc-users] How to include PETSc in an Eclipse CDT project

Matthew Knepley knepley at gmail.com
Wed Apr 18 11:47:34 CDT 2012


On Wed, Apr 18, 2012 at 12:40 PM, Christian Staudt <
christian.staudt at ira.uka.de> wrote:

> Hello PETSc users,
>
> I am new to PETSc (and, coming from the Java world, not an experienced C++
> developer). I hope my question is appropriate on this list.
>
> Here's my problem: I'd like to build an application in C++ against PETSc,
> using Eclipse CDT. However, I have problems including PETSc as a library in
> my Eclipse CDT project.
>
>
> I have tried the following for my test project:
>
> In Properties>>C/C++ Build>>Settings>>GCC C++ Compiler >> Includes I add
> the path
>
> /usr/local/petsc/include/
>
> In Properties>>C/C++ Build>>Settings>>MacOS X C++ Linker >> Libraries, I
> add
>
> /usr/local/petsc/arch-darwin-c-debug/lib/libpetsc.a
>
> to "Libraries (-l)" and
>
> /usr/local/petsc/arch-darwin-c-debug/lib/
>
> to "Library search path (-L)"
>
>
>
> Now I try to build a simple Hello World program which has the lines
>
> #include <petsc.h>
> #include <petscmat.h>
>
> at the beginning of the main file.
>
> I get compiler errors for almost every line of the PETSc header files,
> indicating that basic types are not found, for example:
>

I guarantee you there is a "Header not found" error up at the top that you
cut off. ALWAYS send the full error message.

   Matt


> /usr/local/petsc/include/petscmat.h:1643: error: 'PetscScalar' has not
> been declared
> /usr/local/petsc/include/petscmat.h:1721: error: 'PetscReal' has not been
> declared
> /usr/local/petsc/include/petscmat.h:1152: error: 'PetscReal' does not name
> a type
> ...
>
>
> Can anyone tell me what might be the problem? Thank you.
>
> Chris
>
>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120418/6f295b33/attachment.htm>


More information about the petsc-users mailing list