trunk:tools re-patch for multi-thread support of openfst with GCC 4.1 or up

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@3288 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
This commit is contained in:
Ho Yin Chan 2013-12-10 04:10:02 +00:00
Родитель 98dbae1be2
Коммит 1acd167b46
2 изменённых файлов: 10 добавлений и 4 удалений

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

@ -1,5 +1,7 @@
# SHELL += -x
CXX = g++
all: check_required_programs sph2pipe atlas irstlm_tgt sclite_tgt openfst_tgt
@ -57,7 +59,7 @@ openfst-1.3.2/Makefile: openfst-1.3.2/.patched
openfst-1.3.2/.patched: | openfst-1.3.2_tgt
-cd openfst-1.3.2/src/include/fst; \
patch -p0 -N < ../../../../openfst.patch;
g++ --version | awk '{if(NR==1 && $$2=="(GCC)" && $$3>"4.1") print "cd openfst-1.3.2/src/include/fst; patch -p0 -N < ../../../../extras/openfst_gcc41up.patch"}' | sh -
$(CXX) -dumpversion | awk '{if(NR==1 && $$1>"4.1") print "cd openfst-1.3.2/src/include/fst; patch -p0 -N < ../../../../extras/openfst_gcc41up.patch"}' | sh -
touch $@
openfst-1.3.2_tgt: openfst-1.3.2.tar.gz

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

@ -1,4 +1,4 @@
*** lock.h
*** lock.h
***************
*** 78,85 ****
RefCounter() : count_(1) {}
@ -9,16 +9,20 @@
private:
mutable int count_;
--- 78,88 ----
--- 78,93 ----
RefCounter() : count_(1) {}
int count() const { return count_; }
!
! // below lines are modifications of openfst for multi-thrads support,
! // from tools/extras/openfst_gcc41up.patch, applied by tools/Makefile,
! // applicable to gcc 4.1 or above
! // int Incr() const { return ++count_; }
! // int Decr() const { return --count_; }
!
! int Incr() const { return __sync_add_and_fetch(&count_, 1); }
! int Decr() const { return __sync_sub_and_fetch(&count_, 1); }
! // end modifications
private:
mutable int count_;