Closed yaofuzhou closed 6 months ago
It works out of the box, so don't set special environment variable or change the code. This sequence works for me:
./autogen.sh
mkdir build
cd build
../configure
make -j10 training
It takes about two minutes.
Typically Apple's clang compiler gives the best (= fastest) result. If you want to try the latest gcc-14, that works, too. I used this configure options in my test:
../configure --disable-shared CXX=g++-14 'CXXFLAGS=-g -O2 -Wall -flax-vector-conversions' --prefix=$HOME
Thanks @stweil. You were helpful as you have confirmed that it can be done. The particular solution to my situation was found at https://github.com/pyenv/pyenv/issues/2862. In short, I had to remove /opt/homebrew/opt/binutils/bin
from my PATH
so that the system version of the utility could take over and avoid a GNU-specific issue.
I am running MacOS 14.5 on Apple M1 Max.
I wish to build the training tool of Tesseract with gcc/g++ or the system X-code c/c++. Each attempt resulted in errors during the compiling process. Here I will share my issue with gcc/g++ from Homebrew.
I have made the following edits to the beginning of
Makefile.am
:Then I ran
./autogen.sh
./configure PKG_CONFIG_PATH=/opt/homebrew/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/libarchive/lib/pkgconfig:/opt/homebrew/opt/libffi/lib/pkgconfig
make -j
sudo make install
All of the above commands ran successfully. However, when I ranmake training
, it ended with the following error:I did some googling and this issue may not be specific to Tesseract. Still, I would appreciate any successful experience in building Tesseract's training tool on an M1 Macbook.