Difference: GrmThraxForum (107 vs. 108)

Revision 1082018-03-12 - KarolMazurek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

OpenGrm Thrax Forum

Line: 17 to 17
 
Added:
>
>

Compilation problems under Debian 9.2.1 -- possible solution

KarolMazurek - 2018-03-12 - 16:47

Hi,

When trying to compile Thrax 1.2.5 with OpenFST installed (1.6.7, with flag --enable-grm), I have encountered several problems with compilation:

1)

util/utils.cc: In function 'size_t thrax::{anonymous}::GetResultSize(const std::vector<std::__cxx11::basic_string<char> >&, size_t)':
util/utils.cc:44:16: error: 'accumulate' is not a member of 'std'
   return (std::accumulate(elements.begin(), elements.end(), 0, lambda) +

putting line

#include <numeric>
in file src/lib/util/utils.cc

solves the problem

2)

In file included from walker/loader.cc:27:0:
./../include/thrax/features.h: In member function 'thrax::DataType* thrax::function::FeatureVector<Arc>::Execute(const std::vector<thrax::DataType*>&)':
./../include/thrax/features.h:462:38: error: 'kNoSymbol' is not a member of 'fst::SymbolTable'
       if (label == fst::SymbolTable::kNoSymbol) {

I have checked file <fst/symbol-table.h> And I think it should be fst::kNoSymbol instead of fst::SymbolTable::kNoSymbol.

I have changed line 462 of features.h to:

if (label == fst::kNoSymbol) {
And then compilation went OK.

Could you please investigate and try to reproduce that?

I have managed to reproduce it on other computer with Manjaro distro.

Patches below: features.h

--- thrax-1.2.5/src/include/thrax/features.h   2018-01-28 18:37:28.000000000 +0100
+++ thrax-fixed/src/include/thrax/features.h   2018-03-12 21:30:07.236917900 +0100
Line: 459 to 459
Added:
>
>
return nullptr; } int64 label = generated_symbols->Find(featval); - if (label == fst::SymbolTable::kNoSymbol) { + if (label == fst::kNoSymbol) { std::cout << "Feature/value pair " << featval << " is not defined." << std::endl; delete generated_symbols;

utils.cc

--- thrax-1.2.5/src/lib/util/utils.cc   2018-01-18 01:22:59.000000000 +0100
+++ thrax-fixed/src/lib/util/utils.cc   2018-03-12 21:29:17.702287413 +0100
Line: 23 to 23
Added:
>
>
#include #include #include - +#include // For Cygwin and other installations that do not define ACCESSPERMS (thanks to // Damir Cavar). #ifndef ACCESSPERMS

<--/commentPlugin-->
Log In

 

Public Examples of Thrax with a UTF8 Alphabet?

KennethRBeesley - 2018-01-11 - 14:23

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback