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

centos 7.9 tesseract5.2 cmake failed! boxchar.cpp:65:75: error... #3889

Closed
wuyang-dl opened this issue Aug 3, 2022 · 14 comments
Closed

centos 7.9 tesseract5.2 cmake failed! boxchar.cpp:65:75: error... #3889

wuyang-dl opened this issue Aug 3, 2022 · 14 comments

Comments

@wuyang-dl
Copy link

error INFO:
/home/engine/wy/3rd/tesseract-5.2.0/src/training/pango/boxchar.cpp: In member function ‘void tesseract::BoxChar::GetDirection(int*, int*) const’:
/home/engine/wy/3rd/tesseract-5.2.0/src/training/pango/boxchar.cpp:65:75: error: ‘U_RIGHT_TO_LEFT_ISOLATE’ was not declared in this scope; did you mean ‘U_RIGHT_TO_LEFT_OVERRIDE’?
65 | if (dir == U_RIGHT_TO_LEFT || dir == U_RIGHT_TO_LEFT_ARABIC || dir == U_RIGHT_TO_LEFT_ISOLATE) {
| ^~~~~~~~~~~~~~~~~~~~~~~
| U_RIGHT_TO_LEFT_OVERRIDE

Environment

  • Tesseract Version: 5.2.0
  • Commit Number: tag 5.2.0
  • Platform:centos7.9

error.log shows details
error.log

@zdenop
Copy link
Contributor

zdenop commented Aug 3, 2022

Did you search the issue tracker before posting the issue? .e.g. #1374

@amitdo
Copy link
Collaborator

amitdo commented Aug 4, 2022

The CMake build should do what the Autotools build is doing: check for icu >=52.1 and refuse to build the training tools if this requirement is not met.

@zdenop
Copy link
Contributor

zdenop commented Aug 4, 2022

@zdenop
Copy link
Contributor

zdenop commented Aug 4, 2022

here is relevant part of check:

if(NOT SW_BUILD)
if(PKG_CONFIG_FOUND)
pkg_check_modules(ICU REQUIRED IMPORTED_TARGET icu-uc icu-i18n)
else()
find_package(ICU 52.1 COMPONENTS uc i18n)
endif()
endif()

In provided log there is no info about ICU checks...

@amitdo
Copy link
Collaborator

amitdo commented Aug 4, 2022

Thanks, Zdenko. I only looked at the MakeLists.txt located in the root directory. I forgot that there is another one in the training dir.

@amitdo
Copy link
Collaborator

amitdo commented Aug 4, 2022

if(PKG_CONFIG_FOUND) 
     pkg_check_modules(ICU REQUIRED IMPORTED_TARGET icu-uc icu-i18n)

There is no version check here.

@zdenop
Copy link
Contributor

zdenop commented Aug 5, 2022

@amitdo : you miss the point: according reporter log there was not check for ICU. So putting there any version does not solve reporter problem. I wander how reporter managed to skip ICU presence. Plus ICU 52.1 was released 2013-10-09, so I really wonder if somebody is using older version than that...

@amitdo
Copy link
Collaborator

amitdo commented Aug 6, 2022

Plus ICU 52.1 was released 2013-10-09, so I really wonder if somebody is using older version than that...

http://mirror.centos.org/centos/7.9.2009/os/x86_64/Packages/

libicu-50.2-4.el7_7.i686.rpm

@zdenop
Copy link
Contributor

zdenop commented Aug 6, 2022

So the solution is to use recent and well-maintained OS/distribution.

@wuyang-dl
Copy link
Author

So the solution is to use recent and well-maintained OS/distribution.

hi, I use libicui18n.so( with yum install libicu-devel cmd), for tess check script shows error info:
-- Checking for modules 'icu-uc;icu-i18n'
-- No package 'icu-uc' found
-- No package 'icu-i18n' found

after installing libicu-devel, pango-devel and cairo-devel,
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_SHARED_LIBS=ON ..

then error occurred(Linux version 3.10.0-1160.71.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Jun 28 15:37:28 UTC 2022).

I tried ubuntu(Linux version 5.4.0-122-generic (buildd@lcy02-amd64-035) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu118.04)) #13818.04.1-Ubuntu SMP Fri Jun 24 14:14:03 UTC 2022), tess is ok

tks

@amitdo
Copy link
Collaborator

amitdo commented Aug 10, 2022

You can try to build with autotools instead of CMake.

GCC 4.8 is not supported in Tesseract 5.x.

RHEL/Centos have newer GCC versions in their repos:
http://mirror.centos.org/centos/7.9.2009/sclo/x86_64/rh/Packages/d/

So you can install GCC 11.

@amitdo
Copy link
Collaborator

amitdo commented Aug 10, 2022

Do you plan to train your own model using Tesseract?

If not, ICU, Pango and Cairo are not required.

Autotools: Pango, Cairo and ICU only required by training tools

I don't know if CMake behave in the same way.

@zdenop
Copy link
Contributor

zdenop commented Aug 14, 2022

CMake behaves in the same way as Autotools. From the above information, I am sure that the reporter must modify CMake files to avoid these checks (ICU and GCC). So this is tesseract problem, but a user problem (try to compile tesseract on too with too old software)

@amitdo
Copy link
Collaborator

amitdo commented Oct 16, 2024

CentOS Linux 7 reached EOL on June 30, 2024.

@amitdo amitdo closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants