[英]Installing R package expm on Heroku
I'm having trouble installing the R package expm on my Heroku instance. 我在Heroku实例上安装R软件包expm时遇到问题。
I get the following errors: 我收到以下错误:
* 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’
I'm using the R buildpack and not sure exactly what's causing the error. 我正在使用R buildpack,不确定是什么引起了错误。
Thanks! 谢谢!
I'm planning on installing a R package a friend wrote, but the package expm which it depends on won't install. 我打算安装一个朋友写的R软件包,但是它依赖的软件包expm不会安装。
From sessionInfo(): 从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
The buildpack installs R using this script: https://github.com/virtualstaticvoid/heroku-buildpack-r/blob/master/support/build-r buildpack使用以下脚本安装R: https : //github.com/virtualstaticvoid/heroku-buildpack-r/blob/master/support/build-r
heroku构建包中存在一个错误,已修复。
I had the same error, for a different reason. 我有相同的错误,原因有所不同。
expm
ships with a expm/src/locale.h
file, that is included from expm.h
, and makes the package include <libintl.h>
if it exists (on a simple system this will probably point to /usr/include/libintl.h
), that will in turn include the standard locale.h
of the C libraries (eg /usr/include/locale.h
). expm
附带一个expm/src/locale.h
文件,该文件包含在expm.h
,并且使该软件包包含<libintl.h>
如果存在)(在简单系统上,它可能指向/usr/include/libintl.h
),它将依次包含C库的标准locale.h
(例如/usr/include/locale.h
)。
But my $CPATH
environment variable had a trailing :
(which it shouldn't) causing the current directory (in this case expm/src/
) to be in the search path for <...>
includes. 但是我的
$CPATH
环境变量有一个尾随:
不应该)导致当前目录(在本例中为expm/src/
)位于<...>
include的搜索路径中。 Thus libintl.h
looped back to expm/src/locale.h
and the standard library locale.h
wasn't actually getting included. 因此,
libintl.h
循环回到了expm/src/locale.h
,而实际上并未包含标准库locale.h
。
The solution was to fix my $CPATH
. 解决的办法是修复我的
$CPATH
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.