mirror of
https://git.wownero.com/wownero/wownero-puddle.git
synced 2024-08-15 01:03:20 +00:00
ease building with / without randomx
This commit is contained in:
parent
2c636d00e9
commit
bcc25dee1b
3 changed files with 20 additions and 3 deletions
14
Makefile
14
Makefile
|
@ -56,8 +56,9 @@ MONERO_LIBS = \
|
|||
${MONERO_BUILD_ROOT}/src/ringct/libringct_basic.a \
|
||||
${MONERO_BUILD_ROOT}/src/device/libdevice.a \
|
||||
${MONERO_BUILD_ROOT}/contrib/epee/src/libepee.a \
|
||||
${MONERO_BUILD_ROOT}/external/easylogging++/libeasylogging.a \
|
||||
${MONERO_BUILD_ROOT}/external/randomx/librandomx.a
|
||||
${MONERO_BUILD_ROOT}/external/easylogging++/libeasylogging.a
|
||||
|
||||
LIBRX = ${MONERO_BUILD_ROOT}/external/randomx/librandomx.a
|
||||
|
||||
DIRS = src data rxi/log/src
|
||||
|
||||
|
@ -65,6 +66,15 @@ OS := $(shell uname -s)
|
|||
|
||||
CPPDEFS = _GNU_SOURCE AUTO_INITIALIZE_EASYLOGGINGPP LOG_USE_COLOR
|
||||
|
||||
ifeq ($(wildcard ${LIBRX}),${LIBRX})
|
||||
MONERO_LIBS += ${LIBRX}
|
||||
CPPDEFS += HAVE_RX
|
||||
else
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
$(warning Building without RandomX!)
|
||||
endif
|
||||
endif
|
||||
|
||||
W = -W -Wall -Wno-unused-parameter -Wuninitialized
|
||||
OPT = -maes -fPIC
|
||||
CFLAGS = $(W) -Wbad-function-cast $(OPT) -std=c99
|
||||
|
|
|
@ -248,8 +248,13 @@ static FILE *fd_log;
|
|||
static unsigned char sec_view[32];
|
||||
static unsigned char pub_spend[32];
|
||||
|
||||
#ifdef HAVE_RX
|
||||
extern void rx_stop_mining();
|
||||
extern void rx_slow_hash_free_state();
|
||||
#else
|
||||
void rx_stop_mining(){}
|
||||
void rx_slow_hash_free_state(){}
|
||||
#endif
|
||||
|
||||
#define JSON_GET_OR_ERROR(name, parent, type, client) \
|
||||
json_object *name = NULL; \
|
||||
|
|
|
@ -105,13 +105,15 @@ void get_rx_hash(const unsigned char *input, const size_t in_size,
|
|||
unsigned char *output, const unsigned char *seed_hash,
|
||||
const uint64_t height)
|
||||
{
|
||||
static unsigned max_concurrency = 1;//tools::get_max_concurrency();
|
||||
#ifdef HAVE_RX
|
||||
static unsigned max_concurrency = tools::get_max_concurrency();
|
||||
uint64_t seed_height;
|
||||
if (rx_needhash(height, &seed_height))
|
||||
{
|
||||
rx_seedhash(seed_height, (const char*)seed_hash, max_concurrency);
|
||||
}
|
||||
rx_slow_hash((const char*)input, in_size, (char*)output, max_concurrency);
|
||||
#endif
|
||||
}
|
||||
|
||||
int validate_block_from_blob(const char *blob_hex,
|
||||
|
|
Loading…
Reference in a new issue