From 6d356c8ed61ca6f9de68e30f086a18f24c563de3 Mon Sep 17 00:00:00 2001 From: Dogan Can Date: Thu, 6 Mar 2014 01:51:33 +0000 Subject: [PATCH] sandbox/sail: Added irstlm patch. Renamed configure.in to configure.ac. There are a few places in irstlm code where variable length arrays of non-POD types are causing errors with recent standards compliant c++ compilers. mdiadapt.cpp:1115:16: error: variable length array of non-POD element type 'streampos' (aka 'fpos') streampos pos[lmsize()+1]; ... This use is not part of the c++ standard. Some compilers like gcc support this through an extension while others like clang do not. This patch replaces all VLAs of non-POD types with std::vector. Also, configure.in is renamed to configure.ac to make recent automake distributions happy. git-svn-id: https://svn.code.sf.net/p/kaldi/code/sandbox/sail@3699 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8 --- tools/Makefile | 6 ++++-- tools/irstlm.patch | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 tools/irstlm.patch diff --git a/tools/Makefile b/tools/Makefile index 4f926f192..0b0e62e2f 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -108,11 +108,13 @@ irstlm/Makefile: irstlm/.patched irstlm/.patched: | irstlm -cd irstlm;\ - patch --verbose -N -p0 < ../interpolatedwrite-5.60.02.patch + patch --verbose -N -p0 < ../interpolatedwrite-5.60.02.patch; \ + patch --verbose -N -p0 < ../irstlm.patch; \ + mv configure.in configure.ac touch $@ irstlm: - svn -r 398 co https://svn.code.sf.net/p/irstlm/code/trunk irstlm + svn -r 398 co --non-interactive --trust-server-cert https://svn.code.sf.net/p/irstlm/code/trunk irstlm atlas: ATLAS/include/cblas.h diff --git a/tools/irstlm.patch b/tools/irstlm.patch new file mode 100644 index 000000000..9a0450ea9 --- /dev/null +++ b/tools/irstlm.patch @@ -0,0 +1,39 @@ +--- src/mdiadapt.cpp 2014-03-05 00:43:33.000000000 -0800 ++++ src/mdiadapt.cpp.new 2014-03-05 00:42:41.000000000 -0800 +@@ -20,6 +20,7 @@ + + #include + #include ++#include + #include + #include "mfstream.h" + #include "mempool.h" +@@ -1112,7 +1113,7 @@ + }else{ + cerr << "savebin: " << filename << "\n"; + } +- streampos pos[lmsize()+1]; ++ vector pos(lmsize()+1); + int num[lmsize()+1]; + + int maxlev=lmsize(); +@@ -1303,7 +1304,7 @@ + fstream out(filename,ios::out); + // out.precision(15); + +- streampos pos[lmsize()+1]; ++ vector pos(lmsize()+1); + int num[lmsize()+1]; + char buff[100]; + +--- src/interpolate-lm.cpp 2014-03-05 00:43:37.000000000 -0800 ++++ src/interpolate-lm.cpp.new 2014-03-05 00:43:01.000000000 -0800 +@@ -258,7 +258,7 @@ + //Learning mixture weights + if (learn){ + +- std::vector p[N]; //LM probabilities ++ std::vector< std::vector > p(N); //LM probabilities + float c[N]; //expected counts + float den,norm; //inner denominator, normalization term + float variation=1.0; // global variation between new old params