Updated Compiling from source (markdown)

JayDDee
2022-01-14 17:04:49 -05:00
parent 8e00b5b1c2
commit 4aedb1f4ec

@@ -88,32 +88,35 @@ Windows compilation using Visual Studio is not supported. Mingw64 is used on a L
system (bare metal or virtual machine) to cross-compile cpuminer-opt binaries package
for Windows. That procedure follows this simpler one.
### Building for Windows, the easy way
cpuminer-opt can now be built on Windows for Windows using MinGW-w64 and MSYS2.
Windows 7 or newer is required.
Windows 7 or newer is required. The compiled executable can only run on the system where
it was built. Use the hard way for a portable package.
Download and install the latest version of msys2-x86_64 from https://www.msys2.org/
1. Download and install the latest version of msys2-x86_64 from https://www.msys2.org/
Install the following additional packages
2. Install the following additional packages
`$ pacman -Su autoconf libcurl-devel mingw-w64-x86_64-curl gmp-devel jansson-devel openssl-devel zlib-devel`
Set environment variable to allow cpuminer-opt to be run from a Windows terminal,
3. Set environment variable to allow cpuminer-opt to be run from a Windows terminal,
otherwise it can only run from an MSYS2 terminal.
https://stackoverflow.com/questions/6951938/libgmp-10-dll-is-missing
Download and decompress cpuminer-opt source code to your MSYS2 home directory,
4. Download and decompress cpuminer-opt source code to your MSYS2 home directory,
usually c:\msys2\home\[windows user]\ or a directory of your choice.
Open "MSYS2 MinGW-w64" from the Windows start menu and change directories to the downloaded
5. Open "MSYS2 MinGW-w64" from the Windows start menu, change directories to the downloaded
cpuminer-opt and compile.
`$ ./build.sh`
Run cpuminer.exe directly from an MSYS2 terminal or, if step 3 was performed above,
6. Run cpuminer.exe directly from an MSYS2 terminal or, if step 3 was performed above,
it can run in a Windows terminal on the same system.
## Building for Windows, the hard way
### Building for Windows, the hard way
This procedure is used to build the Windows binary release package and is done from a Linux environment.
@@ -130,7 +133,7 @@ It keeps all mingw stuff contained and isolated from the rest of the system.
Step by step...
### Install packages
#### Install packages
Install necessary packages from the distribution's repositories.
@@ -141,14 +144,14 @@ Additionally, install mingw-w64.
`sudo apt-get install mingw-w64 libz-mingw-w64-dev`
### Create a local library
#### Create a local library
Create a directory for libraries that that need to be compiled in the next stept step.
The Suggested location is $HOME/usr/lib/
`$ mkdir $HOME/usr/lib`
### Build libraries
#### Build libraries
Download and build other packages for mingw that don't have a mingw64 version available in the repositories.
@@ -193,7 +196,7 @@ gmp:
`make`
### Tweak the environment.
#### Tweak the environment.
This step is required everytime you login or the commands can be added to
.bashrc.
@@ -232,7 +235,7 @@ recreated every time a source package is decompressed.
`cp $LOCAL_LIB/curl/lib/.libs/libcurl-4.dll release/`
### Download cpuminer-opt
#### Download cpuminer-opt
The following steps need to be done every time a new source package is
opened.
@@ -245,7 +248,7 @@ https://github.com/JayDDee/cpuminer-opt/releases
Decompress and change to the cpuminer-opt directory.
### Compile
#### Compile
Create a link to the locally compiled version of gmp.h