aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/maths.scm
diff options
context:
space:
mode:
authorArun Isaac <arunisaac@systemreboot.net>2019-03-22 09:15:03 +0530
committerArun Isaac <arunisaac@systemreboot.net>2019-04-01 17:07:31 +0530
commit413f61265e8e2e4a5a71de92098bcf1234eb42ad (patch)
tree0757890708a606000f0b1d6019070bfc3384ba1f /gnu/packages/maths.scm
parentcce9e3792af1a6bddc507ef98e978156e36c09a6 (diff)
downloadguix-413f61265e8e2e4a5a71de92098bcf1234eb42ad.tar
guix-413f61265e8e2e4a5a71de92098bcf1234eb42ad.tar.gz
gnu: Add mlucas.
* gnu/packages/maths.scm (mlucas): New variable.
Diffstat (limited to 'gnu/packages/maths.scm')
-rw-r--r--gnu/packages/maths.scm51
1 files changed, 51 insertions, 0 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index a27633f30d..cc7459f674 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4827,3 +4827,54 @@ implemented as callable objects, and bases of finite element spaces.")
built on top of DUNE, the Distributed and Unified Numerics Environment.")
;; Either GPL version 2 with "runtime exception" or LGPLv3+.
(license (list license:lgpl3+ license:gpl2))))
+
+(define-public mlucas
+ (package
+ (name "mlucas")
+ (version "18")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
+ (sha256
+ (base32
+ "1ax12qj9lyvnx4vs3gx7l8r3wx5gjbsdswp5f00ik9z0wz7xf297"))))
+ (build-system gnu-build-system)
+ (inputs
+ `(("python2" ,python-2)))
+ (arguments
+ `(#:tests? #f ; no tests
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda _
+ (chdir "src")
+ (call-with-output-file "Makefile"
+ (lambda (port)
+ (format port "CC = gcc
+CFLAGS = -O3 ~a -DUSE_THREADS
+LDLIBS = -lm -lpthread -lrt
+Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
+"
+ ,(let ((system (or (%current-target-system)
+ (%current-system))))
+ (cond
+ ((string-prefix? "x86_64" system) "-DUSE_SSE2")
+ (else ""))))))
+ #t))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
+ (install-file "Mlucas" bin)
+ (install-file "primenet.py" bin))
+ #t)))))
+ (home-page "https://www.mersenne.org")
+ (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
+ (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
+numbers in search of a world-record prime. You may use it to test any
+suitable number as you wish, but it is preferable that you do so in a
+coordinated fashion, as part of the Great Internet Mersenne Prime
+Search (GIMPS). Mlucas also includes a simple Python script for assignment
+management via the GIMPS project's Primenet server.")
+ (license license:gpl2+)))