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<mbstate_t>')
  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
This commit is contained in:
Dogan Can 2014-03-06 01:51:33 +00:00
Родитель ebd9e66c38
Коммит 6d356c8ed6
2 изменённых файлов: 43 добавлений и 2 удалений

Просмотреть файл

@ -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

39
tools/irstlm.patch Normal file
Просмотреть файл

@ -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 <cmath>
#include <string>
+#include <vector>
#include <assert.h>
#include "mfstream.h"
#include "mempool.h"
@@ -1112,7 +1113,7 @@
}else{
cerr << "savebin: " << filename << "\n";
}
- streampos pos[lmsize()+1];
+ vector<streampos> 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<streampos> 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<float> p[N]; //LM probabilities
+ std::vector< std::vector<float> > 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