gnu: gsl: Fix test failures on i686-linux by building with -O2.

* gnu/packages/maths.scm (gsl)[arguments]: Pass #:make-flags '() on
i686-linux.  Remove modification of ‘linalg/test.c’ in
‘disable-failing-tests’ phase for i686-linux.

Change-Id: I615d4e0d71253ca294bc5c5c7a278e3046c186cc
This commit is contained in:
Ludovic Courtès 2024-08-18 16:32:45 +02:00
parent 4f55c361f4
commit 4d8382ab84
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -729,7 +729,16 @@ (define-public gsl
(build-system gnu-build-system)
(arguments
(let ((system (%current-system)))
`(#:make-flags (list "CFLAGS=-fPIC")
`(;; 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
@ -756,13 +765,6 @@ (define-public gsl
;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
'((add-before 'check 'disable-failing-tests
(lambda _
(substitute* "linalg/test.c"
((".*gsl_test\\(test_LU_decomp.*") "\n")
((".*gsl_test\\(test_LUc_decomp.*") "\n")
((".*gsl_test\\(test_QR_decomp_r.*") "\n")
((".*gsl_test\\(test_cholesky_decomp.*") "\n")
((".*gsl_test\\(test_pcholesky_solve.*") "\n")
((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
(substitute* "spmatrix/test.c"
((".*test_all.*") "\n")
((".*test_float.*") "\n")