[Trilinos-Users] Undefined reference to Epetra_Time when compiling

Andris Freimanis andris.freimanis_1 at edu.rtu.lv
Mon Jan 23 12:57:48 EST 2017


Hello,

I'm trying to compile a small program that reads epetra matrices from 
matrix market file. And I'm getting this error:

/usr/local/mpich/bin/mpicxx -O2 -std=c++11 -pedantic -ftrapv -Wall 
-Wno-long-long -Wno-deprecated -I/usr/local/trilinos/include 
-I/usr/local/mpich/include  -o main main.cpp -L/usr/local/trilinos/lib 
-lepetra -lepetraext -lblas -lteuchoscomm -lteuchoscore 
-lteuchosparameterlist -lkokkoscore -ldl
/usr/local/trilinos/lib/libepetraext.a(EpetraExt_CrsMatrixIn.cpp.o): In 
function `EpetraExt::MatrixMarketFileToCrsMatrixHandle(char const*, 
Epetra_Comm const&, Epetra_CrsMatrix*&, Epetra_Map const*, Epetra_Map 
const*, Epetra_Map const*, Epetra_Map const*, bool, bool)':
EpetraExt_CrsMatrixIn.cpp:(.text+0x4064): undefined reference to 
`Epetra_Time::Epetra_Time(Epetra_Comm const&)'
EpetraExt_CrsMatrixIn.cpp:(.text+0x4178): undefined reference to 
`Epetra_Time::~Epetra_Time()'
EpetraExt_CrsMatrixIn.cpp:(.text+0x4a36): undefined reference to 
`Epetra_Time::~Epetra_Time()'
EpetraExt_CrsMatrixIn.cpp:(.text+0x56af): undefined reference to 
`Epetra_Time::ElapsedTime() const'
/usr/local/trilinos/lib/libepetraext.a(EpetraExt_CrsMatrixIn.cpp.o): In 
function `EpetraExt::MatrixMarketFileToCrsMatrixHandle64(char const*, 
Epetra_Comm const&, Epetra_CrsMatrix*&, Epetra_Map const*, Epetra_Map 
const*, Epetra_Map const*, Epetra_Map const*, bool, bool)':
EpetraExt_CrsMatrixIn.cpp:(.text+0x62cd): undefined reference to 
`Epetra_Time::Epetra_Time(Epetra_Comm const&)'
EpetraExt_CrsMatrixIn.cpp:(.text+0x63de): undefined reference to 
`Epetra_Time::~Epetra_Time()'
EpetraExt_CrsMatrixIn.cpp:(.text+0x77ce): undefined reference to 
`Epetra_Time::ElapsedTime() const'
EpetraExt_CrsMatrixIn.cpp:(.text+0x7a84): undefined reference to 
`Epetra_Time::~Epetra_Time()'
collect2: error: ld returned 1 exit status
make: *** [main] Error 1

I am pretty sure that I need to link additional libraries, but can't 
figure out which are missing. Do you have any suggestions?

-- 
Andris Freimanis
PhD student

Riga Technical university
Institute of transporation
engineering

Ķīpsalas iela 6a, Rīga
00371 263 823 52
andris.freimanis_1 at edu.rtu.lv
www.rtu.lv



More information about the Trilinos-Users mailing list