1. Download the latest from 
http://www.speech.sri.com/projects/srilm/download.html

2. mkdir srilm && cd srilm && tar xzf ../srilm.tar.gz #They should have 
a top-level directory but don't

3. Edit Makefile to say

SRILM = $(PWD)
MACHINE_TYPE := $(shell $(SRILM)/sbin/machine-type)

at the top.

4. Edit sbin/machine-type to fix the architecture

     x86_64) MACHINE_TYPE=i686-m64
#     MACHINE_TYPE=i686
       ;;

5. Disable TCL for a shared library in common/Makefile.machine.i686-m64

    NO_TCL = X

6. Forcibly use PIC.

make MAKE_PIC=-fPIC -j4

7. Manually build libsrilm.so

cd lib/i686-m64/

g++ -L. -shared 
-Wl,-z,muldefs,-whole-archive,-lflm,-llattice,-lmisc,-ldstruct,-loolm,-no-whole-archive
 
-o libsrilm.so

8. E-mail [email protected] to complain about their broken build 
system.

Obligatory KenLM advertisement: 
http://kheafield.com/code/kenlm/developers/ .  Probably the easiest way 
to build a .so file is to compile moses with

./bjam link=shared

then copy dist/lib/libkenutil.so and dist/lib/libkenlm.so .  You can 
also do this with just the tarball from the website, but the shell 
script only builds programs and the bjam version assumes you have Boost 
build installed.

Kenneth

On 05/13/2012 03:26 AM, saeed smith wrote:
> Hi,
>
> I am sorry if this is not the right place to submit a query like this:
>
> I need a shared library for SRILM to be used in my application
> (*libsrilm.so*). I want to query the language model and compute the
> probabilities for sentences. I have been using the code from Stanford's
> *Phrasal* decoder but it does not compile on *64-bits systems*. Do you
> know other applications containing the code? I guess moses does not use
> this library.
>
> Cheers,
> SS
>
>
> _______________________________________________
> 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

Reply via email to