无法在Windows 7上安装具有GPU支持的R XGBoost [英] Fail to install R XGBoost with GPU support on Windows 7

查看:60
本文介绍了无法在Windows 7上安装具有GPU支持的R XGBoost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Windows 7的R中安装具有GPU支持的XGBoost.我在这里遵循了安装指南(

I tried to install XGBoost with GPU support in R on Windows 7. I followed the installation guide here (http://xgboost.readthedocs.io/en/latest/build.html#installing-r-package-with-gpu-support) and was all fine until the last step. I have spent past few days on searching and could not find solutions. Can somebody please help me?

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

This was the procedure I followed, in 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

在最后一步找到以下错误

Got below errors at the last step

"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 ),则没有错误.但是,我不知道从这里应该怎么做.如果我只是做这样的事情:

If I executed this instead (cmake --build . --target xgboost --config Release), there was no error. However, I have no clue what I should do from here. If I simply do something like this:

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

它以另一个不同的错误结尾,如下所示.我不知道我做错了什么,非常感谢您的帮助.提前非常感谢您!

It ended with a different error like below. I do not know what I did wrong, would really appreciate your help. Thank you very much in advance!

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包含以下两项,然后问题已解决.

Never mind, I found out the reason. It was related to my Rtools setup. I reinstalled it and make sure the PATH has following two items, then problem solved.

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

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

这篇关于无法在Windows 7上安装具有GPU支持的R XGBoost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