From 5a7bcb2d0323c7cecf635dc97328a1f86c08f69e Mon Sep 17 00:00:00 2001 From: Dusan Klinec Date: Wed, 30 Sep 2020 19:58:10 +0200 Subject: [PATCH] fies #1844, adds WITH_SSE cmake option now it is possible to disable sse for Blake2, which is not supported on ARMs --- CMakeLists.txt | 1 + cmake/randomx.cmake | 2 +- doc/build/CMAKE_OPTIONS.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bacc969..53a35540 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ option(WITH_ADL "Enable ADL (AMD Display Library) or sysfs support ( option(WITH_STRICT_CACHE "Enable strict checks for OpenCL cache" ON) option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF) option(WITH_PROFILING "Enable profiling for developers" OFF) +option(WITH_SSE "Enable SSE for Blake2" ON) option(BUILD_STATIC "Build static binary" OFF) option(ARM_TARGET "Force use specific ARM target 8 or 7" 0) diff --git a/cmake/randomx.cmake b/cmake/randomx.cmake index 19d8f481..edc21d8f 100644 --- a/cmake/randomx.cmake +++ b/cmake/randomx.cmake @@ -65,7 +65,7 @@ if (WITH_RANDOMX) set_property(SOURCE src/crypto/randomx/jit_compiler_a64_static.S PROPERTY LANGUAGE C) endif() - if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Clang) + if (NOT ARM_TARGET AND WITH_SSE AND (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Clang)) set_source_files_properties(src/crypto/randomx/blake2/blake2b_sse41.c PROPERTIES COMPILE_FLAGS -msse4.1) endif() diff --git a/doc/build/CMAKE_OPTIONS.md b/doc/build/CMAKE_OPTIONS.md index c3755b58..218c24c9 100644 --- a/doc/build/CMAKE_OPTIONS.md +++ b/doc/build/CMAKE_OPTIONS.md @@ -22,6 +22,7 @@ This feature add external dependency to libhwloc (1.10.0+) (except MSVC builds). * **`-DWITH_EMBEDDED_CONFIG=ON`** Enable [embedded](https://github.com/xmrig/xmrig/issues/957) config support. * **`-DWITH_OPENCL=OFF`** Disable OpenCL backend. * **`-DWITH_CUDA=OFF`** Disable CUDA backend. +* **`-DWITH_SSE=OFF`** Disable SSE for Blake2 (useful for arm builds). ## Debug options