【发布时间】:2015-12-16 05:03:45
【问题描述】:
我正在尝试解决应该在 R 3.2.2 中运行的包似乎对 fftw 的依赖。该软件包的作者声称此依赖项不再存在,但是当我尝试安装该软件包时,我收到以下输出
> install.packages("seewave")
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘seewave’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘seewave’
trying URL 'https://cran.rstudio.com/src/contrib/seewave_2.0.2.tar.gz'
Content type 'application/x-gzip' length 2485930 bytes (2.4 MB)
==================================================
downloaded 2.4 MB
* installing *source* package ‘seewave’ ...
** package ‘seewave’ successfully unpacked and MD5 sums checked
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG
-I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include
-fPIC -Wall -mtune=core2 -g -O2 -c stft.c -o stft.o
stft.c:44:6: warning: unused variable 'i' [-Wunused-variable]
int i = 0;
^
1 warning generated.
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
-L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib
-o seewave.so stft.o -lfftw3 -lsndfile
-F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: library not found for -lfftw3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [seewave.so] Error 1
ERROR: compilation failed for package ‘seewave’
* removing /Library/Frameworks/R.framework/Versions/3.2/Resources/library/seewave’
Warning in install.packages :
installation of package ‘seewave’ had non-zero exit status
名为 fftw 的包已经在 R 中,版本为 1.0.3。但是,当我进入终端并键入以下命令时,我收到一个输出,指出 fftw 缺少“链接”
$ brew install fftw
Warning: fftw-3.3.4_1 already installed, it's just not linked
有趣(或愚蠢),在一个肯定不正确的路径中有一个 fftw3 文件夹,但没有 fftw3.3.4_1 的路径
/Users/mario/fftw-3.3.3
我怎样才能建立正确的链接并解决问题?
提前致谢
【问题讨论】:
-
@WhiteViking NO,
sudo永远不需要brew link! -
@IKavanagh 您提供了一个很好且详细的答案。我删除了关于
sudo brew link的错误评论。谢谢指正。
标签: r osx-yosemite fftw