Updated Compiling from source (markdown)

JayDDee
2024-12-26 17:22:27 -05:00
parent 336d1dbcce
commit ca6419825c

@@ -2,7 +2,7 @@ Compiling cpuminer-opt from source code requires a different environment dependi
# Linux build environment
The following is based on Ubuntu and should also apply to other Debian based Linux distributions. Fedora and other distributions have different package managers and may have slightly different package naming. Some packages may have separate runtime and development versions of the same package. Ensure the development or source code versions versions are installed.
The following is based on Ubuntu and also applies to other Debian based Linux distributions. Fedora and other distributions have different package managers and may have slightly different package naming. Some packages may have separate runtime and development versions of the same package. Ensure the development or source code versions are installed.
Make sure you have the basic development packages installed. Here is a good start:
@@ -13,8 +13,7 @@ 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 compiler 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.
The following command should install everything you need on Debian based distributions.
`
$ sudo apt-get install build-essential automake libcurl4-openssl-dev libjansson-dev libgmp-dev zlib1g-dev git
@@ -23,7 +22,7 @@ $ sudo apt-get install build-essential automake libcurl4-openssl-dev libjansson-
# Windows build environment
cpuminer-top is compiled on Windows using MSys2 and MinGW64. This installs a Linux-like environment where cpuminer-opt can be compiled and run on a Windows computer. MS Visual Studio is not supported.
CPUS based on the x86_64 architecture (Intel & AMD) require Windows-7 64bit and newer. ARM64 CPUs require Windows-11 or newer.
CPUs based on the x86_64 architecture (Intel & AMD) require Windows-7 64bit and newer. ARM64 CPUs require Windows-11 or newer.
#### Install MSys2 MinGW64
@@ -44,15 +43,14 @@ git, openssh, wget, vim, zip, unzip ...
#### Update system Path variable (optional)
Add MSYS2 to the system Path environment variable to allow cpuminer-opt to run from a Windows terminal,
otherwise it can only run from an MSYS2 terminal. FYI: https://stackoverflow.com/questions/6951938/libgmp-10-dll-is-missing
It's possible to run cpuminer-opt from a Windows shell by adding MSYS2 to the system Path environment variable otherwise it can only run from an MSYS2 terminal. FYI: https://stackoverflow.com/questions/6951938/libgmp-10-dll-is-missing
If Windows tools are preferred cpuminer-opt can be downloaded to the Windows Documents folder and accessed from MSYS2 MinGW-w64 terminal using the path /c/users/[USER]/documents. Notepad++ and 7zip are useful Windows programs with good support for Linux file formats. The MSYS2 home directory can be accessed from Windows with C:\msys2\home\[USER].
#### Errata
* Windows on ARM64 is new and may have some isues.
* MacOS on ARM64 use Clang compiler produces many warnings that can be ignored.
* Windows on ARM64 may result in cpuminer-opt segfault. A workaround is documented in the compiling section below.
* Windows on ARM64 uses Clang compiler produces many warnings that can be ignored.
* Windows on ARM64 may result in cpuminer-opt segfault when starting up. A workaround is documented in the compiling section below.
* Windows with CPU groups enabled may produce affinity warnings at startup. The warnings can be ignored as affinity still seems to work correctly.
* Windows on ARM does not display CPU features correctly. The SW features are correct.
* CPU temperature and frequency reports are not supported on Windows.
@@ -75,7 +73,7 @@ For x86_64 replace "aarch64-elf-binutils" with "x86_64-elf-binutils".
#### Errata
* On MacOS m7m algo is not working due to problems linking gmp.
* MacOS on ARM64 Clang compiler is used which produces many warnings that fcan be ignored.
* MacOS on ARM64 Clang compiler is used which produces many warnings that can be ignored.
* MacOS on x86_64 is not yet supported, YMMV.
* MacOS on ARM64 does not display CPU features correctly. The SW features are correct.
* CPU temperature and frequency reports are not supported on MacOS.
@@ -119,12 +117,6 @@ N is the number of threads for the compiler to use.
Some newer CPU architectures may not be defined for "-march=native" in older versions of gcc and may not recognize new features using the default build script. It is often possible to compile an optimum build by manually specifying options.
For example Ryzen 7000 uses "-march-znver4" but is not yet supported as of gcc-12. It can be compiled with gcc-11 by using "-march=znver3 -mavx512f -mavx512dq -mavx512bw -mavx512vl"
Intel Alderlake removed support for AVX512 and is therefore not compatible with Rocketlake or Icelake. "march=alderlake" is supported in gcc-11, otherwise use the Skylake architecture, no additional options are needed.
New Intel Xeon CPUs are likely compatible with Rocketlake & Icelake builds if not directly supported by the compiler. Although Cascadelake is an HEDT architecture it doesn't include VAES and SHA which are included on all new CPUs and used by cpuminer-opt. YMMV.
Many examples for various desktop CPU architectures can be found for x86_64 in file build-allarch.sh, and for ARM64 in arbuild-all.sh.
Windows on ARM64 may crash with a segfault. Adding "-DARM_WIN_HACK" to CFLAGS and recompiling may workaround the crash.
@@ -136,7 +128,6 @@ Windows on ARM64 may crash with a segfault. Adding "-DARM_WIN_HACK" to CFLAGS an
On Windows the file has the .exe extension.
# Building for Windows, the hard way
This procedure is only used to build the Windows binary release package and is done from a Linux environment.