From 634f9eba688126b949c03e03fecfe8c4cfff0495 Mon Sep 17 00:00:00 2001 From: Tony Butler Date: Mon, 7 Feb 2022 13:07:10 -0700 Subject: [PATCH] Check for required L3CACHE object type in hwloc --- cmake/FindHWLOC.cmake | 7 +++++++ cmake/ghostrider.cmake | 1 + 2 files changed, 8 insertions(+) diff --git a/cmake/FindHWLOC.cmake b/cmake/FindHWLOC.cmake index 55309d3e..a3ca9984 100644 --- a/cmake/FindHWLOC.cmake +++ b/cmake/FindHWLOC.cmake @@ -23,3 +23,10 @@ set(HWLOC_INCLUDE_DIRS ${HWLOC_INCLUDE_DIR}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(HWLOC DEFAULT_MSG HWLOC_LIBRARY HWLOC_INCLUDE_DIR) + +include(CheckCSourceCompiles) +check_c_source_compiles( "#include \nint main(void) {hwloc_obj_t o; o->type = HWLOC_OBJ_L3CACHE; return 0;}" HAVE_HWLOC_OBJ_L3CACHE) +if (NOT HAVE_HWLOC_OBJ_L3CACHE) + message(STATUS "HWLOC is too old (v2 minimum), some algorithms will not be built, may cause other problems") + set(WITH_GHOSTRIDER OFF CACHE BOOL "Enable GhostRider algorithm" FORCE) +endif() diff --git a/cmake/ghostrider.cmake b/cmake/ghostrider.cmake index 3bc935b1..9a5b1745 100644 --- a/cmake/ghostrider.cmake +++ b/cmake/ghostrider.cmake @@ -3,6 +3,7 @@ if (WITH_GHOSTRIDER) add_subdirectory(src/crypto/ghostrider) set(GHOSTRIDER_LIBRARY ghostrider) else() + message(STATUS "WITH_GHOSTRIDER=OFF ... GhostRider algorithm disabled") remove_definitions(/DXMRIG_ALGO_GHOSTRIDER) set(GHOSTRIDER_LIBRARY "") endif()