[Trilinos-Users] Problem with building thyraepetraext example

Bartlett, Roscoe A rabartl at sandia.gov
Fri Sep 26 05:21:32 MDT 2008


Hello,

In the future, to avoid these problems, you might want to look at using the export makefile system provided by Trilinos.  When you install Trilinos, you should get the file Makefile.export.thyra put in INSTALL_DIR/include.  The variable THYRA_LIBS will then give you the correct link line in the right order.

Another suggestion is to just build and link the same example from within the Trilinos build tree and then copy and paste the link line echoed during the build process into your own home-grown makefile.

Cheers,

- Ross


________________________________
From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of ??
Sent: Thursday, September 25, 2008 10:17 PM
To: TrilinosUserGroup
Subject: Re: [Trilinos-Users] Problem with building thyraepetraext example

I find the problem, libthyraepetraext depend on libthyraepetra , so in Makefile , -lthyraepetraext should be in front of -lthyraepetra.
Sorry for troubling , i should have looked at the thyraepetraext source file for help first~


2008/9/26 饶锴 <raokai1314 at gmail.com<mailto:raokai1314 at gmail.com>>
Hi all,
     I come with a problem when i build "/packages/thyra/adapters/epetraext/example/model_evaluator".
     My building process is as follows.
     Copy the "ForwardSolveEpetraModelEval2DSimMain.cpp" and the related  .h and .cpp files to my own directory.
     I've got
"EpetraModelEval2DSim.cpp  EpetraModelEval4DOpt.hpp
 EpetraModelEval2DSim.hpp  ForwardSolveEpetraModelEval2DSimMain.cpp
 EpetraModelEval4DOpt.cpp  Makefile" in my work directory.

   When i make the project , the compiling process is correct while linking meets error. The libthyraepetraext.a cannot be linked correctly.
   The error msg is as follows:
*************************************************************************************
mpicxx   -DMPICH_IGNORE_CXX_SEEK -c EpetraModelEval2DSim.cpp '-I /media/sda5/Trilinos/include' '-L /media/sda5/Trilinos/lib'
mpicxx   -DMPICH_IGNORE_CXX_SEEK -c EpetraModelEval4DOpt.cpp '-I /media/sda5/Trilinos/include' '-L /media/sda5/Trilinos/lib'
mpicxx   -DMPICH_IGNORE_CXX_SEEK -c ForwardSolveEpetraModelEval2DSimMain.cpp '-I /media/sda5/Trilinos/include' '-L /media/sda5/Trilinos/lib'
mpicxx -DHAVE_MPI  -DMPICH_IGNORE_CXX_SEEK -o out EpetraModelEval2DSim.o EpetraModelEval4DOpt.o ForwardSolveEpetraModelEval2DSimMain.o '-I /media/sda5/Trilinos/include' '-L /media/sda5/Trilinos/lib' -lrythmos -lthyraepetra -lthyraepetraext -lthyra -lstratimikos -lnew_package -lrtop -lloca -lifpack -lepetraext -lteuchos -lepetra -lml -ltriutils -lnox -lkokkos -lblas -llapack
/media/sda5/Trilinos/lib/libthyraepetraext.a(Thyra_EpetraModelEvaluator.o): In function `Thyra::convert(Thyra::ModelEvaluatorBase::Derivative<double> const&, Teuchos::RCP<Epetra_Map const> const&, Teuchos::RCP<Epetra_Map const> const&)':
Thyra_EpetraModelEvaluator.cpp:(.text+0x2654): undefined reference to `Thyra::EpetraLinearOp::epetra_op() const'
Thyra_EpetraModelEvaluator.cpp:(.text+0x2856): undefined reference to `Thyra::get_Epetra_MultiVector(Epetra_Map const&, Teuchos::RCP<Thyra::MultiVectorBase<double> > const&)'
/media/sda5/Trilinos/lib/libthyraepetraext.a(Thyra_EpetraModelEvaluator.o): In function `Thyra::EpetraModelEvaluator::finishConvertingOutArgsFromEpetraToThyra(EpetraExt::ModelEvaluator::OutArgs const&, Teuchos::RCP<Thyra::LinearOpWithSolveBase<double, double> >&, Teuchos::RCP<Thyra::LinearOpBase<double, double> >&, Teuchos::RCP<Thyra::LinearOpBase<double, double> const>&, Teuchos::RCP<Thyra::EpetraLinearOp>&, Teuchos::RCP<Epetra_Operator>&, Thyra::ModelEvaluatorBase::OutArgs<double> const&) const':
Thyra_EpetraModelEvaluator.cpp:(.text+0x3444): undefined reference to `Thyra::EpetraLinearOp::initialize(Teuchos::RCP<Epetra_Operator> const&, Thyra::ETransp, Thyra::EApplyEpetraOpAs, Thyra::EAdjointEpetraOp, Teuchos::RCP<Thyra::SpmdVectorSpaceBase<double> const> const&, Teuchos::RCP<Thyra::SpmdVectorSpaceBase<double> const> const&)'
...................others omitted...............
*************************************************************************************
   I am wonderring which lib i missed. My makefile is as follows:
**************************************************************************************
CC = mpicxx
HEAD = '-I /media/sda5/Trilinos/include'
LIBS = '-L /media/sda5/Trilinos/lib'
EXE = out
SRCS= $(wildcard *.cpp)
OBJS= $(SRCS:%.cpp=%.o)

all : $(EXE)

$(EXE):$(OBJS)
        $(CC) -DHAVE_MPI  -DMPICH_IGNORE_CXX_SEEK -o $@ $(OBJS) $(HEAD) $(LIBS) -lrythmos -lthyraepetra -lthyraepetraext -lthyra -lstratimikos -lnew_package -lrtop -lloca -lifpack -lepetraext -lteuchos -lepetra -lml -ltriutils -lnox -lkokkos -lblas -llapack

$(OBJS):%.o:%.cpp
        $(CC)   -DMPICH_IGNORE_CXX_SEEK -c $< $(HEAD) $(LIBS)
clean:
    rm -f *.o *.txt
cleanall:clean
    rm -f $(EXE)

******************************************************************************

In my lib directory , there are

libaztecoo.a    libloca.a         librythmos.a      libthyraepetraext.a
libepetra.a     libml.a           libstratimikos.a  libtriutils.a
libepetraext.a  libnew_package.a  libteuchos.a
libifpack.a     libnox.a          libthyra.a
libkokkos.a     librtop.a         libthyraepetra.a

Please help me find where the problem is, thanks!



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://software.sandia.gov/mailman/private/trilinos-users/attachments/20080926/5e5dee33/attachment.html 


More information about the Trilinos-Users mailing list