link error

Satish Balay balay at mcs.anl.gov
Wed Feb 11 22:35:53 CST 2009


Don't know cmake.

You'll have to make sure 'all' compiler options used to compile the
PETSc example are also used in your build system. If you miss
something - you'll have to go back - and add it in.

So:

- look at the make output of compiling a PETSc example
- look at the make output from compiling your code.
- look for whats missing - and add it to your cmake stuff..

[most likely you are missing "-lX11" at link time.]

Satish

On Wed, 11 Feb 2009, Yixun Liu wrote:

>  I can successfully compile the example with PETSC
> makefile. However, I need integrate PETSC into an existing
> application, which use CMake to generate makefile. I add the
> following into CMakelist.txt and use CMake to generate makefile and
> then make.

> #----------
> # PETSc
> #----------
> SET(PETSC_DIR /home/scratch/yixun/petsc-3.0.0-p3)
> SET(PETSC_ARCH /linux-gnu-c-debug)
> SET(X11_DIR /usr/X11R6)
> SET(PETSC_INCLUDE_DIR ${PETSC_DIR}/include
> ${PETSC_DIR}/${PETSC_ARCH}/include)
> SET(PETSC_LIB_DIR ${PETSC_DIR}/${PETSC_ARCH}/lib ${X11_DIR}/lib64
> ${X11_DIR}/lib/X11)


More information about the petsc-users mailing list