0

I am trying to install R package “pdftools” and encounter the following:

In file included from libqpdf/Pl_DCT.cc:1:
include/qpdf/Pl_DCT.hh:27:10: fatal error: 'jpeglib.h' file not found
#include <jpeglib.h>
         ^
1 error generated.
make: *** [libqpdf/Pl_DCT.o] Error 1
ERROR: compilation failed for package ‘qpdf’

I am using R version 3.3.3 on a mac with OS X 10.10.5 and can’t update my OS at the moment for a number of reasons.

  1. I verified that the downloaded source packages are in: /private/var/folders/t3/_mlp_5z15z9_628n5q00pw_s8d_kfs/T/RtmpnJERsz/downloaded_packages

  2. I saw the following post: 'jpeglib.h' file not found

And ran

$ find /usr/local -name \*jpeg\* -print -name \*jpg\* -print
/usr/local/Cellar/boost/1.71.0/include/boost/gil/extension/io/jpeg
/usr/local/Cellar/boost/1.71.0/include/boost/gil/extension/io/jpeg.hpp
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/libjpeg
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/libjpeg-turbo
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg-archive.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg-turbo.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeginfo.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpegoptim.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpegrescan.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mjpegtools.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mozjpeg.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openjpeg.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/recoverjpeg.rb
find: /usr/local/jamf: Permission denied

The file "jpeglib.h" does not seem to be listed, but I located it in: /anaconda3/pkgs/jpeg-9b-he5867d9_2/include/jpeglib.h

  1. Based on other posts, I tried from terminal:
$ brew install boost. (Lot of installing, no errors)
$ brew doctor (Lot of installing, no errors)
$ xcode-select: error: command line tools are already installed, use "Software Update" to install updates
$ brew install cairo gobject-introspection pixman (Lot of installing, no errors)

Then rebooted and tried installing pdftools again with same result.

  1. Also saw this post but it was completely over my head: https://www.cocoanetics.com/2012/01/helping-xcode-find-library-headers/

Any solutions in simple steps appreciated.

marcel
  • 389
  • 1
  • 8
  • 21
  • Hello, I tried it on my mac and I installed it without any problem. Do you have askpass package installed? – boyaronur Oct 20 '19 at 18:00

1 Answers1

0

Here is my session info, I couldn't include it into comments due to restriction.

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/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  
[7] base     

other attached packages:
[1] pdftools_2.2

loaded via a namespace (and not attached):
[1] compiler_3.4.3 tools_3.4.3    pillar_1.2.1   tibble_1.4.2  
[5] Rcpp_1.0.1     qpdf_1.1       rlang_0.3.0.1  askpass_1.1

I just installed pdftools w/o any problem. Upgrading your R version may solve your problem.

boyaronur
  • 521
  • 6
  • 18
  • Right - I should have mentioned that I can't update to R 3.6.1 because at the moment I am unable to update from OS X 10.10.5 right now. Having trouble finding any higher versions of R that I can install (e.g. R 3.4.3). Is there a workaround? – marcel Oct 21 '19 at 05:36
  • https://cran.r-project.org/bin/macosx/el-capitan/base/ you can find 3.4.3 and other versions from this link. do not forget to upvote or accept the answer if it works for you, best :) – boyaronur Oct 21 '19 at 13:53
  • Looks like r 3.4.3 requires a higher version of OS X, so I am stuck for now unless there is a way to help jpeglib.h be found somehow during compiling. – marcel Oct 23 '19 at 01:29