AdolfVonKleist / Phonetisaurus

Phonetisaurus G2P
BSD 3-Clause "New" or "Revised" License
449 stars 122 forks source link

can't build on raspi - compile error #6

Closed d3im closed 7 years ago

d3im commented 8 years ago

Hi, I try to build Phonetisaurus but it gives me an error: src # make g++ -std=c++0x -Wall -Wno-sign-compare -Wno-unused-local-typedefs -DGNUC -O2 -I3rdparty/utfcpp -I3rdparty/rnnlm -I/usr/local/include -I. -c lib/util.cc -o lib/util.o g++ -std=c++0x -Wall -Wno-sign-compare -Wno-unused-local-typedefs -DGNUC -O2 -I3rdparty/utfcpp -I3rdparty/rnnlm -I/usr/local/include -I. -c lib/LatticePruner.cc -o lib/LatticePruner.o g++ -std=c++0x -Wall -Wno-sign-compare -Wno-unused-local-typedefs -DGNUC -O2 -I3rdparty/utfcpp -I3rdparty/rnnlm -I/usr/local/include -I. -c lib/M2MFstAligner.cc -o lib/M2MFstAligner.o g++ -std=c++0x -Wall -Wno-sign-compare -Wno-unused-local-typedefs -DGNUC -O2 -I3rdparty/utfcpp -I3rdparty/rnnlm -I/usr/local/include -L/usr/local/lib -lfst -ldl -lm -lrt -fopenmp -I/home/d3im/Phonetisaurus/src \ lib/util.o lib/LatticePruner.o lib/M2MFstAligner.o \ bin/phonetisaurus-align.cc -DGIT_REVISION=\"317a17-dirty\" \ -o bin/phonetisaurus-align -lfst -ldl -lm -lrt -fopenmp g++ -std=c++0x -Wall -Wno-sign-compare -Wno-unused-local-typedefs -DGNUC -O2 -I3rdparty/utfcpp -I3rdparty/rnnlm -I/usr/local/include -L/usr/local/lib -lfst -ldl -lm -lrt -fopenmp lib/util.o \ -I/home/d3im/Phonetisaurus/src bin/phonetisaurus-arpa2wfst.cc -L/usr/local/lib \ -DGIT_REVISION=\"317a17-dirty\" \ -o bin/phonetisaurus-arpa2wfst -lfst -ldl -lm -lrt -fopenmp g++ -std=c++0x -Wall -Wno-sign-compare -Wno-unused-local-typedefs -DGNUC -O2 -I3rdparty/utfcpp -I3rdparty/rnnlm -I/usr/local/include -std=c++0x -I. -lfst -lm -ldl \ -funroll-loops -ffast-math -lm -w -c 3rdparty/rnnlm/rnnlmlib.cpp \ -o lib/rnnlmlib.o g++ -std=c++0x -Wall -Wno-sign-compare -Wno-unused-local-typedefs -DGNUC -O2 -I3rdparty/utfcpp -I3rdparty/rnnlm -I/usr/local/include -lfst -ldl -lm -lrt -fopenmp -L/usr/local/lib -funroll-loops -I/home/d3im/Phonetisaurus/src \ -ffast-math lib/util.o lib/rnnlmlib.o \ -DGIT_REVISION=\"317a17-dirty\" \ bin/phonetisaurus-g2prnn.cc -o bin/phonetisaurus-g2prnn -lfst -ldl -lm -lrt -fopenmp In file included from bin/phonetisaurus-g2prnn.cc:5:0: /home/d3im/Phonetisaurus/src/include/RnnLMDecoder.h:168:50: error: wrong number of template arguments (3, should be 2) typedef Heap<Token, TokenPointerCompare, false> Queue; ^ In file included from /usr/local/include/fst/vector-fst.h:12:0, from /usr/local/include/fst/cache.h:16, from /usr/local/include/fst/compact-fst.h:14, from /usr/local/include/fst/fstlib.h:34, from bin/phonetisaurus-g2prnn.cc:1: /usr/local/include/fst/fst-decl.h:97:7: error: provided for ‘template<class T, class Compare> class fst::Heap’ class Heap; ^ In file included from bin/phonetisaurus-g2prnn.cc:5:0: /home/d3im/Phonetisaurus/src/include/RnnLMDecoder.h: In member function ‘RnnLMDecoder::RawResults RnnLMDecoder::DecodeRaw(const std::vectorstd::basicstring&, int, int, int, double)’: /home/d3im/Phonetisaurus/src/include/RnnLMDecoder.h:247:18: error: request for member ‘Clear’ in ‘((RnnLMDecoder)this)->RnnLMDecoder::sQueue[i]’, which is of non-class type ‘gnu_cxx::__alloc_traitsstd::allocator::valuetype {aka int}’ sQueue [i].Clear (); ^ /home/d3im/Phonetisaurus/src/include/RnnLMDecoder.h:256:26: error: request for member ‘Empty’ in ‘((RnnLMDecoder)this)->RnnLMDecoder::sQueue[s]’, which is of non-class type ‘gnu_cxx::alloc_traitsstd::allocator::valuetype {aka int}’ while (!sQueue [s].Empty () && k < kMax && n < nbest) { ^ /home/d3im/Phonetisaurus/src/include/RnnLMDecoder.h:257:26: error: request for member ‘Pop’ in ‘((RnnLMDecoder)this)->RnnLMDecoder::sQueue[s]’, which is of non-class type ‘__gnu_cxx::alloc_traitsstd::allocator::valuetype {aka int}’ Token top = sQueue [s].Pop (); ^ /home/d3im/Phonetisaurus/src/include/RnnLMDecoder.h:295:31: error: request for member ‘Insert’ in ‘((RnnLMDecoder_)this)->RnnLMDecoder::sQueue[arc.nextstate]’, which is of non-class type ‘gnu_cxx::__alloc_traitsstd::allocator::valuetype {aka int}’ sQueue [arc.nextstate].Insert (npointer); ^ /home/d3im/Phonetisaurus/src/include/RnnLMDecoder.h:304:26: error: request for member ‘Insert’ in ‘((RnnLMDecoder)this)->RnnLMDecoder::sQueue[arc.nextstate]’, which is of non-class type ‘gnu_cxx::alloc_traitsstd::allocator::valuetype {aka int}’ sQueue [arc.nextstate].Insert ((Token)&(niterator)); ^ /home/d3im/Phonetisaurus/src/include/RnnLMDecoder.h: In member function ‘void RnnLMDecoder::Initialize()’: /home/d3im/Phonetisaurus/src/include/RnnLMDecoder.h:326:28: error: request for member ‘Insert’ in ‘((RnnLMDecoder)this)->RnnLMDecoder::sQueue[0]’, which is of non-class type ‘__gnu_cxx::alloc_traitsstd::allocator::valuetype {aka int}’ prev->key = sQueue [0].Insert ((Token)&(_prev)); ^ Makefile:109: instruction for target „bin/phonetisaurus-g2prnn“ failed make: _* [bin/phonetisaurus-g2prnn] Error 1

