简体   繁体   English

在R中安装ggp​​lot2 / digest时出错

[英]error installing ggplot2/digest in R

I receive the following error after trying to install ggplot2 which in turn tries to install digest . 我在尝试安装ggplot2后收到以下错误,该错误又试图安装digest The session info is pasted below. 会话信息粘贴在下面。

sha2.c(88): catastrophic error: #error directive: Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN
#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN

Has anyone encountered this before? 有人遇到过吗?

> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8            LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                  LC_ADDRESS=C                   LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] kernlab_0.9-18   xts_0.9-3        lmtest_0.9-31    sandwich_2.2-10  reshape2_1.2.2   plyr_1.8             zoo_1.7-9        data.table_1.8.8

loaded via a namespace (and not attached):
[1] grid_2.15.2     lattice_0.20-13 stringr_0.6.2   tcltk_2.15.2    tools_2.15.2 

I encountered this and it appears that it happens because your OS headers don't define BYTE_ORDER. 我遇到了这种情况,似乎是因为您的OS标头未定义BYTE_ORDER而发生。 I don't know what Linux distributions omit this, but I solved this by doing 我不知道什么Linux发行版忽略了这一点,但是我通过这样做解决了

$ wget http://cran.stat.ucla.edu/src/contrib/digest_0.6.3.tar.gz
$ tar zxvf digest_0.6.3.tar.gz

Then edit digest/src/sha2.c and stick the following line in there near the top: 然后编辑digest / src / sha2.c,并将以下行粘贴在顶部附近:

#define BYTE_ORDER LITTLE_ENDIAN

(this is assuming your machine is, in fact, little endian; Intel/AMD processors fall into this category). (这实际上是假设您的计算机为低端字节序; Intel / AMD处理器属于此类)。 Then 然后

R CMD INSTALL digest
* installing to library ‘/N/u/glock/sierra/R/lib64/R/library’
* installing *source* package ‘digest’ ...
file ‘src/sha2.c’ has the wrong MD5 checksum

The wrong MD5 checksum is harmless. 错误的MD5校验和是无害的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM