<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 5/16/2012 9:25 AM, Edward Grefenstette wrote:
    <blockquote
      cite="mid:AC7E2B16-FD1E-4634-B5C9-E6BEBFBC5909@gmail.com"
      type="cite">
      <div>Dear srilm users,</div>
      <div><br>
      </div>
      As mentioned in another email, <a moz-do-not-send="true"
href="http://stackoverflow.com/questions/10606983/problems-installing-srilm-on-os-x-10-7">I've
        encountered and later resolved some problems building srilm with
        gcc v4.6</a>. The fault, it seems, lays with the makearray
      declarations used in LatticeIndex.cc and LatticeNgrams.cc found in
      ./lattice/src/ of the srilm folder.
      <div><br>
      </div>
      <div>I've managed to get srilm to compile by "cheating" and using
        an older version of g++ passed to make with CXX flag, but
        ideally it'd be better to fix the source to be compliant with
        C++0x, as enforced by gcc versions >= 4.3 (I think).</div>
      <div><br>
      </div>
      <div>I attach to this email the modified LatticeIndex.cc
        and LatticeNgrams.cc files from srilm 1.6.0 (diffs reproduced at
        the end of the email), which allowed me to compile srilm using
        gcc 4.6.1 without passing an older g++ using the CXX flag. Could
        someone please sanity check the changes? If they're good, it'd
        be nice to see these files updated in the main distribution so
        that others don't encounter this frustrating problem when they
        update their compilers and decide to (re)build srilm.</div>
    </blockquote>
    SRILM compiles fine on gcc 4.5.x, which is the latest version I've
    verified myself.<br>
    <br>
    It is possible that gcc 4.6.x changed (removed)  the support for
    stack-allocated arrays with size computed at run-time, to be inline
    with standard C++.   In that case a simple change in Array.h (the
    conditional definition of makeArray()) should suffice.<br>
    <br>
    I will try to get my hands on gcc 4.6.x to verify this, but feel
    free to submit a patch along those lines.<br>
    <br>
    Andreas<br>
    <br>
  </body>
</html>