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

cannot compile tesseract 5.0 on mac os 10.14 (mojave) #69

Closed
kylefoley76 opened this issue Jan 18, 2022 · 2 comments
Closed

cannot compile tesseract 5.0 on mac os 10.14 (mojave) #69

kylefoley76 opened this issue Jan 18, 2022 · 2 comments

Comments

@kylefoley76
Copy link

I was able to go through all of the steps installing tesseract 5.0 with Homebrew as listed here

Packages which are always needed.

brew install automake autoconf libtool
brew install pkgconfig
brew install icu4c
brew install leptonica

Packages required for training tools.

brew install pango

Optional packages for extra features.

brew install libarchive

Optional package for builds using g++.

brew install gcc

I then completed the following steps:

git clone https://github.com/tesseract-ocr/tesseract/
cd tesseract
./autogen.sh
mkdir build
cd build

I then ran into problems:

(venv3) Admins-MacBook-Pro-4:build kylefoley$ sudo make install
make: *** No rule to make target install'. Stop. (venv3) Admins-MacBook-Pro-4:build kylefoley$ make training make: *** No rule to make target training'. Stop.
(venv3) Admins-MacBook-Pro-4:build kylefoley$ sudo make training-install
make: *** No rule to make target training-install'. Stop. (venv3) Admins-MacBook-Pro-4:build kylefoley$ ../configure PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in /volumes/googledrive/my drive/laptop/documents/pcode/tesseract/build':
configure: error: cannot run C++ compiled programs.
If you meant to cross compile, use --host'. See config.log' for more details
(venv3) Admins-MacBook-Pro-4:build kylefoley$ configure --disable-shared 'CXXFLAGS=-g -O2 -Wall' PKG_CONFIG_PATH=$(brew --prefix)/opt/icu4c/lib/pkgconfig:$(brew --prefix)/opt/libarchive/lib/pkgconfig:$(brew --prefix)/Library/Homebrew/os/mac/pkgconfig/11
-bash: configure: command not found
(venv3) Admins-MacBook-Pro-4:build kylefoley$ ../configure --disable-shared 'CXXFLAGS=-g -O2 -Wall' PKG_CONFIG_PATH=$(brew --prefix)/opt/icu4c/lib/pkgconfig:$(brew --prefix)/opt/libarchive/lib/pkgconfig:$(brew --prefix)/Library/Homebrew/os/mac/pkgconfig/11
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in /volumes/googledrive/my drive/laptop/documents/pcode/tesseract/build': configure: error: cannot run C++ compiled programs. If you meant to cross compile, use --host'.
See `config.log' for more details

In the above I used a different order but that was after I had tried them in the recommended order. I also tried the solution mentioned here to no avail:

#65

@kylefoley76
Copy link
Author

I'm also a little nervous about where tesseract was cloned. I'm using pytesseract. How is pytesseract going to find out where I put tesseract. According to the above instructions, it made me put tesseract in a strange place. Shouldn't I put it in the same place that I put tesseract 4.0? I knew where that was earlier today but I cannot find that now.

@stweil
Copy link
Contributor

stweil commented Jan 19, 2022

You should not install gcc, but use the default compiler on macOS.

Please use the Tesseract user forum for additional questions.

@stweil stweil closed this as completed Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants