From 2313613db3e2e4a8f33422d7c2a2a1a76b457e0f Mon Sep 17 00:00:00 2001 From: Emerson Gomes Date: Sat, 22 Feb 2020 20:06:49 +0100 Subject: [PATCH] Added cpuminer-rkz --- Dockerfile | 21 +++++++++++++++++---- build.sh | 6 ++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 build.sh diff --git a/Dockerfile b/Dockerfile index 4858a60..4af4eef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ ENV GMP_URL https://gmplib.org/download/gmp/gmp-6.2.0.tar.bz2 ENV CURL_URL https://curl.haxx.se/download/curl-7.66.0.tar.bz2 ENV ZLIB_URL https://www.zlib.net/zlib-1.2.11.tar.gz ENV CPUMINER_URL https://github.com/JayDDee/cpuminer-opt - +ENV CPUMINER_RKZ_URL https://github.com/RickillerZ/cpuminer-RKZ RUN set -xe; \ swupd bundle-add ${BUILD_PACKAGES}; @@ -22,11 +22,16 @@ RUN set -xe; \ for i in ${GLIBC_URL} ${GMP_URL} ${CURL_URL}; \ do curl ${i} | tar xvj; \ done; \ - for i in ${TCMALLOC_URL} ${CPUMINER_URL}; \ + for i in ${CPUMINER_URL} ${CPUMINER_RKZ_URL}; \ do git clone $i; \ done -ENV CFLAGS "-Ofast -march=native -fno-math-errno -fno-semantic-interposition -fno-trapping-math -funroll-loops -fno-stack-protector -fpie -Wl,-z,max-page-size=0x1000 -falign-functions=32 -Wa,-mbranches-within-32B-boundaries" +ENV CFLAGS "-Ofast -march=native -mtune=native \ +-fno-math-errno -fno-semantic-interposition -fno-trapping-math -fno-exceptions \ +-fno-stack-protector -fpie \ +-Wl,-z,max-page-size=0x1000 \ +-falign-functions=32 -Wa,-mbranches-within-32B-boundaries" + ENV CXXFLAGS "${CFLAGS}" ENV CPPFLAGS "-D_FORTIFY_SOURCE=0" ENV LDFLAGS "-L/usr/local/lib" @@ -68,7 +73,15 @@ RUN set -xe; \ # Build Cpuminer RUN set -xe; \ export LDFLAGS="--static -static-libstdc++ -static-libgcc ${LDFLAGS}"; \ - cd /usr/src/cpu*; \ + cd /usr/src/cpuminer-opt; \ + sh autogen.sh; \ + ./configure --with-curl; \ + make -j $(nproc) && make install + +# Build Cpuminer-RKZ +RUN set -xe; \ + export LDFLAGS="--static -static-libstdc++ -static-libgcc ${LDFLAGS}"; \ + cd /usr/src/cpuminer-RKZ*; \ sh autogen.sh; \ ./configure --with-curl; \ make -j $(nproc) && make install diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..9c82512 --- /dev/null +++ b/build.sh @@ -0,0 +1,6 @@ +docker build -t cpu . +CID=$(sudo docker create cpu) +hash=$(cat /proc/cpuinfo | grep flags | uniq | md5sum | cut -b 1-8) +sudo docker cp ${CID}:/usr/src/cpuminer-opt/cpuminer ./cpuminer-opt-${hash} +sudo docker cp ${CID}:/usr/src/cpuminer-RKZ/cpuminer ./cpuminer-rkz-${hash} +sudo docker rm ${CID}