Building tesseract 5.0.0 without optimizations (AVX etc)

424 views
Skip to first unread message

Charles Weld

unread,
Jan 1, 2022, 11:05:42 PM1/1/22
to tesseract-dev
I'm currently trying to build tesseract 5.0 without architecture specific optimizations (AVX etc) using VS 2019 and CMake as the binary needs to be able to run on older hardware than the machine building tesseract.  In the past this was accomplished by using the -DAUTO_OPTIMIZE=OFF (https://github.com/tesseract-ocr/tesseract/issues/2674#issuecomment-536186517) however this was removed in commit 33f1e13 and as far as I can tell will result in library being compiled with all the optimizations available (i.e. will be compiled with the /arch:AVX).

Is there some other way of disabling this or am I missing something?

Note unfortunately I don't have an older machine available that doesn't support these instruction sets so can't easily test if the generated executable does indeed work on them.

Zdenko Podobny

unread,
Jan 2, 2022, 11:32:01 AM1/2/22
to tesser...@googlegroups.com
The current build logic for dot optimization is the same in cmake  and autotools:
  1. configuration process checks if optimization flags are supported by a compiler. If a compiler provide support, they are used for building
  2. there is a runtime check what optimization is supported by the device where tesseract runs, and tesseract use only those which are supported.
So if you have some experience with tesseract 5 crashing because of optimization, please create issue with details.

Zdenko


ne 2. 1. 2022 o 5:05 Charles Weld <charle...@gmail.com> napísal(a):
I'm currently trying to build tesseract 5.0 without architecture specific optimizations (AVX etc) using VS 2019 and CMake as the binary needs to be able to run on older hardware than the machine building tesseract.  In the past this was accomplished by using the -DAUTO_OPTIMIZE=OFF (https://github.com/tesseract-ocr/tesseract/issues/2674#issuecomment-536186517) however this was removed in commit 33f1e13 and as far as I can tell will result in library being compiled with all the optimizations available (i.e. will be compiled with the /arch:AVX).

Is there some other way of disabling this or am I missing something?

Note unfortunately I don't have an older machine available that doesn't support these instruction sets so can't easily test if the generated executable does indeed work on them.

--
You received this message because you are subscribed to the Google Groups "tesseract-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-dev/9a2cf9e5-18e3-48d1-ac41-1d3133189c50n%40googlegroups.com.

Charles Weld

unread,
Jan 2, 2022, 4:46:23 PM1/2/22
to tesser...@googlegroups.com
Thanks Zdenko,
I'll reach out to some of the users of my library that have reported these issues in the past and see if its an issue and file a bug if required.

Cheers,
Charles

You received this message because you are subscribed to a topic in the Google Groups "tesseract-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tesseract-dev/hyIG9xxL820/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tesseract-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-dev/CAJbzG8yXH0ChghvGjeSYzSsa%2B8DQbHrVg0zEfkOp1U4sRHtDBA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages