gnu: clapack: Fix build with gcc-14.

* gnu/packages/maths.scm (clapack)[arguments]: Update to G-Expressions.  Add
"-Wno-error=implicit-function-declaration" to #:configure-flags to relax
gcc-14's strictness.

Change-Id: I23d05c5df64625b0ca04e18375e0ef7f42e85d5c
This commit is contained in:
Janneke Nieuwenhuizen 2025-08-21 20:18:07 +02:00
parent 0e6fddeaec
commit c40c613bda
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -1246,37 +1246,40 @@ of partial differential equations using iterative methods.")
"0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb")))) "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:configure-flags '("-DCMAKE_C_FLAGS=-fcommon -O2") (list
#:configure-flags
#~(list (string-append "-DCMAKE_C_FLAGS=-fcommon -O2"
" -Wno-error=implicit-function-declaration"))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
;; These tests use a lot of stack variables and segfault without ;; These tests use a lot of stack variables and segfault without
;; lifting resource limits. ;; lifting resource limits.
(add-after 'unpack 'disable-broken-tests (add-after 'unpack 'disable-broken-tests
(lambda _ (lambda _
(substitute* "TESTING/CMakeLists.txt" (substitute* "TESTING/CMakeLists.txt"
(("add_lapack_test.* xeigtstz\\)") "")))) (("add_lapack_test.* xeigtstz\\)") ""))))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (let ((libdir (string-append #$output "/lib"))
(libdir (string-append out "/lib")) (f2cinc (string-append #$output "/include/libf2c")))
(f2cinc (string-append out "/include/libf2c"))) (mkdir-p f2cinc)
(mkdir-p f2cinc) (display (getcwd))
(display (getcwd)) (for-each (lambda (file)
(for-each (lambda (file) (install-file file libdir))
(install-file file libdir)) '("SRC/liblapack.a"
'("SRC/liblapack.a" "F2CLIBS/libf2c/libf2c.a"
"F2CLIBS/libf2c/libf2c.a" "TESTING/MATGEN/libtmglib.a"
"TESTING/MATGEN/libtmglib.a" "BLAS/SRC/libblas.a"))
"BLAS/SRC/libblas.a")) (for-each (lambda (file)
(for-each (lambda (file) (install-file file f2cinc))
(install-file file f2cinc)) (cons "F2CLIBS/libf2c/arith.h"
(cons "F2CLIBS/libf2c/arith.h" (find-files (string-append
(find-files (string-append "../clapack-" "../clapack-"
,version "-CMAKE/F2CLIBS/libf2c") #$version "-CMAKE/F2CLIBS/libf2c")
"\\.h$"))) "\\.h$")))
(copy-recursively (string-append "../clapack-" (copy-recursively (string-append "../clapack-"
,version "-CMAKE/INCLUDE") #$version "-CMAKE/INCLUDE")
(string-append out "/include")))))))) (string-append #$output "/include"))))))))
(home-page "https://www.netlib.org/clapack/") (home-page "https://www.netlib.org/clapack/")
(synopsis "Numerical linear algebra library for C") (synopsis "Numerical linear algebra library for C")
(description (description