我在我的Heroku实例上安装R软件包expm时遇到了问题。
我得到以下错误:
* installing *source* package ‘expm’ ...
** package ‘expm’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/app/vendor/R/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -c R_dgebal.c -o R_dgebal.o
In file included from locale.h:4:0,
from expm.h:10,
from R_dgebal.c:4:
R_dgebal.c: In function ‘ebal_type’:
locale.h:5:19: error: ‘LC_MESSAGES’ undeclared (first use in this function)
#define _(String) dgettext ("expm", String)
^
R_dgebal.c:11:8: note: in expansion of macro ‘_’
error(_("argument type='%s' must be a character string of string length 1"),
^
locale.h:5:19: note: each undeclared identifier is reported only once for each function it appears in
#define _(String) dgettext ("expm", String)
^
R_dgebal.c:11:8: note: in expansion of macro ‘_’
error(_("argument type='%s' must be a character string of string length 1"),
^
R_dgebal.c: In function ‘R_dgebal’:
locale.h:5:19: error: ‘LC_MESSAGES’ undeclared (first use in this function)
#define _(String) dgettext ("expm", String)
^
R_dgebal.c:28:8: note: in expansion of macro ‘_’
error(_("invalid 'x': not a numeric (classical R) matrix"));
^
make: *** [R_dgebal.o] Error 1
ERROR: compilation failed for package ‘expm’
* removing ‘/app/vendor/R/lib/R/library/expm’
ERROR: dependency ‘expm’ is not available for package ‘msm’
* removing ‘/app/vendor/R/lib/R/library/msm’
ERROR: dependency ‘msm’ is not available for package ‘ltm’
* removing ‘/app/vendor/R/lib/R/library/ltm’我使用的是R构建包,不确定是什么导致了错误。
谢谢!
我计划安装一个R包,一个朋友写的,但软件包expm,它所依赖的不会安装。
来自sessionInfo():
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base 构建包使用以下脚本安装R:https://github.com/virtualstaticvoid/heroku-buildpack-r/blob/master/support/build-r
发布于 2015-05-12 18:42:02
heroku构建包中有一个bug,已经修复了。
发布于 2015-04-28 08:30:10
您可以尝试从这里中包含二进制文件。msm包似乎可以作为二进制文件使用。
发布于 2017-10-07 05:36:29
因为不同的原因,我也犯了同样的错误。
expm附带了一个来自expm.h的expm/src/locale.h文件,如果它存在的话,它会使包包含<libintl.h> (在简单的系统上,这可能指向/usr/include/libintl.h),而后者又将包括C库的标准locale.h (例如/usr/include/locale.h)。
但是,我的$CPATH环境变量有一个尾随的: (它不应该这样做),导致当前目录(在本例中是expm/src/)位于<...>包含的搜索路径中。因此,libintl.h返回到expm/src/locale.h,标准库locale.h实际上没有被包括在内。
解决办法是修复我的$CPATH。
https://stackoverflow.com/questions/29908143
复制相似问题