10

I am trying to install the fftw3 package through R console

>install.packages("fftw")

After this command it is asking to select the cran mirror.I have selected the cran mirror then following error occurs:

Loading Tcl/Tk interface ... done
Warning: unable to access index for repository http://ftp.iitm.ac.in/cran/src/contrib
Warning messages:
1: In open.connection(con, "r") :
unable to connect to 'cran.r-project.org' on port 80.
2: In getDependencies(pkgs, dependencies, available, lib) :
package ‘fftw’ is not available (for R version 2.14.1)

And When I am trying for fftw3 then following error occurs:

> install.packages("fftw3")
Installing package(s) into ‘/root/R/x86_64-pc-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://ftp.iitm.ac.in/cran/src/contrib
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘fftw3’ is not available (for R version 2.14.1)

Can anyone help me out of this?

Saurabh
  • 867
  • 3
  • 13
  • 28

2 Answers2

27

As Paul said, that's probably not an R package. There is an R package that is a wrapper for the FFTW library, also called fftw, you should install that:

Link to CRAN page of fftw

In Ubuntu you have then still the system requirement to have a proper installed fftw library, that you probably can solve via

sudo apt-get install fftw3 fftw3-dev pkg-config
Daniel Fischer
  • 3,280
  • 1
  • 18
  • 29
  • @Daniel.. Thanks For your response.I have already tried like what you have mentioned.Can you please me about the system requirement fftw3 (>= 3.1.2) to the Link to CRAN page of fftw . How I can achieve that... – Saurabh Feb 13 '13 at 12:20
  • I think first you have to type the `apt-get` command into the console (that has nothing to do with R it is on the OS level) and then, after the OS has the libraries installed you can install the R package as you tried, maybe you could try another Cran mirror. – Daniel Fischer Feb 13 '13 at 12:47
  • @Daniel I did as per your suggestion and installation shows that it was successful but still not working for me.when I am typing the command >library(fftw) then the error is: fftw package not found.Is any other thing I need to do? In fact in R console I also tried install.packages("fftw3") the error was like:Installing package(s) into ‘/root/R/x86_64-pc-linux-gnu-library/2.14’ (as ‘lib’ is unspecified) Warning message: In getDependencies(pkgs, dependencies, available, lib) : package ‘fftw3’ is not available (for R version 2.14.1) – Saurabh Feb 14 '13 at 07:11
  • @Daniel...when I am trying >install.packages("fftw") then following error occurs:No package 'fftw3' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables FFTW_CFLAGS and FFTW_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. ERROR: configuration failed for package ‘fftw’ * removing ‘/root/R/x86_64-pc-linux-gnu-library/2.14/fftw’ Warning message: In install.packages("fftw") : installation of package ‘fftw’ had non-zero exit status – Saurabh Feb 14 '13 at 07:17
  • Have you installed the pkg-config tool for Ubuntu? I think the R package makes use of it (and btw, I forgot to add the dev version of fftw3 in apt-get), so if you install those two things also before installing the R package it should work out (I'll edit my answer accordingly...) – Daniel Fischer Feb 14 '13 at 08:34
-1

The website you linked talks about a C library, there is nothing about an R code package. You mistakenly assume that R can install any .tar.gz file as an R library. An R library has a very specific structure of files and directories, and the error you get is because the .tar.gz does not adhere to this structure.

Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149
  • Thanks for Your response.... but I have also tried to do that like : install.packages("fftw") but still its not working for me.This command asking to select the mirror.I have selected the mirror also – Saurabh Feb 13 '13 at 11:57
  • Please edit your question with this new information, including the errors you get. – Paul Hiemstra Feb 13 '13 at 12:11
  • @Paul.. As per your suggestion I have made the modification in my question hope Its clear now... – Saurabh Feb 13 '13 at 12:18