Skip to content

Commit

Permalink
xmrig: remove -ffast-math to make xmrig actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
Botspot committed Aug 3, 2024
1 parent 941ef5d commit d6c9402
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/XMRig/install
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,17 @@ 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
# -ffast-math: speeds up math and seems to be stable for xmrig. From: https://github.com/xmrig/xmrig/issues/446#issuecomment-373450600
# -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
Expand Down

0 comments on commit d6c9402

Please sign in to comment.