【发布时间】:2011-11-30 20:57:32
【问题描述】:
我正在尝试在 Mac 上安装 rpostgresql。我希望能够使用 IP 地址连接到服务器并将数据读入数据帧。我从 CRAN 下载了包,然后运行了以下行:
install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
这开始编译包,但导致以下错误消息:
> install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
inferring 'repos = NULL' from the file name
* installing *source* package ‘RPostgreSQL’ ...
** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for pg_config... /usr/bin/pg_config
checking for "/usr/include/libpq-fe.h"... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
*** arch - x86_64
gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/usr/include -I/usr/local/include -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o
make: gcc-4.2: No such file or directory
make: *** [RS-DBI.o] Error 1
ERROR: compilation failed for package ‘RPostgreSQL’
* removing ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RPostgreSQL’
Warning in install.packages :
installation of package ‘/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz’ had non-zero exit status
我已经查看了 rpostgresql 网页上的建议(1、2),但很多建议已经超过一年了,所以我认为可能有更多关于如何安装这个包的建议。
【问题讨论】:
-
GCC 不再包含在 Xcode 4.2 中,这就是失败的原因。我不确定这种情况下的解决方法是什么,最好联系 RPostreSQL 开发人员。
-
@DWin GCC 不再包含在 Xcode 中?是的。您链接到的文章也说明了这一点。
标签: macos r installation osx-lion