[petsc-users] building Petsc in an IDE

Jed Brown jedbrown at mcs.anl.gov
Fri Aug 24 08:50:22 CDT 2012

Configure found X11, but you aren't linking it. You have to link all the
libraries returned by

$ make getlinklibs

The output will vary depending on your system and configuration. Here's one
of mine

-Wl,-rpath,/home/jed/petsc/mpich/lib -Wl,-rpath,/home/jed/petsc/mpich/lib
-L/home/jed/petsc/mpich/lib -lpetscts -lpetscsnes -lpetscksp -lpetscdm
-lpetscmat -lpetscvec -lpetscsys -Wl,-rpath,/home/jed/petsc/mpich/lib
-L/home/jed/petsc/mpich/lib -ltriangle -lX11 -lchaco -lsuperlu_4.3
-lsuperlu_dist_3.0 -lparmetis -lmetis
-L/home/jed/usr/elemental-mpich/lib -lelemental -lplcg -lpmrrr -lamspub
-lml -Wl,-rpath,/opt/mpich2/lib -L/opt/mpich2/lib
-L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1 -lmpichcxx -lstdc++ -lpthread
-lspai -lspooles -lblacs -lHYPRE -lmpichcxx -lstdc++ -lsundials_cvode
-lsundials_nvecserial -lsundials_nvecparallel -Wl,-rpath,/usr/lib
-L/usr/lib -lcholmod -lamd -lcolamd -lcamd -lccolamd -lumfpack -lcholmod
-lcamd -lccolamd -lcolamd -lamd -lsuitesparseconfig -llapack -lblas -lm
-lmpichf90 -lgfortran -lm -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++
-ldl -lmpich -lopa -lmpl -lpthread -lrt -lgcc_s -ldl

On Fri, Aug 24, 2012 at 8:47 AM, Arun Kamath <arun.kamath.m at gmail.com>wrote:

> Hi!
> I wanted to know if it is possible to build a PETSc file from an IDE, like
> codelite or code blocks.
> On my attempt to do so after adding the libraries
> libpestc.a, libhypre.a, libf2cblas.a and libf2clapack.a to the link
> libraries and
> petsc/conf, petsc/include and pets/arch-darwin-c-debug/include to the
> complier search directories, the executable is not built and
> errors similar to the one below are returned.
> "Linking console executable: /./examples/tutorials/ex2
> Undefined symbols for architecture x86_64:
>   "_XCreateGC", referenced from:
>       _PetscDrawXiSetGC in libpetsc.a(xinit.o)
> ..........
> ld: symbol(s) not found for architecture x86_64
> collect2: error: ld returned 1 exit status"
> Does anyone have a solution to this?
> Thanks.
> --
> Arun Kamath
> NTNU, Trondheim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120824/b6d9b1b8/attachment.html>

More information about the petsc-users mailing list