Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 尝试使用RTools在R4.0上安装程序包时出现编译错误_C++_R_Compiler Errors_Installation - Fatal编程技术网

C++ 尝试使用RTools在R4.0上安装程序包时出现编译错误

C++ 尝试使用RTools在R4.0上安装程序包时出现编译错误,c++,r,compiler-errors,installation,C++,R,Compiler Errors,Installation,我需要安装软件包“yags”以适应GEEs。但是,我在安装过程中遇到了问题:代码返回了一个错误。我使用的是R版本4.0.0 2020-04-24,平台:x86_64-w64-mingw32/x64 64位,还安装了最新版本的RStudio和RTools install.packages("yags", repos="http://R-Forge.R-project.org", type="source") 错误是: ** using staged installation ** libs *

我需要安装软件包“yags”以适应GEEs。但是,我在安装过程中遇到了问题:代码返回了一个错误。我使用的是R版本4.0.0 2020-04-24,平台:x86_64-w64-mingw32/x64 64位,还安装了最新版本的RStudio和RTools

install.packages("yags", repos="http://R-Forge.R-project.org", type="source")
错误是:

** using staged installation
** libs

*** arch - i386
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG          -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c yags.cc -o yags.o
yags.cc:2476:2: warning: "/*" within comment [-Wcomment]
  /* extern "C" {

yags.cc:2477:2: warning: "/*" within comment [-Wcomment]
  /* void democc( int* n, double* xin, double* xout )

yags.cc:2478:2: warning: "/*" within comment [-Wcomment]
  /*  {

yags.cc:2479:2: warning: "/*" within comment [-Wcomment]
  /*  matrix dumtim = transp(make_row(0.0,2.0,4.0,6.0));

yags.cc:2480:2: warning: "/*" within comment [-Wcomment]
  /*  matrix Xin = from_S(xin, *n, *n);

yags.cc:2481:2: warning: "/*" within comment [-Wcomment]
  /*  //set_el(Xin,0,0) = 491.3626;

yags.cc:2482:2: warning: "/*" within comment [-Wcomment]
  /*  matrix Z = LDLt(Xin);

yags.cc:2483:2: warning: "/*" within comment [-Wcomment]
  /*  //to_S(form_diag(extract_diag(Z)),xout);

yags.cc:2484:2: warning: "/*" within comment [-Wcomment]
  /*  //to_S(lowutri(Z),xout);

yags.cc:2485:2: warning: "/*" within comment [-Wcomment]
  /*  //matrix Ri = exinv(mat11(.5),3,mat11(0.));

yags.cc:2486:2: warning: "/*" within comment [-Wcomment]
  /*  matrix Ri = fominv(mat11(.5),4,dumtim);

yags.cc:2487:2: warning: "/*" within comment [-Wcomment]
  /*  matrix ZZ = diffL( exinv, mat11(.33333) , 4, dumtim, 0.000001 );

yags.cc:2488:2: warning: "/*" within comment [-Wcomment]
  /*

yags.cc:2489:2: warning: "/*" within comment [-Wcomment]
  /* GetUjStruc( dB, JJ, BB, fominv, mat11(.33333), 4, dumtim, .000001 )

yags.cc:2490:2: warning: "/*" within comment [-Wcomment]
  /*

yags.cc:2491:2: warning: "/*" within comment [-Wcomment]
  /*  to_S(JJ,xout);

yags.cc:2492:2: warning: "/*" within comment [-Wcomment]
  /*  }

yags.cc:2493:2: warning: "/*" within comment [-Wcomment]
  /* }  */

yags.cc: In function 'matrix transp(matrix)':
yags.cc:196:10: warning: variable 'look' set but not used [-Wunused-but-set-variable]
  double *look, *load;
          ^~~~
yags.cc: In function 'matrix operator/(matrix&, matrix&)':
yags.cc:472:7: warning: unused variable 'a2c' [-Wunused-variable]
   int a2c = arg2.cols();
       ^~~
yags.cc: In function 'matrix delete_col(matrix, int)':
yags.cc:558:6: warning: unused variable 'ncop' [-Wunused-variable]
  int ncop, nresel, skip;
      ^~~~
yags.cc:558:12: warning: unused variable 'nresel' [-Wunused-variable]
  int ncop, nresel, skip;
            ^~~~~~
yags.cc:558:20: warning: unused variable 'skip' [-Wunused-variable]
  int ncop, nresel, skip;
                    ^~~~
yags.cc:559:10: warning: unused variable 'resbase' [-Wunused-variable]
  double *resbase, *Xbase;
          ^~~~~~~
yags.cc:559:20: warning: unused variable 'Xbase' [-Wunused-variable]
  double *resbase, *Xbase;
                    ^~~~~
yags.cc: In function 'int split(matrix&, matrix&, matrix*)':
yags.cc:1223:12: warning: unused variable 'j' [-Wunused-variable]
  int i=0 , j=0 , k=0, start=0, end=0, len=1;
            ^
yags.cc: In function 'matrix* split(matrix&, matrix&)':
yags.cc:1258:12: warning: unused variable 'j' [-Wunused-variable]
  int i=0 , j=0 , k=0, start=0, end=0, len=1;
            ^
