Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Running buildTF.sh #1

Closed
dsleo opened this issue Mar 10, 2018 · 5 comments
Closed

Error Running buildTF.sh #1

dsleo opened this issue Mar 10, 2018 · 5 comments

Comments

@dsleo
Copy link

dsleo commented Mar 10, 2018

Hello,

Thanks a lot for this really nice repo. I tried to use it but wasn't successful running the buildTF.sh script.

Here are the details versions for my environment:

  • CentOS 7
  • g++ (GCC) 4.8.5 (so I used -std=c++1y instead of c++14)
  • TensorFlow: 1.3

Do you have any idea what's going on ?

Thanks for your help, and here is the (long) log:

../src/PrefixTree.cpp: In member functionvoid PrefixTree::allWordsAdded()’:
../src/PrefixTree.cpp:56:74: error: parameter declared ‘auto’
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                          ^
../src/PrefixTree.cpp:56:91: error: parameter declared ‘auto’
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                           ^
../src/PrefixTree.cpp: In lambda function:
../src/PrefixTree.cpp:56:104: error: ‘lhswas not declared in this scope
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                                        ^
../src/PrefixTree.cpp:56:116: error: ‘rhswas not declared in this scope
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                                                    ^
../src/PrefixTree.cpp: In member functionstd::shared_ptr<PrefixTree::Node> PrefixTree::getNode(const std::vector<unsigned int>&) const’:
../src/PrefixTree.cpp:152:96: error: parameter declared ‘auto’
   auto iter = std::lower_bound(node->children.begin(), node->children.end(), c, [](const auto& p, const auto val) {return p.first < val; });
                                                                                                ^
../src/PrefixTree.cpp:152:110: error: parameter declared ‘auto’
   auto iter = std::lower_bound(node->children.begin(), node->children.end(), c, [](const auto& p, const auto val) {return p.first < val; });
                                                                                                              ^
../src/PrefixTree.cpp: In lambda function:
../src/PrefixTree.cpp:152:123: error: ‘pwas not declared in this scope
   auto iter = std::lower_bound(node->children.begin(), node->children.end(), c, [](const auto& p, const auto val) {return p.first < val; });
                                                                                                                           ^
../src/PrefixTree.cpp:152:133: error: ‘valwas not declared in this scope
   auto iter = std::lower_bound(node->children.begin(), node->children.end(), c, [](const auto& p, const auto val) {return p.first < val; });
                                                                                                                                     ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation of_FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Tp = unsigned int; _Compare = PrefixTree::getNode(const std::vector<unsigned int>&) const::__lambda2]’:
../src/PrefixTree.cpp:152:139:   required from here
/usr/include/c++/4.8.2/bits/stl_algo.h:2447:31: error: no match for call to ‘(PrefixTree::getNode(const std::vector<unsigned int>&) const::__lambda2) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, const unsigned int&)’
    if (__comp(*__middle, __val))
                               ^
../src/PrefixTree.cpp:152:82: note: candidates are:
   auto iter = std::lower_bound(node->children.begin(), node->children.end(), c, [](const auto& p, const auto val) {return p.first < val; });
                                                                                  ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:2447:31: note: void (*)() <conversion>
    if (__comp(*__middle, __val))
                               ^
/usr/include/c++/4.8.2/bits/stl_algo.h:2447:31: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:152:113: note: PrefixTree::getNode(const std::vector<unsigned int>&) const::__lambda2
   auto iter = std::lower_bound(node->children.begin(), node->children.end(), c, [](const auto& p, const auto val) {return p.first < val; });
                                                                                                                 ^
../src/PrefixTree.cpp:152:113: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation ofvoid std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’:
/usr/include/c++/4.8.2/bits/stl_algo.h:2226:70:   required fromvoid std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:5500:55:   required fromvoid std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
../src/PrefixTree.cpp:56:128:   required from here
/usr/include/c++/4.8.2/bits/stl_algo.h:2159:29: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
    if (__comp(*__i, *__first))
                             ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:2159:29: note: void (*)() <conversion>
    if (__comp(*__i, *__first))
                             ^
