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

Christian Staudt christian.staudt at ira.uka.de
Wed Apr 18 12:46:25 CDT 2012


Am 18.04.2012 um 19:17 schrieb Matthew Knepley:

> The include directories can be obtained using:
> 
>   make getincludedirs
> 
> and usually amount to
> 
>   -I${PETSC_DIR}/include -I${PETSC_DIR}/${PETSC_ARCH}/include
> 
> but can be modified by configure for certain packages.
> 
>    Matt



	make getincludedirs 

failed for me with:

cls /usr/local/petsc $ make getincludedirs
conf/petscvariables:3: /usr/local/petsc-3.2-p6/arch-darwin-c-debug/conf/petscvariables: No such file or directory
makefile:15: /usr/local/petsc-3.2-p6/conf/variables: No such file or directory
makefile:16: /usr/local/petsc-3.2-p6/conf/rules: No such file or directory
makefile:17: /usr/local/petsc-3.2-p6/conf/test: No such file or directory
make: *** No rule to make target `/usr/local/petsc-3.2-p6/conf/test'.  Stop.

However, I simply added 

  ${PETSC_DIR}/${PETSC_ARCH}/include

to the includes for my Eclipse project, which fixes the error that petscconf.h was not found.

Now the following error appears:

Building target: PETScTest2
Invoking: MacOS X C++ Linker
g++ -L/usr/local/petsc/arch-darwin-c-debug/lib/ -o "PETScTest2"  ./src/PETScTest2.o   -l/usr/local/petsc/arch-darwin-c-debug/lib/libpetsc.a
ld: library not found for -l/usr/local/petsc/arch-darwin-c-debug/lib/libpetsc.a
collect2: ld returned 1 exit status
make: *** [PETScTest2] Error 1

libpetsc.a definitely exists at this location.  Is my PETSc installation broken?

Chris


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120418/1f7e4576/attachment.htm>


More information about the petsc-users mailing list