Skip to content

Commit

Permalink
Added cpuminer-rkz
Browse files Browse the repository at this point in the history
  • Loading branch information
emerzon committed Feb 22, 2020
1 parent f6bb8b4 commit 2313613
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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"
Expand Down Expand Up @@ -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
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit 2313613

Please sign in to comment.