-   Dylan14 (
-   -   pkgbuild reference thread (

Dylan14 2021-01-17 15:18

pkgbuild reference thread
This thread is intended to serve as reference material for the status of PKGBUILDS for software used by the various people on the forum. It is particularly useful for those that run Arch or derivatives, or for those that want to package the software onto a different Linux distribution, so people can use it without having to worry about compilation.

Table of contents:
1. Introduction (this post)

GIMPS related:
2. mprime ([URL][/URL])
3. mlucas ([URL][/URL])
4. gpuowl ([url][/url])
5. mfaktc ([url][/url])
6. mfakto
7. cudapm1
8. CUDALucas

Prime finding (general stuff):
9. LLR
10. pfgw64
11. mtsieve
12. srsieve (sr1, sr2, sr5)

13. etc tbd

Dylan14 2021-01-17 15:32

There are two packages for this program, both maintained by the [url=]AUR user graysky[/url]: mprime and mprime-bin. Both packages are on the latest stable build, which at the time of posting is 30.3b6.

The first package, [url=]mprime[/url] builds the program from scratch, which includes building the gwnum library (but it does not include it as part of the compiled package itself, which would be useful for those who want to build llr or pfgw from source). Included in the package is a patch file which basically fixes the make flags so that the program can successfully compile.
A downside to this is that the version of mprime built can't communicate with the work server, as to protect against fake result submission from modified clients.

The second package, [url=]mprime-bin[/url], is the precompiled version of the program, which is available on the main site. This can communicate with the work server. It's recommended to choose a directory to run mprime, or to set the appropriate options in the config files to ensure proper operation.

Dylan14 2021-01-17 15:45

There is a package for this program, developed by me [URL=""]here[/URL]. The program does not require any dependencies (outside of the standard ones in the base-devel group, which is needed to build stuff in the AUR).

The PKGBUILD for this program follows the same procedure recommended by Ernst to build the package from source. First, it checks /proc/cpuinfo to see what instructions the program supports (SSE2, AVX, AVX2, AVX512, and SIMD for ARM chips), and then compiles the code. Next, it checks if there are any errors by grepping build.log for error. If no such instances exist then it proceeds with linking and package the resulting executable up.

To get the program to compile properly, a patch is needed: sysctl-missing.patch, which is needed since sysctl.h is not included in version 5.5+ of the Linux Kernel.
In version 19 of the program, an additional patch was needed. This was to get rid of a reference to the fp pointer in the file Mlucas.c. Leaving it in there would cause the linker to complain. This has since been corrected in version 19.1, and therefore this patch is no longer needed.

Dylan14 2021-01-19 23:26

There is a package for this program, developed by me [URL=""]here[/URL]. This program requires two dependencies: gmp and ocl-icd (both of which are available on the main Arch repos).

The file uses the stable tag version of the program and not the latest git commit. Otherwise, it is a straightforward build process.

A git version of this package could also be developed, however, this would require several changes to the PKGBUILD. Namely, the source would have to change from the current archive link to git+[url][/url], checksums would have to be skipped, a pkgver() function would be needed to get the correct version, and possibly other changes. Also, I am not sure if the current git version is that much different from the stable 7.2 version.

Dylan14 2021-01-19 23:41

There is a package for this program, developed by me [URL=""]here[/URL]. This requires two dependencies: nvidia (the NVIDIA driver) and cuda (CUDA build environment), for the building of the program.

There is a patch needed to make the program build with the correct CC versions. This is contained in the file makeandparams.patch. The current version of CUDA at the time of this post (11.2) supports CC's 3.5-8.6. As new versions come out the NVCCFLAGS included in this patch file will need to be updated.
Also, the location of the CUDA toolkit has to be specified to be /opt/cuda/, instead of /usr/local/cuda/.

In addition, I changed the params.h file to allow the GPU_SIEVE_SIZE to go up to 2047.

Also provided is a default mfaktc.ini file, which is installed to /etc/mfaktc/mfaktc.ini. The user is advised to copy this into the directory in which he wants to run mfaktc in.

On occasion, a maximum CUDA version has to be specified since the driver may lag behind the CUDA toolkit. When this happens the user has 2 options: 1. Either downgrade CUDA and add cuda to the IgnorePkg line in /etc/pacman.conf until the driver catches up, or 2. Install the nvidia-beta driver from the AUR.

All times are UTC. The time now is 01:22.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.