>From 337ddd64ce4f3a00f33a90496822500dc6df2010 Mon Sep 17 00:00:00 2001 From: nixo Date: Sat, 28 Dec 2019 00:10:48 +0100 Subject: [PATCH] gnu: Add dsfmt. * gnu/packages/maths.scm (dsfmt): New variable. --- gnu/packages/maths.scm | 63 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 8364d528fd..1d35d880bd 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -372,6 +372,69 @@ semiconductors.") (license license:gpl3+) (home-page "https://www.gnu.org/software/dionysus/"))) +(define-public dsfmt + (package + (name "dsfmt") + (version "2.2.3") + (source (origin + (method url-fetch) + (uri + (string-append + "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-" + version ".tar.gz")) + (sha256 + (base32 + "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42")) + ;; julia needs those (and is the only program depending on dsfmt now) + (patches + (list + (origin (method url-fetch) + (uri + "https://raw.githubusercontent.com/JuliaLang/julia/v1.3.0/deps/patches/dSFMT.c.patch") + (sha256 (base32 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y")) + (file-name "dSFMT.c.patch")) + (origin (method url-fetch) + (uri + "https://raw.githubusercontent.com/JuliaLang/julia/v1.3.0/deps/patches/dSFMT.h.patch") + (sha256 (base32 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n")) + (file-name "dSFMT.h.patch")))))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) ;no configure script + (replace 'build + ;; upstream Makefile does not build a shared library + (lambda _ + (invoke + "gcc" + ;; flags copied from julia + ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk + "-DNDEBUG" "-DDSFMT_MEXP=19937" + "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES" + "-O3" "-finline-functions" "-fomit-frame-pointer" + "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800" + "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c" + "-o" "libdSFMT.so"))) + (replace 'install ;no "install" target + (lambda* (#:key outputs #:allow-other-keys) + (let ((lib (string-append (assoc-ref outputs "out") + "/lib")) + (inc (string-append (assoc-ref outputs "out") + "/include"))) + (install-file "libdSFMT.so" lib) + (install-file "dSFMT.h" inc) + #t)))))) + (synopsis "Double precision SIMD-oriented Fast Mersenne Twister") + (description "Speed up Fast Mersenne Twister generation by avoiding the +expensive conversion of integer to double (floating point). dSFMT directly +generates double precision floating point pseudorandom numbers which have the +IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985) +format. dSFMT is only available on the CPUs which use IEEE 754 format double +precision floating point numbers.") + (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/") + (license license:bsd-3))) + (define-public gsl (package (name "gsl") -- 2.25.0