Ben,

Here are the compile and link lines as well as the link errors.  I modified 
makefile from one of the examples and it references the Make.Common file that 
gets generated from ./configure when setting up the library.  I recently pulled 
a more current version of libMesh from the svn trunk on 8/24/2010 version 3919 
I believe. This is strange since it links without any problems in opt mode. 


g++ -DDEBUG -DPETSC_USE_DYNAMIC_LIBRARIES -g -fPIC 
-I/root/libmesh/include/base 
-I/root/libmesh/include/enums 
-I/root/libmesh/include/error_estimation 
-I/root/libmesh/include/fe 
-I/root/libmesh/include/geom 
-I/root/libmesh/include/mesh 
-I/root/libmesh/include/numerics 
-I/root/libmesh/include/parallel 
-I/root/libmesh/include/partitioning 
-I/root/libmesh/include/quadrature 
-I/root/libmesh/include/solvers 
-I/root/libmesh/include/systems 
-I/root/libmesh/include/utils 
-I/root/libmesh/contrib/boost 
-I/root/libmesh/contrib/laspack 
-I/root/libmesh/contrib/parmetis/Lib 
-I/root/libmesh/contrib/metis/Lib 
-I/root/libmesh/contrib/sfcurves  
-I/root/libmesh/contrib/gzstream 
-I/root/libmesh/contrib/tecplot/include 
-I/root/libmesh/contrib/gmv 
-I/root/libmesh/contrib/tetgen 
-I/root/libmesh/contrib/triangle 
-I/root/libmesh/contrib/exodusii/Lib/include 
-I/root/libmesh/contrib/netcdf/Lib 
-I/root/libmesh/contrib/nemesis/Lib 
-I/root/libmesh/contrib/libHilbert/include 
-I/root/PETSC/petsc-3.1-p4/include 
-I/root/PETSC/petsc-3.1-p4/bmake/linux-gnu-opt 
-I/root/PETSC/petsc-3.1-p4/linux-gnu-opt/include  
-I/root/PETSC/petsc-3.1-p4/linux-gnu-opt/include 
-I/root/PETSC/petsc-3.1-p4/linux-gnu-opt/include 
-I/root/PETSC/petsc-3.1-p4/linux-gnu-opt/include 
-c main.cpp -o main.x86_64-unknown-linux-gnu.dbg.o


g++  -O0 -felide-constructors -g -ansi -pedantic -W -Wall -Wno-long-long 
-Wunused -Wpointer-arith -Wimplicit -Wformat -Wparentheses -fPIC 
-Woverloaded-virtual 
-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC  
3DNRwGS.x86_64-unknown-linux-gnu.dbg.o  FEM.x86_64-unknown-linux-gnu.dbg.o  
main.x86_64-unknown-linux-gnu.dbg.o 
 Math_Util.x86_64-unknown-linux-gnu.dbg.o  
stdafx.x86_64-unknown-linux-gnu.dbg.o -o FEAR-dbg 
/root/libmesh/lib/x86_64-unknown-linux-gnu_dbg/libmesh.so 
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/liblaspack.so
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libparmetis.so
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libmetis.so 
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libsfcurves.so  
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libgzstream.so -lz 
/root/libmesh/contrib/tecplot/lib/x86_64-unknown-linux-gnu/tecio.a 
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libgmv.so 
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libtetgen.so 
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libtriangle.so 
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libexodusii.so
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libnetcdf.so 
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libnemesis.so 
/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg/libHilbert.so 
-Wl,-rpath,/root/PETSC/petsc-3.1-p4/linux-gnu-opt/lib 
-L/root/PETSC/petsc-3.1-p4/linux-gnu-opt/lib -lpetsc  -lX11 
-Wl,-rpath,/root/PETSC/petsc-3.1-p4/linux-gnu-opt/lib 
-L/root/PETSC/petsc-3.1-p4/linux-gnu-opt/lib -lHYPRE 
-Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.4.4 -lmpichcxx -lstdc++ -lspooles 
-lsuperlu_4.0 -lumfpack -lamd -lflapack -lfblas -lnsl -lrt -lm 
-Wl,-rpath,/root/PETSC/petsc-3.1-p4/linux-gnu-opt/lib 
-L/root/PETSC/petsc-3.1-p4/linux-gnu-opt/lib 
-Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.4.4 
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.4 
-ldl -lmpich -lpthread -lrt -lgcc_s -lmpichf90 -lgfortran -lm -lm -lmpichcxx 
-lstdc++ -lmpichcxx -lstdc++ -ldl -lmpich -lpthread -lrt -lgcc_s -ldl  -lnsl 
-lrt  
-Wl,-rpath,/root/libmesh/lib/x86_64-unknown-linux-gnu_dbg 
-Wl,-rpath,/root/libmesh/contrib/lib/x86_64-unknown-linux-gnu_dbg 
-Wl,-rpath,/root/PETSC/petsc-3.1-p4/linux-gnu-opt/lib


