<!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 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<unsigned int>::FNgramCounts(FactoredVocab&,<BR>
FNgramSpecs<unsigned int>&)<BR>
Map2<unsigned int, unsigned int, double>::clear()<BR>
NgramCounts<unsigned int>::NgramCounts(Vocab&, unsigned int)<BR>
<BR>
I was able to 'fix' ngram-counts by adding<BR>
<BR>
#include "NgramStats.cc"<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<unsigned>;<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? 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>
> From: P McIlroy <pmcilroy@gmail.com><BR>
> Date: November 28, 2005 3:17:14 PM PST<BR>
> To: stolcke@speech.sri.com<BR>
> Subject: Fwd: Trouble building your srilm project (macosx)<BR>
><BR>
> I was able to compile one of the failed executables (ngram-count), but<BR>
> it required adding<BR>
><BR>
> #include "NgramStats.cc"<BR>
><BR>
> to the end of the list of includes in the main source file<BR>
> ngram-stats.cc. (This is not the preferred way to force compilation<BR>
> of templates, but it's working for now.) I also tried forcing<BR>
> instantiation by creating a NgramStats_inst.cc file, but this led to<BR>
> horrible multiple definitions.<BR>
><BR>
> I'm still getting a warning for multiple definitions of _qsort(), but<BR>
> I don't think this is a problem.<BR>
><BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>