I don't know what could be wrong, could somebody help? Thanks in advance.

theja0473 commented 8 years ago

root@raspberrypi:~/Phonetisaurus/src# ./configure checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether g++ supports C++11 features by default... no checking whether g++ supports C++11 features with -std=gnu++11... no checking whether g++ supports C++11 features with -std=gnu++0x... no checking whether g++ supports C++11 features with -std=c++11... no checking whether g++ supports C++11 features with -std=c++0x... no configure: error: *\ A compiler with support for C++11 language features is required. screenshot from 2016-04-29 17-50-03

denics commented 7 years ago

Hi all, I'm on a Raspberry Pi, with gcc-4.9 and I have exactly the same error then @d3im . Any idea? The error is the same using distcc or not.

In file included from bin/phonetisaurus-g2prnn.cc:5:0: /home/pi/git/Phonetisaurus/src/include/RnnLMDecoder.h:168:50: error: wrong number of template arguments (3, should be 2) typedef Heap<Token*, TokenPointerCompare, false> Queue; ^ In file included from /usr/local/include/fst/vector-fst.h:12:0, from /usr/local/include/fst/cache.h:16, from /usr/local/include/fst/compact-fst.h:14, from /usr/local/include/fst/fstlib.h:33, from bin/phonetisaurus-g2prnn.cc:1: /usr/local/include/fst/fst-decl.h:143:7: error: provided for 'template<class T, class Compare> class fst::Heap' class Heap; ^ In file included from /home/pi/git/Phonetisaurus/src/include/PhonetisaurusScript.h:39:0, from bin/phonetisaurus-g2pfst.cc:33: /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h: In function 'void NShortestPathSpecialized(const fst::Fst<RevArc>&, fst::MutableFst<Arc>*, const std::vector<typename Arc::Weight>&, size_t, size_t, PathFilter*, float, typename Arc::Weight, typename Arc::StateId)': /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:244:3: error: 'ShortestPathCompare' was not declared in this scope ShortestPathCompare<StateId, Weight> ^ /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:244:3: note: suggested alternative: In file included from /usr/local/include/fst/fstlib.h:72:0, from bin/phonetisaurus-g2pfst.cc:32: /usr/local/include/fst/shortest-path.h:217:7: note: 'fst::internal::ShortestPathCompare' class ShortestPathCompare { ^ In file included from /home/pi/git/Phonetisaurus/src/include/PhonetisaurusScript.h:39:0, from bin/phonetisaurus-g2pfst.cc:33: /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:244:30: error: expected primary-expression before ',' token ShortestPathCompare<StateId, Weight> ^ /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:244:38: error: expected primary-expression before '>' token ShortestPathCompare<StateId, Weight> ^ /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:271:43: error: 'compare' was not declared in this scope pop_heap (heap.begin (), heap.end (), compare); ^ In file included from bin/phonetisaurus-g2prnn.cc:5:0: /home/pi/git/Phonetisaurus/src/include/RnnLMDecoder.h: In member function 'RnnLMDecoder<D>::RawResults RnnLMDecoder<D>::DecodeRaw(const std::vector<std::basic_string<char> >&, int, int, int, double)': /home/pi/git/Phonetisaurus/src/include/RnnLMDecoder.h:247:18: error: request for member 'Clear' in '((RnnLMDecoder<D>*)this)->RnnLMDecoder<D>::sQueue[i]', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' sQueue [i].Clear (); ^ /home/pi/git/Phonetisaurus/src/include/RnnLMDecoder.h:256:26: error: request for member 'Empty' in '((RnnLMDecoder<D>*)this)->RnnLMDecoder<D>::sQueue[s]', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' while (!sQueue [s].Empty () && k < kMax && n < nbest) { ^ /home/pi/git/Phonetisaurus/src/include/RnnLMDecoder.h:257:26: error: request for member 'Pop' in '((RnnLMDecoder<D>*)this)->RnnLMDecoder<D>::sQueue[s]', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' Token* top = sQueue [s].Pop (); ^ /home/pi/git/Phonetisaurus/src/include/RnnLMDecoder.h:295:31: error: request for member 'Insert' in '((RnnLMDecoder<D>*)this)->RnnLMDecoder<D>::sQueue[arc.nextstate]', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' sQueue [arc.nextstate].Insert (npointer); ^ /home/pi/git/Phonetisaurus/src/include/RnnLMDecoder.h:304:26: error: request for member 'Insert' in '((RnnLMDecoder<D>*)this)->RnnLMDecoder<D>::sQueue[arc.nextstate]', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' sQueue [arc.nextstate].Insert ((Token*)&(*niterator)); ^ /home/pi/git/Phonetisaurus/src/include/RnnLMDecoder.h: In member function 'void RnnLMDecoder<D>::Initialize()': /home/pi/git/Phonetisaurus/src/include/RnnLMDecoder.h:326:28: error: request for member 'Insert' in '((RnnLMDecoder<D>*)this)->RnnLMDecoder<D>::sQueue[0]', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' prev->key = sQueue [0].Insert ((Token*)&(*prev)); ^ In file included from bin/phonetisaurus-align.cc:35:0: /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h: In function 'void NShortestPathSpecialized(const fst::Fst<RevArc>&, fst::MutableFst<Arc>*, const std::vector<typename Arc::Weight>&, size_t, size_t, PathFilter*, float, typename Arc::Weight, typename Arc::StateId)': /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:244:3: error: 'ShortestPathCompare' was not declared in this scope ShortestPathCompare<StateId, Weight> ^ /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:244:3: note: suggested alternative: In file included from /usr/local/include/fst/fstlib.h:72:0, from /home/pi/git/Phonetisaurus/src/include/M2MFstAligner.h:33, from bin/phonetisaurus-align.cc:32: /usr/local/include/fst/shortest-path.h:217:7: note: 'fst::internal::ShortestPathCompare' class ShortestPathCompare { ^ In file included from bin/phonetisaurus-align.cc:35:0: /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:244:30: error: expected primary-expression before ',' token ShortestPathCompare<StateId, Weight> ^ /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:244:38: error: expected primary-expression before '>' token ShortestPathCompare<StateId, Weight> ^ /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:271:43: error: 'compare' was not declared in this scope pop_heap (heap.begin (), heap.end (), compare); ^ /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h: In instantiation of 'void NShortestPathSpecialized(const fst::Fst<RevArc>&, fst::MutableFst<Arc>*, const std::vector<typename Arc::Weight>&, size_t, size_t, PathFilter*, float, typename Arc::Weight, typename Arc::StateId) [with Arc = fst::ArcTpl<fst::TropicalWeightTpl<float> >; RevArc = fst::ReverseArc<fst::ArcTpl<fst::TropicalWeightTpl<float> > >; PathFilter = M2MPathFilter<fst::ArcTpl<fst::TropicalWeightTpl<float> > >; typename Arc::Weight = fst::TropicalWeightTpl<float>; size_t = unsigned int; typename Arc::Weight = fst::TropicalWeightTpl<float>; typename Arc::StateId = int]': /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:396:46: required from 'void ShortestPathSpecialized(const fst::Fst<Arc>&, fst::MutableFst<Arc>*, std::vector<typename Arc::Weight>*, PathFilter*, size_t, fst::ShortestPathOptions<Arc, Queue, ArcFilter>&) [with Arc = fst::ArcTpl<fst::TropicalWeightTpl<float> >; Queue = fst::AutoQueue<int>; ArcFilter = fst::AnyArcFilter<fst::ArcTpl<fst::TropicalWeightTpl<float> > >; PathFilter = M2MPathFilter<fst::ArcTpl<fst::TropicalWeightTpl<float> > >; typename Arc::Weight = fst::TropicalWeightTpl<float>; size_t = unsigned int]' /home/pi/git/Phonetisaurus/src/include/PhonetisaurusScript.h:146:33: required from here /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:245:47: error: 'compare' was not declared in this scope compare(pairs, distance, superfinal, delta); ^ /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h: In instantiation of 'void NShortestPathSpecialized(const fst::Fst<RevArc>&, fst::MutableFst<Arc>*, const std::vector<typename Arc::Weight>&, size_t, size_t, PathFilter*, float, typename Arc::Weight, typename Arc::StateId) [with Arc = fst::ArcTpl<fst::TropicalWeightTpl<float> >; RevArc = fst::ReverseArc<fst::ArcTpl<fst::TropicalWeightTpl<float> > >; PathFilter = IdentityPathFilter<fst::ArcTpl<fst::TropicalWeightTpl<float> > >; typename Arc::Weight = fst::TropicalWeightTpl<float>; size_t = unsigned int; typename Arc::Weight = fst::TropicalWeightTpl<float>; typename Arc::StateId = int]': /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:396:46: required from 'void ShortestPathSpecialized(const fst::Fst<Arc>&, fst::MutableFst<Arc>*, std::vector<typename Arc::Weight>*, PathFilter*, size_t, fst::ShortestPathOptions<Arc, Queue, ArcFilter>&) [with Arc = fst::ArcTpl<fst::TropicalWeightTpl<float> >; Queue = fst::AutoQueue<int>; ArcFilter = fst::AnyArcFilter<fst::ArcTpl<fst::TropicalWeightTpl<float> > >; PathFilter = IdentityPathFilter<fst::ArcTpl<fst::TropicalWeightTpl<float> > >; typename Arc::Weight = fst::TropicalWeightTpl<float>; size_t = unsigned int]' bin/phonetisaurus-align.cc:129:36: required from here /home/pi/git/Phonetisaurus/src/include/PhonetisaurusRex.h:245:47: error: 'compare' was not declared in this scope compare(pairs, distance, superfinal, delta); ^ distcc[7144] ERROR: compile (null) on localhost failed Makefile:109: recipe for target 'bin/phonetisaurus-g2prnn' failed make: *** [bin/phonetisaurus-g2prnn] Error 1 make: *** Waiting for unfinished jobs.... distcc[7146] ERROR: compile bin/phonetisaurus-g2pfst.cc on localhost failed Makefile:116: recipe for target 'bin/phonetisaurus-g2pfst' failed make: *** [bin/phonetisaurus-g2pfst] Error 1 distcc[7142] ERROR: compile (null) on localhost failed Makefile:96: recipe for target 'bin/phonetisaurus-align' failed make: *** [bin/phonetisaurus-align] Error 1

denics commented 7 years ago

I forgot to add that I am compiling against openfst 1.6.0

AdolfVonKleist commented 7 years ago

I have not tried 1.6.0, but all should compile correctly with 1.6.1. I have not checked if there are any breaking changes between 1.6.0, 1.6.1. I've just merged this branch to master - which means 1.6.1 is now the default expectation for OpenFst.