ropensci / qpdf

Split, Combine and Compress PDF files
https://docs.ropensci.org/qpdf
Other
56 stars 10 forks source link

Error: ld: library not found for -ljpeg #12

Open ibagur opened 3 years ago

ibagur commented 3 years ago

Hi, I am trying to install by compiling from source on R 4.0.3 on BigSur 11.2 and get this error:

ld: library not found for -ljpeg
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [qpdf.so] Error 1
ERROR: compilation failed for package `‘qpdf’```

I have libjpeg 9d installed via Homebrew. I tried to reinstall and re-start R with no success. No matter what, the error persists. Any suggestions? Thanks

jeroen commented 3 years ago

Can you include the full install log please.

zvezdochiot commented 3 years ago

@ibagur say:

I have libjpeg 9d installed via Homebrew. I tried to reinstall and re-start R with no success. No matter what, the error persists. Any suggestions?

Maybe libjpeg 9d installed without head-files (*.h)?

ibagur commented 3 years ago

Can you include the full install log please.

Sure, I performed a re-install and got this log:

~ % brew reinstall -v jpeg
rm /usr/local/bin/cjpeg
rm /usr/local/bin/djpeg
rm /usr/local/bin/jpegtran
rm /usr/local/bin/rdjpgcom
rm /usr/local/bin/wrjpgcom
rm /usr/local/include/jconfig.h
rm /usr/local/include/jerror.h
rm /usr/local/include/jmorecfg.h
rm /usr/local/include/jpeglib.h
rm /usr/local/lib/libjpeg.9.dylib
rm /usr/local/lib/libjpeg.a
rm /usr/local/lib/libjpeg.dylib
rm /usr/local/lib/pkgconfig/libjpeg.pc
rm /usr/local/share/man/man1/cjpeg.1
rm /usr/local/share/man/man1/djpeg.1
rm /usr/local/share/man/man1/jpegtran.1
rm /usr/local/share/man/man1/rdjpgcom.1
rm /usr/local/share/man/man1/wrjpgcom.1
==> Downloading https://homebrew.bintray.com/bottles/jpeg-9d.big_sur.bottle.tar.gz
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/3.0.0\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 11.2\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location --silent --head --request GET https://homebrew.bintray.com/bottles/jpeg-9d.big_sur.bottle.tar.gz
Already downloaded: /Users/inigo/Library/Caches/Homebrew/downloads/366e6d056caccae5b912a1ce6eca6b57b85be5bf30ab316f24dce4d22cbb1d85--jpeg-9d.big_sur.bottle.tar.gz
==> Verifying checksum for '366e6d056caccae5b912a1ce6eca6b57b85be5bf30ab316f24dce4d22cbb1d85--jpeg-9d.big_sur.bottle.tar.gz'
==> Reinstalling jpeg 
==> Pouring jpeg-9d.big_sur.bottle.tar.gz
tar xof /Users/inigo/Library/Caches/Homebrew/downloads/366e6d056caccae5b912a1ce6eca6b57b85be5bf30ab316f24dce4d22cbb1d85--jpeg-9d.big_sur.bottle.tar.gz -C /var/folders/mj/7zvl797s38qgzlm091ctt_gw0000gn/T/d20210206-87684-1c4t8ik
cp -pR /var/folders/mj/7zvl797s38qgzlm091ctt_gw0000gn/T/d20210206-87684-1c4t8ik/jpeg/. /usr/local/Cellar/jpeg
chmod -Rf +w /var/folders/mj/7zvl797s38qgzlm091ctt_gw0000gn/T/d20210206-87684-1c4t8ik
==> Finishing up
ln -s ../Cellar/jpeg/9d/bin/cjpeg cjpeg
ln -s ../Cellar/jpeg/9d/bin/djpeg djpeg
ln -s ../Cellar/jpeg/9d/bin/jpegtran jpegtran
ln -s ../Cellar/jpeg/9d/bin/rdjpgcom rdjpgcom
ln -s ../Cellar/jpeg/9d/bin/wrjpgcom wrjpgcom
ln -s ../Cellar/jpeg/9d/include/jconfig.h jconfig.h
ln -s ../Cellar/jpeg/9d/include/jerror.h jerror.h
ln -s ../Cellar/jpeg/9d/include/jmorecfg.h jmorecfg.h
ln -s ../Cellar/jpeg/9d/include/jpeglib.h jpeglib.h
ln -s ../../../Cellar/jpeg/9d/share/man/man1/cjpeg.1 cjpeg.1
ln -s ../../../Cellar/jpeg/9d/share/man/man1/djpeg.1 djpeg.1
ln -s ../../../Cellar/jpeg/9d/share/man/man1/jpegtran.1 jpegtran.1
ln -s ../../../Cellar/jpeg/9d/share/man/man1/rdjpgcom.1 rdjpgcom.1
ln -s ../../../Cellar/jpeg/9d/share/man/man1/wrjpgcom.1 wrjpgcom.1
ln -s ../Cellar/jpeg/9d/lib/libjpeg.9.dylib libjpeg.9.dylib
ln -s ../Cellar/jpeg/9d/lib/libjpeg.a libjpeg.a
ln -s ../Cellar/jpeg/9d/lib/libjpeg.dylib libjpeg.dylib
ln -s ../../Cellar/jpeg/9d/lib/pkgconfig/libjpeg.pc libjpeg.pc
/usr/bin/sandbox-exec -f /private/tmp/homebrew20210206-87927-1df6m7l.sb nice ruby -W0 -I $LOAD_PATH -- /usr/local/Homebrew/Library/Homebrew/postinstall.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg.rb
==> Summary
🍺  /usr/local/Cellar/jpeg/9d: 21 files, 953.8KB
==> Upgrading 3 dependents:
poppler 20.11.0 -> 21.02.0, gdal 3.2.0 -> 3.2.1_1, sethrfore/r-srf/r 4.0.3 -> 4.0.3_1
==> Upgrading poppler 20.11.0 -> 21.02.0 
==> Downloading https://homebrew.bintray.com/bottles/cairo-1.16.0_4.big_sur.bottle.tar.gz
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/3.0.0\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 11.2\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location --silent --head --request GET https://homebrew.bintray.com/bottles/cairo-1.16.0_4.big_sur.bottle.tar.gz
Already downloaded: /Users/inigo/Library/Caches/Homebrew/downloads/e82ca05a8c5b6636d3db5b35a98bb17201cbcaa3a5e24a1a95899e57f96a7915--cairo-1.16.0_4.big_sur.bottle.tar.gz
==> Verifying checksum for 'e82ca05a8c5b6636d3db5b35a98bb17201cbcaa3a5e24a1a95899e57f96a7915--cairo-1.16.0_4.big_sur.bottle.tar.gz'
==> Downloading https://homebrew.bintray.com/bottles/nss-3.61.big_sur.bottle.tar.gz
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/3.0.0\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 11.2\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location --silent --head --request GET https://homebrew.bintray.com/bottles/nss-3.61.big_sur.bottle.tar.gz
Already downloaded: /Users/inigo/Library/Caches/Homebrew/downloads/df9385298b95af3be80262f88488d4c5ae3a9c77d45d44abbb692b879ef6b593--nss-3.61.big_sur.bottle.tar.gz
==> Verifying checksum for 'df9385298b95af3be80262f88488d4c5ae3a9c77d45d44abbb692b879ef6b593--nss-3.61.big_sur.bottle.tar.gz'
==> Downloading https://homebrew.bintray.com/bottles/poppler-21.02.0.big_sur.bottle.tar.gz
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/3.0.0\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 11.2\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location --silent --head --request GET https://homebrew.bintray.com/bottles/poppler-21.02.0.big_sur.bottle.tar.gz
Already downloaded: /Users/inigo/Library/Caches/Homebrew/downloads/afa37360c053a76b7af680f5bdf7d88a36e1202e85596abeafa85fa6abe904bd--poppler-21.02.0.big_sur.bottle.tar.gz
==> Verifying checksum for 'afa37360c053a76b7af680f5bdf7d88a36e1202e85596abeafa85fa6abe904bd--poppler-21.02.0.big_sur.bottle.tar.gz'
rm /usr/local/bin/pdfattach
rm /usr/local/bin/pdfdetach
rm /usr/local/bin/pdffonts
rm /usr/local/bin/pdfimages
rm /usr/local/bin/pdfinfo
rm /usr/local/bin/pdfseparate
rm /usr/local/bin/pdfsig
rm /usr/local/bin/pdftocairo
rm /usr/local/bin/pdftohtml
rm /usr/local/bin/pdftoppm
rm /usr/local/bin/pdftops
rm /usr/local/bin/pdftotext
rm /usr/local/bin/pdfunite
rm /usr/local/include/poppler
rm /usr/local/lib/girepository-1.0/Poppler-0.18.typelib
rm /usr/local/lib/libpoppler-cpp.0.9.0.dylib
rm /usr/local/lib/libpoppler-cpp.0.dylib
rm /usr/local/lib/libpoppler-cpp.a
rm /usr/local/lib/libpoppler-cpp.dylib
rm /usr/local/lib/libpoppler-glib.8.19.0.dylib
rm /usr/local/lib/libpoppler-glib.8.dylib
rm /usr/local/lib/libpoppler-glib.a
rm /usr/local/lib/libpoppler-glib.dylib
rm /usr/local/lib/libpoppler-qt5.1.26.0.dylib
rm /usr/local/lib/libpoppler-qt5.1.dylib
rm /usr/local/lib/libpoppler-qt5.dylib
rm /usr/local/lib/libpoppler.104.0.0.dylib
rm /usr/local/lib/libpoppler.104.dylib
rm /usr/local/lib/libpoppler.a
rm /usr/local/lib/libpoppler.dylib
rm /usr/local/lib/pkgconfig/poppler-cairo.pc
rm /usr/local/lib/pkgconfig/poppler-cpp.pc
rm /usr/local/lib/pkgconfig/poppler-glib.pc
rm /usr/local/lib/pkgconfig/poppler-qt5.pc
rm /usr/local/lib/pkgconfig/poppler-splash.pc
rm /usr/local/lib/pkgconfig/poppler.pc
rm /usr/local/share/gir-1.0/Poppler-0.18.gir
rm /usr/local/share/man/man1/pdfattach.1
rm /usr/local/share/man/man1/pdfdetach.1
rm /usr/local/share/man/man1/pdffonts.1
rm /usr/local/share/man/man1/pdfimages.1
rm /usr/local/share/man/man1/pdfinfo.1
rm /usr/local/share/man/man1/pdfseparate.1
rm /usr/local/share/man/man1/pdfsig.1
rm /usr/local/share/man/man1/pdftocairo.1
rm /usr/local/share/man/man1/pdftohtml.1
rm /usr/local/share/man/man1/pdftoppm.1
rm /usr/local/share/man/man1/pdftops.1
rm /usr/local/share/man/man1/pdftotext.1
rm /usr/local/share/man/man1/pdfunite.1
rm /usr/local/share/pkgconfig/poppler-data.pc
rm /usr/local/share/poppler
==> Installing dependencies for poppler: cairo and nss
rm /usr/local/bin/cairo-sphinx
rm /usr/local/bin/cairo-trace
rm /usr/local/include/cairo
rm /usr/local/lib/cairo
rm /usr/local/lib/libcairo-gobject.2.dylib
rm /usr/local/lib/libcairo-gobject.a
rm /usr/local/lib/libcairo-gobject.dylib
rm /usr/local/lib/libcairo-script-interpreter.2.dylib
rm /usr/local/lib/libcairo-script-interpreter.a
rm /usr/local/lib/libcairo-script-interpreter.dylib
rm /usr/local/lib/libcairo.2.dylib
rm /usr/local/lib/libcairo.a
rm /usr/local/lib/libcairo.dylib
rm /usr/local/lib/pkgconfig/cairo-fc.pc
rm /usr/local/lib/pkgconfig/cairo-ft.pc
rm /usr/local/lib/pkgconfig/cairo-gobject.pc
rm /usr/local/lib/pkgconfig/cairo-pdf.pc
rm /usr/local/lib/pkgconfig/cairo-png.pc
rm /usr/local/lib/pkgconfig/cairo-ps.pc
rm /usr/local/lib/pkgconfig/cairo-quartz-font.pc
rm /usr/local/lib/pkgconfig/cairo-quartz-image.pc
rm /usr/local/lib/pkgconfig/cairo-quartz.pc
rm /usr/local/lib/pkgconfig/cairo-script.pc
rm /usr/local/lib/pkgconfig/cairo-svg.pc
rm /usr/local/lib/pkgconfig/cairo-tee.pc
rm /usr/local/lib/pkgconfig/cairo-xcb-shm.pc
rm /usr/local/lib/pkgconfig/cairo-xcb.pc
rm /usr/local/lib/pkgconfig/cairo-xlib-xrender.pc
rm /usr/local/lib/pkgconfig/cairo-xlib.pc
rm /usr/local/lib/pkgconfig/cairo.pc
rm /usr/local/share/gtk-doc
Error: cairo is already installed from sethrfore/r-srf!
Please `brew uninstall cairo` first."
ln -s ../Cellar/cairo/1.16.0_3/bin/cairo-sphinx cairo-sphinx
ln -s ../Cellar/cairo/1.16.0_3/bin/cairo-trace cairo-trace
ln -s ../Cellar/cairo/1.16.0_3/include/cairo cairo
ln -s ../Cellar/cairo/1.16.0_3/share/gtk-doc gtk-doc
ln -s ../Cellar/cairo/1.16.0_3/lib/cairo cairo
ln -s ../Cellar/cairo/1.16.0_3/lib/libcairo-gobject.2.dylib libcairo-gobject.2.dylib
ln -s ../Cellar/cairo/1.16.0_3/lib/libcairo-gobject.a libcairo-gobject.a
ln -s ../Cellar/cairo/1.16.0_3/lib/libcairo-gobject.dylib libcairo-gobject.dylib
ln -s ../Cellar/cairo/1.16.0_3/lib/libcairo-script-interpreter.2.dylib libcairo-script-interpreter.2.dylib
ln -s ../Cellar/cairo/1.16.0_3/lib/libcairo-script-interpreter.a libcairo-script-interpreter.a
ln -s ../Cellar/cairo/1.16.0_3/lib/libcairo-script-interpreter.dylib libcairo-script-interpreter.dylib
ln -s ../Cellar/cairo/1.16.0_3/lib/libcairo.2.dylib libcairo.2.dylib
ln -s ../Cellar/cairo/1.16.0_3/lib/libcairo.a libcairo.a
ln -s ../Cellar/cairo/1.16.0_3/lib/libcairo.dylib libcairo.dylib
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-fc.pc cairo-fc.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-ft.pc cairo-ft.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-gobject.pc cairo-gobject.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-pdf.pc cairo-pdf.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-png.pc cairo-png.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-ps.pc cairo-ps.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-quartz-font.pc cairo-quartz-font.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-quartz-image.pc cairo-quartz-image.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-quartz.pc cairo-quartz.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-script.pc cairo-script.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-svg.pc cairo-svg.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-tee.pc cairo-tee.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-xcb-shm.pc cairo-xcb-shm.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-xcb.pc cairo-xcb.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-xlib-xrender.pc cairo-xlib-xrender.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo-xlib.pc cairo-xlib.pc
ln -s ../../Cellar/cairo/1.16.0_3/lib/pkgconfig/cairo.pc cairo.pc
ln -s ../Cellar/poppler/20.11.0/bin/pdfattach pdfattach
ln -s ../Cellar/poppler/20.11.0/bin/pdfdetach pdfdetach
ln -s ../Cellar/poppler/20.11.0/bin/pdffonts pdffonts
ln -s ../Cellar/poppler/20.11.0/bin/pdfimages pdfimages
ln -s ../Cellar/poppler/20.11.0/bin/pdfinfo pdfinfo
ln -s ../Cellar/poppler/20.11.0/bin/pdfseparate pdfseparate
ln -s ../Cellar/poppler/20.11.0/bin/pdfsig pdfsig
ln -s ../Cellar/poppler/20.11.0/bin/pdftocairo pdftocairo
ln -s ../Cellar/poppler/20.11.0/bin/pdftohtml pdftohtml
ln -s ../Cellar/poppler/20.11.0/bin/pdftoppm pdftoppm
ln -s ../Cellar/poppler/20.11.0/bin/pdftops pdftops
ln -s ../Cellar/poppler/20.11.0/bin/pdftotext pdftotext
ln -s ../Cellar/poppler/20.11.0/bin/pdfunite pdfunite
ln -s ../Cellar/poppler/20.11.0/include/poppler poppler
ln -s ../../Cellar/poppler/20.11.0/share/gir-1.0/Poppler-0.18.gir Poppler-0.18.gir
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdfattach.1 pdfattach.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdfdetach.1 pdfdetach.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdffonts.1 pdffonts.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdfimages.1 pdfimages.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdfinfo.1 pdfinfo.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdfseparate.1 pdfseparate.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdfsig.1 pdfsig.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdftocairo.1 pdftocairo.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdftohtml.1 pdftohtml.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdftoppm.1 pdftoppm.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdftops.1 pdftops.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdftotext.1 pdftotext.1
ln -s ../../../Cellar/poppler/20.11.0/share/man/man1/pdfunite.1 pdfunite.1
ln -s ../../Cellar/poppler/20.11.0/share/pkgconfig/poppler-data.pc poppler-data.pc
ln -s ../Cellar/poppler/20.11.0/share/poppler poppler
ln -s ../../Cellar/poppler/20.11.0/lib/girepository-1.0/Poppler-0.18.typelib Poppler-0.18.typelib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-cpp.0.9.0.dylib libpoppler-cpp.0.9.0.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-cpp.0.dylib libpoppler-cpp.0.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-cpp.a libpoppler-cpp.a
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-cpp.dylib libpoppler-cpp.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-glib.8.19.0.dylib libpoppler-glib.8.19.0.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-glib.8.dylib libpoppler-glib.8.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-glib.a libpoppler-glib.a
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-glib.dylib libpoppler-glib.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-qt5.1.26.0.dylib libpoppler-qt5.1.26.0.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-qt5.1.dylib libpoppler-qt5.1.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler-qt5.dylib libpoppler-qt5.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler.104.0.0.dylib libpoppler.104.0.0.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler.104.dylib libpoppler.104.dylib
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler.a libpoppler.a
ln -s ../Cellar/poppler/20.11.0/lib/libpoppler.dylib libpoppler.dylib
ln -s ../../Cellar/poppler/20.11.0/lib/pkgconfig/poppler-cairo.pc poppler-cairo.pc
ln -s ../../Cellar/poppler/20.11.0/lib/pkgconfig/poppler-cpp.pc poppler-cpp.pc
ln -s ../../Cellar/poppler/20.11.0/lib/pkgconfig/poppler-glib.pc poppler-glib.pc
ln -s ../../Cellar/poppler/20.11.0/lib/pkgconfig/poppler-qt5.pc poppler-qt5.pc
ln -s ../../Cellar/poppler/20.11.0/lib/pkgconfig/poppler-splash.pc poppler-splash.pc
ln -s ../../Cellar/poppler/20.11.0/lib/pkgconfig/poppler.pc poppler.pc
ibagur commented 3 years ago

