Hi all,
I saw this message from last month that doesn't look like it's been
addressed. This is somewhat of a common problem for people writing code
in Moses and new to compiling with bjam. Does anyone have any advice?
Thanks,
Nick
On 04/29/2013 04:16 PM, Prashant Mathur wrote:
Hi all,
I have implemented a feature in moses and now I am trying to use the
implementation of MIRA optimiser in mira/ directory.
For this I just add these few lines to the code.
OnlineLearner.cpp
[code]
#include "mira/Optimiser.h"
using namespace Mira;
...
MiraOptimiser* optimiser = NULL;
...
optimiser = new MiraOptimiser(slack, scale_margin, scale_margin_precision,
scale_update, scale_update_precision, boost,
normaliseMargin, sigmoidParam);
[/code]
This is the exact code from mira/Main.cpp except the fact that the
code itself is in mira/ directory.
The code was perfectly compiling before and even now the OnlineLearner
compiles. But later there is some problem with linking.
gcc.link
moses-chart-cmd/bin/gcc-4.4.7/release/debug-symbols-on/link-static/threading-multi/moses_chart
moses/bin/gcc-4.4.7/release/debug-symbols-on/link-static/threading-multi/libmoses.a(OnlineLearner.o):
In function `MiraOptimiser':
/research/hlt/prashant/Moses/moses_RELEASE-v1/./mira/Optimiser.h:80:
*undefined reference to `vtable for Mira::MiraOptimiser'*
collect2: ld returned 1 exit status
"g++" -L"/research/hlt/prashant/MyInstallation/lib"
-L"/research/hlt/prashant/MyInstallation/lib64" -Wl,-R
-Wl,"/research/hlt/prashant/MyInstallation/lib" -Wl,-R
-Wl,"/research/hlt/prashant/MyInstallation/lib64" -Wl,-rpath-link
-Wl,"/research/hlt/prashant/MyInstallation/lib" -Wl,-rpath-link
-Wl,"/research/hlt/prashant/MyInstallation/lib64" -o
"moses-chart-cmd/bin/gcc-4.4.7/release/debug-symbols-on/link-static/threading-multi/moses_chart"
-Wl,--start-group
"moses-chart-cmd/bin/gcc-4.4.7/release/debug-symbols-on/link-static/threading-multi/Main.o"
"moses-chart-cmd/bin/gcc-4.4.7/release/debug-symbols-on/link-static/threading-multi/mbr.o"
"moses-chart-cmd/bin/gcc-4.4.7/release/debug-symbols-on/link-static/threading-multi/IOWrapper.o"
"moses-chart-cmd/bin/gcc-4.4.7/release/debug-symbols-on/link-static/threading-multi/TranslationAnalysis.o"
"moses/bin/gcc-4.4.7/release/debug-symbols-on/link-static/threading-multi/libmoses.a"
-Wl,-Bstatic -lirstlm -Wl,-Bdynamic -lrt -llzma -lbz2
-lboost_system-mt -lboost_thread-mt -lSegFault -lz -lrt
-Wl,--end-group -g -pthread
I take that there is some problem with linking the libraries. For my
code to work I would need to use libmira_lib.a, but when I try adding
/mira/ to moses/Jamfile .. it cannot use it because the library is
currently being built.
Any solution to this problem?
Is there a way to include /Optimiser.h/ without changing the jamfiles?
I am pretty new to the linking stuff, so please pardon if I am wrong
somewhere.
Thanks a lot,
--
Prashant
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support