Git Product home page Git Product logo

build_xmrig_for_armv7's Introduction

How to build the XMRig for a Raspberry Pi machine with ARMv7 architecture

In the following notes we assume that you want to build the cpuminer-multi software for a Raspberry Pi with ARMv7 architecture.

Basically, ARMv7 and below are 32-bit while ARMv8 introduces the 64-bit instruction set. The latest version of Raspberry Pi 4 comes with an ARMv8 64-bit instruction set.

We will use the release v5.11.4 from the xmrig repository (but you can even compile v6.2.3).

Check your machine

Just to make sure you have an armv7 RPi you can run the following command in a shell prompt:

root@raspberrypi:~# uname -m

You should get a response like this:

root@raspberrypi:~# uname -m
armv7l
root@raspberrypi:~# 

Another way to check the architecture of your CPU is the lscpu command:

root@raspberrypi:~# lscpu 
Architecture:        armv7l
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
Vendor ID:           ARM
Model:               4
Model name:          Cortex-A53
Stepping:            r0p4
CPU max MHz:         1200.0000
CPU min MHz:         600.0000
BogoMIPS:            38.40
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

Install the required libraries in the system

Before starting the build please make sure you have installed the following libraries (make sure you are logged in as root otherwise you will have to use sudo infront of each of the commands):

root@raspberrypi:~#  apt update
root@raspberrypi:~#  apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev

Clone the GitHub repository of the software

We will use the main repository :

root@raspberrypi:~# wget https://github.com/xmrig/xmrig/archive/refs/tags/v5.11.4.zip
root@raspberrypi:~# unzip v5.11.4.zip

Prepare and build

root@raspberrypi:~# cd xmrig-5.11.4
root@raspberrypi:~/xmrig-5.11.4# mkdir build
root@raspberrypi:~/xmrig-5.11.4# cd build
root@raspberrypi:~/xmrig-5.11.4/build# cmake .. -DARM_TARGET=7
root@raspberrypi:~/xmrig-5.11.4/build# make

If you get any errors about

undefined reference to `__atomic...

please add following line to the file CMakeLists.txt: open with an editor:

nano CMakeLists.txt

and under the line:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

please add also this line:

set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")

Rerun the cmake command and if no errors appear you are ready to go:

root@raspberrypi:~/xmrig-5.11.4/build# make

Check miner

If everything gone well when you run the command :

root@raspberrypi:~/xmrig-5.11.4/build# ./xmrig --version 

You should get a similar screen like this:

XMRig 5.11.4
 built on Oct 12 2021 with GCC 8.3.0
 features:

libuv/1.24.1
OpenSSL/1.1.1d
hwloc/1

Start mining!

You are ready to create the configuration file,use your favorite mining pool and start mining:

root@raspberrypi:~/xmrig-5.11.4/build#  ./xmrig -c <config_filename>

Resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.