第一步:安裝依賴
準(zhǔn)備
- 運(yùn)行中輸入
cmd
啟動(dòng)命令行 - 命令行中執(zhí)行
mkdir C:\xmr-stak-dep
Visual Studio 2017 Community
- 下載 VS2017 Community并安裝
- 安裝過(guò)程中選擇如下組件
-
Desktop development with C++
(left side) -
VC++ 2015.3 v140 toolset for desktop
(right side)
-
64位CMake
- 下載安裝最新版cmake
- 通過(guò)測(cè)試的版本: cmake 3.9
- 安裝過(guò)程中選擇選項(xiàng)
Add CMake to the system PATH for all users
(注:VS2017中也帶了CMake奏纪,但沒(méi)加入Path闯睹,在C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe
,可直接使用)
Cuda 8.0+ (only needed to use NVIDIA GPUs)
- donwload and install https://developer.nvidia.com/cuda-downloads
- for minimal install choose
Custom installation options
during the install and select- CUDA/Develpment
- CUDA/Visual Studio Integration (ignore the warning during the install that VS2017 is not supported)
- CUDA/Runtime
- Driver components
AMD APP SDK 3.0 (僅在AMD GPU上需要)
Dependencies OpenSSL/Hwloc and Microhttpd
for CUDA 8*:
- download the version 1 of the precompiled binary from https://github.com/fireice-uk/xmr-stak-dep/releases/download/v1/xmr-stak-dep.zip
- version 1 of the pre-compiled dependencies is not compatible with Visual Studio Toolset v141
對(duì)CUDA 9 或 AMD GPUs, CPU:
- 下載第二版預(yù)編譯依賴
- 所有東西解壓到
C:\xmr-stak-dep
檢驗(yàn)依賴文件夾
open a command line
cmd
-
run
cd c:\xmr-stak-dep tree .
-
結(jié)果應(yīng)該如下
C:\xmr-stak-dep>tree . Folder PATH listing for volume Windows Volume serial number is XX02-XXXX C:\XMR-STAK-DEP ├───hwloc │ ├───include │ │ ├───hwloc │ │ │ └───autogen │ │ └───private │ │ └───autogen │ └───lib ├───libmicrohttpd │ ├───include │ └───lib └───openssl ├───bin ├───include │ └───openssl └───lib
編譯
下載解壓
xmr-stak
打開(kāi)命令行
cmd
cd
到解壓的源代碼目錄-
執(zhí)行下面的命令 (注意: VS2017 安裝目錄可能不同)
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat" set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl mkdir build cd build
-
for CUDA 8*
cmake -G "Visual Studio 15 2017 Win64" -T v140,host=x64 ..
-
for CUDA 9 或 AMD GPUs, CPU
cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 ..
-
最后:
```
cmake --build . --config Release --target install
cd bin\Release
copy C:\xmr-stak-dep\openssl\bin\* .
```