I am trying to install duncantl/Rtesseract on a Mac running Big Sur. I used homebrew to install leptonica, tesseract, and pkg-config to get this far. But, now it is saying it can't find the sample files for some image types, and saying it can't be compiled.
Here's the output:
`> library(remotes)
install_github("duncantl/Rtesseract")
Downloading GitHub repo duncantl/Rtesseract@HEAD
✓ checking for file ‘/private/var/folders/3h/1f85xrs966s86gznzxn26ypc0000gn/T/Rtmprl9Zn9/remotes7aae3031a823/duncantl-Rtesseract-b941ca1/DESCRIPTION’ ...
─ preparing ‘Rtesseract’:
✓ checking DESCRIPTION meta-information ...
─ cleaning src
─ running ‘cleanup’
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘Rtesseract_0.4-0.tar.gz’
installing source package ‘Rtesseract’ ...
using staged installation
checking for pkg-config... /usr/local/bin/pkg-config
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... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
CXXFLAGS = -std=c++11
Tesseract CFLAGS = -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica
Did not find baseapi.h directly. Need to look for <tesseract/baseapi.h> or add tesseract to include flags -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -DADD_TESSERACT_DIR=1
Has textonly parameter
NO DetectOrientationScript() method
No OEM_CUBE_ONLY enumeration value for the TessBaseAPI
Compiling readImage
testing leptonica can read different image formats
Error in fopenReadStream: file not found
Error in pixRead: image file not found: inst/images/IMG_1236.jpg
Error in fopenReadStream: file not found
Error in pixRead: image file not found: inst/images/OCRSample.tiff
png support
webp support
Error in findFileFormatStream: truncated file
Error in pixReadStream: Unknown format: no pix returned
Error in pixRead: pix not read no jp2 suppport
gif support
bmp support
pnm support
Error in pixReadStream: Unknown format: no pix returned
Error in pixRead: pix not read
spix support
Tesseract version: 5.0.0-alpha-20210401-158-ge1761
Leptonica version: 1.81.1
R_INCLUDE_DIR: /Library/Frameworks/R.framework/Resources/include
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/imageCapabilities.R
config.status: creating R/config.R
* libs
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -DADD_TESSERACT_DIR=1 -DHAS_GETINPUT_NAME=1 -DHAS_GETDATAPATH=1 -DHAS_GETSOURCEYRESOLUTION=1 -DPDF_RENDER_HAS_TEXT_ONLY=1 -DHAS_OEM_LSTM=1 -std=gnu++11 -I/usr/local/include -fPIC -Wall -g -O2 -c PageSegMode.cc -o PageSegMode.o
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -DADD_TESSERACT_DIR=1 -DHAS_GETINPUT_NAME=1 -DHAS_GETDATAPATH=1 -DHAS_GETSOURCEYRESOLUTION=1 -DPDF_RENDER_HAS_TEXT_ONLY=1 -DHAS_OEM_LSTM=1 -std=gnu++11 -I/usr/local/include -fPIC -Wall -g -O2 -c RConverters.cc -o RConverters.o
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -DADD_TESSERACT_DIR=1 -DHAS_GETINPUT_NAME=1 -DHAS_GETDATAPATH=1 -DHAS_GETSOURCEYRESOLUTION=1 -DPDF_RENDER_HAS_TEXT_ONLY=1 -DHAS_OEM_LSTM=1 -std=gnu++11 -I/usr/local/include -fPIC -Wall -g -O2 -c RtesseractBoxRenderer.cc -o RtesseractBoxRenderer.o
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -DADD_TESSERACT_DIR=1 -DHAS_GETINPUT_NAME=1 -DHAS_GETDATAPATH=1 -DHAS_GETSOURCEYRESOLUTION=1 -DPDF_RENDER_HAS_TEXT_ONLY=1 -DHAS_OEM_LSTM=1 -std=gnu++11 -I/usr/local/include -fPIC -Wall -g -O2 -c confidence.cpp -o confidence.o
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -DADD_TESSERACT_DIR=1 -DHAS_GETINPUT_NAME=1 -DHAS_GETDATAPATH=1 -DHAS_GETSOURCEYRESOLUTION=1 -DPDF_RENDER_HAS_TEXT_ONLY=1 -DHAS_OEM_LSTM=1 -std=gnu++11 -I/usr/local/include -fPIC -Wall -g -O2 -c exit.cpp -o exit.o
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -DADD_TESSERACT_DIR=1 -DHAS_GETINPUT_NAME=1 -DHAS_GETDATAPATH=1 -DHAS_GETSOURCEYRESOLUTION=1 -DPDF_RENDER_HAS_TEXT_ONLY=1 -DHAS_OEM_LSTM=1 -std=gnu++11 -I/usr/local/include -fPIC -Wall -g -O2 -c ext.cpp -o ext.o
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -DADD_TESSERACT_DIR=1 -DHAS_GETINPUT_NAME=1 -DHAS_GETDATAPATH=1 -DHAS_GETSOURCEYRESOLUTION=1 -DPDF_RENDER_HAS_TEXT_ONLY=1 -DHAS_OEM_LSTM=1 -std=gnu++11 -I/usr/local/include -fPIC -Wall -g -O2 -c lept.cc -o lept.o
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -I/usr/local/include -I/usr/local/Cellar/leptonica/1.81.1/include/leptonica -DADD_TESSERACT_DIR=1 -DHAS_GETINPUT_NAME=1 -DHAS_GETDATAPATH=1 -DHAS_GETSOURCEYRESOLUTION=1 -DPDF_RENDER_HAS_TEXT_ONLY=1 -DHAS_OEM_LSTM=1 -std=gnu++11 -I/usr/local/include -fPIC -Wall -g -O2 -c
leptLines.cc -o leptLines.o
leptLines.cc:278:14: warning: unused variable 'val' [-Wunused-variable]
l_uint32 val;
^
leptLines.cc:299:14: warning: unused variable 'val' [-Wunused-variable]
l_uint32 val;
^
leptLines.cc:377:28: error: no matching function for call to 'pixCountRGBColors'
return ( ScalarInteger( pixCountRGBColors(pixs) ));
^~~~~
/usr/local/Cellar/leptonica/1.81.1/include/leptonica/allheaders.h:1640:22: note: candidate function not viable: requires 3 arguments, but 1 was provided
LEPT_DLL extern l_ok pixCountRGBColors ( PIX pixs, l_int32 factor, l_int32 pncolors );
^
leptLines.cc:427:1: warning: unused variable 'pixs2' [-Wunused-variable]
PIX_FUN2(pixSubtract)
^
leptLines.cc:416:10: note: expanded from macro 'PIX_FUN2'
PIX pixs2 = GET_REF(r_pixs2, PIX); \
^
leptLines.cc:428:1: warning: unused variable 'pixs2' [-Wunused-variable]
PIX_FUN2(pixAnd)
^
leptLines.cc:416:10: note: expanded from macro 'PIX_FUN2'
PIX pixs2 = GET_REF(r_pixs2, PIX); \
^
leptLines.cc:429:1: warning: unused variable 'pixs2' [-Wunused-variable]
PIX_FUN2(pixOr)
^
leptLines.cc:416:10: note: expanded from macro 'PIX_FUN2'
PIX pixs2 = GET_REF(r_pixs2, PIX); \
^
leptLines.cc:430:1: warning: unused variable 'pixs2' [-Wunused-variable]
PIX_FUN2(pixXor)
^
leptLines.cc:416:10: note: expanded from macro 'PIX_FUN2'
PIX *pixs2 = GET_REF(r_pixs2, PIX); \
^
leptLines.cc:493:9: warning: unused variable 'i' [-Wunused-variable]
int i, j, r, c, depth, row, x, y;
^
leptLines.cc:493:12: warning: unused variable 'j' [-Wunused-variable]
int i, j, r, c, depth, row, x, y;
^
leptLines.cc:541:15: warning: unused variable 'depth' [-Wunused-variable]
int i, j, depth, x, y;
^
9 warnings and 1 error generated.
make: * [leptLines.o] Error 1
ERROR: compilation failed for package ‘Rtesseract’
removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rtesseract’
Warning message:
In i.p(...) :
installation of package ‘/var/folders/3h/1f85xrs966s86gznzxn26ypc0000gn/T//Rtmprl9Zn9/file7aae2c7e6fd8/Rtesseract_0.4-0.tar.gz’ had non-zero exit status**`
I am trying to install duncantl/Rtesseract on a Mac running Big Sur. I used homebrew to install leptonica, tesseract, and pkg-config to get this far. But, now it is saying it can't find the sample files for some image types, and saying it can't be compiled.
Here's the output:
`> library(remotes)
~~~~ /usr/local/Cellar/leptonica/1.81.1/include/leptonica/allheaders.h:1640:22: note: candidate function not viable: requires 3 arguments, but 1 was provided LEPT_DLL extern l_ok pixCountRGBColors ( PIX pixs, l_int32 factor, l_int32 pncolors ); ^ leptLines.cc:427:1: warning: unused variable 'pixs2' [-Wunused-variable] PIX_FUN2(pixSubtract) ^ leptLines.cc:416:10: note: expanded from macro 'PIX_FUN2' PIX pixs2 = GET_REF(r_pixs2, PIX); \ ^ leptLines.cc:428:1: warning: unused variable 'pixs2' [-Wunused-variable] PIX_FUN2(pixAnd) ^ leptLines.cc:416:10: note: expanded from macro 'PIX_FUN2' PIX pixs2 = GET_REF(r_pixs2, PIX); \ ^ leptLines.cc:429:1: warning: unused variable 'pixs2' [-Wunused-variable] PIX_FUN2(pixOr) ^ leptLines.cc:416:10: note: expanded from macro 'PIX_FUN2' PIX pixs2 = GET_REF(r_pixs2, PIX); \ ^ leptLines.cc:430:1: warning: unused variable 'pixs2' [-Wunused-variable] PIX_FUN2(pixXor) ^ leptLines.cc:416:10: note: expanded from macro 'PIX_FUN2' PIX *pixs2 = GET_REF(r_pixs2, PIX); \ ^ leptLines.cc:493:9: warning: unused variable 'i' [-Wunused-variable] int i, j, r, c, depth, row, x, y; ^ leptLines.cc:493:12: warning: unused variable 'j' [-Wunused-variable] int i, j, r, c, depth, row, x, y; ^ leptLines.cc:541:15: warning: unused variable 'depth' [-Wunused-variable] int i, j, depth, x, y; ^ 9 warnings and 1 error generated. make: * [leptLines.o] Error 1 ERROR: compilation failed for package ‘Rtesseract’