NiuTrans / NiuTrans.SMT

NiuTrans.SMT is an open-source statistical machine translation system developed by a joint team from NLP Lab. at Northeastern University and the NiuTrans Team. The NiuTrans system is fully developed in C++ language. So it runs fast and uses less memory. Currently it supports phrase-based, hierarchical phrase-based and syntax-based (string-to-tree, tree-to-string and tree-to-tree) models for research-oriented studies.
GNU General Public License v2.0
148 stars 36 forks source link

Multiple compile issues on Linux #1

Closed AntonOfTheWoods closed 6 years ago

AntonOfTheWoods commented 6 years ago

My C++ is very weak but doing a fresh pull and make has multiple errors when attempting to build from master on Ubuntu 18.04. It appears that there are many issues, the first of which is

OurTree.cpp: In member function ‘bool smt::Tree::CreateForest(const char*)’:                                                                                  
OurTree.cpp:377:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]                                                 
         while(ibeg != '\0'){                                                                                                                                 
                       ^~~~                                                                                                                                   Makefile:13: recipe for target 'OurTree.o' failed                                                                                                             
make[1]: *** [OurTree.o] Error 1                                                                                                                              
make[1]: Leaving directory '/home/a.melser/dev/NiuTrans.SMT/src/NiuTrans.Decoder'                                                                             
Makefile:12: recipe for target 'all' failed                                                                                                                   
make: *** [all] Error 2  

But there seem to be many others, like missing variables (src/NiuTrans.PhraseExtractor/dispatcher.cpp, options.sort_phrase_table), missing methods:

ruletable_scorer.cpp: In member function ‘bool ruletable_scorer::PhraseTable::generatePhraseTable(ruletable_scorer::PhraseAlignment&, bool&, std::ofstream&, b
ool&, ruletable_scorer::OptionsOfScore&, ruletable_scorer::ScoreClassifyNum&)’:                                                                  
ruletable_scorer.cpp:280:80: error: no matching function for call to ‘ruletable_scorer::PhraseTable::output(std::ofstream&, bool&, ruletable_scorer::OptionsOf
Score&, ruletable_scorer::ScoreClassifyNum&, double&)’                                                                                                        
         output( outfile, inverseFlag, options, scoreClassifyNum ,totalFrequency); 

And maybe more. Is there something I am missing or has this version not been tested on Linux? If you have a version that has definitely been compiled on Linux I can compare with then I can help get this working!

FYI, none of the links to download packages on http://www.nlplab.com/NiuPlan/NiuTrans.html or http://www.niutrans.com/niutrans/NiuTrans.html are still working.

AntonOfTheWoods commented 6 years ago

Thanks for the bugfix. There is one remaining issue for me on Ubuntu 18.04. I still get the first error above. I can make the error go away by either changing line 377 of NiuTrans.Decoder/OurTree.cpp to:

while(*ibeg != '\0'){

or

while(ibeg != "\0"){

I suspect it is the first one that is required but really don't have enough C++ to know for sure. Both versions compile. Thanks again for your help.

liyinqiao2012 commented 6 years ago

@AntonOfTheWoods Thank you for your feedback, we checked our codes and fix the bug you have mentioned. As what you said,

while(*ibeg != '\0'){

is the right version and we have updated the correct codes on github. Thank you very much!

AntonOfTheWoods commented 6 years ago

Perfect, thanks, I confirm it now compiles fine on Ubuntu 18.04!