在Heroku上安装R package expm

时间:2015-04-28 00:16:40

标签: r heroku

我在Heroku实例上安装R package 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 buildpack并且不确定究竟是什么导致了错误。

谢谢!

我打算安装朋友写的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   

buildpack使用以下脚本安装R:https://github.com/virtualstaticvoid/heroku-buildpack-r/blob/master/support/build-r

3 个答案:

答案 0 :(得分:1)

heroku构建包中有一个错误,已修复。

答案 1 :(得分:0)

您可以尝试从here添加二进制文件。 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <master> <list type="array" nil="true"/> </master> 包似乎可以二进制形式提供。

答案 2 :(得分:0)

由于其他原因,我遇到了同样的错误。

expm/src/locale.h附带expm.h文件,该文件包含在<libintl.h>中,并且如果包含/usr/include/libintl.h,则包含locale.h(在简单的系统上,这可能指向到/usr/include/locale.h),这将反过来包括C库的标准$CPATH(例如:)。

但我的expm/src/环境变量有一个尾随<...>(它不应该这样)导致当前目录(在本例中为libintl.h)位于搜索路径中expm/src/locale.h包括。因此,locale.h已回传到$CPATH,标准库false实际上并没有包含在内。

解决方案是修复我的=IF(ISNUMBER(SEARCH("6021",C25)),(Value!$M$4))