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

updating via install.packages("pdftools") leads to inability to use library #111

Closed
dcaud opened this issue Apr 25, 2022 · 9 comments
Closed

Comments

@dcaud
Copy link

dcaud commented Apr 25, 2022

After updating the library, library(pdftools) now produces:

Error: package or namespace load failed for ‘pdftools’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/pdftools/libs/pdftools.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/pdftools/libs/pdftools.so, 0x0006): Library not loaded: /opt/X11/lib/libXrender.1.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/pdftools/libs/pdftools.so
Reason: tried: '/opt/X11/lib/libXrender.1.dylib' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/libXrender.1.dylib' (no such file)

Here's my session info:

R version 4.1.2 (2021-11-01)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.2.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] shinybusy_0.3.0 shinyWidgets_0.6.4 magick_2.7.3 colourpicker_1.1.1
[5] shiny_1.7.1

loaded via a namespace (and not attached):
[1] Rcpp_1.0.8.3 compiler_4.1.2 bslib_0.3.1 later_1.3.0
[5] jquerylib_0.1.4 shinyjs_2.1.0 tools_4.1.2 digest_0.6.29
[9] jsonlite_1.8.0 lifecycle_1.0.1 rlang_1.0.2 DBI_1.1.2
[13] cli_3.2.0 fastmap_1.1.0 withr_2.5.0 httr_1.4.2
[17] htmlwidgets_1.5.4 sass_0.4.1 askpass_1.1 qpdf_1.1
[21] R6_2.5.1 pool_0.1.6 purrr_0.3.4 magrittr_2.0.3
[25] promises_1.2.0.1 ellipsis_0.3.2 htmltools_0.5.2 mime_0.12
[29] xtable_1.8-4 httpuv_1.6.5 miniUI_0.1.1.1 cachem_1.0.6

@dcaud
Copy link
Author

dcaud commented Apr 25, 2022

I also can't seem to revert to an older version, so I'm stuck. Any help would be appreciated.

devtools::install_version("pdftools", version = "2.3.1") fails with

Downloading package from url: https://cran.rstudio.com//src/contrib/Archive/pdftools/pdftools_2.1.tar.gz

  • installing source package ‘pdftools’ ...
    ** package ‘pdftools’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Package poppler-cpp was not found in the pkg-config search path.
    Perhaps you should add the directory containing `poppler-cpp.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'poppler-cpp' found
    Homebrew 3.3.9
    Homebrew/homebrew-core (git revision e251e3ffc46; last commit 2022-01-03)
    Homebrew/homebrew-cask (git revision 64ab035cd4; last commit 2022-01-03)
    Using PKG_CFLAGS=-I/usr/local/opt/poppler/include/cpp
    Using PKG_LIBS=-L/usr/local/opt/poppler/lib -lpoppler-cpp
    'config' variable 'CXXCPP' is defunct
    ------------------------- ANTICONF ERROR ---------------------------
    Configuration failed because poppler-cpp was not found. Try installing:
  • deb: libpoppler-cpp-dev (Debian, Ubuntu, etc)
  • rpm: poppler-cpp-devel (Fedora, CentOS, RHEL)
  • csw: poppler_dev (Solaris)
  • brew: poppler (Mac OSX)
    If poppler-cpp is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a poppler-cpp.pc file. If pkg-config
    is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
    R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

ERROR: configuration failed for package ‘pdftools’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/pdftools’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/x5/lxrbhxtw8v55k1006s6kjjfr0000gp/T//RtmpwTaVP6/remotes6be225befa2/pdftools’ had non-zero exit status

@dcaud
Copy link
Author

dcaud commented Apr 25, 2022

I think the problem with using the new version is gone, after this: brew install xquartz

@subhashishhh
Copy link

I think the problem with using the new version is gone, after this: brew install xquartz

Yes, you are absolutely correct for my case also it is solved now for macOS Monterey. Thank you very much.

@jeroen
Copy link
Member

jeroen commented May 1, 2022

@s-u can we please try to avoid the xquartz dependency for your poppler/cairo builds? Many people don't have this; the autobrew builds for cairo/poppler that we were using before did not have this problem.

BBieri pushed a commit to iheid-library/iheiddown that referenced this issue May 2, 2022
@yogat3ch
Copy link

This issue persists on Arm Macs. My device specs are as follows:
Chip: Apple M1 Pro
MacOS Monterey 12.3.1

unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/pdftools/libs/pdftools.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/pdftools/libs/pdftools.so, 0x0006): Library not loaded: /opt/X11/lib/libXrender.1.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/pdftools/libs/pdftools.so
  Reason: tried: '/opt/X11/lib/libXrender.1.dylib' (no such file), '/usr/lib/libXrender.1.dylib' (no such file)

@yogat3ch
Copy link

brew install xquartz does fix the problem. Thank you @dcaud

@jeroen
Copy link
Member

jeroen commented May 27, 2022

This is a bug caused by the CRAN build system. A workaround is to install pdftools from r-universe:

install.packages("pdftools", repos = "https://ropensci.r-universe.dev")

@jeroen
Copy link
Member

jeroen commented May 29, 2022

I have added a workaround now.

@jeroen jeroen closed this as completed May 29, 2022
@yogat3ch
Copy link

Awesome, thank you @jeroen !

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

4 participants