Skip to content

Latest commit

 

History

504 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Actions Status

Mlucas

Ernst Mayer's Mlucas and Mfactor programs for GIMPS

Ernst Mayer passed away unexpectedly on September 10, 2023. This repository contains his posthumously released Mlucas v21 code, which is now maintained by the Great Internet Mersenne Prime Search (GIMPS) community. AutoPrimeNet (the Python PrimeNet program) previously bundled with Mlucas is now maintained in a separate repository.

Mlucas and Mfactor are 100% open source programs. Mlucas is for primality and P-1 testing of Mersenne and Fermat numbers, including support for the Lucas-Lehmer, Probable prime (PRP) and Pépin tests. Mfactor is for trial factoring. They support x86 Intel and AMD, ARM and other CPUs.

Feature Mlucas Prime95/MPrime
Architectures x86 - SSE2 ✔️ ✔️
- x86 - AVX ✔️ ✔️
- x86 - AVX2 ✔️ ✔️
- x86 - FMA3 ✔️ ✔️
- x86 - IMCI512 ✔️
- x86 - AVX512 ✔️ (F, CD
KNL: F, CD, ER)
✔️ (F, optional DQ)
- ARM - ASIMD ✔️
- Other ✔️
Worktypes LL ✔️ ✔️
- PRP ✔️ ✔️
- TF Mfactor ✔️
- P-1 ✔️ ✔️
- P+1 ✔️
- ECM ✔️
- Pépin ✔️ PRP
- Suyama ✔️
PRP Proof generation ✔️
- Proof certification ✔️
Error Checking Jacobi (LL/P-1) LL only
- Gerbicz (PRP/Pépin) ✔️ ✔️
Random Shifts ✔️ ✔️
Interface CLI ✔️ MPrime only
- GUI Prime95 only
Multithreaded ✔️ ✔️
Multiple Workers Separate runs/processes ✔️
PrimeNet Support AutoPrimeNet ✔️
Max FFT Length 512M 32M (AVX)
50M (FMA3)
64M (AVX512)
Largest Exponent 8,937,021,911 595,700,000 (AVX)
922,668,300 (FMA3)
1,169,000,000 (AVX512)
Relative Performance ~50-90% 100%
Free 🆓 Yes, GPLv2 No, EULA
100% Open Source ✔️ Mostly
Claim Full EFF Awards ✔️

The original Mlucas README is available for posterity and contains a lot of information, but note that it is no longer up to date. For more information about Mlucas, please see the Mlucas subforum on the Mersenne Forum. The source code for and information about historical versions of Mlucas can be found on:

Usage

Automatic method

Linux users can use the Mlucas install script to automatically download, build, setup and run Mlucas, including downloading, setting up and running the AutoPrimeNet for automated PrimeNet assignments.

Manual method

Dependencies:

  • Make
  • GNU C or Clang compiler
  • *GNU Multiple Precision (GMP) library
  • *Portable Hardware Locality (hwloc) library
  • *Python 3

* Optional

Download

Linux
  1. Verify that the dependencies above are installed. On Debian and Ubuntu, run: sudo apt update and sudo apt install build-essential libgmp-dev libhwloc-dev.
  2. If one has git installed, just run: git clone https://github.com/primesearch/Mlucas.git. Otherwise, download the latest archive: wget https://github.com/primesearch/Mlucas/archive/main.tar.gz and then decompress the files: tar -xzvf main.tar.gz.
  3. To download AutoPrimeNet, run: wget -nv https://raw.github.com/tdulcet/AutoPrimeNet/main/autoprimenet.py.
macOS
  1. Verify that the dependencies above are installed. Run: brew install gmp hwloc.
  2. If one has git installed, just run: git clone https://github.com/primesearch/Mlucas.git. Otherwise, download the latest archive: curl -fLO https://github.com/primesearch/Mlucas/archive/main.tar.gz and then decompress the files: tar -xzvf main.tar.gz.
  3. To download AutoPrimeNet, run: curl -sSfLO https://raw.github.com/tdulcet/AutoPrimeNet/main/autoprimenet.py.
Windows

Native Windows builds are experimental. For now, Windows users should use the Windows Subsystem for Linux (WSL) and follow the Linux instructions above instead.

  1. Download and install MSYS2.
  2. Verify that the dependencies above are installed. With the MINGW64 environment, run: pacman -S mingw-w64-x86_64-gmp mingw-w64-x86_64-hwloc.
  3. If one has git installed, just run: git clone https://github.com/primesearch/Mlucas.git. Otherwise, download the latest archive: wget https://github.com/primesearch/Mlucas/archive/main.tar.gz and then decompress the files: tar -xzvf main.tar.gz.
  4. To download AutoPrimeNet, run: wget -nv https://raw.github.com/tdulcet/AutoPrimeNet/main/autoprimenet.py.

Build

  1. Change into the Mlucas directory. Run: cd Mlucas or cd Mlucas-main depending on which method one used to download it.
  2. Run:
    • To build Mlucas: bash makemake.sh [use_hwloc].
    • To build Mfactor: bash makemake.sh mfac [word], where word is optionally one of 1word, 2word, 3word, 4word or nword.

To build with Clang or another compiler instead of GCC, run: export CC=<compiler>, for example: export CC=clang.

Setup and Run

  1. Change into the obj directory. Run: cd obj or cd obj_mfac depending on if one built Mlucas or Mfactor respectively.

This README is still in progress. For now, see the original Mlucas README, which has more information about how to setup and run Mlucas. Also see Help below. Note that with Mlucas v21, if built with the hwloc library, one would want to use the new -core option instead of -cpu.

Help

The help.txt file includes a variety of usage information not covered in the original README, concentrating largely on the Mlucas command line options. A separate documentation page covers Fermat numbers.

Contributing

Pull requests welcome!

About

Ⓜ️ Ernst Mayer's Mlucas and Mfactor programs for GIMPS

Resources

Stars

22 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages