ropensci / tesseract

Bindings to Tesseract OCR engine for R
https://docs.ropensci.org/tesseract
243 stars 25 forks source link

Can't compile on Linux CentOS 7 #55

Closed pvo93 closed 2 years ago

pvo93 commented 3 years ago

I'm having trouble compiling the tesseract R package on our research Linux servers. Before starting R, I set CXX11CPP as follows.

export CXX11CPP='g++ -E -std=gnu++17'

However, R seems to ignore it and default to gnu++11. I'm using gcc 8.3.1.

R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

[Previously saved workspace restored]

install.packages("tesseract") Installing package into ‘/home/biotools/rpackages/R-4.0.3-2020-12-15’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/src/contrib/tesseract_4.1.tar.gz' Content type 'application/x-gzip' length 447439 bytes (436 KB)

downloaded 436 KB

The downloaded source packages are in ‘/local1/tmp/RtmpBVBRk6/downloaded_packages’ Warning message: In install.packages("tesseract") : installation of package ‘tesseract’ had non-zero exit status

jeroen commented 3 years ago

I think there may be an issue with your installation of libtesseract in /usr/local/biotools/bsi/ver2. Which version is this?

pvo93 commented 3 years ago

It's 5.0.0-alpha-2-2-1224. I had problems trying to compile 4.1.1.

[m015733@dudley]/usr/local/biotools/bsi/ver2/lib: ls -l libtesseract. -rw-r--r-- 1 wa03872 rcode 196086110 Mar 16 09:19 libtesseract.a -rwxr-xr-x 1 wa03872 rcode 1101 Mar 16 09:19 libtesseract.la lrwxrwxrwx 1 wa03872 rcode 21 Mar 16 09:19 libtesseract.so -> libtesseract.so.5.0.0 lrwxrwxrwx 1 wa03872 rcode 21 Mar 16 09:19 libtesseract.so.5 -> libtesseract.so.5.0.0 -rwxr-xr-x 1 wa03872 rcode 63307408 Mar 16 09:19 libtesseract.so.5.0.0*

jeroen commented 3 years ago

I haven't tested the R package with 5.x. What problems did you have with 4.1? Do you not have the option to install tesseract-devel from EPEL?

pvo93 commented 3 years ago

I install and maintain our R packages, but I don't have root access so I typically compile from source. I was able to compile tesseract 4.1.1, but I get the following error when I try to install the R package. I verified the existence of the header file.

install.packages("tesseract") Installing package into ‘/home/m015733/R/x86_64-pc-linux-gnu-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/src/contrib/tesseract_4.1.tar.gz' Content type 'application/x-gzip' length 447439 bytes (436 KB)

downloaded 436 KB

The downloaded source packages are in ‘/local1/tmp/Rtmp8QaFlz/downloaded_packages’ Warning message: In install.packages("tesseract") : installation of package ‘tesseract’ had non-zero exit status

system("ls -l /usr/local/biotools/bsi/ver2/include/leptonica") total 588 -rw-r--r-- 1 wa03872 rcode 259877 Mar 16 10:35 allheaders.h . . .

jeroen commented 3 years ago

Looks like you should be compiling with -I/usr/local/biotools/bsi/ver2/include ?