From f4ba1e35e11de9379bf57fb059a4f3c24cc4e7e4 Mon Sep 17 00:00:00 2001 From: xmrig Date: Sat, 14 Sep 2019 15:57:50 +0700 Subject: [PATCH 1/6] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a56048220..56bc297ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v3.1.2 +- Many RandomX optimizations and fixes. + - [#1163](https://github.com/xmrig/xmrig/pull/1163) Optimized soft AES code, up to +30% hashrate on CPU without AES support and other optimizations. + - [#1166](https://github.com/xmrig/xmrig/pull/1166) Fixed crash when initialize dataset with big threads count (eg 272). + - [#1168](https://github.com/xmrig/xmrig/pull/1168) Optimized loading from scratchpad. + # v3.1.1 - [#1133](https://github.com/xmrig/xmrig/issues/1133) Fixed syslog regression. - [#1138](https://github.com/xmrig/xmrig/issues/1138) Fixed multiple network bugs. From 179ef31b80f2cc42c948b629689f00e547b483f6 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 14 Sep 2019 20:34:15 +0700 Subject: [PATCH 2/6] Fixed cmake 2.8 support. --- src/3rdparty/argon2/CMakeLists.txt | 35 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/3rdparty/argon2/CMakeLists.txt b/src/3rdparty/argon2/CMakeLists.txt index 30900b0bc..f77835f3b 100644 --- a/src/3rdparty/argon2/CMakeLists.txt +++ b/src/3rdparty/argon2/CMakeLists.txt @@ -1,23 +1,23 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) -project(Argon2 C) -set(ARGON2_VERSION 1.0) +project(argon2 C) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) include(CheckCSourceCompiles) -add_library(argon2 STATIC +set(ARGON2_SOURCES lib/argon2.c lib/core.c lib/encoding.c lib/genkat.c lib/impl-select.c lib/blake2/blake2.c -) + ) -target_include_directories(argon2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) -target_include_directories(argon2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib) +set(ARGON2_X86_64_ENABLED ON) +set(ARGON2_X86_64_LIBS argon2-sse2 argon2-ssse3 argon2-xop argon2-avx2 argon2-avx512f) +set(ARGON2_X86_64_SOURCES arch/x86_64/lib/argon2-arch.c arch/x86_64/lib/cpu-flags.c) if (CMAKE_C_COMPILER_ID MATCHES MSVC) function(add_feature_impl FEATURE MSVC_FLAG DEF) @@ -28,7 +28,6 @@ if (CMAKE_C_COMPILER_ID MATCHES MSVC) target_compile_options(argon2-${FEATURE} PRIVATE ${MSVC_FLAG}) target_compile_definitions(argon2-${FEATURE} PRIVATE ${DEF}) - target_link_libraries(argon2 PUBLIC argon2-${FEATURE}) endfunction() add_feature_impl(sse2 "" HAVE_SSE2) @@ -36,8 +35,6 @@ if (CMAKE_C_COMPILER_ID MATCHES MSVC) add_feature_impl(xop "" HAVE_XOP) add_feature_impl(avx2 "/arch:AVX2" HAVE_AVX2) add_feature_impl(avx512f "/arch:AVX512F" HAVE_AVX512F) - - target_sources(argon2 PRIVATE arch/x86_64/lib/argon2-arch.c arch/x86_64/lib/cpu-flags.c) elseif (NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8) function(add_feature_impl FEATURE GCC_FLAG DEF) add_library(argon2-${FEATURE} STATIC arch/x86_64/lib/argon2-${FEATURE}.c) @@ -67,8 +64,6 @@ elseif (NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8) message("-- argon2: feature '${FEATURE}' detected!") target_compile_definitions(argon2-${FEATURE} PRIVATE ${DEF}) endif() - - target_link_libraries(argon2 PUBLIC argon2-${FEATURE}) endfunction() add_feature_impl(sse2 -msse2 HAVE_SSE2) @@ -76,8 +71,18 @@ elseif (NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8) add_feature_impl(xop -mxop HAVE_XOP) add_feature_impl(avx2 -mavx2 HAVE_AVX2) add_feature_impl(avx512f -mavx512f HAVE_AVX512F) - - target_sources(argon2 PRIVATE arch/x86_64/lib/argon2-arch.c arch/x86_64/lib/cpu-flags.c) else() - target_sources(argon2 PRIVATE arch/generic/lib/argon2-arch.c) + set(ARGON2_X86_64_ENABLED OFF) + list(APPEND ARGON2_SOURCES arch/generic/lib/argon2-arch.c) endif() + +if (ARGON2_X86_64_ENABLED) + set(ARGON2_LIBS ${ARGON2_X86_64_LIBS}) + list(APPEND ARGON2_SOURCES ${ARGON2_X86_64_SOURCES}) +endif() + +add_library(argon2 STATIC ${ARGON2_SOURCES}) +target_link_libraries(argon2 ${ARGON2_LIBS}) + +target_include_directories(argon2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_include_directories(argon2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib) From a8f5b8ac8bc17a7a1b190c50acd97725ab12f5f3 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 15 Sep 2019 13:26:26 +0700 Subject: [PATCH 3/6] #1132 Fixed CentOS 7 compatibility. --- cmake/flags.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/flags.cmake b/cmake/flags.cmake index bc441dd03..97f22f3c1 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -2,6 +2,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD 11) +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED ON) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE Release) endif() @@ -13,11 +16,10 @@ endif() include(CheckSymbolExists) if (CMAKE_CXX_COMPILER_ID MATCHES GNU) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-strict-aliasing") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -fno-rtti -Wno-class-memaccess") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -fno-rtti -Wno-strict-aliasing -Wno-class-memaccess") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -s") if (XMRIG_ARMv8) @@ -46,6 +48,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU) add_definitions(/D_GNU_SOURCE) if (${CMAKE_VERSION} VERSION_LESS "3.1.0") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() From c6accf51517d5c44fcca7e0006541b1fa8470a18 Mon Sep 17 00:00:00 2001 From: xmrig Date: Sun, 15 Sep 2019 15:26:22 +0700 Subject: [PATCH 4/6] Create CMAKE_OPTIONS.md --- doc/build/CMAKE_OPTIONS.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 doc/build/CMAKE_OPTIONS.md diff --git a/doc/build/CMAKE_OPTIONS.md b/doc/build/CMAKE_OPTIONS.md new file mode 100644 index 000000000..b201f2587 --- /dev/null +++ b/doc/build/CMAKE_OPTIONS.md @@ -0,0 +1,23 @@ +# CMake options +This document contains list of useful cmake options. + +## Algorithms + +* **`-DWITH_CN_LITE=OFF`** disable all CryptoNight-Lite algorithms (`cn-lite/0`, `cn-lite/1`). +* **`-DWITH_CN_HEAVY=OFF`** disable all CryptoNight-Heavy algorithms (`cn-heavy/0`, `cn-heavy/xhv`, `cn-heavy/tube`). +* **`-DWITH_CN_PICO=OFF`** disable CryptoNight-Pico algorithm (`cn-pico`). +* **`-DWITH_CN_GPU=OFF`** disable CryptoNight-GPU algorithm (`cn/gpu`). +* **`-DWITH_RANDOMX=OFF`** disable RandomX algorithms (`rx/loki`, `rx/wow`). +* **`-DWITH_ARGON2=OFF`** disable Argon2 algorithms (`argon2/chukwa`, `argon2/wrkz`). + +## Features + +* **`-DWITH_HWLOC=OFF`** +disable [hwloc](https://github.com/xmrig/xmrig/issues/1077) support. +Disabling this feature is not recommended in most cases. +This feature add external dependency to libhwloc (1.10.0+) (except MSVC builds). +* **`-DWITH_LIBCPUID=OFF`** disable built in libcpuid support, this feature always disabled if hwloc enabled, if both hwloc and libcpuid disabled auto configuration for CPU will very limited. +* **`-DWITH_HTTP=OFF`** disable built in HTTP support, this feature used for HTTP API and daemon (solo mining) support. +* **`-DWITH_TLS=OFF`** disable SSL/TLS support (secure connections to pool). This feature add external dependency to OpenSSL. +* **`-DWITH_ASM=OFF`** disable assembly optimizations for modern CryptoNight algorithms. +* **`-DWITH_EMBEDDED_CONFIG=ON`** Enable [embedded](https://github.com/xmrig/xmrig/issues/957) config support. From 62d184a377fbebd95f44ad6ab8a1a53fdbb82d4c Mon Sep 17 00:00:00 2001 From: xmrig Date: Sun, 15 Sep 2019 15:57:02 +0700 Subject: [PATCH 5/6] Update CMAKE_OPTIONS.md --- doc/build/CMAKE_OPTIONS.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/build/CMAKE_OPTIONS.md b/doc/build/CMAKE_OPTIONS.md index b201f2587..8cb66eecb 100644 --- a/doc/build/CMAKE_OPTIONS.md +++ b/doc/build/CMAKE_OPTIONS.md @@ -21,3 +21,19 @@ This feature add external dependency to libhwloc (1.10.0+) (except MSVC builds). * **`-DWITH_TLS=OFF`** disable SSL/TLS support (secure connections to pool). This feature add external dependency to OpenSSL. * **`-DWITH_ASM=OFF`** disable assembly optimizations for modern CryptoNight algorithms. * **`-DWITH_EMBEDDED_CONFIG=ON`** Enable [embedded](https://github.com/xmrig/xmrig/issues/957) config support. + +## Debug options + +* **`-DWITH_DEBUG_LOG=ON`** enable debug log (mostly network requests). +* **`-DHWLOC_DEBUG=ON`** enable some debug log for hwloc. +* **`-DCMAKE_BUILD_TYPE=Debug`** enable debug build, only useful for investigate crashes, this option slow down miner. + +## Special build options + +* **`-DXMRIG_DEPS=`** path to precompiled dependensices https://github.com/xmrig/xmrig-deps +* **`-DARM_TARGET=`** override ARM target, possible values `7` (ARMv7) and `8` (ARMv8). +* **`-DUV_INCLUDE_DIR=`** custom path to libuv headers. +* **`-DUV_LIBRARY=`** custom path to libuv library. +* **`-DHWLOC_INCLUDE_DIR=`** custom path to hwloc headers. +* **`-DHWLOC_LIBRARY=`** custom path to hwloc library. +* **`-DOPENSSL_ROOT_DIR=`** custom path to OpenSSL. From ff981ecb5cb53fcc1bcd9af7bd0c5829a8fe5085 Mon Sep 17 00:00:00 2001 From: xmrig Date: Sun, 15 Sep 2019 16:25:05 +0700 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56bc297ac..30e533594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ # v3.1.2 - Many RandomX optimizations and fixes. + - [#1132](https://github.com/xmrig/xmrig/issues/1132) Fixed build on CentOS 7. - [#1163](https://github.com/xmrig/xmrig/pull/1163) Optimized soft AES code, up to +30% hashrate on CPU without AES support and other optimizations. - [#1166](https://github.com/xmrig/xmrig/pull/1166) Fixed crash when initialize dataset with big threads count (eg 272). - [#1168](https://github.com/xmrig/xmrig/pull/1168) Optimized loading from scratchpad. +- [#1128](https://github.com/xmrig/xmrig/issues/1128) Fixed CMake 2.8 compatibility. # v3.1.1 - [#1133](https://github.com/xmrig/xmrig/issues/1133) Fixed syslog regression.