在CentOS的fftwtools上安装R软件包需要fftw3

时间:2019-01-07 15:56:37

标签: r centos fftw

我需要安装R软件包fftwtools。我收到此错误消息,这是(我认为)由于R找不到fftw3的库:

> install.packages("fftwtools")
Installing package into ‘/home/renaut/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cran.cnr.berkeley.edu/src/contrib/fftwtools_0.9-8.tar.gz'
Content type 'application/x-gzip' length 142268 bytes (138 KB)
==================================================
downloaded 138 KB

icc -I"/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/Compiler/intel2016.4/r/3.5.0/lib64/R/include" -DNDEBUG   -I/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/imkl/11.3.4.258/mkl/include -I/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/java/1.8.0_121/include   -fpic  -O2 -xCore-AVX2 -ftz -fp-speculation=safe -fp-model source  -c fftwtools.c -o fftwtools.o
icc -I"/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/Compiler/intel2016.4/r/3.5.0/lib64/R/include" -DNDEBUG   -I/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/imkl/11.3.4.258/mkl/include -I/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/java/1.8.0_121/include   -fpic  -O2 -xCore-AVX2 -ftz -fp-speculation=safe -fp-model source  -c fftwtools_init.c -o fftwtools_init.o
icc -shared -L/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/Compiler/intel2016.4/r/3.5.0/lib64/R/lib -L/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/icc/2016.4.258/lib/intel64 -L/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/imkl/11.3.4.258/lib -L/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/imkl/11.3.4.258/mkl/lib/intel64 -L/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/imkl/11.3.4.258/lib -L/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/java/1.8.0_121/lib -o fftwtools.so fftwtools.o fftwtools_init.o -lfftw3 -lm -L/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/Compiler/intel2016.4/r/3.5.0/lib64/R/lib -lR
/cvmfs/soft.computecanada.ca/nix/store/xs99yskj0vhrf6cmn2048i870r8nzqm0-binutils-2.28/bin/ld: cannot find -lfftw3
make: *** [/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/Compiler/intel2016.4/r/3.5.0/lib64/R/share/make/shlib.mk:6: fftwtools.so] Error 1
ERROR: compilation failed for package ‘fftwtools’
* removing ‘/home/renaut/R/x86_64-pc-linux-gnu-library/3.5/fftwtools’

The downloaded source packages are in
    ‘/tmp/RtmpQo1r6g/downloaded_packages’
Warning message:
In install.packages("fftwtools") :
  installation of package ‘fftwtools’ had non-zero exit status

我不知道该如何解决。我已经安装了fftw(从这里:http://fftw.org/fftw3_doc/Installation-on-Unix.html),但是如何检查它是否正确安装或告诉R是库呢?


> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/Compiler/intel2016.4/r/3.5.0/lib64/R/lib/libR.so
LAPACK: /cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/Compiler/intel2016.4/r/3.5.0/lib64/R/modules/lapack.so

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8    
 [5] LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8   
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.0

谢谢!

1 个答案:

答案 0 :(得分:0)

打开终端。然后键入以下命令以安装FFTW3 C ++库:

sudo apt-get install libfftw3-dev libfftw3-doc

然后从CRAN或使用RStudio的Devtools安装fftw3软件包。对我来说很好。