前期准备
- Visual Studio 2017 Community
下载路径: https://www.visualstudio.com/downloads/
安装时需要选择
Desktop development with C++
VC++ 2015.3 v140 toolset for desktop
- Cmake for windows
下载路径: https://cmake.org/download/
安装时选择: Add CMake to the system PATH for all users
下载代码
https://github.com/fireice-uk/xmr-stak
解压代码(路径记为PATH1,根据自己的路径修改)
下载依赖
https://github.com/fireice-uk/xmr-stak-dep/releases
下载后将依赖解压(路径记为PATH2)
<pre>
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
</pre>
编译
- 进入xmr-stak目录(PATH1),打开cmd
- 执行:
& "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"
导入VS140COMNTOOLS环境变量
VsMSBuildCmd.bat的路径可能与vs安装位置有关,可能需要根据自己的路径进行变更
- 执行:
mkdir build
cd build
在PATH1下新建build文件夹
- 执行:
cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 -DOpenCL_ENABLE=OFF -DCUDA_ENABLE=OFF
-DCMAKE_PREFIX_PATH="PATH2\hwloc;PATH2\libmicrohttpd;PATH2\openssl" ..
生成编译脚本
- 执行:
cmake --build . --config Release --target install
开始编译
- 执行:
cd bin\Release
copy PATH2\openssl\bin\* .
拷贝openssl依赖文件至bin目录下
网友评论