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

g++ 6.3 build failure #3255

Closed
amitdo opened this issue Jan 22, 2021 · 8 comments
Closed

g++ 6.3 build failure #3255

amitdo opened this issue Jan 22, 2021 · 8 comments

Comments

@amitdo
Copy link
Collaborator

amitdo commented Jan 22, 2021

Environment

  • Tesseract Version: 5.0 alpha
  • Commit Number: e3fd938
  • Platform: Linux debian 4.9.0-14-amd64 defect issue #1 SMP Debian 4.9.246-2 (2020-12-17) x86_64 GNU/Linux

gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)

g++ 6.3 fails to compile commit e3fd938.

config.log

make.log

@stweil
Copy link
Member

stweil commented Jan 23, 2021

Building with g++-6 fails since commit 4fc467a according to my tests.

So Tesseract no longer compiles with Debian stretch (old stable).

@stweil
Copy link
Member

stweil commented Jan 23, 2021

The problems are indeed related to C++11. Those related to the STRING class can easily be fixed. As far as I see the only remaining code which needs a newer compiler is this:

src/ccutil/unicharset.cpp: In member function ‘void tesseract::UNICHARSET::unichar_insert(const char*, tesseract::OldUncleanUnichars)’:
../../../src/ccutil/unicharset.cpp:618:37: error: forming reference to void
     auto &u = unichars.emplace_back();

In C++-11 emplace_back is a void function, so that needs different code if we want to support C++-11.

@stweil
Copy link
Member

stweil commented Jan 23, 2021

The modifications which I mentioned above are not sufficient, because training has more dependencies on newer compilers. In addition, I get unresolved symbols when linking.

So I am afraid that supporting g++-6 would require more work. There are currently other, more important, problems.

@stweil
Copy link
Member

stweil commented Jan 23, 2021

Builds of git master currently work with -std=c++14, but 3 code locations like the following one then show warnings because they use C++17 code:

src/training/mftraining.cpp: In function ‘int main(int, char**)’:
src/training/mftraining.cpp:207:8: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  207 |   auto [trainer,shape_table] = tesseract::LoadTrainingData(argc, argv,
      |        ^

@amitdo
Copy link
Collaborator Author

amitdo commented Jan 23, 2021

It's not important to me to have gcc-6 support, but I do want to know what are the minimum GCC, Clang and MSVC versions that can compile the current 5.0 code.

@amitdo
Copy link
Collaborator Author

amitdo commented Jan 25, 2021

Travis CI seems to use gcc 6 and was able to build (with cmake) commit e3fd938.

@Shreeshrii
Copy link
Collaborator

Travis CI seems to use gcc 6 and was able to build (with cmake) commit e3fd938.

Travis build for MacOS does not build the lstm related training tools. See log

$ sudo make install
[ 88%] Built target libtesseract
[ 89%] Built target tesseract
[ 93%] Built target common_training
[ 93%] Built target ambiguous_words
[ 94%] Built target wordlist2dawg
[ 95%] Built target cntraining
[ 96%] Built target dawg2wordlist
[ 97%] Built target shapeclustering
[ 98%] Built target combine_tessdata
[ 99%] Built target mftraining
[100%] Built target classifier_tester
Install the project...
-- Install configuration: "Release"

Linux builds the following. See log

$ sudo make install
[ 78%] Built target libtesseract
[ 78%] Built target tesseract
[ 82%] Built target common_training
[ 83%] Built target shapeclustering
[ 84%] Built target mftraining
[ 89%] Built target unicharset_training
[ 91%] Built target pango_training
[ 92%] Built target text2image
[ 93%] Built target wordlist2dawg
[ 93%] Built target ambiguous_words
[ 94%] Built target classifier_tester
[ 95%] Built target combine_tessdata
[ 95%] Built target combine_lang_model
[ 96%] Built target lstmeval
[ 96%] Built target lstmtraining
[ 96%] Built target dawg2wordlist
[ 97%] Built target cntraining
[ 98%] Built target merge_unicharsets
[ 99%] Built target set_unicharset_properties
[100%] Built target unicharset_extractor```

@amitdo
Copy link
Collaborator Author

amitdo commented Jan 27, 2021

Travis CI seems to use gcc 6 and was able to build (with cmake) commit e3fd938.

My mistake.

#- if [[ $LINUX && "$CXX" = "g++" ]]; then export CXX="g++-6" CC="gcc-6"; fi

I didn't notice this line was commented out.

My report didn't include training tools.

I don't think @stweil submmited his partial fix.

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

3 participants