4

I got error when installing package tseries of R.

Following is the error. The point might be "gfortran: No such file or directory". How do you fix it?

> install.packages("tseries")

  there is a binary version,but a source version:
         binary  source needs_compilation
tseries 0.10-41 0.10-42              TRUE

Do you want to install from sources the package which needs compilation?
y/n: y
install source‘tseries’

试开URL’https://mirror.lzu.edu.cn/CRAN/src/contrib/tseries_0.10-42.tar.gz'
Content type 'application/octet-stream' length 164529 bytes (160 KB)
==================================================
downloaded 160 KB

* installing *source* package ‘tseries’ ...
** 成功将‘tseries’程序包解包并MD5和检查
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c arma.c -o arma.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c bdstest.c -o bdstest.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c boot.c -o boot.o
gfortran   -fPIC  -g -O2  -c dsumsl.f -o dsumsl.o
make: gfortran: No such file or directory
make: *** [dsumsl.o] Error 1
ERROR: compilation failed for package ‘tseries’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/tseries’

packages in
    ‘/private/var/folders/md/8kgtqqz12j94hbcvhqz0w7gw0000gp/T/Rtmp3nng81/downloaded_packages’
Warning message:
In install.packages("tseries") : when installing ‘tseries’,value of return status is not 0
> 

version of R in my mac

version _
platform x86_64-apple-darwin15.6.0
arch x86_64
os darwin15.6.0
system x86_64, darwin15.6.0
status
major 3
minor 4.0
year 2017
month 04
day 21
svn rev 72570
language R
version.string R version 3.4.0 (2017-04-21) nickname You Stupid Darkness

William Song
  • 577
  • 6
  • 17
  • Did you try to install the binary version (i.e. answering no at the question)? – nicola Jun 23 '17 at 09:02
  • Is `gfortran` installed on your machine? If not, try with https://gcc.gnu.org/wiki/GFortranBinaries – Marco Sandri Jun 23 '17 at 09:03
  • what is gfortran? Is it Fortran? No. How do you install the binary version? – William Song Jun 23 '17 at 09:05
  • When i execute $brew search gfortran, it shows GNU Fortran is now provided as part of GCC, and can be installed with: brew install gcc. I have installed gcc with brew. so I had it already. – William Song Jun 23 '17 at 09:13
  • 3
    See that after you tried `install.package("tseries")`, R asked: `Do you want to install from sources the package which needs compilation?` and you replied "yes". Try "no" instead. – nicola Jun 23 '17 at 09:14
  • @nicola succeed. Thank you. – William Song Jun 23 '17 at 09:39
  • @nicola any insight into what's going on? that worked for me as well now... I didn't see any `$PATH` issues so couldn't understand why `tseries` installer wasn't finding the right `gfortran` binary apparently... – MichaelChirico Nov 20 '18 at 04:31

0 Answers0