From d6c940212513ccbee157fc0299ed7ccb619236e7 Mon Sep 17 00:00:00 2001 From: Botspot <54716352+Botspot@users.noreply.github.com> Date: Fri, 2 Aug 2024 19:07:36 -0500 Subject: [PATCH] xmrig: remove -ffast-math to make xmrig actually work See https://github.com/MoneroOcean/xmrig/issues/128 --- apps/XMRig/install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/XMRig/install b/apps/XMRig/install index 393a1cc599..f9c46da874 100755 --- a/apps/XMRig/install +++ b/apps/XMRig/install @@ -160,6 +160,9 @@ if true;then error "Failed to detect OS CPU architecture! Something is very wrong." fi + #remove xmrig built-in march cmake setting which is not as specific as mcpu=native + sed -i '/^ if (ARM_TARGET EQUAL 8)$/,/^ endif()$/d' /home/pi/xmrig/cmake/cpu.cmake + #Cmake flags: # -O3: enables many performance optimizations at the expense of compilation time. From: https://www.youtube.com/watch?v=4e0fRKHG7Hk # -mcpu=native: tunes the program for current system's detected CPU. From: https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu @@ -167,7 +170,7 @@ if true;then # -funsafe-loop-optimizations: Assume no overflowing loops # -DARM_TARGET: selects ARM processor major architecture - either 7 or 8 - cmake .. -DCMAKE_CXX_FLAGS="-O3 -mcpu=native -ffast-math -funsafe-loop-optimizations" -DCMAKE_C_FLAGS="-O3 -mcpu=native -ffast-math -funsafe-loop-optimizations" -DARM_TARGET="$DARM_TARGET" || error 'Failed to generate build files!' + cmake .. -DCMAKE_CXX_FLAGS="-O3 -mcpu=native -funsafe-loop-optimizations" -DCMAKE_C_FLAGS="-O3 -mcpu=native -funsafe-loop-optimizations" -DARM_TARGET="$DARM_TARGET" || error 'Failed to generate build files!' #More cmake flags that are specific to xmrig can be found at: https://xmrig.com/docs/miner/cmake-options #compile