Problem compiling tesseract 4.0 on macOS

56 views
Skip to first unread message

Ning Zhao

unread,
Jun 4, 2018, 10:03:19 AM6/4/18
to tesseract-ocr
I'm trying to install tesseract 4.0 on macOS High Sierra from source following https://github.com/tesseract-ocr/tesseract/wiki/Compiling#macos (macOS with Homebrew part).

When I did the `make -j` part, after popping up over 1000 lines of output, it gave me these lines at the end:

1296 /bin/sh ../../libtool  --tag=CXX   --mode=link g++  -g -O2 -std=c++11  -L/u     sr/local/opt/icu4c/lib -o tesseract tesseract-tesseractmain.o libtesseract.     la -L/usr/local/Cellar/leptonica/1.76.0/lib -llept

1297 libtool: link: g++ -g -O2 -std=c++11 -o .libs/tesseract tesseract-tesseract     main.o -Wl,-bind_at_load  -L/usr/local/opt/icu4c/lib ./.libs/libtesseract.d     ylib -L/usr/local/Cellar/leptonica/1.76.0/lib -llept

1298 Making all in .

1299 Making all in tessdata

1300 Making all in configs

1301 make[3]: Nothing to be done for `all'.

1302 Making all in tessconfigs

1303 make[3]: Nothing to be done for `all'.

1304 make[3]: Nothing to be done for `all-am'.

1305 Making all in doc

1306 make[2]: Nothing to be done for `all'.

1307 Making all in unittest

1308 make[2]: Nothing to be done for `all'.


The ./configure I used is (I have checked `brew info icu4c` for the two flags):
./configure CPPFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib

Thinking there might be something wrong happened during the 1300 lines of output, I ran `make -j > makelog`. Although most output went into the log file, these were printed onto the terminal:

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libtesseract_cutil.a(cutil_class.o) has no symbols

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libtesseract_cutil.a(cutil_class.o) has no symbols

networkio.cpp:55:15: warning: 'this' pointer cannot be null in well-defined C++

      code; comparison may be assumed to always evaluate to true

      [-Wtautological-undefined-compare]

  ASSERT_HOST(this != nullptr);

              ^~~~    ~~~~~~~

../../src/ccutil/errcode.h:84:30: note: expanded from macro 'ASSERT_HOST'

#define ASSERT_HOST(x) if (!(x))                                        \

                             ^

1 warning generated.

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libtesseract_lstm.a(tfnetwork.o) has no symbols

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libtesseract_lstm.a(tfnetwork.o) has no symbols

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libtesseract.a(tfnetwork.o) has no symbols

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libtesseract.a(cutil_class.o) has no symbols

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libtesseract.a(tfnetwork.o) has no symbols

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: .libs/libtesseract.a(cutil_class.o) has no symbols


I suspect this might give some clue, but I don't really understand what's going on.

I have also tried configure like below, but got the "Nothing to be done for `all'" as well.
./configure CC=gcc CXX=g++ CPPFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib --prefix=$HOME/miniconda3/envs/ragdoll

Can anyone give me a hand please?

Ning

shree

unread,
Jun 4, 2018, 12:35:36 PM6/4/18
to tesseract-ocr

Ning Zhao

unread,
Jun 5, 2018, 8:31:36 PM6/5/18
to tesseract-ocr
Thanks Shree.

I tried what Stefan suggested, but couldn't solve the compiling problem.

However, with `make -j` giving that complaints, the compiled and installed executable seems executable. `tesseract --version` gives
```

tesseract 4.0.0-beta.1-306-g45b11cd

 leptonica-1.76.0

  libjpeg 9c : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11

 Found AVX2

 Found AVX

 Found SSE

```

`tesseract --list-langs` prints all the language packs I installed as well.

Maybe not a perfect closing to this thread, but I'll use it for now and see what happens.

Cheers,
Ning
Reply all
Reply to author
Forward
0 new messages