@ibagur say:

I have libjpeg 9d installed via Homebrew. I tried to reinstall and re-start R with no success. No matter what, the error persists. Any suggestions?

Maybe libjpeg 9d installed without head-files (*.h)?

Apparently head files are on several locations, but it seems R cannot find it

sudo find /usr | grep "jpeglib.h"
/usr/local/include/jpeglib.h
/usr/local/mac-dev-env/libjpeg-9c/include/jpeglib.h
/usr/local/Cellar/jpeg/9d/include/jpeglib.h
/usr/local/src/jpeg-9c/jpeglib.h
zvezdochiot commented 3 years ago

@ibagur say.

Apparently head files are on several locations, but it seems R cannot find it

Not. Clang does not find exactly the library. Have you used the configure script? He writes something to src/Makevars.

ibagur commented 3 years ago

Not. Clang does not find exactly the library. Have you used the configure script? He writes something to src/Makevars.

Not sure how to use 'configure'. The Makevars file, under .R folders looks like this. How can I tell 'clang++' to find '/usr/local/include/jpeglib.h'?:

XCBASE:=$(shell xcrun --show-sdk-path)
LLVMBASE:=$(shell brew --prefix llvm)
GCCBASE:=$(shell brew --prefix gcc)
GETTEXT:=$(shell brew --prefix gettext)