yags.cc: In function 'matrix mult_like_S(matrix, matrix)':
yags.cc:1576:11: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   if (nc1 == 1 & nc2 >= 1) { NC = nc2; confto2 = 1; }
       ~~~~^~~~
yags.cc:1577:16: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   else if (nc2 == 1 & nc1 >=1 ) {NC = nc1; confto2 = 0; }
            ~~~~^~~~
yags.cc: In function 'matrix UJ_equi_eval(matrix, matrix, matrix, double, int, matrix)':
yags.cc:2055:11: warning: unused variable 'rho' [-Wunused-variable]
    double rho = alpin.el(0,0);
           ^~~
yags.cc:2057:11: warning: unused variable 'dUdr' [-Wunused-variable]
    double dUdr = 0.;
           ^~~~
yags.cc: In function 'void yags_engine(int*, int*, int*, double*, double*, double*, double*, double*, double*, int*, double*, int*, int*, double*, double*, double*, double*, double*, double*, double*, double*, double*, int*, int*, double*, double*, int*, double*, double*, double*, double*, double*, double*, int*)':
yags.cc:2220:18: error: overloaded function with no contextual type information
     mu = (void *)exp;
                  ^~~
yags.cc:2221:24: error: overloaded function with no contextual type information
     dmu_deta = (void *)exp;
                        ^~~
yags.cc:2232:18: error: overloaded function with no contextual type information
     mu = (void *)exp;
                  ^~~
yags.cc:2233:24: error: overloaded function with no contextual type information
     dmu_deta = (void *)exp;
                        ^~~
yags.cc:2250:18: error: overloaded function with no contextual type information
     mu = (void *)exp;
                  ^~~
yags.cc:2251:24: error: overloaded function with no contextual type information
     dmu_deta = (void *)exp;
                        ^~~
yags.cc:2256:18: error: overloaded function with no contextual type information
     mu = (void *)exp;
                  ^~~
yags.cc:2257:24: error: overloaded function with no contextual type information
     dmu_deta = (void *)exp;
                        ^~~
yags.cc:2360:15: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
    while (del > *tol & iter < *maxiter )
           ~~~~^~~~~~
yags.cc:2370:18: warning: suggest parentheses around comparison in operand of '|' [-Wparentheses]
     if (*corcode == UJ_equimart | *fixscale == 1) phi = 1.0;
         ~~~~~~~~~^~~~~~~~~~~~~~
yags.cc:2334:8: warning: unused variable 'cc' [-Wunused-variable]
    int cc = Xin.cols();
        ^~
yags.cc:2275:12: warning: unused variable 'User_cor' [-Wunused-variable]
  const int User_cor = 9;
            ^~~~~~~~
yags.cc:2206:9: warning: statement will never be executed [-Wswitch-unreachable]
   printf("famco %d\n", *famcode);
   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [C:/PROGRA~1/R/R-40~1.0/etc/i386/Makeconf:227: yags.o] Error 1
ERROR: compilation failed for package 'yags'
* removing 'C:/Users/Morgane/Documents/R/win-library/4.0/yags'
Warning in install.packages :
  installation of package ‘yags’ had non-zero exit status

错误:

(as ‘lib’ is unspecified)
trying URL 'https://cran.r-project.org/src/contrib/Archive/multicore/multicore_0.1-1.tar.gz'
Content type 'application/x-gzip' length 12497 bytes (12 KB)
downloaded 12 KB

* installing *source* package 'multicore' ...
** using staged installation
** libs

*** arch - i386
"C:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG          -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c fork.c -o fork.o
fork.c:13:10: fatal error: sys/select.h: No such file or directory
 #include <sys/select.h>
          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-40~1.0/etc/i386/Makeconf:222: fork.o] Error 1
ERROR: compilation failed for package 'multicore'
* removing 'C:/Users/Morgane/Documents/R/win-library/4.0/multicore'
Warning in install.packages :
  installation of package ‘C:/Users/Morgane/AppData/Local/Temp/Rtmp2rFgVC/downloaded_packages/multicore_0.1-1.tar.gz’ had non-zero exit status

这两个软件包不再是标准的R软件包,因此不能保证最终用户可以安装它们。R-Forge是一个开发服务器,包多核已存档。CRAN转而使用包并行。由于parallel是一个基本软件包,它已经存在,不需要安装

然后,让我们转到包yags:查看我们发现的R-Forge

Version: 6.1-13 | Last change: 2011-04-27 05:07:10+02
所以它似乎已经过时了。因此,我建议您联系原始软件包的作者,或者寻找替代方案,可能是更近期的实现,例如rjags,或者在网上搜索gee R cran或jags R.

更新 保留最初的问题,以防任何人遇到相同的问题

我联系了yags软件包的作者,并从GitHub而不是R-Forge存储库安装了它:


devtools::install_gitubvjcitn/yags

感谢您的回答。我想特别使用它们的原因是,我试图使用一些论文2011、2016、2017中先前描述的方法来分析我的数据。但我会尝试寻找一些替代方法:好的,然后你可以考虑问作者或者获取历史工具的填充集,包括R本身。所有这些都还在,太好了!非常感谢。
Version: 6.1-13 | Last change: 2011-04-27 05:07:10+02