Here are the link errors........

3DNRwGS.x86_64-unknown-linux-gnu.dbg.o:(.data.rel.ro._ZTVN7libMesh6FEBaseE[vtable
 for libMesh::FEBase]+0x68): undefined reference to 
`libMesh::FEBase::compute_map(std::vector<double, std::allocator<double> > 
const&, libMesh::Elem const*)'
3DNRwGS.x86_64-unknown-linux-gnu.dbg.o:(.data.rel.ro._ZTVN7libMesh6FEBaseE[vtable
 for libMesh::FEBase]+0x70): undefined reference to 
`libMesh::FEBase::compute_affine_map(std::vector<double, std::allocator<double> 
> const&, libMesh::Elem const*)'
main.x86_64-unknown-linux-gnu.dbg.o: In function `main':
/root/FEAR/main.cpp:410: undefined reference to 
`libMesh::System::add_variable(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&, libMeshEnums::Order, libMeshEnums::FEFamily, 
std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned char> 
> const*)'
/root/FEAR/main.cpp:411: undefined reference to 
`libMesh::System::add_variable(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&, libMeshEnums::Order, libMeshEnums::FEFamily, 
std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned char> 
> const*)'
/root/FEAR/main.cpp:412: undefined reference to 
`libMesh::System::add_variable(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&, libMeshEnums::Order, libMeshEnums::FEFamily, 
std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned char> 
> const*)'
/root/FEAR/main.cpp:416: undefined reference to 
`libMesh::System::add_variable(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&, libMeshEnums::Order, libMeshEnums::FEFamily, 
std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned char> 
> const*)'
/root/FEAR/main.cpp:436: undefined reference to 
`libMesh::System::add_variable(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&, libMeshEnums::Order, libMeshEnums::FEFamily, 
std::set<unsigned char, std::less<unsigned char>, std::allocator<unsigned char> 
> const*)'
main.x86_64-unknown-linux-gnu.dbg.o:/root/FEAR/main.cpp:437: more undefined 
references to `libMesh::System::add_variable(std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&, libMeshEnums::Order, 
libMeshEnums::FEFamily, std::set<unsigned char, std::less<unsigned char>, 
std::allocator<unsigned char> > const*)' follow
main.x86_64-unknown-linux-gnu.dbg.o: In function `main':
/root/FEAR/main.cpp:646: undefined reference to 
`libMesh::EquationSystems::build_solution_vector(std::vector<double, 
std::allocator<double> >&) const'
/root/FEAR/main.cpp:695: undefined reference to 
`libMesh::EquationSystems::build_solution_vector(std::vector<double, 
std::allocator<double> >&) const'
/root/FEAR/main.cpp:721: undefined reference to 
`libMesh::EquationSystems::build_solution_vector(std::vector<double, 
std::allocator<double> >&) const'
main.x86_64-unknown-linux-gnu.dbg.o: In function 
`assemble_darcy(libMesh::EquationSystems&, std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&)':
/root/FEAR/main.cpp:1709: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
/root/FEAR/main.cpp:1710: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
/root/FEAR/main.cpp:1711: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
/root/FEAR/main.cpp:1712: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
/root/FEAR/main.cpp:1713: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
/root/FEAR/main.cpp:1900: undefined reference to 
`libMesh::DofMap::constrain_element_matrix_and_vector(libMesh::DenseMatrix<double>&,
 libMesh::DenseVector<double>&, std::vector<unsigned int, 
std::allocator<unsigned int> >&, bool) const'
main.x86_64-unknown-linux-gnu.dbg.o: In function 
`compute_jacobian(libMesh::NumericVector<double> const&, 
libMesh::SparseMatrix<double>&, libMesh::NonlinearImplicitSystem&)':
/root/FEAR/main.cpp:2587: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
/root/FEAR/main.cpp:2668: undefined reference to 
`libMesh::DofMap::constrain_element_matrix(libMesh::DenseMatrix<double>&, 
std::vector<unsigned int, std::allocator<unsigned int> >&, bool) const'
main.x86_64-unknown-linux-gnu.dbg.o: In function 
`compute_residual(libMesh::NumericVector<double> const&, 
libMesh::NumericVector<double>&, libMesh::NonlinearImplicitSystem&)':
/root/FEAR/main.cpp:3191: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
/root/FEAR/main.cpp:3484: undefined reference to 
`libMesh::DofMap::constrain_element_vector(libMesh::DenseVector<double>&, 
std::vector<unsigned int, std::allocator<unsigned int> >&, bool) const'
main.x86_64-unknown-linux-gnu.dbg.o: In function 
`assemble_stress(libMesh::EquationSystems&, std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&)':
/root/FEAR/main.cpp:3606: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
/root/FEAR/main.cpp:3894: undefined reference to 
`libMesh::DofMap::constrain_element_matrix_and_vector(libMesh::DenseMatrix<double>&,
 libMesh::DenseVector<double>&, std::vector<unsigned int, 
std::allocator<unsigned int> >&, bool) const'
main.x86_64-unknown-linux-gnu.dbg.o: In function 
`assemble_move(libMesh::EquationSystems&, std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&)':
/root/FEAR/main.cpp:4096: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
/root/FEAR/main.cpp:4285: undefined reference to 
`libMesh::DofMap::constrain_element_matrix_and_vector(libMesh::DenseMatrix<double>&,
 libMesh::DenseVector<double>&, std::vector<unsigned int, 
std::allocator<unsigned int> >&, bool) const'
main.x86_64-unknown-linux-gnu.dbg.o: In function 
`compute_stress(libMesh::EquationSystems&, std::vector<double, 
std::allocator<double> >, std::vector<double, std::allocator<double> >&, 
std::vector<double, std::allocator<double> >&, bool)':
/root/FEAR/main.cpp:4463: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
main.x86_64-unknown-linux-gnu.dbg.o: In function 
`assemble_thermal(libMesh::EquationSystems&, std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&)':
/root/FEAR/main.cpp:5064: undefined reference to 
`libMesh::DofMap::dof_indices(libMesh::Elem const*, std::vector<unsigned int, 
std::allocator<unsigned int> >&, unsigned int) const'
collect2: ld returned 1 exit status
make: *** [FEAR-dbg] Error 1


