无法在 Windows 7 上安装支持 GPU 的 R XGBoost

2024-02-27

我尝试在 Windows 7 上的 R 中安装具有 GPU 支持的 XGBoost。我按照此处的安装指南进行操作(http://xgboost.readthedocs.io/en/latest/build.html#installing-r-package-with-gpu-support http://xgboost.readthedocs.io/en/latest/build.html#installing-r-package-with-gpu-support)直到最后一步一切都很好。我花了几天时间进行搜索,但找不到解决方案。有人能帮帮我吗?

这是我在 Git Bash 中遵循的过程:

git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init
git submodule update
mkdir build
cd build
cmake .. -G"Visual Studio 14 2015 Win64" -DUSE_CUDA=ON -DR_LIB=ON -DLIBR_EXECUTABLE="C:/Program Files/R/R-3.4.1/bin/x64/R.exe"
cmake --build . --target install --config Release

最后一步出现以下错误

"C:\Users\geng\xgboost\build\install.vcxproj" (default target) (1) ->
(PostBuildEvent target) ->
  EXEC : warning : running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-
34~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-34~1.2/share/make/winshlib.mk" SHL
IB="xgboost.dll" WIN=64 TCLBIN=64 OBJECTS=""' had status 127 [C:\Users\geng\xgb
oost\build\install.vcxproj]


