Reason for ANDROID_BUILD preprocessor variable?

203 views
Skip to first unread message

Robert Pösel

unread,
Jan 11, 2021, 8:38:45 AM1/11/21
to tesseract-dev
Hello, 

I am maintaining Tesseract4Android library since Tesseract 4.0 was released and I always wondered what is the reason for using ANDROID_BUILD preprocessor variable? The thing is, I have to **not define it** if I want to build the Tesseract correctly as otherwise there are compile errors and project won't build at all (I just tried with current code).

I think it is some old relic from time when wasn't sure whether Android devices are capable of running the LSTM engine or not (as it removes some parts of code that is using LSTM). But maybe there was/is some different reason for it?

Considering the project won't build when I define ANDROID_BUILD and everything is perfectly fine on Android when I **don't** define it, I think it should be removed completely from Tesseract codebase. It is not even defined in Tesseract's own CMakeLists.txt file, only in Leptonica's CMakeLists.txt file (and then used in 2 header files in Leptonica, where it's use is probably correct).

What do you think?


Zdenko Podobny

unread,
Jan 12, 2021, 9:52:01 AM1/12/21
to tesser...@googlegroups.com
Hi,

I am not aware of any of today's main tesseract contributors using android build, so feel free to send your PR to master to improve android build.

I am afraid nobody remembers why the ANDROID_BUILD is defined is configuration ;-)

Zdenko


po 11. 1. 2021 o 14:38 Robert Pösel <po...@adaptech.cz> napísal(a):
--
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/35c614f8-b2dc-4a51-aa66-58b3016534c6n%40googlegroups.com.

Robert Pösel

unread,
Jan 14, 2021, 2:24:48 AM1/14/21
to tesser...@googlegroups.com
Okay, I prepared the PR to remove it then :)

https://github.com/tesseract-ocr/tesseract/pull/3230

Robert

úterý 12. ledna 2021 15:51
Hi,

I am not aware of any of today's main tesseract contributors using android build, so feel free to send your PR to master to improve android build.

I am afraid nobody remembers why the ANDROID_BUILD is defined is configuration ;-)

Zdenko


--
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/Bo-l3-QoOWM/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/CAJbzG8xFsu06RAkCoCxyk73onQrQTr6uZRXkiXXMO-173KQejQ%40mail.gmail.com.
pondělí 11. ledna 2021 13:43
Hello, 

I am maintaining Tesseract4Android library since Tesseract 4.0 was released and I always wondered what is the reason for using ANDROID_BUILD preprocessor variable? The thing is, I have to **not define it** if I want to build the Tesseract correctly as otherwise there are compile errors and project won't build at all (I just tried with current code).

I think it is some old relic from time when wasn't sure whether Android devices are capable of running the LSTM engine or not (as it removes some parts of code that is using LSTM). But maybe there was/is some different reason for it?

Considering the project won't build when I define ANDROID_BUILD and everything is perfectly fine on Android when I **don't** define it, I think it should be removed completely from Tesseract codebase. It is not even defined in Tesseract's own CMakeLists.txt file, only in Leptonica's CMakeLists.txt file (and then used in 2 header files in Leptonica, where it's use is probably correct).

What do you think?


--
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/Bo-l3-QoOWM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tesseract-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages