Fixed keccak_bmi.cpp compilation without RandomX

This commit is contained in:
SChernykh 2024-05-31 10:33:44 +02:00
parent bd6f68790e
commit fb87e01986
3 changed files with 12 additions and 4 deletions

View file

@ -156,6 +156,9 @@ endif()
if (WITH_RANDOMX) if (WITH_RANDOMX)
set(HEADERS ${HEADERS} src/miner.h) set(HEADERS ${HEADERS} src/miner.h)
set(SOURCES ${SOURCES} src/miner.cpp) set(SOURCES ${SOURCES} src/miner.cpp)
else()
set(HEADERS ${HEADERS} external/src/RandomX/src/cpu.hpp)
set(SOURCES ${SOURCES} external/src/RandomX/src/cpu.cpp)
endif() endif()
if (WITH_GRPC) if (WITH_GRPC)
@ -267,6 +270,13 @@ endif()
add_definitions(/DZMQ_STATIC) add_definitions(/DZMQ_STATIC)
include(CheckIncludeFile)
check_include_file(asm/hwcap.h HAVE_HWCAP)
if(HAVE_HWCAP)
add_definitions(/DHAVE_HWCAP)
endif()
include(CheckCXXSourceCompiles) include(CheckCXXSourceCompiles)
check_cxx_source_compiles("int main(){ return __builtin_clzll(1);}" HAVE_BUILTIN_CLZLL) check_cxx_source_compiles("int main(){ return __builtin_clzll(1);}" HAVE_BUILTIN_CLZLL)

@ -1 +1 @@
Subproject commit 7ee603afebc063fa9c28a5350daee40be831d468 Subproject commit 1b1f6d222d9c499b1a1ee40efa788bbcbfcb5513

View file

@ -17,9 +17,7 @@
#include "common.h" #include "common.h"
#include "keccak.h" #include "keccak.h"
#ifdef WITH_RANDOMX
#include "RandomX/src/cpu.hpp" #include "RandomX/src/cpu.hpp"
#endif
namespace p2pool { namespace p2pool {
@ -120,7 +118,7 @@ NOINLINE void keccakf_plain(std::array<uint64_t, 25>& st)
void (*keccakf)(std::array<uint64_t, 25>&) = keccakf_plain; void (*keccakf)(std::array<uint64_t, 25>&) = keccakf_plain;
#if defined(WITH_RANDOMX) && (defined(__x86_64__) || defined(_M_AMD64)) #if defined(__x86_64__) || defined(_M_AMD64)
static struct KeccakBMI_Check { static struct KeccakBMI_Check {
KeccakBMI_Check() { KeccakBMI_Check() {
if (randomx::Cpu().hasBmi()) { if (randomx::Cpu().hasBmi()) {