Compile XDAG miner for Windows

FSOL
3 min readOct 25, 2022

--

Tutorial “from stratch” for compiling XMRIG fork with embedded rx/XDAG algo for Windows.

Photo composed by FSOL

1°/ Install and update MSYS2 environment

  • Run installation (follow guide as written on msys2’s website)
Select default path for install

When this window appear, you’re ready to go :

Now install gcc (GNU Compiler Collection) :

pacman -S mingw-w64-x86_64-gcc
gcc now install

Note : Follow upgrade process on https://www.msys2.org/docs/updating/ .

In details:

pacman -Suy
Confirm to close

After closing, repeat again :

pacman -Suy
Always confirm

In some case, AV program can rise up :

Create an exception if necessary to complete install

2°/ Cloning from GitHub

We need to install ‘git’ for msys2 :

pacman -S git
Always conf
cd 
git clone --branch xdag https://github.com/swordlet/xmrig.git

Same as above, AV program can rise up :

Create an exception if necessary

As you can see, we retreive XMRIG’s sources :

Optional :

If you want building ‘0 fee’ release, you should edit (with VSCODE by example)/xmrig/src/donate.h and modify lines 40 & 41 like this :

Note : Real path of donate.h is C:\msys64\home\<user>\xmrig\src\.

4°/ Install CMAKE for Windows

Download and install latest CMake release : https://cmake.org/download/

During install choose option Add CMake to the system PATH for all users or Add CMake to the system PATH for the current user. For all other choices, select items by default.

5°/ Now install XMRIG dependencies.

Nexts steps come from https://xmrig.com/docs/miner/build/windows :

  1. Create folder c:\xmrig-deps
  2. Download the most recent version of prebuilt dependencies by using the green Code button and Download ZIP
  3. Extract gcc folders to c:\xmrig-deps

6°/ Build something

Back to MSYS :

cd
mkdir xmrig/build && cd xmrig/scripts
"c:\Program Files\CMake\bin\cmake.exe" .. -G "Unix Makefiles" -DXMRIG_DEPS=c:/xmrig-deps/gcc/x64

And then you’ll get this result :

7°/ Build program

The end is near. Type this :

make -j$(nproc)

You’ll get this as result :

As you can see with ls -l , a file called ‘xmrig.exe’ has been created !

8°/ Proof Of Work

Copy ‘xmrig.exe’ + WinRing0x64.sys + your usual config.json file (already containing your wallet address & goods settings pool) in a same new folder, and run ‘xmrig.exe’. Don’t forget launch proxy before you need it.

Hocus-pocus’ you should get this :

BRAVO ! You did it !!!

This is XMRIG for XDAG compile with gcc instead of original release available on github who is compile with MSVC.

For going forward :

Check this out : https://xmrig.com/docs/miner/build/windows

--

--