/usr/include/c++/4.8.2/bits/stl_algo.h:2159:29: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation ofvoid std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’:
/usr/include/c++/4.8.2/bits/stl_algo.h:5349:59:   required fromvoid std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:2332:68:   required fromvoid std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Size = long int; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:5499:44:   required fromvoid std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
../src/PrefixTree.cpp:56:128:   required from here
/usr/include/c++/4.8.2/bits/stl_algo.h:1948:27: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
  if (__comp(*__i, *__first))
                           ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:1948:27: note: void (*)() <conversion>
  if (__comp(*__i, *__first))
                           ^
/usr/include/c++/4.8.2/bits/stl_algo.h:1948:27: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation ofvoid std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’:
/usr/include/c++/4.8.2/bits/stl_algo.h:2295:13:   required from_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:2337:62:   required fromvoid std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Size = long int; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:5499:44:   required fromvoid std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
../src/PrefixTree.cpp:56:128:   required from here
/usr/include/c++/4.8.2/bits/stl_algo.h:114:28: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
       if (__comp(*__a, *__b))
                            ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:114:28: note: void (*)() <conversion>
       if (__comp(*__a, *__b))
                            ^
/usr/include/c++/4.8.2/bits/stl_algo.h:114:28: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:116:25: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
    if (__comp(*__b, *__c))
                         ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:116:25: note: void (*)() <conversion>
    if (__comp(*__b, *__c))
                         ^
/usr/include/c++/4.8.2/bits/stl_algo.h:116:25: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:118:30: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
    else if (__comp(*__a, *__c))
                              ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:118:30: note: void (*)() <conversion>
    else if (__comp(*__a, *__c))
                              ^
/usr/include/c++/4.8.2/bits/stl_algo.h:118:30: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:123:33: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
       else if (__comp(*__a, *__c))
                                 ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:123:33: note: void (*)() <conversion>
       else if (__comp(*__a, *__c))
                                 ^
/usr/include/c++/4.8.2/bits/stl_algo.h:123:33: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:125:33: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
       else if (__comp(*__b, *__c))
                                 ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:125:33: note: void (*)() <conversion>
       else if (__comp(*__b, *__c))
                                 ^
/usr/include/c++/4.8.2/bits/stl_algo.h:125:33: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation of_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Tp = std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’:
/usr/include/c++/4.8.2/bits/stl_algo.h:2296:78:   required from_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:2337:62:   required fromvoid std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Size = long int; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:5499:44:   required fromvoid std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
../src/PrefixTree.cpp:56:128:   required from here
/usr/include/c++/4.8.2/bits/stl_algo.h:2263:35: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, const std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
    while (__comp(*__first, __pivot))
                                   ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:2263:35: note: void (*)() <conversion>
    while (__comp(*__first, __pivot))
                                   ^
/usr/include/c++/4.8.2/bits/stl_algo.h:2263:35: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:2266:34: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (const std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
    while (__comp(__pivot, *__last))
                                  ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h:2266:34: note: void (*)() <conversion>
    while (__comp(__pivot, *__last))
                                  ^
/usr/include/c++/4.8.2/bits/stl_algo.h:2266:34: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.8.2/algorithm:62,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_heap.h: In instantiation ofvoid std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Distance = long int; _Tp = std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’:
/usr/include/c++/4.8.2/bits/stl_heap.h:448:15:   required fromvoid std::make_heap(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:1946:47:   required fromvoid std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:5349:59:   required fromvoid std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:2332:68:   required fromvoid std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Size = long int; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
/usr/include/c++/4.8.2/bits/stl_algo.h:5499:44:   required fromvoid std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’
../src/PrefixTree.cpp:56:128:   required from here
/usr/include/c++/4.8.2/bits/stl_heap.h:313:40: error: no match for call to ‘(PrefixTree::allWordsAdded()::__lambda1) (std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&, std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >&)’
        *(__first + (__secondChild - 1))))
                                        ^
../src/PrefixTree.cpp:56:60: note: candidates are:
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                            ^
In file included from /usr/include/c++/4.8.2/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.8.2/algorithm:62,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_heap.h:313:40: note: void (*)() <conversion>
        *(__first + (__secondChild - 1))))
                                        ^
