Skip to content
Snippets Groups Projects
Commit fa752284 authored by psychocrypt's avatar psychocrypt
Browse files

native compile by default

- add CMake flag `XMRSTAK_COMPILE` to select `native` or `static` compile
- add new flags to the documentation
parent 22039b2a
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,17 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${BUILD_TYPE}") ...@@ -39,6 +39,17 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${BUILD_TYPE}")
set(XMR-STAK_CURRENCY "all" CACHE STRING "select miner currency") set(XMR-STAK_CURRENCY "all" CACHE STRING "select miner currency")
set_property(CACHE XMR-STAK_CURRENCY PROPERTY STRINGS "all;monero;aeon") set_property(CACHE XMR-STAK_CURRENCY PROPERTY STRINGS "all;monero;aeon")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(XMR-STAK_COMPILE "native" CACHE STRING "select CPU compute architecture")
set_property(CACHE XMR-STAK_COMPILE PROPERTY STRINGS "native;generic")
if("${XMR-STAK_COMPILE}" STREQUAL "native")
set(CMAKE_CXX_FLAGS "-march=native -mtune=native ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-march=native -mtune=native ${CMAKE_C_FLAGS}")
elseif(NOT "${XMR-STAK_COMPILE}" STREQUAL "generic")
message(FATAL_ERROR "XMR-STAK_COMPILE is set to an unknown value '${XMR-STAK_COMPILE}'")
endif()
endif()
if("${XMR-STAK_CURRENCY}" STREQUAL "all") if("${XMR-STAK_CURRENCY}" STREQUAL "all")
message(STATUS "Set miner currency to 'monero' and 'aeon'") message(STATUS "Set miner currency to 'monero' and 'aeon'")
elseif("${XMR-STAK_CURRENCY}" STREQUAL "aeon") elseif("${XMR-STAK_CURRENCY}" STREQUAL "aeon")
......
...@@ -37,6 +37,7 @@ After the configuration you need to compile the miner, follow the guide for your ...@@ -37,6 +37,7 @@ After the configuration you need to compile the miner, follow the guide for your
- you can find the binary and the `config.txt` file after `make install` in `$HOME/xmr-stak-cpu/bin` - you can find the binary and the `config.txt` file after `make install` in `$HOME/xmr-stak-cpu/bin`
- `CMAKE_LINK_STATIC` link libgcc and libstdc++ libraries static (default OFF) - `CMAKE_LINK_STATIC` link libgcc and libstdc++ libraries static (default OFF)
- disable with `cmake .. -DCMAKE_LINK_STATIC=ON` - disable with `cmake .. -DCMAKE_LINK_STATIC=ON`
- if you use static compile to run the miner on another system set `-DXMR-STAK_COMPILE=generic` (only available for LINUX, BSD and MacOSX)
- `CMAKE_BUILD_TYPE` set the build type - `CMAKE_BUILD_TYPE` set the build type
- valid options: `Release` or `Debug` - valid options: `Release` or `Debug`
- you should always keep `Release` for your productive miners - you should always keep `Release` for your productive miners
...@@ -44,10 +45,17 @@ After the configuration you need to compile the miner, follow the guide for your ...@@ -44,10 +45,17 @@ After the configuration you need to compile the miner, follow the guide for your
- there is no *http* interface available if option is disabled: `cmake .. -DMICROHTTPD_ENABLE=OFF` - there is no *http* interface available if option is disabled: `cmake .. -DMICROHTTPD_ENABLE=OFF`
- `OpenSSL_ENABLE` allow to disable/enable the dependency *OpenSSL* - `OpenSSL_ENABLE` allow to disable/enable the dependency *OpenSSL*
- it is not possible to connect to a *https* secured pool if option is disabled: `cmake .. -DOpenSSL_ENABLE=OFF` - it is not possible to connect to a *https* secured pool if option is disabled: `cmake .. -DOpenSSL_ENABLE=OFF`
- `XMR-STAK_CURRENCY` - compile for Monero(XMR) or Aeon(AEON) usage only e.g. `cmake .. -DXMR-STAK_CURRENCY=monero`
### only available for LINUX, BSD and MacOSX
- `XMR-STAK_COMPILE` select the CPU compute architecture (default: native)
- native means the miner binary can be used only on the system where it is compiled but will archive the highest hash rate
- use `cmake .. -DXMR-STAK_COMPILE=generic` to run the miner on all CPU's with sse2
### only available for Windows
- `WIN_UAC` will enable or disable the "Run As Administrator" prompt on Windows. - `WIN_UAC` will enable or disable the "Run As Administrator" prompt on Windows.
- UAC confirmation is needed to use large pages on Windows 7. - UAC confirmation is needed to use large pages on Windows 7.
- On Windows 10 it is only needed once to set up the account to use them. - On Windows 10 it is only needed once to set up the account to use them.
- `XMR-STAK_CURRENCY` - compile for Monero(XMR) or Aeon(AEON) usage only e.g. `cmake .. -DXMR-STAK_CURRENCY=monero`
## CPU Build Options ## CPU Build Options
......
...@@ -69,9 +69,9 @@ ...@@ -69,9 +69,9 @@
- g++ version 5.1 or higher is required for full C++11 support. - 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](scripts/build_xmr-stak_docker/build_xmr-stak_docker.sh). 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](scripts/build_xmr-stak_docker/build_xmr-stak_docker.sh).
### To do a static build for a system without gcc 5.1+ ### To do a generic and static build for a system without gcc 5.1+
``` ```
cmake -DCMAKE_LINK_STATIC=ON . cmake -DCMAKE_LINK_STATIC=ON -DXMR-STAK_COMPILE=generic .
make install make install
``` ```
Note - cmake caches variables, so if you want to do a dynamic build later you need to specify '-DCMAKE_LINK_STATIC=OFF' Note - cmake caches variables, so if you want to do a dynamic build later you need to specify '-DCMAKE_LINK_STATIC=OFF'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment