aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-08-18 16:37:55 +0200
committerLudovic Courtès <ludo@gnu.org>2024-08-31 10:45:46 +0200
commit461df5574fbadaaec71c774cd7eb38d091944532 (patch)
tree66c353a8d7291a510acae1d378ca43332d0ebff4 /gnu
parent4d8382ab840300ffe2a364d0e2a27b8db3d04fab (diff)
downloadguix-461df5574fbadaaec71c774cd7eb38d091944532.tar.gz
guix-461df5574fbadaaec71c774cd7eb38d091944532.zip
gnu: gsl: Use gexps.
* gnu/packages/maths.scm (gsl)[arguments]: Use gexps. Change-Id: Ic81576c61a237ff41d6ed767dcf58e38ca96e9ca
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/maths.scm121
1 files changed, 62 insertions, 59 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 76aec6b250..a308d5db65 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -728,65 +728,68 @@ precision floating point numbers.")
(outputs '("out" "static"))
(build-system gnu-build-system)
(arguments
- (let ((system (%current-system)))
- `(;; FIXME: Setting CFLAGS=-fPIC is not only unnecessary, it's also
- ;; harmful because it removes the default '-O2 -g', meaning that the
- ;; library ends up being compiled as -O0. Consequently, some
- ;; numerical tests fail, notably on i686-linux. TODO: Remove
- ;; 'CFLAGS=-fPIC' for all systems and revisit or remove
- ;; 'disable-failing-tests' phases accordingly.
- #:make-flags ,(if (and (not (%current-target-system))
- (string=? system "i686-linux"))
- ''()
- '(list "CFLAGS=-fPIC"))
- #:phases
- (modify-phases %standard-phases
- ,@(cond
- ((and (target-riscv64?)
- (%current-target-system))
- '((add-after 'unpack 'force-bootstrap
- (lambda _
- ;; gsl ships with an old configure script that does not
- ;; support riscv64. Regenerate it.
- (delete-file "configure")))))
-
- ((or (string-prefix? "aarch64" system)
- (string-prefix? "powerpc" system))
- ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
- ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
- '((add-before 'check 'disable-failing-tests
- (lambda _
- (substitute* "spmatrix/test.c"
- ((".*test_complex.*") "\n"))))))
-
- ((string-prefix? "i686" system)
- ;; There are rounding issues with these tests on i686:
- ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
- ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
- '((add-before 'check 'disable-failing-tests
- (lambda _
- (substitute* "spmatrix/test.c"
- ((".*test_all.*") "\n")
- ((".*test_float.*") "\n")
- ((".*test_complex.*") "\n"))
-
- ;; XXX: These tests abort with:
- ;; gsl: cholesky.c:645: ERROR: matrix is not positive definite
- (substitute* '("multifit_nlinear/test.c"
- "multilarge_nlinear/test.c")
- (("gsl_ieee_env_setup.*" all)
- (string-append "exit (77);\n" all)))))))
-
- (else '()))
- (add-after 'install 'move-static-library
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((static (string-append (assoc-ref outputs "static") "/lib/"))
- (out (string-append (assoc-ref outputs "out") "/lib/")))
- (mkdir-p static)
- (rename-file (string-append out "libgsl.a")
- (string-append static "libgsl.a"))
- (rename-file (string-append out "libgslcblas.a")
- (string-append static "libgslcblas.a")))))))))
+ (list ;; FIXME: Setting CFLAGS=-fPIC is not only unnecessary, it's also
+ ;; harmful because it removes the default '-O2 -g', meaning that the
+ ;; library ends up being compiled as -O0. Consequently, some
+ ;; numerical tests fail, notably on i686-linux. TODO: Remove
+ ;; 'CFLAGS=-fPIC' for all systems and revisit or remove
+ ;; 'disable-failing-tests' phases accordingly.
+ #:make-flags (if (and (not (%current-target-system))
+ (string=? (%current-system) "i686-linux"))
+ #~'()
+ #~(list "CFLAGS=-fPIC"))
+ #:phases
+ #~(modify-phases %standard-phases
+ #$@(cond
+ ((and (target-riscv64?)
+ (%current-target-system))
+ #~((add-after 'unpack 'force-bootstrap
+ (lambda _
+ ;; gsl ships with an old configure script that does not
+ ;; support riscv64. Regenerate it.
+ (delete-file "configure")))))
+
+ ((or (string-prefix? "aarch64" (%current-system))
+ (string-prefix? "powerpc" (%current-system)))
+ ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
+ ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
+ #~((add-before 'check 'disable-failing-tests
+ (lambda _
+ (substitute* "spmatrix/test.c"
+ ((".*test_complex.*")
+ "\n"))))))
+
+ ((string-prefix? "i686" (%current-system))
+ ;; There are rounding issues with these tests on i686:
+ ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
+ ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
+ #~((add-before 'check 'disable-failing-tests
+ (lambda _
+ (substitute* "spmatrix/test.c"
+ ((".*test_all.*") "\n")
+ ((".*test_float.*") "\n")
+ ((".*test_complex.*") "\n"))
+
+ ;; XXX: These tests abort with:
+ ;; gsl: cholesky.c:645: ERROR: matrix is not positive definite
+ (substitute* '("multifit_nlinear/test.c"
+ "multilarge_nlinear/test.c")
+ (("gsl_ieee_env_setup.*" all)
+ (string-append "exit (77);\n" all)))))))
+
+ (else #~()))
+ (add-after 'install 'move-static-library
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((static (string-append (assoc-ref outputs
+ "static")
+ "/lib/"))
+ (out (string-append (assoc-ref outputs "out")
+ "/lib/")))
+ (mkdir-p static)
+ (rename-file (string-append out "libgsl.a")
+ (string-append static "libgsl.a"))
+ (rename-file (string-append out "libgslcblas.a")
+ (string-append static "libgslcblas.a"))))))))
(native-inputs
(if (and (target-riscv64?)
(%current-target-system))