[petsc-users] libpetsc.a(lgc.c.o): In function `PetscDrawLGDraw':lgc.c:469: undefined reference to `XSetIOErrorHandler'
Ted Sariyski
tsariysk at craft-tech.com
Thu Oct 17 12:10:32 CDT 2013
Hi,
I am trying to use ex10 (from snes/ex10d) and ex3p from MFEM (Finite
Element Discretization Library), as starting templates. Separately, I
can work with both examples. Now, I am trying to merge ex10.c (PETSc) to
ex3p.cpp (MFEM). There are three lines changed in the original ex3p
example: two include statements and replacement of MPI_Init with
PetscInitialize:
#include "petscsnes.h"
#include "petscao.h"
...
// MPI_Init(&argc, &argv);
PetscInitialize(&argc,&argv,"options.inf",help);
At link time, I get a long list of "undefined reference to ..." (see
below).
What do I miss here?
Thanks in advance,
--Ted
P.S. The example from MFEM has a call to GLVis server. I wonder whether
it may cause conflicts with PETSc visualization libraries?
ex10d: (works fine)
=================================
mpicxx -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas
-g -o ex10 ../ex10.c -I/home/tsariysk/MFEM/OMPI/PETSc_real/include
-I/home/tsariysk/MFEM/OMPI/PETSc_real/include
-I/home/tsariysk/MFEM/OMPI/metis-5.1.0/build/Linux-x86_64/include
-I/usr/include -I/usr/include/openmpi-x86_64
-L/home/tsariysk/MFEM/OMPI/PETSc_real/lib -lpetsc -llapack -lblas -lX11
-Wl,-rpath,/home/tsariysk/MFEM/OMPI/metis-5.1.0/build/Linux-x86_64/libmetisusr
-L/home/tsariysk/MFEM/OMPI/metis-5.1.0/build/Linux-x86_64/libmetisusr
-lmetis -lpthread -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lhdf5 -lhdf5_cpp
-lhdf5_fortran -lhdf5_hl -lhdf5_hl_cpp -lm -L/usr/lib64/openmpi/lib
-L/opt/centos/devtoolset-1.1/root/usr/lib/gcc/x86_64-redhat-linux/4.7.2
-L/opt/centos/devtoolset-1.1/root/usr/lib64
-L/opt/centos/devtoolset-1.1/root/usr/lib -lmpi_f90 -lmpi_f77 -lgfortran
-lm -lgfortran -lm -lquadmath -lm -lmpi_cxx -lstdc++ -ldl -lmpi -lgcc_s
-lpthread -ldl
rm -rf ex10.o
ex3p: (eclipse Makefile)
=================================
g++ -I/home/tsariysk/MFEM/OMPI/PETSc_real/include
-I/home/tsariysk/MFEM/OMPI/PETSc_real/include
-I/home/tsariysk/MFEM/OMPI/metis-5.1.0/build/Linux-x86_64/include
-I/usr/include -I/usr/include/openmpi-x86_64 -L/usr/lib64/openmpi/lib
-L/home/tsariysk/MFEM/OMPI/PETSc_real/lib
-L/home/tsariysk/MFEM/OMPI/metis-5.1.0/build/Linux-x86_64/libmetis
-L/home/tsariysk/MFEM/OMPI/hypre-2.9.0b/src/hypre/lib -g3 -o "SPHERE"
./mesh/element.o ./mesh/hexahedron.o ./mesh/mesh.o ./mesh/mesquite.o
./mesh/ncmesh.o ./mesh/nurbs.o ./mesh/pmesh.o ./mesh/point.o
./mesh/quadrilateral.o ./mesh/segment.o ./mesh/tetrahedron.o
./mesh/triangle.o ./mesh/vertex.o ./linalg/densemat.o ./linalg/hypre.o
./linalg/matrix.o ./linalg/ode.o ./linalg/operator.o ./linalg/solvers.o
./linalg/sparsemat.o ./linalg/sparsesmoothers.o ./linalg/vector.o
./general/array.o ./general/communication.o ./general/error.o
./general/isockstream.o ./general/osockstream.o ./general/sets.o
./general/socketstream.o ./general/sort_pairs.o ./general/stable3d.o
./general/table.o ./general/tic_toc.o ./fem/bilinearform.o
./fem/bilininteg.o ./fem/coefficient.o ./fem/eltrans.o ./fem/fe.o
./fem/fe_coll.o ./fem/fespace.o ./fem/geom.o ./fem/gridfunc.o
./fem/intrules.o ./fem/linearform.o ./fem/lininteg.o
./fem/nonlinearform.o ./fem/nonlininteg.o ./fem/pbilinearform.o
./fem/pfespace.o ./fem/pgridfunc.o ./fem/plinearform.o
./fem/pnonlinearform.o ./sphere.o -lmpi_cxx -lmpi -ldl -lmetis
-lHYPRE -lpetsc
/home/tsariysk/MFEM/OMPI/PETSc_real/lib/libpetsc.a(lgc.c.o): In function
`PetscDrawLGDraw':
/home/tsariysk/MFEM/petsc-3.4.1/src/sys/classes/draw/utils/lgc.c:469:
undefined reference to `XSetIOErrorHandler'
/home/tsariysk/MFEM/petsc-3.4.1/src/sys/classes/draw/utils/lgc.c:471:
undefined reference to `XSetIOErrorHandler'
/home/tsariysk/MFEM/petsc-3.4.1/src/sys/classes/draw/utils/lgc.c:519:
undefined reference to `XSetIOErrorHandler'
/home/tsariysk/MFEM/OMPI/PETSc_real/lib/libpetsc.a(xops.c.o): In
function `PetscDrawLine_X(_p_PetscDraw*, double, double, double, double,
int)':
/home/tsariysk/MFEM/petsc-3.4.1/src/sys/classes/draw/impls/x/xops.c:49:
undefined reference to `XSetForeground'
/home/tsariysk/MFEM/petsc-3.4.1/src/sys/classes/draw/impls/x/xops.c:53:
undefined reference to `XDrawLine'
/home/tsariysk/MFEM/OMPI/PETSc_real/lib/libpetsc.a(xops.c.o): In
function `PetscDrawArrow_X(_p_PetscDraw*, double, double, double,
double, int)':
/home/tsariysk/MFEM/petsc-3.4.1/src/sys/classes/draw/impls/x/xops.c:65:
undefined reference to `XSetForeground'
/home/tsariysk/MFEM/petsc-3.4.1/src/sys/classes/draw/impls/x/xops.c:69:
undefined reference to `XDrawLine'
/home/tsariysk/MFEM/petsc-3.4.1/src/sys/classes/draw/impls/x/xops.c:72:
undefined reference to `XDrawLine'
...
...
/home/tsariysk/MFEM/petsc-3.4.1/src/sys/classes/draw/impls/x/xcolor.c:326:
undefined reference to `XAllocColor'
collect2: error: ld returned 1 exit status
More information about the petsc-users
mailing list