首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >R:在R-4.1.1中从源代码安装GWmodel包时出错

R:在R-4.1.1中从源代码安装GWmodel包时出错
EN

Stack Overflow用户
提问于 2022-11-07 17:03:52
回答 1查看 33关注 0票数 0

我正在尝试从GWmodel网站的源代码安装软件包。运行install_github(lbb220/GWmodel/GWmodel)后,我将收到以下错误:Error: Failed to install 'unknown package' from GitHub: Line starting '<<<<<<< HEAD ...' is malformed!

我想从源代码安装软件包而不使用install.packages("GWmodel")的原因是我想使用parallel.method = "cuda"。在文档中,它说:

在GWR函数中使用CUDA进行高性能计算的要求:要在gwr.basic、bw.gwr和gwr.model.selection中运行GWR(即指定为“cuda”),需要满足以下条件:

至少有一个NVIDIA GPU支持用户计算机上的CUDA。CUDA (>10.2)的环境变量'CUDA_HOME‘设置正确。包应该从源重新构建。-对于Linux用户,如果编辑人员能够检测到CUDA工具包,就会自动生成“GWmodelCUDA”。-对于Windows用户,“GWmodelCUDA.dll”和“GWmodelCUDA.lib”将自动下载;但是,我们建议用户手动构建“GWmodelCUDA”库,以避免一些潜在的未知问题,并为此过程提供了一个“CMakeLists.txt”文件。如果上述任何条件不满足,GWR将无法工作,即使“parallel.method”被指定为“cuda”。

如果我使用install.github()安装它,我将得到我提到的错误。我已经安装了CUDA (>10.2),并正确设置了环境变量'CUDA_HOME‘。

如果我使用install.packages("GWmodel"),就不会有任何错误。我还尝试下载GWmodel.zip并从本地zip文件中安装,但也有相同的错误。

我已经成功地安装了rtools (我使用示例这里测试了它)

我正在使用R.Studio 1.4.1717R 4.1.1Windows 11

我该怎么做呢?

我使用了install_github("lbb220/GWmodel"),虽然我没有收到上面的错误,但是安装仍然不能完成。我现在收到以下信息:

代码语言:javascript
复制
** libs

*** arch - i386
"C:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-41~1.1/include" -DNDEBUG  -I'C:/Program Files/R/R-4.1.1/library/Rcpp/include' -I'C:/Program Files/R/R-4.1.1/library/RcppArmadillo/include'     -ARMA_64BIT_WORD=1 -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c GWmodel.cpp -o GWmodel.o
GWmodel.cpp: In function 'double sp_gcdist(double, double, double, double)':
GWmodel.cpp:764:29: error: 'DOUBLE_EPS' was not declared in this scope
     if (fabs(lat1 - lat2) < DOUBLE_EPS) {
                             ^~~~~~~~~~
GWmodel.cpp:764:29: note: suggested alternative: 'ENABLE_NLS'
     if (fabs(lat1 - lat2) < DOUBLE_EPS) {
                             ^~~~~~~~~~
                             ENABLE_NLS
GWmodel.cpp: In function 'void printMat(arma::mat)':
GWmodel.cpp:1165:16: warning: comparison of integer expressions of different signedness: 'const uword' {aka 'const unsigned int'} and 'int' [-Wsign-compare]
   if (m.n_rows < n)
       ~~~~~~~~~^~~
make: *** [C:/PROGRA~1/R/R-41~1.1/etc/i386/Makeconf:245: GWmodel.o] Error 1
ERROR: compilation failed for package 'GWmodel'
* removing 'C:/Program Files/R/R-4.1.1/library/GWmodel'
Warning message:
In i.p(...) :
  installation of package ‘C:/Users/GEOGRA~1/AppData/Local/Temp/RtmpOwWBPs/file8f43609514d/GWmodel_2.2-0.tar.gz’ had non-zero exit status
EN

回答 1

Stack Overflow用户

发布于 2022-11-07 17:56:14

这是因为您实际上并不是从主存储库安装的。试试install_github(lbb220/GWmodel)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74350268

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档