From 22dd59cd672d876a99c719087117b19074cd0d49 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 1 Jul 2019 07:28:36 -0500 Subject: gn: Add octave@3.4.3. Add two upstream patches and package glpk@4.48 for octave to use. --- gn/packages/maths.scm | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 gn/packages/maths.scm (limited to 'gn/packages/maths.scm') diff --git a/gn/packages/maths.scm b/gn/packages/maths.scm new file mode 100644 index 0000000..f57459d --- /dev/null +++ b/gn/packages/maths.scm @@ -0,0 +1,74 @@ +(define-module (gn packages maths) + #:use-module (gnu packages) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix utils) + #:use-module (gnu packages base) + #:use-module (gnu packages gperf) + #:use-module (gnu packages maths) + #:use-module (gnu packages texinfo) + #:use-module (srfi srfi-1)) + +(define-public octave-3.4.3 + (package + (inherit octave-cli) + (name "octave") + (version "3.4.3") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://gnu/octave/octave-" + version ".tar.gz")) + (sha256 + (base32 + "04lh3crzwpramvfvxq34n2r29pmfl37rssj853nz9a3pyq7wrrir")) + (patches (search-patches "gnulib-gets.patch" + "octave-nested-class.patch")))) + (arguments + (substitute-keyword-arguments (package-arguments octave-cli) + ((#:configure-flags cf) + `(cons "--enable-docs=no" ; docs fail to build + ,cf)) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'patch-configure-script + (lambda _ + (substitute* '("configure" + "src/DLD-FUNCTIONS/__delaunayn__.cc" + "src/DLD-FUNCTIONS/__voronoi__.cc" + "src/DLD-FUNCTIONS/convhulln.cc") + (("qhull/qhull.h") "libqhull/libqhull.h") + (("qhull/qhull_a.h") "libqhull/qhull_a.h")) + #t)) + (replace 'configure-makeinfo + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/help.cc" + (("\"makeinfo\"") + (string-append + "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\""))) + #t)))))) + (native-inputs + `(("glibc-2.27" ,glibc-2.27) ; works around fseeko.c problem in gnulib + ,@(fold alist-delete (package-native-inputs octave-cli) + '("lzip")))) + (inputs + `(("glpk" ,glpk-4.48) + ("gperf" ,gperf) + ,@(fold alist-delete (package-inputs octave-cli) + ;; suitesparse provides cholmod_common_struct, may need older version + '("glpk" "suitesparse")))))) + +;; 4.49 is the last version with _glp_lpx_simplex exported +;; 4.49 is the version where all lpx_ routines were removed +(define-public glpk-4.48 + (package + (inherit glpk) + (version "4.48") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://gnu/glpk/glpk-" + version ".tar.gz")) + (sha256 + (base32 + "1cddqsdcfwavdklg7hsfifppsry81dx3c17wzk6r22mjjpwcihmb")))))) -- cgit v1.2.3 From 1647ee8c2f317d7c68ad1116741f931d0d1ebd5a Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 2 Jul 2019 12:23:04 -0500 Subject: gn: Octave@3.4.3: Build with glibc-2.28. [inputs]: Add newer fseeko.c from gnulib, remove glibc-2.27. [arguments]: Copy newer fseeko.c into place after unpacking. --- gn/packages/maths.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gn/packages/maths.scm') diff --git a/gn/packages/maths.scm b/gn/packages/maths.scm index f57459d..52e2a28 100644 --- a/gn/packages/maths.scm +++ b/gn/packages/maths.scm @@ -3,7 +3,6 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) - #:use-module (gnu packages base) #:use-module (gnu packages gperf) #:use-module (gnu packages maths) #:use-module (gnu packages texinfo) @@ -39,6 +38,8 @@ "src/DLD-FUNCTIONS/convhulln.cc") (("qhull/qhull.h") "libqhull/libqhull.h") (("qhull/qhull_a.h") "libqhull/qhull_a.h")) + (copy-file (assoc-ref %build-inputs "fseeko.c") + "libgnu/fseeko.c") #t)) (replace 'configure-makeinfo (lambda* (#:key inputs #:allow-other-keys) @@ -48,7 +49,13 @@ "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\""))) #t)))))) (native-inputs - `(("glibc-2.27" ,glibc-2.27) ; works around fseeko.c problem in gnulib + `(("fseeko.c" ,(origin + (method url-fetch) + (uri "https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/fseeko.c;hb=d40db5e23197dcd105fa3c0dc6633b51af3c08d9") + (file-name "gnulib-fseeko.c-0.0.0-1-d40db5e23") + (sha256 + (base32 + "1ifa5200pskgdzd6qi4nicwyjjkc415bs403mjrrzv8cdrf6hp3k")))) ,@(fold alist-delete (package-native-inputs octave-cli) '("lzip")))) (inputs -- cgit v1.2.3 From 1ad9db9d7f51dc11421c9c79006436bf47418571 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 8 Jul 2019 04:43:29 -0500 Subject: gn: Add suitesparse-3.5.0. --- gn/packages/maths.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'gn/packages/maths.scm') diff --git a/gn/packages/maths.scm b/gn/packages/maths.scm index 52e2a28..097000b 100644 --- a/gn/packages/maths.scm +++ b/gn/packages/maths.scm @@ -79,3 +79,49 @@ (sha256 (base32 "1cddqsdcfwavdklg7hsfifppsry81dx3c17wzk6r22mjjpwcihmb")))))) + +(define-public suitesparse-3.5.0 + (package + (inherit suitesparse) + (version "3.5.0") + (source + (origin + (method url-fetch) + (uri (string-append + "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-" + version ".tar.gz")) + (sha256 + (base32 + "0npn7c1j5qag5m2r0cmh3bwc42c1jk8k2yg2cfyxlcrp0h7wn4rc")))) + (arguments + (substitute-keyword-arguments (package-arguments suitesparse) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'build-without-metis + (lambda _ + (substitute* "UFconfig/UFconfig.mk" + (("CHOLMOD_CONFIG = ") + "CHOLMOD_CONFIG = -DNPARTITION") + (("SPQR_CONFIG = ") + "SPQR_CONFIG = -DNPARTITION") + (("METIS = ../../metis-4.0/libmetis.a") + "METIS =") + (("METIS_PATH = .*") + "METIS_PATH = \n")) + (substitute* "Makefile" + (("\\( .*CHOLMOD .*") "\n")) + #t)) + (add-after 'unpack 'fix-source + (lambda _ + (substitute* "UFconfig/Makefile" + (("Lib/") "")) + #t)) + (add-before 'install 'prepare-directories + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/lib")) + (mkdir-p (string-append out "/include"))) + #t)))))) + (inputs + `(,@(fold alist-delete (package-inputs suitesparse) + '("metis")))))) -- cgit v1.2.3 From 3a2654b63743fc23fa45ba1d2c85e61acc9d1c03 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 8 Jul 2019 06:50:44 -0500 Subject: gn: suitesparse-3.5.0: Build with -fPIC. --- gn/packages/maths.scm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gn/packages/maths.scm') diff --git a/gn/packages/maths.scm b/gn/packages/maths.scm index 097000b..d696176 100644 --- a/gn/packages/maths.scm +++ b/gn/packages/maths.scm @@ -115,6 +115,9 @@ (lambda _ (substitute* "UFconfig/Makefile" (("Lib/") "")) + ;; octave-3.4.3 expects it to be built with -fPIC + (substitute* "UFconfig/UFconfig.mk" + (("-O3") "-O3 -fPIC")) #t)) (add-before 'install 'prepare-directories (lambda* (#:key outputs #:allow-other-keys) -- cgit v1.2.3 From ec1280b48c11762699ffa84c8789a4dab2b56b4a Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 8 Jul 2019 08:02:00 -0500 Subject: gn: suitesparse-3.5.0: Build with metis. --- gn/packages/maths.scm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'gn/packages/maths.scm') diff --git a/gn/packages/maths.scm b/gn/packages/maths.scm index d696176..320d83c 100644 --- a/gn/packages/maths.scm +++ b/gn/packages/maths.scm @@ -97,19 +97,13 @@ (substitute-keyword-arguments (package-arguments suitesparse) ((#:phases phases) `(modify-phases ,phases - (add-after 'unpack 'build-without-metis - (lambda _ - (substitute* "UFconfig/UFconfig.mk" - (("CHOLMOD_CONFIG = ") - "CHOLMOD_CONFIG = -DNPARTITION") - (("SPQR_CONFIG = ") - "SPQR_CONFIG = -DNPARTITION") - (("METIS = ../../metis-4.0/libmetis.a") - "METIS =") - (("METIS_PATH = .*") - "METIS_PATH = \n")) - (substitute* "Makefile" - (("\\( .*CHOLMOD .*") "\n")) + (add-after 'unpack 'unpack-metis + (lambda* (#:key inputs #:allow-other-keys) + (let ((metis (assoc-ref inputs "metis-source"))) + (invoke "tar" "xvf" metis) + ;; backported from 4.0.3 + (substitute* (find-files "metis-4.0") + (("log2") "ilog2"))) #t)) (add-after 'unpack 'fix-source (lambda _ @@ -125,6 +119,14 @@ (mkdir-p (string-append out "/lib")) (mkdir-p (string-append out "/include"))) #t)))))) + (native-inputs + `(("metis-source" ,(origin + (method url-fetch) + (uri "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/OLD/metis-4.0.1.tar.gz") + (sha256 + (base32 + "0lnkdfdrmmyy67h356bgdc06acvmcr26av9kdvqlws12znrr5iv0")))) + ,@(package-native-inputs suitesparse))) (inputs `(,@(fold alist-delete (package-inputs suitesparse) '("metis")))))) -- cgit v1.2.3