Cannot build XGBoost for R with GPU on Windows10

I cannot build XGBoost for R with GPU support on Windows10.

Here are the steps I took on 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 12 2013 Win64" -DUSE_CUDA=ON -DR_LIB=ON

CMakeError.log

Determining if the function clock_gettime exists in the rt failed with the following output:
Change Dir: C:/Users/aantico/Desktop/xgboost/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe cmTC_64da3.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=12.0 /v:m && Microsoft ® Build Engine version 12.0.31010.0

[Microsoft .NET Framework, version 4.0.30319.42000]

Copyright © Microsoft Corporation. All rights reserved.

Microsoft ® C/C++ Optimizing Compiler Version 18.00.40629 for x64

Copyright © Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D CHECK_FUNCTION_EXISTS=clock_gettime /D “CMAKE_INTDIR=“Debug”” /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_64da3.dir\Debug\" /Fd"cmTC_64da3.dir\Debug\vc120.pdb" /Gd /TC /errorReport:queue “C:\Program Files\CMake\share\cmake-3.15\Modules\CheckFunctionExists.c”

CheckFunctionExists.c

LINK : fatal error LNK1104: cannot open file ‘rt.lib’ [C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\cmTC_64da3.vcxproj]

Determining if the fopen64 exist failed with the following output:
Change Dir: C:/Users/aantico/Desktop/xgboost/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe cmTC_de054.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=12.0 /v:m && Microsoft ® Build Engine version 12.0.31010.0

[Microsoft .NET Framework, version 4.0.30319.42000]

Copyright © Microsoft Corporation. All rights reserved.

Microsoft ® C/C++ Optimizing Compiler Version 18.00.40629 for x64

Copyright © Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D “CMAKE_INTDIR=“Debug”” /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_de054.dir\Debug\" /Fd"cmTC_de054.dir\Debug\vc120.pdb" /Gd /TC /errorReport:queue C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c

CheckSymbolExists.c

C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c(8): error C2065: ‘fopen64’ : undeclared identifier [C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\cmTC_de054.vcxproj]

File C:/Users/aantico/Desktop/xgboost/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <stdio.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef fopen64
return ((int*)(&fopen64))[argc];
#else
(void)argc;
return 0;
#endif
}

Determining if the include file cxxabi.h exists failed with the following output:
Change Dir: C:/Users/aantico/Desktop/xgboost/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe cmTC_90cd0.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=12.0 /v:m && Microsoft ® Build Engine version 12.0.31010.0

[Microsoft .NET Framework, version 4.0.30319.42000]

Copyright © Microsoft Corporation. All rights reserved.

Microsoft ® C/C++ Optimizing Compiler Version 18.00.40629 for x64

Copyright © Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D “CMAKE_INTDIR=“Debug”” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTC_90cd0.dir\Debug\" /Fd"cmTC_90cd0.dir\Debug\vc120.pdb" /Gd /TP /errorReport:queue C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\CheckIncludeFile.cxx

CheckIncludeFile.cxx

C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\CheckIncludeFile.cxx(1): fatal error C1083: Cannot open include file: ‘cxxabi.h’: No such file or directory [C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\cmTC_90cd0.vcxproj]

Determining if the nanosleep exist failed with the following output:
Change Dir: C:/Users/aantico/Desktop/xgboost/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe cmTC_1cb52.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=12.0 /v:m && Microsoft ® Build Engine version 12.0.31010.0

[Microsoft .NET Framework, version 4.0.30319.42000]

Copyright © Microsoft Corporation. All rights reserved.

Microsoft ® C/C++ Optimizing Compiler Version 18.00.40629 for x64

Copyright © Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D “CMAKE_INTDIR=“Debug”” /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_1cb52.dir\Debug\" /Fd"cmTC_1cb52.dir\Debug\vc120.pdb" /Gd /TC /errorReport:queue C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c

CheckSymbolExists.c

C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c(8): error C2065: ‘nanosleep’ : undeclared identifier [C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\cmTC_1cb52.vcxproj]

File C:/Users/aantico/Desktop/xgboost/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <time.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef nanosleep
return ((int*)(&nanosleep))[argc];
#else
(void)argc;
return 0;
#endif
}

Determining if the backtrace exist failed with the following output:
Change Dir: C:/Users/aantico/Desktop/xgboost/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe cmTC_cb99c.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=12.0 /v:m && Microsoft ® Build Engine version 12.0.31010.0

[Microsoft .NET Framework, version 4.0.30319.42000]

Copyright © Microsoft Corporation. All rights reserved.

Microsoft ® C/C++ Optimizing Compiler Version 18.00.40629 for x64

Copyright © Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D “CMAKE_INTDIR=“Debug”” /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_cb99c.dir\Debug\" /Fd"cmTC_cb99c.dir\Debug\vc120.pdb" /Gd /TC /errorReport:queue C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c

CheckSymbolExists.c

C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c(2): fatal error C1083: Cannot open include file: ‘execinfo.h’: No such file or directory [C:\Users\aantico\Desktop\xgboost\build\CMakeFiles\CMakeTmp\cmTC_cb99c.vcxproj]

File C:/Users/aantico/Desktop/xgboost/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <execinfo.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef backtrace
return ((int*)(&backtrace))[argc];
#else
(void)argc;
return 0;
#endif
}

It seems like you are using an old version of Visual Studio (2013). Can you use 2015 or later?