简体   繁体   中英

digest package not installing in R - lgfortran not found

I am trying to install the digest package in R. However the installation is failing, apparently because the compiler does not recognize the -lgfortran flag. I have been unable to find any information on this. Any help is appreciated.

> install.packages('digest', repos='http://cran.us.r-project.org')
trying URL 'http://cran.us.r-project.org/src/contrib/digest_0.6.12.tar.gz'
Content type 'application/x-gzip' length 120337 bytes (117 KB)
==================================================
downloaded 117 KB

* installing *source* package ‘digest’ ...
** package ‘digest’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c aes.c -o aes.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c crc32.c -o crc32.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c digest.c -o digest.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c init.c -o init.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c md5.c -o md5.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c pmurhash.c -o pmurhash.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c raes.c -o raes.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c sha1.c -o sha1.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c sha2.c -o sha2.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c sha256.c -o sha256.o
gcc -std=gnu99 -I/home/alexander/anaconda3/lib/R/include -DNDEBUG  -I/home/alexander/anaconda3/include    -fpic  -I/home/alexander/anaconda3/include  -c xxhash.c -o xxhash.o
gcc -std=gnu99 -shared -L/home/alexander/anaconda3/lib/R/lib -L/home/alexander/anaconda3/lib -lgfortran -o digest.so aes.o crc32.o digest.o init.o md5.o pmurhash.o raes.o sha1.o sha2.o sha256.o xxhash.o -L/home/alexander/anaconda3/lib/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
/home/alexander/anaconda3/lib/R/share/make/shlib.mk:6: recipe for target 'digest.so' failed
make: *** [digest.so] Error 1
ERROR: compilation failed for package ‘digest’
* removing ‘/home/alexander/anaconda3/lib/R/library/digest’
* restoring previous ‘/home/alexander/anaconda3/lib/R/library/digest’
  1. use homebrew to install gcc, gfortrain
  2. Create folder /Users/YOURNAME/.R
  3. Create text file /Users/YOURNAME/.R/Makevars
  4. Put this into that file:

FC = usr/local/opt/gcc/bin/gfortran

F77 = /usr/local/opt/gcc/bin/gfortran

FLIBS = -L/usr/local/opt/gcc/lib

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM