Skip to content

Commit

Permalink
v3.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JayDDee committed May 30, 2019
1 parent eb3f57b commit 77c5ae8
Show file tree
Hide file tree
Showing 82 changed files with 6,926 additions and 3,726 deletions.
126 changes: 126 additions & 0 deletions INSTALL_LINUX
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@


Requirements:

Intel Core2 or newer, or AMD Steamroller or newer CPU. ARM CPUs are not
supported.
64 bit Linux operating system. Apple is not supported.

Building on linux prerequisites:

It is assumed users know how to install packages on their system and
be able to compile standard source packages. This is basic Linux and
beyond the scope of cpuminer-opt. Regardless compiling is trivial if you
follow the instructions.

Make sure you have the basic development packages installed.
Here is a good start:

http://askubuntu.com/questions/457526/how-to-install-cpuminer-in-ubuntu

Install any additional dependencies needed by cpuminer-opt. The list below
are some of the ones that may not be in the default install and need to
be installed manually. There may be others, read the error messages they
will give a clue as to the missing package.

The following command should install everything you need on Debian based
distributions such as Ubuntu:

sudo apt-get install build-essential libssl-dev libcurl4-openssl-dev libjansson-dev libgmp-dev automake zlib1g-dev

build-essential (Development Tools package group on Fedora)
automake
libjansson-dev
libgmp-dev
libcurl4-openssl-dev
libssl-dev
lib-thread
zlib1g-dev

SHA support on AMD Ryzen CPUs requires gcc version 5 or higher and
openssl 1.1.0e or higher. Add one of the following, depending on the
compiler version, to CFLAGS:
"-march=native" or "-march=znver1" or "-msha".

Due to poor AVX2 performance on Ryzen users should add -DRYZEN_ to CFLAGS
to override multiway AVX2 on algos with sha256, and use SHA instead.

Additional instructions for static compilalation can be found here:
https://lxadm.com/Static_compilation_of_cpuminer
Static builds should only considered in a homogeneous HW and SW environment.
Local builds will always have the best performance and compatibility.

Extract cpuminer source.

tar xvzf cpuminer-opt-x.y.z.tar.gz
cd cpuminer-opt-x.y.z

Run ./build.sh to build on Linux or execute the following commands.

./autogen.sh
CFLAGS="-O3 -march=native -Wall" ./configure --with-curl
make

Start mining.

./cpuminer -a algo -o url -u username -p password

Windows

Precompiled Windows binaries are built on a Linux host using Mingw
with a more recent compiler than the following Windows hosted procedure.

Building on Windows prerequisites:

msys
mingw_w64
Visual C++ redistributable 2008 X64
openssl

Install msys and mingw_w64, only needed once.

Unpack msys into C:\msys or your preferred directory.

Install mingw_w64 from win-builds.
Follow instructions, check "msys or cygwin" and "x86_64" and accept default
existing msys instalation.

Open a msys shell by double clicking on msys.bat.
Note that msys shell uses linux syntax for file specifications, "C:\" is
mounted at "/c/".

Add mingw bin directory to PATH variable
PATH="/c/msys/opt/windows_64/bin/:$PATH"

Instalation complete, compile cpuminer-opt.

Unpack cpuminer-opt source files using tar from msys shell, or using 7zip
or similar Windows program.

In msys shell cd to miner directory.
cd /c/path/to/cpuminer-opt

Run build.sh to build on Windows or execute the following commands.

./autogen.sh
CFLAGS="-O3 -march=native -Wall" ./configure --with-curl
make

Start mining

cpuminer.exe -a algo -o url -u user -p password

The following tips may be useful for older AMD CPUs.

AMD CPUs older than Steamroller, including Athlon x2 and Phenom II x4, are
not supported by cpuminer-opt due to an incompatible implementation of SSE2
on these CPUs. Some algos may crash the miner with an invalid instruction.
Users are recommended to use an unoptimized miner such as cpuminer-multi.

Some users with AMD CPUs without AES_NI have reported problems compiling
with build.sh or "-march=native". Problems have included compile errors
and poor performance. These users are recommended to compile manually
specifying "-march=btver1" on the configure command line.

Support for even older x86_64 without AES_NI or SSE2 is not availble.

