SRILM and gcc 3.4.3

Andreas Stolcke stolcke at speech.sri.com
Mon Nov 15 13:39:13 PST 2004


FYI, the patch below is necessary to get SRILM to compile with the latest 
version of the gcc compiler.  It might work for older gcc 3.4.x releases, too,
but I haven't tried it.

--Andreas

*** /tmp/T0p3XbS_	Mon Nov 15 13:35:18 2004
--- dstruct/src/LHash.cc	Sun Nov 14 20:45:54 2004
***************
*** 9,15 ****
  
  #ifndef lint
  static char LHash_Copyright[] = "Copyright (c) 1995-1998 SRI International.  All Rights Reserved.";
! static char LHash_RcsId[] = "@(#)$Header: /home/srilm/devel/dstruct/src/RCS/LHash.cc,v 1.44 2003/07/01 06:03:35 stolcke Exp $";
  #endif
  
  #include <iostream.h>
--- 9,15 ----
  
  #ifndef lint
  static char LHash_Copyright[] = "Copyright (c) 1995-1998 SRI International.  All Rights Reserved.";
! static char LHash_RcsId[] = "@(#)$Header: /home/srilm/devel/dstruct/src/RCS/LHash.cc,v 1.45 2004/11/15 04:45:47 stolcke Exp $";
  #endif
  
  #include <iostream.h>
***************
*** 22,28 ****
  
  #undef INSTANTIATE_LHASH
  #define INSTANTIATE_LHASH(KeyT, DataT) \
! 	DataT *LHash< KeyT, DataT >::removedData = 0; \
  	template class LHash< KeyT, DataT >; \
  	template class LHashIter< KeyT, DataT >
  
--- 22,28 ----
  
  #undef INSTANTIATE_LHASH
  #define INSTANTIATE_LHASH(KeyT, DataT) \
! 	template <> DataT *LHash< KeyT, DataT >::removedData = 0; \
  	template class LHash< KeyT, DataT >; \
  	template class LHashIter< KeyT, DataT >
  
*** /tmp/T00K4fDt	Mon Nov 15 13:35:47 2004
--- dstruct/src/SArray.cc	Sun Nov 14 20:45:55 2004
***************
*** 9,15 ****
  
  #ifndef lint
  static char SArray_Copyright[] = "Copyright (c) 1995-1998 SRI International.  All Rights Reserved.";
! static char SArray_RcsId[] = "@(#)$Header: /home/srilm/devel/dstruct/src/RCS/SArray.cc,v 1.35 2003/07/01 06:03:35 stolcke Exp $";
  #endif
  
  #include <stdio.h>
--- 9,15 ----
  
  #ifndef lint
  static char SArray_Copyright[] = "Copyright (c) 1995-1998 SRI International.  All Rights Reserved.";
! static char SArray_RcsId[] = "@(#)$Header: /home/srilm/devel/dstruct/src/RCS/SArray.cc,v 1.36 2004/11/15 04:45:47 stolcke Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 22,28 ****
  
  #undef INSTANTIATE_SARRAY
  #define INSTANTIATE_SARRAY(KeyT, DataT) \
! 	DataT *SArray< KeyT, DataT >::removedData = 0; \
  	template class SArray< KeyT, DataT >; \
  	template class SArrayIter< KeyT, DataT >
  
--- 22,28 ----
  
  #undef INSTANTIATE_SARRAY
  #define INSTANTIATE_SARRAY(KeyT, DataT) \
! 	template <> DataT *SArray< KeyT, DataT >::removedData = 0; \
  	template class SArray< KeyT, DataT >; \
  	template class SArrayIter< KeyT, DataT >
  
*** /tmp/T0HUxS3_	Mon Nov 15 13:36:12 2004
--- lm/src/ngram-count.cc	Sun Nov 14 20:46:20 2004
***************
*** 6,12 ****
  
  #ifndef lint
  static char Copyright[] = "Copyright (c) 1995-2002 SRI International.  All Rights Reserved.";
! static char RcsId[] = "@(#)$Header: /home/srilm/devel/lm/src/RCS/ngram-count.cc,v 1.48 2003/10/10 01:23:39 stolcke Exp $";
  #endif
  
  #include <stdlib.h>
--- 6,12 ----
  
  #ifndef lint
  static char Copyright[] = "Copyright (c) 1995-2002 SRI International.  All Rights Reserved.";
! static char RcsId[] = "@(#)$Header: /home/srilm/devel/lm/src/RCS/ngram-count.cc,v 1.49 2004/11/15 04:46:15 stolcke Exp $";
  #endif
  
  #include <stdlib.h>
***************
*** 390,396 ****
       * This stores the discounting parameters for the various orders
       * Note this is only needed when estimating an LM
       */
!     Discount **discounts = new (Discount *)[order];
      assert(discounts != 0);
  
      for (i = 0; i < order; i ++) {
--- 390,396 ----
       * This stores the discounting parameters for the various orders
       * Note this is only needed when estimating an LM
       */
!     Discount **discounts = new Discount *[order];
      assert(discounts != 0);
  
      for (i = 0; i < order; i ++) {
*** /tmp/T00yHSdk	Mon Nov 15 13:36:32 2004
--- lm/src/nbest-optimize.cc	Sun Nov 14 20:46:20 2004
***************
*** 5,11 ****
  
  #ifndef lint
  static char Copyright[] = "Copyright (c) 2000-2004 SRI International.  All Rights Reserved.";
! static char RcsId[] = "@(#)$Header: /home/srilm/devel/lm/src/RCS/nbest-optimize.cc,v 1.36 2004/09/09 10:44:31 stolcke Exp $";
  #endif
  
  #include <stdio.h>
--- 5,11 ----
  
  #ifndef lint
  static char Copyright[] = "Copyright (c) 2000-2004 SRI International.  All Rights Reserved.";
! static char RcsId[] = "@(#)$Header: /home/srilm/devel/lm/src/RCS/nbest-optimize.cc,v 1.37 2004/11/15 04:46:15 stolcke Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 1646,1652 ****
  	/*
  	 * Allocate score matrix for this nbest list
  	 */
! 	NBestScore **scores = new (NBestScore *)[numScores];
  	assert(scores != 0);
  
  	for (unsigned i = 0; i < numScores; i ++) {
--- 1646,1652 ----
  	/*
  	 * Allocate score matrix for this nbest list
  	 */
! 	NBestScore **scores = new NBestScore *[numScores];
  	assert(scores != 0);
  
  	for (unsigned i = 0; i < numScores; i ++) {



More information about the SRILM-User mailing list