- download xmrig: https://github.com/xmrig/xmrig/releases
- copy xmrig/scripts to xmrig-proxy/scripts
$ cp -frv xmrig/scripts xmrig-proxy/
$ cd xmrig-proxy && scripts/build_deps.sh
- edit cmake/cmake.flags
- find
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
and add-static
to it - result:
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++ -static")
$ mkdir -p build && cd build
$ cmake .. -DXMRIG_DEPS=scripts/deps
$ make -j`nproc`
xmrig-proxy built this way will work on most systems, although if you want a truly static binary you should compile on Alpine Linux.
- apk add git make cmake libstdc++ gcc g++ libuv-dev openssl-dev hwloc-dev
- apk add bash automake libtool m4 autom4te autoconf linux-headers
- (optional) edit
build.openssl.sh
and change the version from1.1.1m
to1.1.1n
for added security - scripts/build_deps.sh
$ mkdir -p build && cd build
$ cmake .. -DXMRIG_DEPS=scripts/deps
$ make -j`nproc`