在Linux上编译 xmr-stak
Install Dependencies
AMD APP SDK 3.0 (only needed to use AMD GPUs)
- download and install the latest version from https://www.dropbox.com/sh/mpg882ekirnsfa7/AADWz5X-TgVdsmWt0QwMgTWLa/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2?dl=0
(do not wonder why it is a link to a dropbox but AMD has removed the SDK downloads, see https://community.amd.com/thread/228059)
Cuda 8.0+ (only needed to use NVIDIA GPUs)
- download and install https://developer.nvidia.com/cuda-downloads
- for minimal install choose
Custom installation options
during the install and select- CUDA/Develpment
- CUDA/Runtime
- Driver components
GNU Compiler
1 | # Ubuntu / Debian |
g++ version 5.1 or higher is required for full C++11 support.
If you want to compile the binary without installing libraries / compiler or just compile binary for some other distribution, please check the build_xmr-stak_docker.sh script.Some newer gcc versions are not supported by CUDA (e.g. Ubuntu 17.10). It will require installing gcc 5 but you can avoid changing defaults.
In that case you can force CUDA to use an older compiler in the following way:1
cmake -DCUDA_HOST_COMPILER=/usr/bin/gcc-5 ..
To do a generic and static build for a system without gcc 5.1+
1 | cmake -DCMAKE_LINK_STATIC=ON -DXMR-STAK_COMPILE=generic . |
Note - cmake caches variables, so if you want to do a dynamic build later you need to specify ‘-DCMAKE_LINK_STATIC=OFF’
Reference xmr-stak