R installation of package fails /usr/bin/ld: cannot fild -ljpeg

694 Views Asked by At

Installing the R package jpeg fails on a CentOS server for which I have no sudo access.

I'm using R 3.6.3. I've compiled libjpeg-turbo 1.5.2 and added the appropriate paths to PATH and LD_LIBRARY_PATH and put jpeglib.h and the other files from libjpeg-turbo-1.5.2_build/include in this directory: /home/msimenc/software/R-3.6.3_build/lib64/R/include.

I don't know how gcc can come to know what -ljpeg is. Can someone point me in the right direction?

Below is the output from install.packages("jpeg")

trying URL 'https://cloud.r-project.org/src/contrib/jpeg_0.1-8.1.tar.gz'
Content type 'application/x-gzip' length 18116 bytes (17 KB)
==================================================
downloaded 17 KB

* installing *source* package ‘jpeg’ ...
** package ‘jpeg’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -std=gnu99 -I"/home/msimenc/software/R-3.6.3_build/lib64/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c read.c -o read.o
gcc -std=gnu99 -I"/home/msimenc/software/R-3.6.3_build/lib64/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c write.c -o write.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o jpeg.so read.o write.o -ljpeg
/usr/bin/ld: cannot find -ljpeg
collect2: error: ld returned 1 exit status
make: *** [jpeg.so] Error 1
ERROR: compilation failed for package ‘jpeg’
* removing ‘/home/msimenc/software/R-3.6.3_build/lib64/R/library/jpeg’

The downloaded source packages are in
    ‘/tmp/RtmpwM8sVp/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("jpeg") :
  installation of package ‘jpeg’ had non-zero exit status
0

There are 0 best solutions below