/usr/include/c++/4.8.2/bits/stl_heap.h:313:40: note:   candidate expects 1 argument, 3 provided
../src/PrefixTree.cpp:56:94: note: PrefixTree::allWordsAdded()::__lambda1
   std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });
                                                                                              ^
../src/PrefixTree.cpp:56:94: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_algo.h: At global scope:
/usr/include/c++/4.8.2/bits/stl_algo.h:2110:5: error: ‘void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’, declared using local typePrefixTree::allWordsAdded()::__lambda1’, is used but never defined [-fpermissive]
     __unguarded_linear_insert(_RandomAccessIterator __last,
     ^
In file included from /usr/include/c++/4.8.2/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.8.2/algorithm:62,
                 from ../src/PrefixTree.cpp:3:
/usr/include/c++/4.8.2/bits/stl_heap.h:331:5: error: ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’, declared using local typePrefixTree::allWordsAdded()::__lambda1’, is used but never defined [-fpermissive]
     __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
     ^
/usr/include/c++/4.8.2/bits/stl_heap.h:178:5: error: ‘void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >*, std::vector<std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> > > >; _Distance = long int; _Tp = std::pair<unsigned int, std::shared_ptr<PrefixTree::Node> >; _Compare = PrefixTree::allWordsAdded()::__lambda1]’, declared using local typePrefixTree::allWordsAdded()::__lambda1’, is used but never defined [-fpermissive]
     __push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
     ^
@githubharald
Copy link
Owner

Hi,

it seems that your compiler does not handle generic lambdas [1], that are lambdas for which the parameter types are specified with the auto keyword.
I'm using g++ 5.4.0 - I think updating g++ would be the easiest way to get the TF op compiled.

Another option is to explicitly provide the parameter types instead of using auto.
Open PrefixTree.cpp and replace the generic lambdas:

Line 56: instead of

std::sort(node->children.begin(), node->children.end(), [](const auto& lhs, const auto& rhs) {return lhs.first < rhs.first; });

write

std::sort(node->children.begin(), node->children.end(), [](const std::pair<uint32_t, std::shared_ptr<Node>>& lhs, const std::pair<uint32_t, std::shared_ptr<Node>>& rhs) {return lhs.first < rhs.first; });

Line 152: instead of

auto iter = std::lower_bound(node->children.begin(), node->children.end(), c, [](const auto& p, const auto val) {return p.first < val; });

write

auto iter = std::lower_bound(node->children.begin(), node->children.end(), c, [](const std::pair<uint32_t, std::shared_ptr<Node>>& p, const uint32_t val) {return p.first < val; });

[1] https://isocpp.org/wiki/faq/cpp14-language#generic-lambdas

@dsleo
Copy link
Author

dsleo commented Mar 11, 2018

Hi,

Thanks for your quick reply ! It works perfectly fine now.

I've updated my g++ to g++ (GCC) 7.2.1 and could compile just fine.
However loading tf.load_op_library('../cpp/proj/TFWordBeamSearch.so') fails with undefined symbols (_ZTIN10tensorflow8OpKernelE).
So, you have to add the flag -D_GLIBCXX_USE_CXX11_ABI=0 in buildTF.sh for it to work as suggested in here.

Many thanks,
Léo.

@dsleo dsleo closed this as completed Mar 11, 2018
@dsleo
Copy link
Author

dsleo commented Mar 15, 2018

Hello,

I've tried to run this on tensorflow 1.4.1, but same error as earlier upon loading tf.load_op_library('../cpp/proj/TFWordBeamSearch.so', with undefined symbols (_ZTIN10tensorflow8OpKernelE.
However, this time, even with the flag -D_GLIBCXX_USE_CXX11_ABI=0, the issue persists.

Any idea what I could possibly look out for to fix this ? Or is your library currently not supporting tf 1.4.1 ?

Many thanks.

@githubharald
Copy link
Owner

I've only tested it with TF 1.3.
This seems to be the same issue - maybe try the suggestions from there: tensorflow/tensorflow#13607 (comment)

@dsleo
Copy link
Author

dsleo commented Mar 16, 2018

Right, that did the trick ! Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants