Unable to build on macOS Mojave (10.14)

182 views
Skip to first unread message

Benoît Mars

unread,
Jan 10, 2024, 4:29:48 PM1/10/24
to tesseract-ocr
I am trying to upgrade tesseract from 5.2.0 to 5.3.3 on macOS 10.14.6 via Homebrew (v 4.2.3). The build fails during the "make training" process with the following errors:

Last 15 lines from /Users/benoitmars/Library/Logs/Homebrew/tesseract/03.make:
src/training/unicharset_extractor.cpp:74:33: error: '~path' is unavailable: introduced in macOS 10.15
    if (filePath.extension() == ".box") {
                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:791:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
src/training/unicharset_extractor.cpp:74:30: error: 'operator==' is unavailable: introduced in macOS 10.15
    if (filePath.extension() == ".box") {
                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:1156:41: note: 'operator==' has been explicitly marked unavailable here
  friend _LIBCPP_INLINE_VISIBILITY bool operator==(const path& __lhs, const path& __rhs) noexcept {
                                        ^
9 errors generated.


Any idea to fix this? Thanks!

Zdenko Podobny

unread,
Jan 10, 2024, 4:42:58 PM1/10/24
to tesser...@googlegroups.com
... I am trying to upgrade tesseract from 5.2.0 to 5.3.3 on macOS 10.14.6
... is unavailable: introduced in macOS 10.15

Upgrade?

Zdenko


st 10. 1. 2024 o 17:29 Benoît Mars <benoi...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/dd8aca79-a516-4369-8039-b7dfbd78e339n%40googlegroups.com.

Benoît Mars

unread,
Jan 10, 2024, 8:48:16 PM1/10/24
to tesseract-ocr
Not possible on my 2012 Mac Pro, sadly… 

Tom Morris

unread,
Jan 11, 2024, 7:05:23 PM1/11/24
to tesseract-ocr
It looks like unicharset_extractor.cpp is the only place that std::filesystem::path is used and that was introduced relatively recently:
so it probably wouldn't be hard to restore compatibility with older systems, but you're likely living on borrowed time.

If you want to try fixing this locally, you could replace path.extension() with string.compare()

Tom

Zdenko Podobny

unread,
Jan 11, 2024, 8:10:54 PM1/11/24
to tesser...@googlegroups.com
std::filesystem::path[1] is part of the C++17 standard and Tesseract requires this standard for a long time (4-5 years)[2]. So you suggest reverting this decision? 


[1] https://en.cppreference.com/w/cpp/filesystem/path


Zdenko


št 11. 1. 2024 o 20:05 Tom Morris <tfmo...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.

Benoît Mars

unread,
Jan 12, 2024, 1:29:52 PM1/12/24
to tesseract-ocr
Yes, the future looks complicated for this version of macOS, but I do not really have the choice… Now the error is with the line #69:

src/training/unicharset_extractor.cpp:69:58: error: 'u8string' is unavailable: introduced in macOS 10.15


It prevents me from installing ffmpeg which is really painful…

Zdenko Podobny

unread,
Jan 12, 2024, 1:44:28 PM1/12/24
to tesser...@googlegroups.com
ffmpeg needs tesseract training tools as dependency?
I guess something is misconfigured. On most unix-like  system training tools are separated and not installed by default....
Can you avoid the 'make training' step?

I also wonder why the tesseract build process did not stop during configuration process as there should be tests for C++17...

Personally I do not think you need training tools (at least I would not suggest to do tesseract training on such old system)
 
Zdenko


pi 12. 1. 2024 o 14:29 Benoît Mars <benoi...@gmail.com> napísal(a):

Tom Morris

unread,
Jan 18, 2024, 8:31:11 PM1/18/24
to tesseract-ocr
On Friday, January 12, 2024 at 8:44:28 AM UTC-5 zdenop wrote:
I also wonder why the tesseract build process did not stop during configuration process as there should be tests for C++17...

Mojave has the C++17 compiler support, so the compiler check succeeds, but the stdlib implementation is missing some things required for full C++17 support (like the filesystem library).

Tom

Benoît Mars

unread,
Jan 23, 2024, 10:55:32 AM1/23/24
to tesseract-ocr
Yes, that's why I am stucked during the building. The dependency is added by homebrew when I am trying to update ffmpeg, and I cannot find the way to avoid it…

Zdenko Podobny

unread,
Jan 23, 2024, 12:38:56 PM1/23/24
to tesser...@googlegroups.com
You can install tesseract without building & installing training tools. 

Anyway requesting tesseract as decendacy of  ffmpeg makes no sense for me (and it is not listed at https://trac.ffmpeg.org/wiki/CompilationGuide/macOS). So something in homebrew should be fixed/setup correctly.


Zdenko


ut 23. 1. 2024 o 11:55 Benoît Mars <benoi...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.

Tom Morris

unread,
Jan 23, 2024, 6:08:11 PM1/23/24
to tesseract-ocr

Anyway requesting tesseract as decendacy of  ffmpeg makes no sense for me (and it is not listed at https://trac.ffmpeg.org/wiki/CompilationGuide/macOS). So something in homebrew should be fixed/setup correctly.

I did a little investigation and discovered that this is principally a Homebrew issue where:

- tesseract is a non-optional dependency of ffmpeg [1][2] (and the default tap doesn't allow configuration options)
- the homebrew recipe for tesseract always does a `make training` [3]

It looks like your options, if you want to stick with a Homebrew install of ffmpeg are:

- use the alternate Homebrew tap and don't specify --with--tesseract [4]
    brew tap homebrew-ffmpeg/ffmpeg
    brew install homebrew-ffmpeg/ffmpeg/ffmpeg

- use FFMPEG 2.8 which doesn't have the tesseract dependency [5]

Hope that helps!

Tom

 

Benoît Mars

unread,
Jan 25, 2024, 4:29:54 PM1/25/24
to tesseract-ocr
Thanks for your help! Unfortunately, it's now with the snappy dependency that the build fails… it seems that this version of macOS is now really obsolete… Sad because the hardware still works like clockwork!

Benoît Mars

unread,
Jan 25, 2024, 4:30:48 PM1/25/24
to tesseract-ocr
For snappy, the error is:

Undefined symbols for architecture x86_64:

  "std::__1::__libcpp_verbose_abort(char const*, ...)", referenced from:

      std::__throw_bad_array_new_length[abi:un170006]() in snappy.cc.o

      std::__1::__throw_length_error[abi:un170006](char const*) in snappy.cc.o

ld: symbol(s) not found for architecture x86_64



Tom Morris

unread,
Jan 25, 2024, 5:45:39 PM1/25/24
to tesseract-ocr
On Thursday, January 25, 2024 at 11:29:54 AM UTC-5 benoi...@gmail.com wrote:
Thanks for your help! Unfortunately, it's now with the snappy dependency that the build fails… it seems that this version of macOS is now really obsolete… Sad because the hardware still works like clockwork!

Sorry to hear that, but I think that it's beyond the scope of the tesseract list/group.

I would suggest one of two general strategies:
1. stick with older versions of apps (e.g. ffmpeg) which are compatible with the vintage of your operating system
2. use one of the hacks to update the operating system on your old hardware

Good luck!

Tom
Reply all
Reply to author
Forward
0 new messages