RcppArmadillo Compile Errors on OS X Mavericks

匆匆过客 提交于 2019-11-29 07:11:33
Kevin Ushey

EDIT: If you're a Homebrew user, you now instead need to use brew install gcc (gfortran is no longer provided separate of gcc), and you can then follow the instructions here to get set up.


You have to symlink the libraries to /usr/local/lib manually:

ln -s /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/libgfortran.* /usr/local/lib/

I thought brew link gfortran would handle this, but apparently it only symlinks the gfortran program and not the actual libraries. So, unfortunately, you have to do it yourself.

(Replace 4.8.2 with whichever version of gfortran you're using from homebrew.)


Alternatively, if you want to keep from modifying /usr/local/lib, you can use

FLIBS=-L/usr/local/Cellar/gfortran/4.8.2/gfortran

in your ~/.R/Makevars file instead, so R knows where to find the gfortran libraries.

I can only suggest you study the numerous threads on the r-sig-mac list, the different answers here on SO as well as the posts on the rcpp-devel list.

As your error comes from the failed Fortran linking, maybe also review the standard page by Simon U. as well as the tools page it points too. AFAIK you should use the (older) gfortran 4.2.* from that page with R -- but then I am not an OS X user.

Edit in late 2016: We now have more detailed instructions in section 2.16 of the Rcpp FAQ.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!