173 changes: 173 additions & 0 deletions INSTALL_WINDOWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
Instructions for compiling cpuminer-opt for Windows.


Windows compilation using Visual Studio is not supported. Mingw64 is
used on a Linux system (bare metal or virtual machine) to cross-compile
cpuminer-opt executable binaries for Windows.

These instructions were written for Debian and Ubuntu compatible distributions
but should work on other major distributions as well. However some of the
package names or file paths may be different.

It is assumed a Linux system is already available and running. And the user
has enough Linux knowledge to find and install packages and follow these
instructions.

First it is a good idea to create new user specifically for cross compiling.
It keeps all mingw stuff contained and isolated from the rest of the system.

Step by step...

1. Install necessary packages from the distribution's repositories.

Refer to Linux compile instructions and install required packages.

Additionally, install mingw-64.

sudo apt-get install mingw-w64


2. Create a local library directory for packages to be compiled in the next
step. Recommended location is $HOME/usr/lib/


3. Download and build other packages for mingw that don't have a mingw64
version available in the repositories.

Download the following source code packages from their respective and
respected download locations, copy them to ~/usr/lib/ and uncompress them.

openssl
curl
gmp

In most cases the latest vesrion is ok but it's safest to download
the same major and minor version as included in your distribution.

Run the following commands or follow the supplied instructions.
Do not run "make install" unless you are using ~/usr/lib, which isn't
recommended.

Some instructions insist on running "make check". If make check fails
it may still work, YMMV.

You can speed up "make" by using all CPU cores available with "-j n" where
n is the number of CPU threads you want to use.

openssl:

./Configure mingw64 shared --cross-compile-prefix=x86_64-w64-mingw32
make

curl:

./configure --with-winssl --with-winidn --host=x86_64-w64-mingw32
make

gmp:

./configure --host=x86_64-w64-mingw32
make



4. Tweak the environment.

This step is required everytime you login or the commands can be added to
.bashrc.

Define some local variables to point to local library.

export LOCAL_LIB="$HOME/usr/lib"

export LDFLAGS="-L$LOCAL_LIB/curl/lib/.libs -L$LOCAL_LIB/gmp/.libs -L$LOCAL_LIB/openssl"

export CONFIGURE_ARGS="--with-curl=$LOCAL_LIB/curl --with-crypto=$LOCAL_LIB/openssl --host=x86_64-w64-mingw32"

Create a release directory and copy some dll files previously built.
This can be done outside of cpuminer-opt and only needs to be done once.
If the release directory is in cpuminer-opt directory it needs to be
recreated every a source package is decompressed.

mkdir release
cp /usr/x86_64-w64-mingw32/lib/zlib1.dll release/
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll release/
cp /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/libstdc++-6.dll release/
cp /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/libgcc_s_seh-1.dll release/
cp $LOCAL_LIB/openssl/libcrypto-1_1-x64.dll release/
cp $LOCAL_LIB/curl/lib/.libs/libcurl-4.dll release/



The following steps need to be done every time a new source package is
opened.

5. Download cpuminer-opt

Download the latest source code package of cpumuner-opt to your desired
location. .zip or .tar.gz, your choice.

https://github.com/JayDDee/cpuminer-opt/releases

Decompress and change to the cpuminer-opt directory.



6. Prepare to compile

Create a link to the locally compiled version of gmp.h

ln -s $LOCAL_LIB/gmp-version/gmp.h ./gmp.h

Edit configure.ac to fix lipthread package name.

sed -i 's/"-lpthread"/"-lpthreadGC2"/g' configure.ac


7. Compile

you can use the default compile if you intend to use cpuminer-opt on the
same CPU and the virtual machine supports that architecture.

./build.sh

Otherwise you can compile manually while setting options in CFLAGS.

Some common options:

To compile for a specific CPU architecture:

CFLAGS="-O3 -march=znver1 -Wall" ./configure --with-curl

This will compile for AMD Ryzen.

You can compile more generically for a set of specific CPU features
if you know what features you want:

CFLAGS="-O3 -maes -msse4.2 -Wall" ./configure --with-curl

This will compile for an older CPU that does not have AVX.

You can find several examples in build-allarch.sh

If you have a CPU with more than 64 threads and Windows 7 or higher you
can enable the CPU Groups feature:

-D_WIN32_WINNT==0x0601

