XMRigCC 2.0 (#263)
# 2.0.0 **Thx to @xmrig and @SChernykh awesome work!** * Full Rebase on XMRig 3.1.1 * randomX/wow/XL * NUMA support * flexible multi algorithm configuration * unlimited switching between incompatible algorithms at runtime * Argon2, UPX2 (Nice hashrate improvement) and CN-Conceal support integrated like in previous version * 5-10% Hashrate improvement on ARMv8 CPUs when mining CN based algos compared to stock xmrig * Fully compatible to XMRigCCServer 1.9.5 no server upgrade needed! **New XMRigCCServer will be released soon with new features**
This commit is contained in:
parent
7d7a3a71f8
commit
b8fe729b52
645 changed files with 85475 additions and 63443 deletions
25
cmake/FindHWLOC.cmake
Normal file
25
cmake/FindHWLOC.cmake
Normal file
|
@ -0,0 +1,25 @@
|
|||
find_path(
|
||||
HWLOC_INCLUDE_DIR
|
||||
NAMES hwloc.h
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "include"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_path(HWLOC_INCLUDE_DIR NAMES hwloc.h)
|
||||
|
||||
find_library(
|
||||
HWLOC_LIBRARY
|
||||
NAMES hwloc.a hwloc libhwloc
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "lib"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(HWLOC_LIBRARY NAMES hwloc.a hwloc libhwloc)
|
||||
|
||||
set(HWLOC_LIBRARIES ${HWLOC_LIBRARY})
|
||||
set(HWLOC_INCLUDE_DIRS ${HWLOC_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(HWLOC DEFAULT_MSG HWLOC_LIBRARY HWLOC_INCLUDE_DIR)
|
|
@ -1,39 +0,0 @@
|
|||
# - Try to find MHD
|
||||
# Once done this will define
|
||||
#
|
||||
# MHD_FOUND - system has MHD
|
||||
# MHD_INCLUDE_DIRS - the MHD include directory
|
||||
# MHD_LIBRARY - Link these to use MHD
|
||||
|
||||
find_path(
|
||||
MHD_INCLUDE_DIR
|
||||
NAMES microhttpd.h
|
||||
DOC "microhttpd include dir"
|
||||
)
|
||||
|
||||
find_library(
|
||||
MHD_LIBRARY
|
||||
NAMES microhttpd microhttpd-10 libmicrohttpd libmicrohttpd-dll
|
||||
DOC "microhttpd library"
|
||||
)
|
||||
|
||||
set(MHD_INCLUDE_DIRS ${MHD_INCLUDE_DIR})
|
||||
set(MHD_LIBRARIES ${MHD_LIBRARY})
|
||||
|
||||
# debug library on windows
|
||||
# same naming convention as in qt (appending debug library with d)
|
||||
# boost is using the same "hack" as us with "optimized" and "debug"
|
||||
# official MHD project actually uses _d suffix
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL MSVC)
|
||||
find_library(
|
||||
MHD_LIBRARY_DEBUG
|
||||
NAMES microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d
|
||||
DOC "mhd debug library"
|
||||
)
|
||||
set(MHD_LIBRARIES optimized ${MHD_LIBRARIES} debug ${MHD_LIBRARY_DEBUG})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(mhd DEFAULT_MSG MHD_INCLUDE_DIR MHD_LIBRARY)
|
||||
mark_as_advanced(MHD_INCLUDE_DIR MHD_LIBRARY)
|
||||
|
|
@ -1,5 +1,22 @@
|
|||
find_path(
|
||||
UV_INCLUDE_DIR
|
||||
NAMES uv.h
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "include"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_path(UV_INCLUDE_DIR NAMES uv.h)
|
||||
find_library(UV_LIBRARY NAMES uv libuv)
|
||||
|
||||
find_library(
|
||||
UV_LIBRARY
|
||||
NAMES libuv.a uv libuv
|
||||
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
||||
PATH_SUFFIXES "lib"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(UV_LIBRARY NAMES libuv.a uv libuv)
|
||||
|
||||
set(UV_LIBRARIES ${UV_LIBRARY})
|
||||
set(UV_INCLUDE_DIRS ${UV_INCLUDE_DIR})
|
||||
|
|
31
cmake/OpenSSL.cmake
Normal file
31
cmake/OpenSSL.cmake
Normal file
|
@ -0,0 +1,31 @@
|
|||
if (WITH_TLS)
|
||||
set(OPENSSL_ROOT_DIR ${XMRIG_DEPS})
|
||||
|
||||
if (WIN32)
|
||||
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
||||
set(OPENSSL_MSVC_STATIC_RT TRUE)
|
||||
|
||||
set(EXTRA_LIBS ${EXTRA_LIBS} Crypt32)
|
||||
endif()
|
||||
|
||||
find_package(OpenSSL)
|
||||
|
||||
if (OPENSSL_FOUND)
|
||||
set(TLS_SOURCES src/base/net/stratum/Tls.h src/base/net/stratum/Tls.cpp)
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
if (WITH_HTTP)
|
||||
set(TLS_SOURCES ${TLS_SOURCES} src/base/net/http/HttpsClient.h src/base/net/http/HttpsClient.cpp)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "OpenSSL NOT found: use `-DWITH_TLS=OFF` to build without TLS support")
|
||||
endif()
|
||||
|
||||
add_definitions(/DXMRIG_FEATURE_TLS)
|
||||
else()
|
||||
set(TLS_SOURCES "")
|
||||
set(OPENSSL_LIBRARIES "")
|
||||
remove_definitions(/DXMRIG_FEATURE_TLS)
|
||||
|
||||
set(CMAKE_PROJECT_NAME "${CMAKE_PROJECT_NAME}-notls")
|
||||
endif()
|
18
cmake/argon2.cmake
Normal file
18
cmake/argon2.cmake
Normal file
|
@ -0,0 +1,18 @@
|
|||
if (WITH_ARGON2)
|
||||
add_definitions(/DXMRIG_ALGO_ARGON2)
|
||||
|
||||
list(APPEND HEADERS_CRYPTO
|
||||
src/crypto/argon2/Hash.h
|
||||
src/crypto/argon2/Impl.h
|
||||
)
|
||||
|
||||
list(APPEND SOURCES_CRYPTO
|
||||
src/crypto/argon2/Impl.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(src/3rdparty/argon2)
|
||||
set(ARGON2_LIBRARY argon2)
|
||||
else()
|
||||
remove_definitions(/DXMRIG_ALGO_ARGON2)
|
||||
set(ARGON2_LIBRARY "")
|
||||
endif()
|
217
cmake/asm.cmake
217
cmake/asm.cmake
|
@ -1,179 +1,52 @@
|
|||
message("Generating ASM files")
|
||||
if (WITH_ASM AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(XMRIG_ASM_LIBRARY "xmrig-asm")
|
||||
|
||||
# CN v1 original
|
||||
set(ALGO "original")
|
||||
set(ITERATIONS "524288") #0x80000
|
||||
set(MASK "2097136") #0x1FFFF0
|
||||
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||
enable_language(ASM_MASM)
|
||||
|
||||
configure_file("src/crypto/asm/cnv1_main_loop_sandybridge.inc.in" "src/crypto/asm/cnv1_main_loop_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv1_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/cnv1_main_loop_soft_aes_sandybridge.inc")
|
||||
if (MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
|
||||
set(XMRIG_ASM_FILES
|
||||
"src/crypto/cn/asm/cn_main_loop.asm"
|
||||
"src/crypto/cn/asm/CryptonightR_template.asm"
|
||||
)
|
||||
else()
|
||||
set(XMRIG_ASM_FILES
|
||||
"src/crypto/cn/asm/win64/cn_main_loop.asm"
|
||||
"src/crypto/cn/asm/win64/CryptonightR_template.asm"
|
||||
)
|
||||
endif()
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv1_main_loop_sandybridge.inc.in" "src/crypto/asm/win/cnv1_main_loop_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv1_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/win/cnv1_main_loop_soft_aes_sandybridge.inc")
|
||||
|
||||
# CN v2 ORIGINAL
|
||||
set(ALGO "originalv2")
|
||||
set(ITERATIONS "524288") #0x80000
|
||||
set(MASK "2097136") #0x1FFFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/cnv2_main_loop_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/cnv2_main_loop_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/cnv2_main_loop_ryzen.inc")
|
||||
configure_file("src/crypto/asm/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/cnv2_double_main_loop_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/cnv2_main_loop_soft_aes_sandybridge.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/win/cnv2_main_loop_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/win/cnv2_main_loop_ryzen.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/win/cnv2_double_main_loop_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_soft_aes_sandybridge.inc")
|
||||
|
||||
# CN v1 FAST
|
||||
set(ALGO "fast")
|
||||
set(ITERATIONS "262144") #0x40000
|
||||
set(MASK "2097136") #0x1FFFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv1_main_loop_sandybridge.inc.in" "src/crypto/asm/cnv1_main_loop_fast_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv1_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/cnv1_main_loop_fast_soft_aes_sandybridge.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv1_main_loop_sandybridge.inc.in" "src/crypto/asm/win/cnv1_main_loop_fast_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv1_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/win/cnv1_main_loop_fast_soft_aes_sandybridge.inc")
|
||||
|
||||
# CN v2 FAST
|
||||
set(ALGO "fastv2")
|
||||
set(ITERATIONS "262144") #0x40000
|
||||
set(MASK "2097136") #0x1FFFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/cnv2_main_loop_fastv2_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/cnv2_main_loop_fastv2_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/cnv2_main_loop_fastv2_ryzen.inc")
|
||||
configure_file("src/crypto/asm/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/cnv2_double_main_loop_fastv2_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/cnv2_main_loop_fastv2_soft_aes_sandybridge.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_fastv2_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/win/cnv2_main_loop_fastv2_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/win/cnv2_main_loop_fastv2_ryzen.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/win/cnv2_double_main_loop_fastv2_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_fastv2_soft_aes_sandybridge.inc")
|
||||
|
||||
# CN XCASH
|
||||
set(ALGO "xcash")
|
||||
set(ITERATIONS "1048576") #0x100000
|
||||
set(MASK "2097136") #0x1FFFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/cnv2_main_loop_xcash_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/cnv2_main_loop_xcash_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/cnv2_main_loop_xcash_ryzen.inc")
|
||||
configure_file("src/crypto/asm/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/cnv2_double_main_loop_xcash_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/cnv2_main_loop_xcash_soft_aes_sandybridge.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_xcash_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/win/cnv2_main_loop_xcash_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/win/cnv2_main_loop_xcash_ryzen.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/win/cnv2_double_main_loop_xcash_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_xcash_soft_aes_sandybridge.inc")
|
||||
|
||||
# CN ZELERIUS
|
||||
set(ALGO "zelerius")
|
||||
set(ITERATIONS "393216") #0x60000
|
||||
set(MASK "2097136") #0x1FFFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/cnv2_main_loop_zelerius_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/cnv2_main_loop_zelerius_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/cnv2_main_loop_zelerius_ryzen.inc")
|
||||
configure_file("src/crypto/asm/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/cnv2_double_main_loop_zelerius_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/cnv2_main_loop_zelerius_soft_aes_sandybridge.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_zelerius_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/win/cnv2_main_loop_zelerius_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/win/cnv2_main_loop_zelerius_ryzen.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/win/cnv2_double_main_loop_zelerius_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_zelerius_soft_aes_sandybridge.inc")
|
||||
|
||||
# CN LITE
|
||||
|
||||
set(ALGO "lite")
|
||||
set(ITERATIONS "262144") #0x40000
|
||||
set(MASK "1048560") #0xFFFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv1_main_loop_sandybridge.inc.in" "src/crypto/asm/cnv1_main_loop_lite_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv1_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/cnv1_main_loop_lite_soft_aes_sandybridge.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv1_main_loop_sandybridge.inc.in" "src/crypto/asm/win/cnv1_main_loop_lite_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv1_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/win/cnv1_main_loop_lite_soft_aes_sandybridge.inc")
|
||||
|
||||
# CN UPX
|
||||
|
||||
set(ALGO "upx")
|
||||
set(ITERATIONS "131072") #0x20000
|
||||
set(MASK "1048560") #0xFFFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv1_main_loop_sandybridge.inc.in" "src/crypto/asm/cnv1_main_loop_upx_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv1_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/cnv1_main_loop_upx_soft_aes_sandybridge.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv1_main_loop_sandybridge.inc.in" "src/crypto/asm/win/cnv1_main_loop_upx_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv1_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/win/cnv1_main_loop_upx_soft_aes_sandybridge.inc")
|
||||
|
||||
# CN V2 ULTRALITE
|
||||
set(ALGO "ultralite")
|
||||
set(ITERATIONS "65536") #0x10000
|
||||
set(MASK "131056") #0x1FFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/cnv2_main_loop_ultralite_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/cnv2_main_loop_ultralite_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/cnv2_main_loop_ultralite_ryzen.inc")
|
||||
configure_file("src/crypto/asm/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/cnv2_double_main_loop_ultralite_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/cnv2_main_loop_ultralite_soft_aes_sandybridge.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ivybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_ultralite_ivybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_bulldozer.inc.in" "src/crypto/asm/win/cnv2_main_loop_ultralite_bulldozer.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_ryzen.inc.in" "src/crypto/asm/win/cnv2_main_loop_ultralite_ryzen.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_double_main_loop_sandybridge.inc.in" "src/crypto/asm/win/cnv2_double_main_loop_ultralite_sandybridge.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_soft_aes_sandybridge.inc.in" "src/crypto/asm/win/cnv2_main_loop_ultralite_soft_aes_sandybridge.inc")
|
||||
|
||||
# CN V2 RWZ
|
||||
set(ALGO "original")
|
||||
set(ITERATIONS "393216") #0x60000
|
||||
set(MASK "2097136") #0x1FFFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_rwz_all.inc.in" "src/crypto/asm/cnv2_main_loop_rwz_original_all.inc")
|
||||
configure_file("src/crypto/asm/cnv2_double_main_loop_rwz_all.inc.in" "src/crypto/asm/cnv2_double_main_loop_rwz_original_all.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_rwz_all.inc.in" "src/crypto/asm/win/cnv2_main_loop_rwz_original_all.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_double_main_loop_rwz_all.inc.in" "src/crypto/asm/win/cnv2_double_main_loop_rwz_original_all.inc")
|
||||
|
||||
|
||||
# CN V2 UPX2
|
||||
set(ALGO "upx2")
|
||||
set(ITERATIONS "16384") #0x4000
|
||||
set(MASK "131056") #0x1FFF0
|
||||
|
||||
configure_file("src/crypto/asm/cnv2_main_loop_rwz_all.inc.in" "src/crypto/asm/cnv2_main_loop_rwz_upx2_all.inc")
|
||||
configure_file("src/crypto/asm/cnv2_double_main_loop_rwz_all.inc.in" "src/crypto/asm/cnv2_double_main_loop_rwz_upx2_all.inc")
|
||||
|
||||
configure_file("src/crypto/asm/win/cnv2_main_loop_rwz_all.inc.in" "src/crypto/asm/win/cnv2_main_loop_rwz_upx2_all.inc")
|
||||
configure_file("src/crypto/asm/win/cnv2_double_main_loop_rwz_all.inc.in" "src/crypto/asm/win/cnv2_double_main_loop_rwz_upx2_all.inc")
|
||||
|
||||
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||
enable_language(ASM_MASM)
|
||||
set(XMRIG_ASM_FILE "src/crypto/asm/win/cn_main_loop.asm"
|
||||
"src/crypto/asm/win/CryptonightR_template.asm")
|
||||
set_property(SOURCE ${XMRIG_ASM_FILE} PROPERTY ASM_MASM)
|
||||
include_directories(${CMAKE_BINARY_DIR}/src/crypto/asm/win)
|
||||
else()
|
||||
enable_language(ASM)
|
||||
|
||||
if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES GNU)
|
||||
set(XMRIG_ASM_FILE "src/crypto/asm/win/cn_main_loop_win_gcc.S"
|
||||
"src/crypto/asm/win/CryptonightR_template.S")
|
||||
set_property(SOURCE ${XMRIG_ASM_FILES} PROPERTY ASM_MASM)
|
||||
else()
|
||||
set(XMRIG_ASM_FILE "src/crypto/asm/cn_main_loop.S"
|
||||
"src/crypto/asm/CryptonightR_template.S")
|
||||
enable_language(ASM)
|
||||
|
||||
if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES GNU)
|
||||
set(XMRIG_ASM_FILES
|
||||
"src/crypto/cn/asm/win64/cn_main_loop.S"
|
||||
"src/crypto/cn/asm/CryptonightR_template.S"
|
||||
)
|
||||
else()
|
||||
set(XMRIG_ASM_FILES
|
||||
"src/crypto/cn/asm/cn_main_loop.S"
|
||||
"src/crypto/cn/asm/CryptonightR_template.S"
|
||||
)
|
||||
endif()
|
||||
|
||||
set_property(SOURCE ${XMRIG_ASM_FILES} PROPERTY C)
|
||||
endif()
|
||||
|
||||
set_property(SOURCE ${XMRIG_ASM_FILE} PROPERTY C)
|
||||
include_directories(${CMAKE_BINARY_DIR}/src/crypto/asm/)
|
||||
endif()
|
||||
add_library(${XMRIG_ASM_LIBRARY} STATIC ${XMRIG_ASM_FILES})
|
||||
set(XMRIG_ASM_SOURCES
|
||||
src/crypto/common/Assembly.h
|
||||
src/crypto/common/Assembly.cpp
|
||||
src/crypto/cn/r/CryptonightR_gen.cpp
|
||||
)
|
||||
set_property(TARGET ${XMRIG_ASM_LIBRARY} PROPERTY LINKER_LANGUAGE C)
|
||||
|
||||
add_library(xmrig_asm STATIC ${XMRIG_ASM_FILE})
|
||||
set_property(TARGET xmrig_asm PROPERTY LINKER_LANGUAGE C)
|
||||
add_definitions(/DXMRIG_FEATURE_ASM)
|
||||
else()
|
||||
set(XMRIG_ASM_SOURCES "")
|
||||
set(XMRIG_ASM_LIBRARY "")
|
||||
|
||||
remove_definitions(/DXMRIG_FEATURE_ASM)
|
||||
endif()
|
||||
|
|
25
cmake/cn-gpu.cmake
Normal file
25
cmake/cn-gpu.cmake
Normal file
|
@ -0,0 +1,25 @@
|
|||
if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
if (XMRIG_ARM)
|
||||
set(CN_GPU_SOURCES src/crypto/cn/gpu/cn_gpu_arm.cpp)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_arm.cpp PROPERTIES COMPILE_FLAGS "-O3")
|
||||
endif()
|
||||
else()
|
||||
set(CN_GPU_SOURCES src/crypto/cn/gpu/cn_gpu_avx.cpp src/crypto/cn/gpu/cn_gpu_ssse3.cpp)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "-O3 -mavx2")
|
||||
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_ssse3.cpp PROPERTIES COMPILE_FLAGS "-O3")
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(/DXMRIG_ALGO_CN_GPU)
|
||||
else()
|
||||
set(CN_GPU_SOURCES "")
|
||||
|
||||
remove_definitions(/DXMRIG_ALGO_CN_GPU)
|
||||
endif()
|
|
@ -7,19 +7,37 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
|
|||
add_definitions(/DRAPIDJSON_SSE2)
|
||||
endif()
|
||||
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64)$")
|
||||
set(XMRIG_ARM ON)
|
||||
set(XMRIG_ARMv8 ON)
|
||||
set(WITH_LIBCPUID OFF)
|
||||
|
||||
add_definitions(/DXMRIG_ARM)
|
||||
add_definitions(/DXMRIG_ARMv8)
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7|armv7f|armv7s|armv7k|armv7-a|armv7l)$")
|
||||
set(XMRIG_ARM ON)
|
||||
set(XMRIG_ARMv7 ON)
|
||||
set(WITH_LIBCPUID OFF)
|
||||
|
||||
add_definitions(/DXMRIG_ARM)
|
||||
add_definitions(/DXMRIG_ARMv7)
|
||||
if (NOT ARM_TARGET)
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|armv8-a)$")
|
||||
set(ARM_TARGET 8)
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7|armv7f|armv7s|armv7k|armv7-a|armv7l)$")
|
||||
set(ARM_TARGET 7)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ARM_TARGET AND ARM_TARGET GREATER 6)
|
||||
set(XMRIG_ARM ON)
|
||||
set(WITH_LIBCPUID OFF)
|
||||
add_definitions(/DXMRIG_ARM)
|
||||
|
||||
message(STATUS "Use ARM_TARGET=${ARM_TARGET} (${CMAKE_SYSTEM_PROCESSOR})")
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
if (ARM_TARGET EQUAL 8)
|
||||
set(XMRIG_ARMv8 ON)
|
||||
add_definitions(/DXMRIG_ARMv8)
|
||||
|
||||
CHECK_CXX_COMPILER_FLAG(-march=armv8-a+crypto XMRIG_ARM_CRYPTO)
|
||||
|
||||
if (XMRIG_ARM_CRYPTO)
|
||||
add_definitions(/DXMRIG_ARM_CRYPTO)
|
||||
set(ARM8_CXX_FLAGS "-march=armv8-a+crypto")
|
||||
else()
|
||||
set(ARM8_CXX_FLAGS "-march=armv8-a")
|
||||
endif()
|
||||
elseif (ARM_TARGET EQUAL 7)
|
||||
set(XMRIG_ARMv7 ON)
|
||||
add_definitions(/DXMRIG_ARMv7)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -6,6 +6,10 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
|||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
add_definitions(/DNDEBUG)
|
||||
endif()
|
||||
|
||||
include(CheckSymbolExists)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
|
@ -13,23 +17,28 @@ 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 -fno-exceptions -fno-rtti -Wno-class-memaccess")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -fno-rtti -Wno-class-memaccess")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -s")
|
||||
|
||||
if (XMRIG_ARMv8)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8-a+crypto")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crypto -flax-vector-conversions")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM8_CXX_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARM8_CXX_FLAGS} -flax-vector-conversions")
|
||||
elseif (XMRIG_ARMv7)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -flax-vector-conversions")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
|
||||
|
||||
add_definitions(/DHAVE_ROTR)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
else()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -Wl,--large-address-aware")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
|
||||
endif()
|
||||
|
@ -56,12 +65,12 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
|||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-exceptions -fno-rtti -Wno-missing-braces")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -fno-rtti -Wno-missing-braces")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants")
|
||||
|
||||
if (XMRIG_ARMv8)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8-a+crypto")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crypto")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM8_CXX_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARM8_CXX_FLAGS}")
|
||||
elseif (XMRIG_ARMv7)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -march=${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
@ -76,3 +85,10 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
|||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if (NOT WIN32)
|
||||
check_symbol_exists("__builtin___clear_cache" "stdlib.h" HAVE_BUILTIN_CLEAR_CACHE)
|
||||
if (HAVE_BUILTIN_CLEAR_CACHE)
|
||||
add_definitions(/DHAVE_BUILTIN_CLEAR_CACHE)
|
||||
endif()
|
||||
endif()
|
||||
|
|
57
cmake/randomx.cmake
Normal file
57
cmake/randomx.cmake
Normal file
|
@ -0,0 +1,57 @@
|
|||
if (WITH_RANDOMX)
|
||||
add_definitions(/DXMRIG_ALGO_RANDOMX)
|
||||
|
||||
list(APPEND HEADERS_CRYPTO
|
||||
src/crypto/rx/Rx.h
|
||||
src/crypto/rx/RxAlgo.h
|
||||
src/crypto/rx/RxCache.h
|
||||
src/crypto/rx/RxConfig.h
|
||||
src/crypto/rx/RxDataset.h
|
||||
src/crypto/rx/RxVm.h
|
||||
)
|
||||
|
||||
list(APPEND SOURCES_CRYPTO
|
||||
src/crypto/randomx/aes_hash.cpp
|
||||
src/crypto/randomx/allocator.cpp
|
||||
src/crypto/randomx/argon2_core.c
|
||||
src/crypto/randomx/argon2_ref.c
|
||||
src/crypto/randomx/blake2_generator.cpp
|
||||
src/crypto/randomx/blake2/blake2b.c
|
||||
src/crypto/randomx/bytecode_machine.cpp
|
||||
src/crypto/randomx/dataset.cpp
|
||||
src/crypto/randomx/instructions_portable.cpp
|
||||
src/crypto/randomx/randomx.cpp
|
||||
src/crypto/randomx/reciprocal.c
|
||||
src/crypto/randomx/soft_aes.cpp
|
||||
src/crypto/randomx/superscalar.cpp
|
||||
src/crypto/randomx/virtual_machine.cpp
|
||||
src/crypto/randomx/virtual_memory.cpp
|
||||
src/crypto/randomx/vm_compiled_light.cpp
|
||||
src/crypto/randomx/vm_compiled.cpp
|
||||
src/crypto/randomx/vm_interpreted_light.cpp
|
||||
src/crypto/randomx/vm_interpreted.cpp
|
||||
src/crypto/rx/Rx.cpp
|
||||
src/crypto/rx/RxAlgo.cpp
|
||||
src/crypto/rx/RxCache.cpp
|
||||
src/crypto/rx/RxConfig.cpp
|
||||
src/crypto/rx/RxDataset.cpp
|
||||
src/crypto/rx/RxVm.cpp
|
||||
)
|
||||
|
||||
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||
enable_language(ASM_MASM)
|
||||
list(APPEND SOURCES_CRYPTO
|
||||
src/crypto/randomx/jit_compiler_x86_static.asm
|
||||
src/crypto/randomx/jit_compiler_x86.cpp
|
||||
)
|
||||
elseif (NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
list(APPEND SOURCES_CRYPTO
|
||||
src/crypto/randomx/jit_compiler_x86_static.S
|
||||
src/crypto/randomx/jit_compiler_x86.cpp
|
||||
)
|
||||
# cheat because cmake and ccache hate each other
|
||||
set_property(SOURCE src/crypto/randomx/jit_compiler_x86_static.S PROPERTY LANGUAGE C)
|
||||
endif()
|
||||
else()
|
||||
remove_definitions(/DXMRIG_ALGO_RANDOMX)
|
||||
endif()
|
Loading…
Add table
Add a link
Reference in a new issue