Including srilm *.a inside a .so

Andreas Stolcke stolcke at speech.sri.com
Fri Nov 9 14:21:18 PST 2007


> 
> Dear Andreas,
> 
>     I'm recently using SRILM toolkit, which I think is a very useful=20
> tool and very well done. Congratulations.

Thanks, that's nice to hear !

> 
>     Just a previous note: in the documentation of the LM library there=20
> is no explanation that the order has to be specified in the constructor=20
> or by using the setorder() function. En therefore, when you read a LM=20
> file using the LM::read() function if one do not take this into account=20
> the maximum order is always three.

The library is not well-document as you know.
The fact that the ngram order defaults to 3 is documented in the 
ngram-count man page.
I certainly don't want to make any claims for the quality of the documentation
in general.

BTW, if anyone feels like improving the document (fixing or expanding it)
I'd be more than happy to accept submissions ...

>     OK, now my question. I'm using SRILM inside a shared object,=20
> therefore I included it like this:
> 
>     g++ -shared=20
> -Wl,-z,muldefs,-whole-archive,-lflm,-llattice,-lmisc,-ldstruct,-loolm,-no=
> -whole-archive=20
> -o lib.so
> 
...
> 
>     I noticed that if I compile the libraries wit TCL OFF then this=20
> problem disappears because tclmain.o is not included in the library.
>   =20
> 
>     I wonder whether this is how it should work or if it is a bug that=20
> could be arranged for next SRILM version.
> 
>     I hope this is useful for somebody it took my a while to understand=20
> why I couldn't include the libraries inside my .so. They key point to do =
> 
> so with tcl8.4 is to compile SRILM without TCL option. This means to set =
> 
> NO_TCL =3D X in the appropriate makefile in srilm/common/

I would recommend just disabling the Tcl stuff ti avoid the problem.
It's not important enough to track down this dynamic linker issue.

Andreas 




More information about the SRILM-User mailing list