Once you have run configure successfully run make with n CPU threads:

make -j n

Copy cpuminer.exe to the release directory, compress and copy the release
directory to a Windows system and run cpuminer.exe from the command line.

Run cpuminer

In a command windows change directories to the unzipped release folder.
to get a list of all options:

cpuminer.exe --help

Command options are specific to where you mine. Refer to the pool's
instructions on how to set them.
18 changes: 13 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ cpuminer_SOURCES = \
algo/argon2/argon2d/argon2d/argon2.c \
algo/argon2/argon2d/argon2d/core.c \
algo/argon2/argon2d/argon2d/opt.c \
algo/argon2/argon2d/argon2d/thread.c \
algo/argon2/argon2d/argon2d/argon2d_thread.c \
algo/argon2/argon2d/argon2d/encoding.c \
algo/blake/sph_blake.c \
algo/blake/blake-hash-4way.c \
algo/blake/blake256-hash-4way.c \
algo/blake/blake512-hash-4way.c \
algo/blake/blake-gate.c \
algo/blake/blake.c \
algo/blake/blake-4way.c \
Expand Down Expand Up @@ -136,6 +137,8 @@ cpuminer_SOURCES = \
algo/nist5/nist5-4way.c \
algo/nist5/nist5.c \
algo/nist5/zr5.c \
algo/panama/sph_panama.c \
algo/radiogatun/sph_radiogatun.c \
algo/pluck.c \
algo/quark/quark-gate.c \
algo/quark/quark.c \
Expand Down Expand Up @@ -167,6 +170,7 @@ cpuminer_SOURCES = \
algo/shabal/shabal-hash-4way.c \
algo/shavite/sph_shavite.c \
algo/shavite/sph-shavite-aesni.c \
algo/shavite/shavite-hash-2way.c \
algo/shavite/shavite.c \
algo/simd/sph_simd.c \
algo/simd/nist.c \
Expand Down Expand Up @@ -240,16 +244,20 @@ cpuminer_SOURCES = \
algo/x15/x15-gate.c \
algo/x15/x15.c \
algo/x15/x15-4way.c \
algo/x16/x16r-gate.c \
algo/x16/x16r.c \
algo/x16/x16r-4way.c \
algo/x17/x17-gate.c \
algo/x17/x17.c \
algo/x17/x17-4way.c \
algo/x17/xevan-gate.c \
algo/x17/xevan.c \
algo/x17/xevan-4way.c \
algo/x17/x16r-gate.c \
algo/x17/x16r.c \
algo/x17/x16r-4way.c \
algo/x17/hmq1725.c \
algo/x17/sonoa-gate.c \
algo/x17/sonoa-4way.c \
algo/x17/sonoa.c \
algo/x20/x20r.c \
algo/yescrypt/yescrypt.c \
algo/yescrypt/sha256_Y.c \
algo/yescrypt/yescrypt-best.c \
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ https://bitcointalk.org/index.php?topic=1326803.0

mailto://jayddee246@gmail.com

See file RELEASE_NOTES for change log and compile instructions.
See file RELEASE_NOTES for change log and INSTALL_LINUX or INSTALL_WINDOWS
for compile instructions.

Requirements
------------
Expand Down Expand Up @@ -78,6 +79,7 @@ Supported Algorithms
lyra2h Hppcoin
lyra2re lyra2
lyra2rev2 lyra2v2, Vertcoin
lyra2rev3 lyrav2v3, Vertcoin
lyra2z Zcoin (XZC)
lyra2z330 Lyra2 330 rows, Zoin (ZOI)
m7m Magi (XMG)
Expand All @@ -100,6 +102,7 @@ Supported Algorithms
skein Skein+Sha (Skeincoin)
skein2 Double Skein (Woodcoin)
skunk Signatum (SIGT)
sonoa Sono
timetravel Machinecoin (MAC)
timetravel10 Bitcore
tribus Denarius (DNR)
Expand Down Expand Up @@ -130,6 +133,8 @@ Supported Algorithms
Errata
------

Cryptonight and variants are no longer supported, use another miner.

Neoscrypt crashes on Windows, use legacy version.

AMD CPUs older than Piledriver, including Athlon x2 and Phenom II x4, are not
Expand Down
Loading

0 comments on commit 77c5ae8

Please sign in to comment.