"C:\Users\geng\xgboost\build\install.vcxproj" (default target) (1) ->
(PostBuildEvent target) ->
  EXEC : error : compilation failed for package 'xgboost' [C:\Users\geng\xgboos
t\build\install.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.ta
rgets(133,5): error MSB3073: The command "setlocal\r [C:\Users\geng\xgboost\bui
ld\install.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(133,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=
Release -P cmake_install.cmake\r [C:\Users\geng\xgboost\build\install.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(133,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd\r [C:\Users\geng\x
gboost\build\install.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(133,5): error MSB3073: :cmEnd\r [C:\Users\geng\xgboost\build\install.vcxpro
j]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(133,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :c
mDone\r [C:\Users\geng\xgboost\build\install.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(133,5): error MSB3073: :cmErrorLevel\r [C:\Users\geng\xgboost\build\install
.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(133,5): error MSB3073: exit /b %1\r [C:\Users\geng\xgboost\build\install.vc
xproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(133,5): error MSB3073: :cmDone\r [C:\Users\geng\xgboost\build\install.vcxpr
oj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(133,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd\r [C:\Users\geng\x
gboost\build\install.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(133,5): error MSB3073: :VCEnd" exited with code -1. [C:\Users\geng\xgboost\
build\install.vcxproj]

    166 Warning(s)
    2 Error(s)

如果我执行这个(cmake --build . --target xgboost --config Release),没有错误。但是,我不知道从这里我应该做什么。如果我只是做这样的事情:

cd R-package
"C:/Program Files/R/R-3.4.2/bin/R.exe" CMD INSTALL .

它以如下所示的不同错误结束。我不知道我做错了什么,非常感谢您的帮助。预先非常感谢您!

geng@g20user MINGW64 ~/xgboost/build/R-package (master)
$ "C:/Program Files/R/R-3.4.2/bin/R.exe" CMD INSTALL .
* installing to library 'C:/Users/geng/Documents/R/win-library/3.4'
* installing *source* package 'xgboost' ...
** libs

*** arch - i386
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-34~1.2/etc/
i386/Makeconf" -f "C:/PROGRA~1/R/R-34~1.2/share/make/winshlib.mk" SHLIB="xgboost
.dll" OBJECTS=""' had status 127
ERROR: compilation failed for package 'xgboost'
* removing 'C:/Users/geng/Documents/R/win-library/3.4/xgboost'

没关系,我已经找到原因了。这与我的 Rtools 设置有关。我重新安装它并确保 PATH 有以下两项,然后问题解决。

c:\Rtools\bin;c:\Rtools\mingw_64\bin

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法在 Windows 7 上安装支持 GPU 的 R XGBoost 的相关文章

  • 为什么 data.table `:=` 的 knit 缓存失败?

    这在精神上与this https stackoverflow com q 15267018 1900520问题 但机制上一定不同 如果您尝试缓存knitr包含一个块data table 分配然后它的行为就好像该块尚未运行 并且后面的块看不到
  • 将 r 数据框中的列字符串转换为数字

    我有一个数据框 其中有一列字符串 如下所示 mydata lt c 1 356670 35 355030 1 356670 35 355030 1 356620 35 355890 1 356930 35 358660 1 357000 3
  • 使用 X11 窗口的 R 脚本仅打开一秒钟

    我正在通过 Linux Mint 16 命令行运行 R 脚本 它包含我想在窗口中显示的箱线图 所以我使用 x11 函数来创建该窗口 这是我的代码 testdata lt data frame sample 1 1000 size 100 r
  • 向图像添加坐标,以用作 R 中的 Leaflet、Shiny 和 Shinydashboard 包中的地图

    我计划使用 Leaflet Shiny 和 Shinydashboard 沿着以下很棒的路线创建一个带有医院 OHS 事件标记的交互式地图交互式地图和直方图模板 http shiny rstudio com gallery superzip
  • R中的不定积分

    我正在计算方程的不定积分 我将加速度计的数据通过可视化 C 程序输入到 R 中 然后就可以很简单地得出一个方程来表示加速度曲线 这一切都很好 但是我还需要计算撞击速度 根据我在高中时代的理解 我的加速度曲线的不定积分将产生速度方程 我知道执
  • 在 R 中使用 gsub 删除尾随空格[重复]

    这个问题在这里已经有答案了 有没有人有一个技巧可以用 gsub 删除变量上的尾随空格 以下是我的数据示例 正如您所看到的 我在变量中同时包含尾随空格和嵌入空格 county lt c mississippi mississippi cany
  • 绘制具有数据子集的图层时,因子水平的顺序会发生变化

    我试图控制图例中项目的顺序ggplot2我查找了其他一些类似的问题 并发现了如何更改我正在绘制的因子变量的水平顺序 我正在绘制 12 月 1 月 7 月和 6 月 4 个月的数据 如果我只对所有月份执行一个绘图命令 它会按预期工作 图例中排
  • Rstudio 命令历史记录

    这些天我经常使用 Rstudio 但最近注意到我的命令不再存储在历史记录中 我不知道这是从什么时候开始的 但可能是在安装最新版本时发生的 关于问题可能是什么的任何想法吗 Thanks 这是我们在 v0 93 73 中引入并在 v0 93 7
  • 如何加速 R for 循环?

    我正在为 R 中 GWmodel 包中的 gwr basic 函数运行以下 for 循环 我需要做的是收集任何给定带宽的估计参数的平均值 代码如下 library GWmodel data DubVoter Dub voter LARent
  • S4 类 [(子集)带有附加参数的继承

    这是一个扩展在 R 中的访问器函数中使用 callNextMethod https stackoverflow com q 24875284 2752888 2017 03 25 更新 为了说明如何仅在加载方法时失败 但在构建的包中时不会失
  • 无重叠的抖动点

    My data a lt sample 1 5 100 replace TRUE b lt sample 1 5 100 replace TRUE c lt sample 1 10 100 replace TRUE d lt sample
  • 字边界正则表达式问题

    我在使用单词边界时遇到问题 b在我的正则表达式中 我正在使用 R 但当我尝试时问题也存在http regexr com http regexr com 我使用的模式是 bs l b 虽然我预计下面的第 1 行和第 3 行能够匹配此模式 但只
  • 列槽不足

    当尝试为 data table 中的每个变量 108 个变量 创建 12 个滞后时 我收到一条错误 指出列槽不足 此操作应创建大约 1200 个变量或列 Data A as data table Datos A Varnames names
  • 了解用于处理色边距的scale_fill_continuous_divergingx参数输入

    这个问题是我上一个问题的延续here https stackoverflow com questions 58718527 setting midpoint for continuous diverging color scale on a
  • lmer(来自 R 包 lme4)如何计算对数似然?

    我试图理解 lmer 函数 我发现了很多关于如何使用该命令的信息 但关于它实际执行的操作的信息却很少 除了这里的一些神秘注释 http www bioconductor org help course materials 2008 PHSI
  • grid.arrange 中的错误 -rangeGrob() 函数

    我有两个图 p1 和 p2 我试图使用 grid arrage 绘制它们 我的代码如下所示 grid arrange p1 p2 ncol 2 top textGrob Distribution across each day of the
  • R 中的 as.numeric 有什么问题? [复制]

    这个问题在这里已经有答案了 gt X864291X8X74 1 8 0000000000 9 0000000000 10 0000000000 6 0000000000 8 0000000000 10 Levels 0 0000000000
  • R-在多个图的外缘绘制居中图例

    我想在具有多个绘图的设备中的绘图区域之外绘制居中图例 SO 中提出了许多关于更改 R 图中图例位置的问题 略有不同 例如 1 R 组合图的通用标题和图例 https stackoverflow com questions 8736966 r
  • 使用 stargazer 分析包含时间序列的数据帧

    我有一个面板数据集共 10 个观测值和 3 个变量 观测值 30 的数量 10 行 国家 地区 2 列 迁移参数 相应年份的 1 列 可以这么说 我的数据框由 3 个年度数据框组成 我该如何申请观星者考虑到它是一个面板数据集 所以最大 N
  • 有没有一种简单的方法可以根据多个标准进行排名,从而保留 R 中的联系?

    当单个标准排序良好时 rank 函数会返回明显的结果 rank c 2 4 1 3 5 1 2 4 1 3 5 当单个标准具有联系时 排名函数 默认情况下 将平均排名分配给联系 rank c 2 4 1 1 5 1 3 0 4 0 1 5

随机推荐