RDieHarder包:安装错误

时间:2017-12-13 17:33:40

标签: r

我在为R ver安装 RDieHarder 包时遇到问题。 3.3。在Windows 10上。 我收到了一个错误:

 Installing package into ‘C:/Users/Student/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of C/C++/Fortran:
  ‘RDieHarder’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘RDieHarder’

trying URL 'https://cran.rstudio.com/src/contrib/RDieHarder_0.1.3.tar.gz'
Content type 'application/x-gzip' length 390268 bytes (381 KB)
downloaded 381 KB

* installing *source* package 'RDieHarder' ...
** pakiet 'RDieHarder' został pomyślnie rozpakowany oraz sumy MD5 zostały sprawdzone

   **********************************************
   WARNING: this package has a configure script
         It probably needs manual configuration
   **********************************************


** libs
c:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-33~1.1/include" -DNDEBUG     -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c add_ui_rngs.c -o add_ui_rngs.o
In file included from add_ui_rngs.c:7:0:
dieharder.h:24:25: fatal error: gsl/gsl_rng.h: No such file or directory
 #include <gsl/gsl_rng.h>
                         ^
compilation terminated.
make: *** [add_ui_rngs.o] Error 1
Ostrzeżenie: uruchomione polecenie 'make -f "C:/PROGRA~1/R/R-33~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.1/share/make/winshlib.mk" SHLIB="RDieHarder.dll" WIN=64 TCLBIN=64 OBJECTS="add_ui_rngs.o choose_rng.o dieharder.o dieharder_exit.o help.o list_rand.o list_rngs.o list_tests.o output.o output_rnds.o parsecl.o rng_empty_random.o run_all_tests.o run_test.o startup.o time_rng.o user_template.o"' otrzymało status 2
ERROR: compilation failed for package 'RDieHarder'
* removing 'C:/Users/Student/Documents/R/win-library/3.3/RDieHarder'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\Student\Documents\R\win-library\3.3" C:\Users\Student\AppData\Local\Temp\RtmpQ1UTXT/downloaded_packages/RDieHarder_0.1.3.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘RDieHarder’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\Student\AppData\Local\Temp\RtmpQ1UTXT\downloaded_packages’

我真的不知道是什么问题。我做了很多次。但对于这个包标准安装不起作用。我是这样做的:

install.packages("RDieHarder")

我也尝试从下载文件安装它,但它没有改变任何东西。

2 个答案:

答案 0 :(得分:0)

似乎没有安装GSL库,根据description on CRAN需要RDieHarder包:

  

SystemRequirements:来自http://www.phy.duke.edu/~rgb/General/dieharder.php的DieHarder库(&gt; = 3.31.1),用于GSL随机数生成器的GNU GSL

安装GSL library应删除该错误。

答案 1 :(得分:0)

如警告消息中所述,您可能需要使用configure.args中的install.packages

手动指定DieHarder软件的位置

更多信息请检查: http://r.789695.n4.nabble.com/having-trouble-installing-RDieHarder-td4670295.html

<强> [编辑]

方法1:

由于我的电脑上没有安装DieHard,下面的代码只是一个示例,说明如何使用configure.args

从安装了DieHard的文件夹中:

  1. 必须有一个子文件夹,您可以在其中找到.dll文件,让我们将路径命名为path1,然后
  2. 另一个子文件夹,你可以在其中找到一些.h文件,让我们将路径命名为path2。
  3. 在R中你需要这样的东西:

    install.packages(“RDieHarder”,configure.args =“ - with-dieharder-include = path2 --with-dieharder-libdir = path1”)

  4. 方法2:

    这个方法在写下上面可能的答案时跳入了我的脑海。安装DieHard后,系统环境变量PATH可能已安装软件位置。但它可能不包括上面提到的path1和path2。尝试将path1和path2添加到PATH环境变量,然后:

    install.packages("RDieHarder")