CC=$(LLVMBASE)/bin/clang
CXX=$(LLVMBASE)/bin/clang++
CXX11=$(LLVMBASE)/bin/clang++
CXX14=$(LLVMBASE)/bin/clang++
CXX17=$(LLVMBASE)/bin/clang++
CXX1X=$(LLVMBASE)/bin/clang++

CPPFLAGS=-isystem "$(LLVMBASE)/include" -isysroot "$(XCBASE)"
LDFLAGS=-L"$(LLVMBASE)/lib" -L"$(GETTEXT)/lib" --sysroot="$(XCBASE)"

FC=$(GCCBASE)/bin/gfortran
F77=$(GCCBASE)/bin/gfortran
FLIBS=-L$(GCCBASE)/lib/gcc/9/ -lm
zvezdochiot commented 3 years ago

@ibagur say:

Not sure how to use 'configure'.

Just see its (configure) contents. There are only a few teams.

ibagur commented 3 years ago

@ibagur say:

Not sure how to use 'configure'.

Just see its (configure) contents. There are only a few teams.

Thank you for your reply, but I am still confused as I am not a Unix specialist at all, so I ignore how to see the 'configure' contents or who those 'teams' are. To recap what first I tried was to install QPDF package on R, and I got the following error:

include/qpdf/Pl_DCT.hh:27:10: fatal error: 'jpeglib.h' file not found

