Trouble building srilm project (macosx)
Foster, George
George.Foster at cnrc-nrc.gc.ca
Sat Jan 21 07:39:28 PST 2006
Peter,
I'm running a version of OSX 10.3.9 and gcc that's almost identical to yours:
% uname -a
Darwin 0547-CRTL.local 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc
% gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)
I had no problems building srilm 1.4.5 using the INSTALL instructions
(no code changes necessary).
George
-----Original Message-----
From: owner-srilm-user at speech.sri.com on behalf of P McIlroy
Sent: Mon 11/28/2005 11:39 PM
To: srilm-user at speech.sri.com
Subject: Trouble building srilm project (macosx)
I joined this group in hopes of finding some help on the MacOS compile.
I'm getting a handful of uninstantiated templates in the out-of-the-box
compile on OS X 10.3.9, with compiler version:
gcc version 3.3 20030304 (Apple Computer, Inc. build 1666)
The undefined functions are, in various executables:
FNgramCounts<unsigned int>::FNgramCounts(FactoredVocab&,
FNgramSpecs<unsigned int>&)
Map2<unsigned int, unsigned int, double>::clear()
NgramCounts<unsigned int>::NgramCounts(Vocab&, unsigned int)
I was able to 'fix' ngram-counts by adding
#include "NgramStats.cc"
to the main program.
The same fix does not work for ngram.cc.
Additional investigation shows that the instance file
NGramStatsInt.o
does not include an instantiation of the NGramCount constructor.
Other attempts like adding this to the main program:
static template NGramCounts<unsigned>;
lead to multiple definition errors in the linker.
Is there a known configuration or compiler option that works on OS X
10.3? Or will upgrading to 10.4 fix the problems?
thanks,
Peter McIlroy
Begin forwarded message:
> From: P McIlroy <pmcilroy at gmail.com>
> Date: November 28, 2005 3:17:14 PM PST
> To: stolcke at speech.sri.com
> Subject: Fwd: Trouble building your srilm project (macosx)
>
> I was able to compile one of the failed executables (ngram-count), but
> it required adding
>
> #include "NgramStats.cc"
>
> to the end of the list of includes in the main source file
> ngram-stats.cc. (This is not the preferred way to force compilation
> of templates, but it's working for now.) I also tried forcing
> instantiation by creating a NgramStats_inst.cc file, but this led to
> horrible multiple definitions.
>
> I'm still getting a warning for multiple definitions of _qsort(), but
> I don't think this is a problem.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.speech.sri.com/pipermail/srilm-user/attachments/20060121/866af9fe/attachment.html>
More information about the SRILM-User
mailing list