John


John A. Dec, Ph.D.
NASA Langley Research Center
Structural & Thermal Systems Branch, MS 431
Hampton, VA 23681
ph: (757) 864-7023
cell: (757) 848-7629 


-----Original Message-----
From: Kirk, Benjamin (JSC-EG311) 
Sent: Monday, September 13, 2010 10:12 AM
To: Dec, John A. (LARC-D206); [email protected]
Subject: Re: [Libmesh-users] Problem linking my code in debug mode

On 9/13/10 9:01 AM, "Dec, John A. (LARC-D206)" <[email protected]> wrote:

> While in debug mode, my code compiles without any problems, however in the
> linking phase I get a bunch of undefined references to a couple of libMesh
> functions.  The functions in question are libMesh::System::add_variable,
> libMesh::EquationSystems::build_solution_vector, and
> libMesh::DofMap::dof_indices.  My code uses several other libMesh functions
> and the linker does not spit out any undefined references for those.  I have
> no idea what is going on since my code compiles and links just fine in
> optimized mode.     I'm using the gcc 4.4 compiler under Fedora 13.

Would you please post the link line and the errors?  Are you using
libmesh-config to get the libraries to link?

Curious that it is only missing a few libraries- all the libMesh functions
live in the same place, so it should be an all-or-nothing thing...

-Ben


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to