Hi,

This was a recursive issue ... libmoses needed libmira to compile and libmira needed libmoses to compile.
However, I was able to solve this issue in rather naive way.
Instead of using files from mira/ directory I copied all the files that I wanted to use in a separate directory and added the path to the moses/Jamfile. Now everything works perfectly fine.

Thanks for the support though,
--
Prashant

On 05/16/2013 09:00 PM, Hieu Hoang wrote:
i saw that it wasn't addressed too but my solution to difficult linking problems is to avoid bjam/automake/cmake/make. ie. anything that tries to help, but makes it more difficult to understand.

I would just execute a direct g++ command, eg
  g++ -L [path] -lmira -o whatever.exe

I did this with mgiza after fruitlessly trying to fiddle with cmake.
http://mgizapp.svn.sourceforge.net/viewvc/mgizapp/trunk/mgizapp/manual-compile/

It's prob not a fast way, but it's the easiest way for me



On 16 May 2013 19:48, Nick Ruiz <[email protected] <mailto:[email protected]>> wrote:

    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]  <mailto:[email protected]>
    http://mailman.mit.edu/mailman/listinfo/moses-support


    _______________________________________________
    Moses-support mailing list
    [email protected] <mailto:[email protected]>
    http://mailman.mit.edu/mailman/listinfo/moses-support




--
Hieu Hoang
Research Associate
University of Edinburgh
http://www.hoang.co.uk/hieu


_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to