So aparently 'clang++' is not finding this 'jpeglib.h'. But the file do exists in my system, located on ''/usr/local/include/jpeglib.h'.

I would like just to know the exact steps I need to do in order to Clang++ finding 'jpeglib.h' at compilation time so QPDF package can be finally compiled and installed.

zvezdochiot commented 3 years ago

@ibagur say:

so I ignore how to see the 'configure' contents

https://github.com/ropensci/qpdf/blob/00f58464c506c33a1ec0addf19bb791216e973f1/configure#L1-L17

It must be executed:

./configure

or

sh configure

It should change src/Makevars to suit your system.

errcricket commented 2 years ago

I am having a similar issue. I am trying to install pdftools of which qpdf is required. When I try to install qpdf, I get the following error:

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’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/qpdf’
Warning in install.packages :
  installation of package ‘qpdf’ had non-zero exit status

I have installed and reinstalled libjpeg via brew with the following command: brew install libjpeg and confirmed the install with sudo find /usr | grep "jpeglib.h".

/usr/local/Cellar/jpeg/9e/include/jpeglib.h

The directions in this thread are...vague to me. I cannot install qpdf and the package is removed so I am not sure how I can access the folder/file qpdf/configure.

If you could please provide a solution that is a bit clearer I would appreciate it.

jeroen commented 2 years ago

@errcricket can you try

brew install jpeg-turbo
errcricket commented 2 years ago

DISCO! That solved the issue. Thank you.

jmh530 commented 9 months ago

@jeroen I got the same error with respect to jpeglib.h (also mentioned here https://github.com/ropensci/qpdf/issues/7). That solution does not work for me as I am on a work computer and cannot get through the corporate firewall (using Windows 10 machine).