<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>RE: Trouble building srilm project (macosx)</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Peter,<BR>
<BR>
I'm running a version of OSX 10.3.9 and gcc that's almost identical to yours:<BR>
<BR>
% uname -a<BR>
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&nbsp; Power Macintosh powerpc<BR>
<BR>
% gcc -v<BR>
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs<BR>
Thread model: posix<BR>
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)<BR>
<BR>
I had no problems building srilm 1.4.5 using the INSTALL instructions<BR>
(no code changes necessary).<BR>
<BR>
George<BR>
<BR>
-----Original Message-----<BR>
From: owner-srilm-user@speech.sri.com on behalf of P McIlroy<BR>
Sent: Mon 11/28/2005 11:39 PM<BR>
To: srilm-user@speech.sri.com<BR>
Subject: Trouble building srilm project (macosx)<BR>
<BR>
I joined this group in hopes of finding some help on the MacOS compile.<BR>
<BR>
I'm getting a handful of uninstantiated templates in the out-of-the-box<BR>
compile on OS X 10.3.9, with compiler version:<BR>
<BR>
gcc version 3.3 20030304 (Apple Computer, Inc. build 1666)<BR>
<BR>
The undefined functions are, in various executables:<BR>
<BR>
FNgramCounts&lt;unsigned int&gt;::FNgramCounts(FactoredVocab&amp;,<BR>
FNgramSpecs&lt;unsigned int&gt;&amp;)<BR>
Map2&lt;unsigned int, unsigned int, double&gt;::clear()<BR>
NgramCounts&lt;unsigned int&gt;::NgramCounts(Vocab&amp;, unsigned int)<BR>
<BR>
I was able to 'fix' ngram-counts by adding<BR>
<BR>
#include &quot;NgramStats.cc&quot;<BR>
<BR>
to the main program.<BR>
<BR>
The same fix does not work for ngram.cc.<BR>
<BR>
Additional investigation shows that the instance file<BR>
<BR>
NGramStatsInt.o<BR>
<BR>
does not include an instantiation of the NGramCount constructor.<BR>
<BR>
Other attempts like adding this to the main program:<BR>
<BR>
static template NGramCounts&lt;unsigned&gt;;<BR>
<BR>
lead to multiple definition errors in the linker.<BR>
<BR>
Is there a known configuration or compiler option that works on OS X<BR>
10.3?&nbsp; Or will upgrading to 10.4 fix the problems?<BR>
<BR>
thanks,<BR>
<BR>
Peter McIlroy<BR>
<BR>
<BR>
<BR>
Begin forwarded message:<BR>
<BR>
&gt; From: P McIlroy &lt;pmcilroy@gmail.com&gt;<BR>
&gt; Date: November 28, 2005 3:17:14 PM PST<BR>
&gt; To: stolcke@speech.sri.com<BR>
&gt; Subject: Fwd: Trouble building your srilm project (macosx)<BR>
&gt;<BR>
&gt; I was able to compile one of the failed executables (ngram-count), but<BR>
&gt; it required adding<BR>
&gt;<BR>
&gt; #include &quot;NgramStats.cc&quot;<BR>
&gt;<BR>
&gt; to the end of the list of includes in the main source file<BR>
&gt; ngram-stats.cc.&nbsp; (This is not the preferred way to force compilation<BR>
&gt; of templates, but it's working for now.)&nbsp; I also tried forcing<BR>
&gt; instantiation by creating a NgramStats_inst.cc file, but this led to<BR>
&gt; horrible multiple definitions.<BR>
&gt;<BR>
&gt; I'm still getting a warning for multiple definitions of _qsort(), but<BR>
&gt; I don't think this is a problem.<BR>
&gt;<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>