Including srilm *.a inside a .so
jadell at gps.tsc.upc.edu
Fri Nov 9 02:12:16 PST 2007
I'm recently using SRILM toolkit, which I think is a very useful
tool and very well done. Congratulations.
Just a previous note: in the documentation of the LM library there
is no explanation that the order has to be specified in the constructor
or by using the setorder() function. En therefore, when you read a LM
file using the LM::read() function if one do not take this into account
the maximum order is always three.
OK, now my question. I'm using SRILM inside a shared object,
therefore I included it like this:
This means that ALL symbols are included in the lib.so whether
needed or not.
In particular I have a problem with the Tcl_AppInit. If you compile
the libraries with TCL option on, then tclmain.cc is included inside
$> nm libmisc.a | grep tclmain
And this object has two undefined symbols;
This symbols had to be defined in tcl library, however I'm using
tcl8.4 and the Tcl_AppInit symbol is not defined there. In the tcl.h
* Convenience declaration of Tcl_AppInit for backwards compatibility.
* This function is not *implemented* by the tcl library, so the storage
* class is neither DLLEXPORT nor DLLIMPORT
EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp));
Therefore, if I try to use libmisc compiled with TCL inside the
previously mention shared object lib.so, this error is given:
ldd -d lib.so
undefined symbol: Tcl_AppInit (/home/lib.so)
I noticed that if I compile the libraries wit TCL OFF then this
problem disappears because tclmain.o is not included in the library.
I wonder whether this is how it should work or if it is a bug that
could be arranged for next SRILM version.
I hope this is useful for somebody it took my a while to understand
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 = X in the appropriate makefile in srilm/common/
Jordi Adell Mercado
TALP Research Center
Signal and Communication Theory Dpt.
Universitat Politècnica de Catalunya (UPC)
c/Jordi Girona 1-3 e-mail: jadell at gps.tsc.upc.es
Campus Nord D5-120 web: http://gps-tsc.upc.es/veu/personal/jadell
08034 - Barcelona phone: 93-401.16.27
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3257 bytes
Desc: S/MIME Cryptographic Signature
More information about the SRILM-User