ropensci / pdftools

Text Extraction, Rendering and Converting of PDF Documents
https://docs.ropensci.org/pdftools
Other
524 stars 71 forks source link

How to install poppler 0.73.0 and pdftools in Debian? #98

Closed andresmorago closed 3 years ago

andresmorago commented 3 years ago

Hello to all. I have been tirelessly trying to install a more recent version of poppler on my Debian (9.13 stretch) machine. Even though im able to compile it, for some reason installing pdftools ends with errors. I will appreciate any help given.

running sudo apt-get install libpoppler-cpp-dev will install version 0.48.0 on my system

Here is what i have done so far, according to these instructions

sudo apt purge libpoppler-cpp-dev
sudo apt-get install libopenjp2-7-dev libgdk-pixbuf2.0-dev cmake checkinstall
sudo apt-get build-dep libpoppler-cpp-dev
cd 
wget https://poppler.freedesktop.org/poppler-0.73.0.tar.xz
tar -xf poppler-0.73.0.tar.xz
cd poppler-0.73.0
mkdir build
cd build
cmake ..
sudo checkinstall make install

the above returns

 Done. The new package has been installed and saved to

 /home/admonda/poppler-0.73.0/build/poppler_0.73.0-1_amd64.deb

 You can remove it from your system anytime using: 

      dpkg -r poppler

then i execute echo "export R_LD_LIBRARY_PATH=\$R_LD_LIBRARY_PATH:/usr/local/lib" >> .bashrc which returns nothing

then i go to my R console and run the pdftools package installation which fails

> install.packages("pdftools")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
probando la URL 'https://cloud.r-project.org/src/contrib/pdftools_3.0.1.tar.gz'
Content type 'application/x-gzip' length 935692 bytes (913 KB)
==================================================
downloaded 913 KB

* installing *source* package ‘pdftools’ ...
** package ‘pdftools’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/include/poppler/cpp -I/usr/local/include/poppler
Using PKG_LIBS=-L/usr/local/lib -lpoppler-cpp
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/local/include/poppler/cpp -I/usr/local/include/poppler -I"/usr/local/lib/R/site-library/Rcpp/include"  -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/local/include/poppler/cpp -I/usr/local/include/poppler -I"/usr/local/lib/R/site-library/Rcpp/include"  -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c bindings.cpp -o bindings.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-z,relro -o pdftools.so RcppExports.o bindings.o -L/usr/local/lib -lpoppler-cpp -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-pdftools/00new/pdftools/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘pdftools’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/site-library/00LOCK-pdftools/00new/pdftools/libs/pdftools.so':
  libpoppler-cpp.so.0: cannot open shared object file: No such file or directory
Error: loading failed
Ejecución interrumpida
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/pdftools’

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

My R session info

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS:   /usr/lib/libblas/libblas.so.3.7.0
LAPACK: /usr/lib/lapack/liblapack.so.3.7.0

locale:
 [1] LC_CTYPE=es_CO.UTF-8       LC_NUMERIC=C               LC_TIME=es_CO.UTF-8        LC_COLLATE=es_CO.UTF-8     LC_MONETARY=es_CO.UTF-8   
 [6] LC_MESSAGES=es_CO.UTF-8    LC_PAPER=es_CO.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=es_CO.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3    Rcpp_1.0.6     tinytex_0.32   qpdf_1.1       xfun_0.23      askpass_1.1