diff options
| author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2024-09-12 15:12:36 +0200 |
|---|---|---|
| committer | Simon Tournier <zimon.toutoune@gmail.com> | 2025-02-14 12:40:23 +0100 |
| commit | 3b6e7eec6e27ce3b1b7cc4cce71f37b52f319184 (patch) | |
| tree | f1ebc8adddacd33bf6efcdb6d986f48718c12a56 | |
| parent | 3a916935311568b742d734cf76be8a45737f9382 (diff) | |
gnu: julia: Update to 1.9.3.
* gnu/packages/julia.scm (julia): Update to 1.9.3.
[arguments]: Use gexps.
[inputs, native-inputs]: Remove labels.
* gnu/packages/llvm.scm (llvm-julia): Rename to…
(llvm-14-julia): … this. Upgrade to 14.0.6-3.
* gnu/packages/patches/julia-1.9-build-tweaks.patch: New file.
* gnu/packages/patches/julia-Use-MPFR-4.2.patch: Remove.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
Co-authored-by: Philippe Virouleau <philippe.virouleau@inria.fr>
Change-Id: I6ef35c6cd31741a7725b50364dd0f8fa6a0c6424
| -rw-r--r-- | gnu/local.mk | 2 | ||||
| -rw-r--r-- | gnu/packages/julia.scm | 862 | ||||
| -rw-r--r-- | gnu/packages/llvm.scm | 38 | ||||
| -rw-r--r-- | gnu/packages/patches/julia-1.9-build-tweaks.patch | 152 | ||||
| -rw-r--r-- | gnu/packages/patches/julia-Use-MPFR-4.2.patch | 228 |
5 files changed, 651 insertions, 631 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index fbca6d4ce83..46ed98beeaf 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1644,8 +1644,8 @@ dist_patch_DATA = \ | |||
| 1644 | %D%/packages/patches/john-the-ripper-jumbo-with-gcc-11.patch \ | 1644 | %D%/packages/patches/john-the-ripper-jumbo-with-gcc-11.patch \ |
| 1645 | %D%/packages/patches/json-c-0.13-CVE-2020-12762.patch \ | 1645 | %D%/packages/patches/json-c-0.13-CVE-2020-12762.patch \ |
| 1646 | %D%/packages/patches/json-c-0.12-CVE-2020-12762.patch \ | 1646 | %D%/packages/patches/json-c-0.12-CVE-2020-12762.patch \ |
| 1647 | %D%/packages/patches/julia-1.9-build-tweaks.patch \ | ||
| 1647 | %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ | 1648 | %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ |
| 1648 | %D%/packages/patches/julia-Use-MPFR-4.2.patch \ | ||
| 1649 | %D%/packages/patches/libcall-ui-make-it-installable.patch \ | 1649 | %D%/packages/patches/libcall-ui-make-it-installable.patch \ |
| 1650 | %D%/packages/patches/libcamera-ipa_manager-disable-signature-verification.patch \ | 1650 | %D%/packages/patches/libcamera-ipa_manager-disable-signature-verification.patch \ |
| 1651 | %D%/packages/patches/libcss-check-format.patch \ | 1651 | %D%/packages/patches/libcss-check-format.patch \ |
diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm index 9668b3fd1ea..5c7d900a09f 100644 --- a/gnu/packages/julia.scm +++ b/gnu/packages/julia.scm | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #:use-module ((guix licenses) #:prefix license:) | 28 | #:use-module ((guix licenses) #:prefix license:) |
| 29 | #:use-module (guix packages) | 29 | #:use-module (guix packages) |
| 30 | #:use-module (guix download) | 30 | #:use-module (guix download) |
| 31 | #:use-module (guix gexp) | ||
| 31 | #:use-module (guix utils) | 32 | #:use-module (guix utils) |
| 32 | #:use-module (guix git-download) | 33 | #:use-module (guix git-download) |
| 33 | #:use-module (guix build-system gnu) | 34 | #:use-module (guix build-system gnu) |
| @@ -142,412 +143,493 @@ libraries. It is also a bit like @code{ldd} and @code{otool -L}.") | |||
| 142 | (define-public julia | 143 | (define-public julia |
| 143 | (package | 144 | (package |
| 144 | (name "julia") | 145 | (name "julia") |
| 145 | (version "1.8.3") | 146 | (version "1.9.3") |
| 146 | (source (origin | 147 | (source |
| 147 | (method url-fetch) | 148 | (origin |
| 148 | (uri (string-append | 149 | (method url-fetch) |
| 149 | "https://github.com/JuliaLang/julia/releases/download/v" | 150 | (uri (string-append |
| 150 | version "/julia-" version ".tar.gz")) | 151 | "https://github.com/JuliaLang/julia/releases/download/v" version |
| 151 | (sha256 | 152 | "/julia-" version ".tar.gz")) |
| 152 | (base32 | 153 | (sha256 |
| 153 | "0jf8dr5j7y8cjnr65kn38xps5h9m2qvi8g1yd8qgiip5r87ld3ad")) | 154 | (base32 "0788hbcr1v89crv2j3insy89lxs0zwjbxk9q73jpj4g7j26bszcd")) |
| 154 | (patches (search-patches "julia-SOURCE_DATE_EPOCH-mtime.patch" | 155 | (patches (search-patches "julia-SOURCE_DATE_EPOCH-mtime.patch" |
| 155 | "julia-Use-MPFR-4.2.patch")))) | 156 | "julia-1.9-build-tweaks.patch")))) |
| 156 | (build-system gnu-build-system) | 157 | (build-system gnu-build-system) |
| 157 | (arguments | 158 | (arguments |
| 158 | `(#:test-target "test" | 159 | (list #:test-target "test" |
| 159 | #:modules ((ice-9 match) | 160 | #:modules `((ice-9 match) |
| 160 | (guix build gnu-build-system) | 161 | (guix build gnu-build-system) |
| 161 | (guix build utils)) | 162 | (guix build utils)) |
| 162 | 163 | ||
| 163 | ;; The test suite takes many times longer than building and | 164 | ;; The test suite takes many times longer than building and |
| 164 | ;; can easily fail on smaller machines when they run out of memory. | 165 | ;; can easily fail on smaller machines when they run out of memory. |
| 165 | #:tests? ,(not (or (%current-target-system) | 166 | #:tests? (not (or (%current-target-system) |
| 166 | (target-aarch64?))) | 167 | (target-aarch64?))) |
| 167 | 168 | ||
| 168 | ;; Do not strip binaries to keep support for full backtraces. | 169 | ;; Do not strip binaries to keep support for full backtraces. |
| 169 | ;; See https://github.com/JuliaLang/julia/issues/17831 | 170 | ;; See https://github.com/JuliaLang/julia/issues/17831 |
| 170 | #:strip-binaries? #f | 171 | #:strip-binaries? #f |
| 171 | 172 | ||
| 172 | ;; The DSOs use $ORIGIN to refer to each other, but (guix build | 173 | ;; The DSOs use $ORIGIN to refer to each other, but (guix build |
| 173 | ;; gremlin) doesn't support it yet, so skip this phase. | 174 | ;; gremlin) doesn't support it yet, so skip this phase. |
| 174 | #:validate-runpath? #f | 175 | #:validate-runpath? #f |
| 175 | 176 | ||
| 176 | #:phases | 177 | #:phases |
| 177 | (modify-phases %standard-phases | 178 | #~(modify-phases %standard-phases |
| 178 | (delete 'configure) | 179 | (delete 'configure) |
| 179 | (add-after 'unpack 'prepare-deps | 180 | (add-after 'unpack 'prepare-deps |
| 180 | (lambda* (#:key inputs #:allow-other-keys) | 181 | (lambda* (#:key inputs #:allow-other-keys) |
| 181 | ;; needed by libwhich | 182 | ;; needed by libwhich |
| 182 | (setenv "LD_LIBRARY_PATH" | 183 | (match inputs |
| 183 | (string-join (map (lambda (pkg) | 184 | (((labels . directories) ...) |
| 184 | (string-append (assoc-ref inputs pkg) | 185 | (set-path-environment-variable |
| 185 | "/lib")) | 186 | "LD_LIBRARY_PATH" |
| 186 | '("curl" "dsfmt" | 187 | '("lib") directories))))) |
| 187 | "gmp" "lapack" | 188 | (add-before 'check 'set-home |
| 188 | "libssh2" "libnghttp2" "libgit2" | 189 | ;; Some tests require a home directory to be set. |
| 189 | "libblastrampoline" | 190 | (lambda _ |
| 190 | "mbedtls" "mpfr" | 191 | (setenv "HOME" "/tmp"))) |
| 191 | "openblas" "openlibm" "pcre2" | 192 | (add-before 'build 'fix-include-and-link-paths |
| 192 | "suitesparse" "gfortran:lib")) | 193 | (lambda* (#:key inputs #:allow-other-keys) |
| 193 | ":")))) | 194 | ;; The REPL must be linked with libuv. |
| 194 | ;; FIXME: Building the documentation requires Julia packages that | 195 | (substitute* "cli/Makefile" |
| 195 | ;; would be downloaded from the Internet. We should build them in a | 196 | (("JLDFLAGS \\+= ") |
| 196 | ;; separate build phase. | 197 | (string-append "JLDFLAGS += " |
| 197 | (add-after 'unpack 'disable-documentation | 198 | (search-input-file inputs |
| 198 | (lambda _ | 199 | "/lib/libuv.so") " "))))) |
| 199 | (substitute* "Makefile" | 200 | (add-before 'build 'fix-nested-dlopen |
| 200 | (("(install: .*) \\$\\(BUILDROOT\\)/doc/_build/html/en/index.html" _ line) | 201 | (lambda* (#:key inputs #:allow-other-keys) |
| 201 | (string-append line "\n")) | 202 | (substitute* "Make.inc" |
| 202 | (("src ui doc deps") | 203 | ;; See the patch comment for the explanation, *must* be updated |
| 203 | "src ui deps")))) | 204 | ;; when updating julia. |
| 204 | (add-after 'unpack 'activate-gnu-source-for-loader | 205 | (("GUIX_LIBUTF8PROC") |
| 205 | (lambda _ | 206 | (search-input-file inputs "/lib/libutf8proc.a"))) |
| 206 | (substitute* "cli/Makefile" | 207 | (substitute* "Makefile" |
| 207 | (("LOADER_CFLAGS =") "LOADER_CFLAGS = -D_GNU_SOURCE")))) | 208 | ;; See the patch comment for the explanation, *must* be updated |
| 208 | ;; libquadmath is not available on all architectures. | 209 | ;; when updating julia. |
| 209 | ;; https://github.com/JuliaLang/julia/issues/41613 | 210 | (("GUIX_LIBCHOLMOD") |
| 210 | (add-after 'unpack 'make-libquadmath-optional | 211 | (search-input-file inputs "/lib/libcholmod.so")) |
| 211 | (lambda _ | 212 | (("GUIX_LIBSPQR") |
| 212 | (substitute* "base/Makefile" | 213 | (search-input-file inputs "/lib/libspqr.so")) |
| 213 | (("libquadmath,0") "libquadmath,0,ALLOW_FAILURE")))) | 214 | (("GUIX_LIBSC") |
| 214 | (add-before 'check 'set-home | 215 | (search-input-file inputs |
| 215 | ;; Some tests require a home directory to be set. | 216 | "/lib/libsuitesparseconfig.so")) |
| 216 | (lambda _ (setenv "HOME" "/tmp"))) | 217 | (("GUIX_LIBUMFPACK") |
| 217 | (add-before 'build 'fix-include-and-link-paths | 218 | (search-input-file inputs "/lib/libumfpack.so"))))) |
| 218 | (lambda* (#:key inputs #:allow-other-keys) | 219 | (add-before 'build 'replace-default-shell |
| 219 | ;; The REPL must be linked with libuv. | 220 | (lambda* (#:key inputs #:allow-other-keys) |
| 220 | (substitute* "cli/Makefile" | 221 | (substitute* "base/client.jl" |
| 221 | (("JLDFLAGS \\+= ") | 222 | (("/bin/sh") |
| 222 | (string-append "JLDFLAGS += " | 223 | (search-input-file inputs "/bin/sh"))))) |
| 223 | (assoc-ref inputs "libuv") | 224 | (add-before 'build 'shared-objects-paths |
| 224 | "/lib/libuv.so "))))) | 225 | (lambda* (#:key inputs #:allow-other-keys) |
| 225 | (add-before 'build 'replace-default-shell | 226 | (let ((jlpath (lambda (pkgname) |
| 226 | (lambda* (#:key inputs #:allow-other-keys) | 227 | (string-append "stdlib/" pkgname |
| 227 | (substitute* "base/client.jl" | 228 | "_jll/src/" pkgname |
| 228 | (("/bin/sh") (search-input-file inputs "/bin/sh"))))) | 229 | "_jll.jl"))) |
| 229 | (add-before 'build 'shared-objects-paths | 230 | (jlbasepath (lambda (pkgname) |
| 230 | (lambda* (#:key inputs #:allow-other-keys) | 231 | (string-append "base/" pkgname |
| 231 | (let ((jlpath | 232 | ".jl"))) |
| 232 | (lambda (pkgname) | 233 | (tolib (lambda (libname) |
| 233 | (string-append | 234 | (search-input-file inputs |
| 234 | "stdlib/" pkgname "_jll/src/" pkgname "_jll.jl"))) | 235 | (string-append |
| 235 | (from | 236 | "/lib/" libname |
| 236 | (lambda (libname) | 237 | ".so")))) |
| 237 | (string-append "const " libname " = .*\\.so"))) | 238 | (toquotedlib (lambda (libname) |
| 238 | (to | 239 | (define file |
| 239 | (lambda* (pkg libname #:optional libname_jl) | 240 | (string-append "/lib/" |
| 241 | libname | ||
| 242 | ".so")) | ||
| 243 | (string-append "\"" | ||
| 244 | (search-input-file | ||
| 245 | inputs file) | ||
| 246 | "\""))) | ||
| 247 | (from (lambda (libname) | ||
| 248 | (string-append "const " libname | ||
| 249 | " = .*\\.so"))) | ||
| 250 | (to (lambda* (libname #:optional libname_jl) | ||
| 251 | (define file | ||
| 252 | (string-append "/lib/" libname ".so")) | ||
| 253 | |||
| 254 | (string-append "const " | ||
| 255 | (or libname_jl libname) | ||
| 256 | " = \"" | ||
| 257 | (search-input-file | ||
| 258 | inputs file))))) | ||
| 259 | (substitute* "src/jitlayers.cpp" | ||
| 260 | (("libatomic.so") | ||
| 261 | (search-input-file inputs "/lib/libatomic.so"))) | ||
| 262 | (substitute* (list (jlbasepath "linking") | ||
| 263 | (jlpath "LLD")) | ||
| 264 | (("\"lld\"") | ||
| 265 | (string-append "\"" | ||
| 266 | (search-input-file inputs | ||
| 267 | "/bin/lld") | ||
| 268 | "\""))) | ||
| 269 | (substitute* (jlbasepath "pcre") | ||
| 270 | (("libpcre2-8") | ||
| 271 | (tolib "libpcre2-8"))) | ||
| 272 | (substitute* (jlbasepath "gmp") | ||
| 273 | (("libgmp.so.10") | ||
| 274 | (tolib "libgmp"))) | ||
| 275 | (substitute* (jlbasepath "mpfr") | ||
| 276 | (("libmpfr.so.6") | ||
| 277 | (tolib "libmpfr"))) | ||
| 278 | (substitute* (jlbasepath "irrationals") | ||
| 279 | ((":libmpfr") | ||
| 280 | (toquotedlib "libmpfr"))) | ||
| 281 | (substitute* "stdlib/Random/src/generation.jl" | ||
| 282 | ((":libmpfr") | ||
| 283 | (toquotedlib "libmpfr"))) | ||
| 284 | (substitute* "stdlib/Printf/src/Printf.jl" | ||
| 285 | (("\"libmpfr\"") | ||
| 286 | (toquotedlib "libmpfr"))) | ||
| 287 | (substitute* "stdlib/Random/src/DSFMT.jl" | ||
| 288 | ((":libdSFMT") | ||
| 289 | (toquotedlib "libdSFMT"))) | ||
| 290 | (for-each (lambda (file) | ||
| 291 | (substitute* file | ||
| 292 | ((":libgit2") | ||
| 293 | (toquotedlib "libgit2")))) | ||
| 294 | (find-files "stdlib/LibGit2/" "\\.jl$")) | ||
| 295 | (substitute* (jlpath "CompilerSupportLibraries") | ||
| 296 | (((from "libgomp")) | ||
| 297 | (to "libgomp")) | ||
| 298 | (((from "libgfortran")) | ||
| 299 | (string-append | ||
| 300 | "const libgfortran = string(\"" | ||
| 301 | (search-input-file inputs | ||
| 302 | "/lib/libgfortran.so")))) | ||
| 303 | (substitute* (jlpath "dSFMT") | ||
| 304 | (((from "libdSFMT")) | ||
| 305 | (to "libdSFMT"))) | ||
| 306 | (substitute* (jlpath "GMP") | ||
| 307 | (((from "libgmp")) | ||
| 308 | (to "libgmp")) | ||
| 309 | (((from "libgmpxx")) | ||
| 310 | (to "libgmpxx"))) | ||
| 311 | (substitute* (jlpath "libLLVM") | ||
| 312 | (((from "libLLVM")) | ||
| 313 | (to "libLLVM"))) | ||
| 314 | (substitute* (jlbasepath "binaryplatforms") | ||
| 315 | (("libLLVM-14jl") | ||
| 316 | (tolib "libLLVM-14jl"))) | ||
| 317 | (substitute* (jlpath "LibCURL") | ||
| 318 | (((from "libcurl")) | ||
| 319 | (to "libcurl"))) | ||
| 320 | (substitute* (jlpath "LibGit2") | ||
| 321 | (((from "libgit2")) | ||
| 322 | (to "libgit2"))) | ||
| 323 | (substitute* (jlpath "LibSSH2") | ||
| 324 | (((from "libssh2")) | ||
| 325 | (to "libssh2"))) | ||
| 326 | (substitute* (jlpath "LibUV") | ||
| 327 | (((from "libuv")) | ||
| 328 | (to "libuv"))) | ||
| 329 | (substitute* (jlpath "LibUnwind") | ||
| 330 | (((from "libunwind")) | ||
| 331 | (to "libunwind"))) | ||
| 332 | (substitute* (jlpath "MPFR") | ||
| 333 | (((from "libmpfr")) | ||
| 334 | (to "libmpfr"))) | ||
| 335 | (substitute* (jlpath "MbedTLS") | ||
| 336 | (((from "libmbedcrypto")) | ||
| 337 | (to "libmbedcrypto")) | ||
| 338 | (((from "libmbedtls")) | ||
| 339 | (to "libmbedtls")) | ||
| 340 | (((from "libmbedx509")) | ||
| 341 | (to "libmbedx509"))) | ||
| 342 | (substitute* (jlpath "nghttp2") | ||
| 343 | (((from "libnghttp2")) | ||
| 344 | (to "libnghttp2"))) | ||
| 345 | (substitute* (jlpath "OpenBLAS") | ||
| 346 | (("libgfortran.so") | ||
| 347 | (tolib "libgfortran")) | ||
| 348 | (((from "libopenblas")) | ||
| 349 | #$@(if (target-x86-64?) | ||
| 350 | `((to "libopenblas64_" "libopenblas")) | ||
| 351 | `((to "libopenblas"))))) | ||
| 352 | (substitute* (jlpath "OpenLibm") | ||
| 353 | (((from "libopenlibm")) | ||
| 354 | (to "libopenlibm"))) | ||
| 355 | (substitute* (jlpath "PCRE2") | ||
| 356 | (((from "libpcre2_8")) | ||
| 357 | (to "libpcre2-8" "libpcre2_8"))) | ||
| 358 | (substitute* (jlpath "SuiteSparse") | ||
| 359 | (((from "libamd")) | ||
| 360 | (to "libamd")) | ||
| 361 | (((from "libbtf")) | ||
| 362 | (to "libbtf")) | ||
| 363 | (((from "libcamd")) | ||
| 364 | (to "libcamd")) | ||
| 365 | (((from "libccolamd")) | ||
| 366 | (to "libccolamd")) | ||
| 367 | (((from "libcholmod")) | ||
| 368 | (to "libcholmod")) | ||
| 369 | (((from "libcolamd")) | ||
| 370 | (to "libcolamd")) | ||
| 371 | (((from "libklu")) | ||
| 372 | (to "libklu")) | ||
| 373 | (((from "libldl")) | ||
| 374 | (to "libldl")) | ||
| 375 | (((from "librbio")) | ||
| 376 | (to "librbio")) | ||
| 377 | (((from "libspqr")) | ||
| 378 | (to "libspqr")) | ||
| 379 | (((from "libsuitesparse")) | ||
| 380 | (to "libsuitesparse")) | ||
| 381 | (((from "libsuitesparseconfig")) | ||
| 382 | (to "libsuitesparseconfig")) | ||
| 383 | (((from "libumfpack")) | ||
| 384 | (to "libumfpack"))) | ||
| 385 | (substitute* (jlpath "Zlib") | ||
| 386 | (((from "libz")) | ||
| 387 | (to "libz"))) | ||
| 388 | (substitute* (jlpath "libblastrampoline") | ||
| 389 | (("libblastrampoline\\.so") | ||
| 390 | (search-input-file inputs | ||
| 391 | "/lib/libblastrampoline.so")))))) | ||
| 392 | (add-before 'build 'use-ssl-cert-file | ||
| 393 | (lambda _ | ||
| 394 | ;; We must adapt MozillaCACerts to use SSL_CERT_FILE. | ||
| 395 | (substitute* "stdlib/MozillaCACerts_jll/src/MozillaCACerts_jll.jl" | ||
| 396 | (("global cacert = .*") | ||
| 240 | (string-append | 397 | (string-append |
| 241 | "const " (or libname_jl libname) " = \"" | 398 | "global cacert = get(ENV, \"SSL_CERT_FILE\"," |
| 242 | (assoc-ref inputs pkg) "/lib/" libname ".so")))) | 399 | ;; our fallback location. |
| 243 | (substitute* (jlpath "CompilerSupportLibraries") | 400 | "\"/etc/ssl/certs/ca-certificates.crt\")\n"))))) |
| 244 | (((from "libgfortran")) | 401 | (add-after 'unpack 'enable-parallel-tests |
| 245 | (string-append "const libgfortran = string(\"" | 402 | (lambda* (#:key parallel-tests? #:allow-other-keys) |
| 246 | (search-input-file inputs "/lib/libgfortran.so")))) | 403 | (when parallel-tests? |
| 247 | (substitute* (jlpath "dSFMT") | 404 | (setenv "JULIA_TEST_USE_MULTIPLE_WORKERS" "true")))) |
| 248 | (((from "libdSFMT")) (to "dsfmt" "libdSFMT"))) | 405 | (add-after 'unpack 'adjust-test-suite |
| 249 | (substitute* (jlpath "GMP") | 406 | (lambda* (#:key inputs #:allow-other-keys) |
| 250 | (((from "libgmp")) (to "gmp" "libgmp")) | 407 | (substitute* "test/spawn.jl" |
| 251 | (((from "libgmpxx")) (to "gmp" "libgmpxx"))) | 408 | (("shcmd = `sh`") |
| 252 | (substitute* (jlpath "libLLVM") | 409 | (string-append "shcmd = `" |
| 253 | (((from "libLLVM")) (to "llvm" "libLLVM"))) | 410 | (which "sh") "`"))) |
| 254 | (substitute* (jlpath "LibCURL") | ||
| 255 | (((from "libcurl")) (to "curl" "libcurl"))) | ||
| 256 | (substitute* (jlpath "LibGit2") | ||
| 257 | (((from "libgit2")) (to "libgit2" "libgit2"))) | ||
| 258 | (substitute* (jlpath "LibSSH2") | ||
| 259 | (((from "libssh2")) (to "libssh2" "libssh2"))) | ||
| 260 | (substitute* (jlpath "LibUV") | ||
| 261 | (((from "libuv")) (to "libuv" "libuv"))) | ||
| 262 | (substitute* (jlpath "LibUnwind") | ||
| 263 | (((from "libunwind")) (to "libunwind" "libunwind"))) | ||
| 264 | (substitute* (jlpath "MPFR") | ||
| 265 | (((from "libmpfr")) (to "mpfr" "libmpfr"))) | ||
| 266 | (substitute* (jlpath "MbedTLS") | ||
| 267 | (((from "libmbedcrypto")) (to "mbedtls" "libmbedcrypto")) | ||
| 268 | (((from "libmbedtls")) (to "mbedtls" "libmbedtls")) | ||
| 269 | (((from "libmbedx509")) (to "mbedtls" "libmbedx509"))) | ||
| 270 | (substitute* (jlpath "nghttp2") | ||
| 271 | (((from "libnghttp2")) (to "libnghttp2" "libnghttp2"))) | ||
| 272 | (substitute* (jlpath "OpenBLAS") | ||
| 273 | (((from "libopenblas")) | ||
| 274 | ,@(if (target-x86-64?) | ||
| 275 | `((to "openblas" "libopenblas64_" "libopenblas")) | ||
| 276 | `((to "openblas" "libopenblas"))))) | ||
| 277 | (substitute* (jlpath "OpenLibm") | ||
| 278 | (((from "libopenlibm")) (to "openlibm" "libopenlibm"))) | ||
| 279 | (substitute* (jlpath "PCRE2") | ||
| 280 | (((from "libpcre2_8")) (to "pcre2" "libpcre2-8" "libpcre2_8"))) | ||
| 281 | (substitute* (jlpath "SuiteSparse") | ||
| 282 | (((from "libamd")) (to "suitesparse" "libamd")) | ||
| 283 | (((from "libbtf")) (to "suitesparse" "libbtf")) | ||
| 284 | (((from "libcamd")) (to "suitesparse" "libcamd")) | ||
| 285 | (((from "libccolamd")) (to "suitesparse" "libccolamd")) | ||
| 286 | (((from "libcholmod")) (to "suitesparse" "libcholmod")) | ||
| 287 | (((from "libcolamd")) (to "suitesparse" "libcolamd")) | ||
| 288 | (((from "libklu")) (to "suitesparse" "libklu")) | ||
| 289 | (((from "libldl")) (to "suitesparse" "libldl")) | ||
| 290 | (((from "librbio")) (to "suitesparse" "librbio")) | ||
| 291 | (((from "libspqr")) (to "suitesparse" "libspqr")) | ||
| 292 | (((from "libsuitesparse")) (to "suitesparse" "libsuitesparse")) | ||
| 293 | (((from "libsuitesparseconfig")) | ||
| 294 | (to "suitesparse" "libsuitesparseconfig")) | ||
| 295 | (((from "libumfpack")) (to "suitesparse" "libumfpack"))) | ||
| 296 | (substitute* (jlpath "Zlib") | ||
| 297 | (((from "libz")) (to "zlib" "libz"))) | ||
| 298 | (substitute* (jlpath "libblastrampoline") | ||
| 299 | (("libblastrampoline\\.so") | ||
| 300 | (search-input-file inputs "/lib/libblastrampoline.so")))))) | ||
| 301 | (add-before 'build 'use-ssl-cert-file | ||
| 302 | (lambda _ | ||
| 303 | ;; We must adapt MozillaCACerts to use SSL_CERT_FILE. | ||
| 304 | (substitute* "stdlib/MozillaCACerts_jll/src/MozillaCACerts_jll.jl" | ||
| 305 | (("global cacert = .*") | ||
| 306 | (string-append | ||
| 307 | "global cacert = get(ENV, \"SSL_CERT_FILE\"," | ||
| 308 | ;; our fallback location. | ||
| 309 | "\"/etc/ssl/certs/ca-certificates.crt\")\n"))))) | ||
| 310 | (add-after 'unpack 'enable-parallel-tests | ||
| 311 | (lambda* (#:key parallel-tests? #:allow-other-keys) | ||
| 312 | (when parallel-tests? | ||
| 313 | (setenv "JULIA_TEST_USE_MULTIPLE_WORKERS" "true")))) | ||
| 314 | (add-after 'unpack 'adjust-test-suite | ||
| 315 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 316 | (substitute* "test/spawn.jl" | ||
| 317 | (("shcmd = `sh`") (string-append "shcmd = `" (which "sh") "`"))) | ||
| 318 | ;; Some tests only check to see if the input is the correct version. | ||
| 319 | (substitute* "stdlib/PCRE2_jll/test/runtests.jl" | ||
| 320 | (("10.40.0") ,(package-version (this-package-input "pcre2")))) | ||
| 321 | (substitute* "stdlib/MbedTLS_jll/test/runtests.jl" | ||
| 322 | (("2.28.0") ,(package-version (this-package-input "mbedtls")))) | ||
| 323 | (substitute* "stdlib/MPFR_jll/test/runtests.jl" | ||
| 324 | (("4.1.0") ,(package-version (this-package-input "mpfr")))) | ||
| 325 | (substitute* "stdlib/GMP_jll/test/runtests.jl" | ||
| 326 | (("6.2.1") ,(package-version (this-package-input "gmp")))) | ||
| 327 | (substitute* "stdlib/LibGit2_jll/test/runtests.jl" | ||
| 328 | (("1.3.0") ,(package-version (this-package-input "libgit2")))) | ||
| 329 | (substitute* "stdlib/nghttp2_jll/test/runtests.jl" | ||
| 330 | (("1.48.0") ,(package-version (this-package-input "libnghttp2")))) | ||
| 331 | (substitute* "stdlib/Zlib_jll/test/runtests.jl" | ||
| 332 | (("1.2.12") ,(package-version (this-package-input "zlib")))) | ||
| 333 | (substitute* "stdlib/SuiteSparse_jll/test/runtests.jl" | ||
| 334 | (("5010") ,(string-replace-substring | ||
| 335 | (version-major+minor | ||
| 336 | (package-version | ||
| 337 | (this-package-input "suitesparse"))) "." "0"))))) | ||
| 338 | (add-before 'check 'disable-broken-tests | ||
| 339 | (lambda _ | ||
| 340 | ;; disabling REPL tests because they require a stdin | ||
| 341 | ;; There are some read-only precompile issues in the 1.6 series. | ||
| 342 | ;; https://github.com/JuliaLang/julia/pull/41614 | ||
| 343 | ;; https://github.com/JuliaLang/julia/issues/41156 | ||
| 344 | (substitute* "test/choosetests.jl" | ||
| 345 | (("\"cmdlineargs\",") "") | ||
| 346 | (("\"precompile\",") "")) | ||
| 347 | ;; Dates/io tests fail on master when networking is unavailable | ||
| 348 | ;; https://github.com/JuliaLang/julia/issues/34655 | ||
| 349 | (substitute* "stdlib/Dates/test/io.jl" | ||
| 350 | (("using Dates") "import Dates | ||
| 351 | using Dates: @dateformat_str, Date, DateTime, DateFormat, Time")) | ||
| 352 | ;; julia embeds a certificate, we are not doing that | ||
| 353 | (substitute* "stdlib/MozillaCACerts_jll/test/runtests.jl" | ||
| 354 | (("@test isfile\\(MozillaCACerts_jll.cacert\\)") | ||
| 355 | "@test_broken isfile(MozillaCACerts_jll.cacert)")) | ||
| 356 | ;; since certificate is not present some tests are failing in network option | ||
| 357 | (substitute* "usr/share/julia/stdlib/v1.8/NetworkOptions/test/runtests.jl" | ||
| 358 | (("@test isfile\\(bundled_ca_roots\\(\\)\\)") | ||
| 359 | "@test_broken isfile(bundled_ca_roots())") | ||
| 360 | (("@test ispath\\(ca_roots_path\\(\\)\\)") | ||
| 361 | "@test_broken ispath(ca_roots_path())") | ||
| 362 | (("@test ca_roots_path\\(\\) \\!= bundled_ca_roots\\(\\)") | ||
| 363 | "@test_broken ca_roots_path() != bundled_ca_roots()")) | ||
| 364 | ;; WARNING: failed to select UTF-8 encoding, using ASCII | ||
| 365 | ;; Using 'setlocale' doesn't affect the test failures. | ||
| 366 | ;(setlocale LC_ALL "en_US.utf8") | ||
| 367 | ;(setenv "LC_ALL" "en_US.utf8") | ||
| 368 | (substitute* "test/cmdlineargs.jl" | ||
| 369 | (("test v\\[3") "test_broken v[3") | ||
| 370 | (("test isempty\\(v\\[3") "test_broken isempty(v[3")) | ||
| 371 | ;; These test(s) randomly fails because they depend on CPU. | ||
| 372 | (substitute* "test/math.jl" | ||
| 373 | ;; @test_broken cannot be used because if the test randomly | ||
| 374 | ;; passes, then it also raises an error. | ||
| 375 | (("@test isinf\\(log1p\\(-one\\(T\\)\\)\\)") | ||
| 376 | " ")) | ||
| 377 | 411 | ||
| 378 | ;; These are new test failures for 1.8: | 412 | ;; Some tests only check to see if the input is the correct version. |
| 379 | ;; This test passes on some architectures and fails on others. | 413 | (substitute* "stdlib/PCRE2_jll/test/runtests.jl" |
| 380 | (substitute* "stdlib/LinearAlgebra/test/lu.jl" | 414 | (("10\\.42\\.0") |
| 381 | (("@test String") "@test_skip String")) | 415 | #$(package-version (this-package-input "pcre2")))) |
| 416 | (substitute* "stdlib/MbedTLS_jll/test/runtests.jl" | ||
| 417 | (("2\\.28\\.2") | ||
| 418 | #$(package-version (this-package-input "mbedtls-apache")))) | ||
| 419 | (substitute* "stdlib/MPFR_jll/test/runtests.jl" | ||
| 420 | (("4\\.1\\.1") | ||
| 421 | #$(package-version (this-package-input "mpfr")))) | ||
| 422 | (substitute* "stdlib/GMP_jll/test/runtests.jl" | ||
| 423 | (("6\\.2\\.1") | ||
| 424 | #$(package-version (this-package-input "gmp")))) | ||
| 425 | (substitute* "stdlib/LibGit2_jll/test/runtests.jl" | ||
| 426 | (("1\\.5\\.0") | ||
| 427 | #$(package-version (this-package-input "libgit2")))) | ||
| 428 | (substitute* "stdlib/nghttp2_jll/test/runtests.jl" | ||
| 429 | (("1\\.48\\.0") | ||
| 430 | #$(package-version (this-package-input "nghttp2")))) | ||
| 431 | (substitute* "stdlib/Zlib_jll/test/runtests.jl" | ||
| 432 | (("1\\.2\\.13") | ||
| 433 | #$(package-version (this-package-input "zlib")))) | ||
| 434 | (substitute* "stdlib/SuiteSparse_jll/test/runtests.jl" | ||
| 435 | (("5010") | ||
| 436 | #$(string-replace-substring | ||
| 437 | (version-major+minor | ||
| 438 | (package-version | ||
| 439 | (this-package-input "suitesparse"))) "." "0"))))) | ||
| 440 | (add-before 'check 'disable-broken-tests | ||
| 441 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 442 | ;; disabling REPL tests because they require a stdin | ||
| 443 | ;; There are some read-only precompile issues in the 1.6 series. | ||
| 444 | ;; https://github.com/JuliaLang/julia/pull/41614 | ||
| 445 | ;; https://github.com/JuliaLang/julia/issues/41156 | ||
| 446 | (substitute* "test/choosetests.jl" | ||
| 447 | (("\"cmdlineargs\",") | ||
| 448 | "") | ||
| 449 | (("\"precompile\",") | ||
| 450 | "")) | ||
| 451 | ;; Distributed test with remote execution | ||
| 452 | (substitute* "usr/share/julia/stdlib/v1.9/Distributed/test/distributed_exec.jl" | ||
| 453 | (("using Test,") | ||
| 454 | "exit()\n")) | ||
| 455 | ;; Dates/io tests fail on master when networking is unavailable | ||
| 456 | ;; https://github.com/JuliaLang/julia/issues/34655 | ||
| 457 | (substitute* "stdlib/Dates/test/io.jl" | ||
| 458 | (("using Dates") | ||
| 459 | "import Dates | ||
| 460 | using Dates: @dateformat_str, Date, DateTime, DateFormat, Time")) | ||
| 461 | ;; julia embeds a certificate, we are not doing that | ||
| 462 | (substitute* "stdlib/MozillaCACerts_jll/test/runtests.jl" | ||
| 463 | (("@test isfile\\(MozillaCACerts_jll.cacert\\)") | ||
| 464 | "@test_broken isfile(MozillaCACerts_jll.cacert)")) | ||
| 465 | ;; since certificate is not present some tests are failing in network option | ||
| 466 | (substitute* "usr/share/julia/stdlib/v1.9/NetworkOptions/test/runtests.jl" | ||
| 467 | (("@test isfile\\(bundled_ca_roots\\(\\)\\)") | ||
| 468 | "@test_broken isfile(bundled_ca_roots())") | ||
| 469 | (("@test ispath\\(ca_roots_path\\(\\)\\)") | ||
| 470 | "@test_broken ispath(ca_roots_path())") | ||
| 471 | (("@test ca_roots_path\\(\\) \\!= bundled_ca_roots\\(\\)") | ||
| 472 | "@test_broken ca_roots_path() != bundled_ca_roots()")) | ||
| 473 | ;; WARNING: failed to select UTF-8 encoding, using ASCII | ||
| 474 | ;; Using 'setlocale' doesn't affect the test failures. | ||
| 475 | ;; (setlocale LC_ALL "en_US.utf8") | ||
| 476 | ;; (setenv "LC_ALL" "en_US.utf8") | ||
| 477 | (substitute* "test/cmdlineargs.jl" | ||
| 478 | (("test v\\[3") | ||
| 479 | "test_broken v[3") | ||
| 480 | (("test isempty\\(v\\[3") | ||
| 481 | "test_broken isempty(v[3")) | ||
| 482 | ;; These test(s) randomly fails because they depend on CPU. | ||
| 483 | (substitute* "test/math.jl" | ||
| 484 | ;; @test_broken cannot be used because if the test randomly | ||
| 485 | ;; passes, then it also raises an error. | ||
| 486 | (("@test isinf\\(log1p\\(-one\\(T\\)\\)\\)") | ||
| 487 | " ")) | ||
| 382 | 488 | ||
| 383 | (substitute* "stdlib/InteractiveUtils/test/runtests.jl" | 489 | ;; These are new test failures for 1.8: |
| 384 | (("@test !occursin\\(\"Environment") | 490 | ;; This test passes on some architectures and fails on others. |
| 385 | "@test_broken !occursin(\"Environment") | 491 | (substitute* "stdlib/LinearAlgebra/test/lu.jl" |
| 386 | (("@test occursin\\(\"Environment") | 492 | (("@test String") |
| 387 | "@test_broken occursin(\"Environment")) | 493 | "@test_skip String")) |
| 388 | (substitute* "usr/share/julia/stdlib/v1.8/Statistics/test/runtests.jl" | ||
| 389 | (("@test cov\\(A") "@test_skip cov(A") | ||
| 390 | (("@test isfinite") "@test_skip isfinite")) | ||
| 391 | ;; LoadError: SuiteSparse threads test failed with nthreads == 4 | ||
| 392 | (substitute* "usr/share/julia/stdlib/v1.8/SuiteSparse/test/runtests.jl" | ||
| 393 | (("Base\\.USE_GPL_LIBS") "false")) | ||
| 394 | ;; Got exception outside of a @test | ||
| 395 | ;; LinearAlgebra.LAPACKException(16) | ||
| 396 | ;; eliminate all the test bits. | ||
| 397 | (substitute* "stdlib/LinearAlgebra/test/schur.jl" | ||
| 398 | (("f = schur\\(A, B\\)") "f = schur(A, A)") | ||
| 399 | (("@test f\\.Q\\*f\\.S\\*f\\.Z'.*") "\n") | ||
| 400 | (("@test f\\.Q\\*f\\.T\\*f\\.Z'.*") "\n")) | ||
| 401 | (substitute* "test/threads.jl" | ||
| 402 | (("@test success") "@test_broken success")))) | ||
| 403 | ;; Doesn't this just mean they weren't linked correctly? | ||
| 404 | (add-after 'install 'symlink-missing-libraries | ||
| 405 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 406 | (let* ((out (assoc-ref outputs "out")) | ||
| 407 | (link | ||
| 408 | (lambda (pkgname pred) | ||
| 409 | (map (lambda (file) | ||
| 410 | (unless (file-exists? | ||
| 411 | (string-append out "/lib/julia/" | ||
| 412 | (basename file))) | ||
| 413 | (symlink file (string-append out "/lib/julia/" | ||
| 414 | (basename file))))) | ||
| 415 | (find-files (string-append (assoc-ref inputs pkgname) | ||
| 416 | "/lib") pred))))) | ||
| 417 | (link "libunwind" "libunwind\\.so") | ||
| 418 | (link "llvm" "libLLVM-13jl\\.so") | ||
| 419 | (link "utf8proc" "libutf8proc\\.so") | ||
| 420 | (link "zlib" "libz\\.so")))) | ||
| 421 | (add-after 'install 'make-wrapper | ||
| 422 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 423 | (let* ((out (assoc-ref outputs "out")) | ||
| 424 | (bin (string-append out "/bin")) | ||
| 425 | (program "julia")) | ||
| 426 | (with-directory-excursion bin | ||
| 427 | (wrap-program program | ||
| 428 | `("JULIA_LOAD_PATH" ":" prefix | ||
| 429 | ("" "$JULIA_LOAD_PATH")) | ||
| 430 | `("JULIA_DEPOT_PATH" ":" prefix | ||
| 431 | ("" "$JULIA_DEPOT_PATH")))))))) | ||
| 432 | #:make-flags | ||
| 433 | (list | ||
| 434 | "VERBOSE=1" ;; more helpful logging of what make is doing | ||
| 435 | (string-append "prefix=" (assoc-ref %outputs "out")) | ||
| 436 | 494 | ||
| 437 | ;; Passing the MARCH or JULIA_CPU_TARGET flag is necessary to build | 495 | (substitute* "usr/share/julia/stdlib/v1.9/Statistics/test/runtests.jl" |
| 438 | ;; binary substitutes for the supported architectures. See also | 496 | (("@test cov\\(A") |
| 439 | ;; https://docs.julialang.org/en/v1/devdocs/sysimg/#Specifying-multiple-system-image-targets | 497 | "@test_skip cov(A") |
| 440 | ,(match (or (%current-target-system) | 498 | (("@test isfinite") |
| 441 | (%current-system)) | 499 | "@test_skip isfinite")) |
| 442 | ("x86_64-linux" | 500 | ;; LoadError: SuiteSparse threads test failed with nthreads == 4 |
| 443 | ;; These are the flags that upstream uses for their binaries. | 501 | (substitute* "usr/share/julia/stdlib/v1.9/SuiteSparse/test/runtests.jl" |
| 444 | "JULIA_CPU_TARGET=generic;generic,-cx16,clone_all;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)") | 502 | (("Base\\.USE_GPL_LIBS") |
| 445 | ("i686-linux" "MARCH=pentium4") | 503 | "false")) |
| 446 | ("armhf-linux" "JULIA_CPU_TARGET=armv7-a,neon") | 504 | ;; Got exception outside of a @test |
| 447 | ("powerpc64le-linux" "JULIA_CPU_TARGET=pwr8") | 505 | ;; LinearAlgebra.LAPACKException(16) |
| 448 | ;; Prevent errors when querying this package on unsupported | 506 | ;; eliminate all the test bits. |
| 449 | ;; platforms, e.g. when running "guix package --search=" | 507 | (substitute* "stdlib/LinearAlgebra/test/schur.jl" |
| 450 | ;; and also of targeting the builder's architecture. | 508 | (("f = schur\\(A, B\\)") |
| 451 | (_ "JULIA_CPU_TARGET=generic")) | 509 | "f = schur(A, A)") |
| 510 | (("@test f\\.Q\\*f\\.S\\*f\\.Z'.*") | ||
| 511 | "\n") | ||
| 512 | (("@test f\\.Q\\*f\\.T\\*f\\.Z'.*") | ||
| 513 | "\n")))) | ||
| 514 | ;; Doesn't this just mean they weren't linked correctly? | ||
| 515 | (add-after 'install 'symlink-missing-libraries | ||
| 516 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 517 | (let* ((out (assoc-ref outputs "out")) | ||
| 518 | (link (lambda (pkgname pred) | ||
| 519 | (map (lambda (file) | ||
| 520 | (unless (file-exists? (string-append | ||
| 521 | out | ||
| 522 | "/lib/julia/" | ||
| 523 | (basename | ||
| 524 | file))) | ||
| 525 | (symlink file | ||
| 526 | (string-append | ||
| 527 | out | ||
| 528 | "/lib/julia/" | ||
| 529 | (basename file))))) | ||
| 530 | (find-files (string-append (assoc-ref | ||
| 531 | inputs | ||
| 532 | pkgname) | ||
| 533 | "/lib") pred))))) | ||
| 534 | (link "libunwind-julia" "libunwind\\.so") | ||
| 535 | (link "llvm" "libLLVM-14jl\\.so") | ||
| 536 | (link "gmp" "libgmp\\.so.10") | ||
| 537 | (link "mpfr" "libmpfr\\.so.6") | ||
| 538 | (link "zlib" "libz\\.so")))) | ||
| 539 | (add-after 'install 'make-wrapper | ||
| 540 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 541 | (let* ((out (assoc-ref outputs "out")) | ||
| 542 | (bin (string-append out "/bin")) | ||
| 543 | (program "julia")) | ||
| 544 | (with-directory-excursion bin | ||
| 545 | (wrap-program program | ||
| 546 | `("JULIA_LOAD_PATH" ":" prefix | ||
| 547 | ("" "$JULIA_LOAD_PATH")) | ||
| 548 | `("JULIA_DEPOT_PATH" ":" prefix | ||
| 549 | ("" "$JULIA_DEPOT_PATH")))))))) | ||
| 452 | 550 | ||
| 453 | "CONFIG_SHELL=bash -x" ; needed to build bundled libraries | 551 | #:make-flags |
| 454 | "USE_BINARYBUILDER=0" | 552 | #~(list (string-append "prefix=" |
| 455 | ;; list (and order!) of "USE_SYSTEM_*" is here: | 553 | (assoc-ref %outputs "out")) |
| 456 | ;; https://github.com/JuliaLang/julia/blob/v1.8.2/Make.inc | ||
| 457 | "USE_SYSTEM_CSL=1" | ||
| 458 | "USE_SYSTEM_LLVM=1" | ||
| 459 | "USE_SYSTEM_LIBUNWIND=1" | ||
| 460 | "USE_SYSTEM_PCRE=1" | ||
| 461 | "USE_SYSTEM_OPENLIBM=1" | ||
| 462 | "USE_SYSTEM_DSFMT=1" | ||
| 463 | "USE_SYSTEM_LIBBLASTRAMPOLINE=1" | ||
| 464 | "USE_SYSTEM_BLAS=1" | ||
| 465 | "USE_SYSTEM_LAPACK=1" | ||
| 466 | "USE_SYSTEM_GMP=1" | ||
| 467 | "USE_SYSTEM_MPFR=1" | ||
| 468 | "USE_SYSTEM_LIBSUITESPARSE=1" | ||
| 469 | "USE_SYSTEM_LIBUV=1" | ||
| 470 | "USE_SYSTEM_UTF8PROC=1" | ||
| 471 | "USE_SYSTEM_MBEDTLS=1" | ||
| 472 | "USE_SYSTEM_LIBSSH2=1" | ||
| 473 | "USE_SYSTEM_NGHTTP2=1" | ||
| 474 | "USE_SYSTEM_CURL=1" | ||
| 475 | "USE_SYSTEM_LIBGIT2=1" | ||
| 476 | "USE_SYSTEM_PATCHELF=1" | ||
| 477 | "USE_SYSTEM_LIBWHICH=1" | ||
| 478 | "USE_SYSTEM_ZLIB=1" | ||
| 479 | "USE_SYSTEM_P7ZIP=1" | ||
| 480 | 554 | ||
| 481 | "USE_LLVM_SHLIB=1" | 555 | ;; Passing the MARCH or JULIA_CPU_TARGET flag is necessary to build |
| 556 | ;; binary substitutes for the supported architectures. See also | ||
| 557 | ;; https://docs.julialang.org/en/v1/devdocs/sysimg/#Specifying-multiple-system-image-targets | ||
| 558 | #$(match (or (%current-target-system) | ||
| 559 | (%current-system)) | ||
| 560 | ("x86_64-linux" | ||
| 561 | ;; These are the flags that upstream uses for their binaries. | ||
| 562 | "JULIA_CPU_TARGET=generic;generic,-cx16,clone_all;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)") | ||
| 563 | ("i686-linux" "MARCH=pentium4") | ||
| 564 | ("armhf-linux" | ||
| 565 | "JULIA_CPU_TARGET=armv7-a,neon") | ||
| 566 | ("powerpc64le-linux" | ||
| 567 | "JULIA_CPU_TARGET=pwr8") | ||
| 568 | ;; Prevent errors when querying this package on unsupported | ||
| 569 | ;; platforms, e.g. when running "guix package --search=" | ||
| 570 | ;; and also of targeting the builder's architecture. | ||
| 571 | (_ "JULIA_CPU_TARGET=generic")) | ||
| 482 | 572 | ||
| 483 | "NO_GIT=1" ; build from release tarball. | 573 | "CONFIG_SHELL=bash -x" ;needed to build bundled libraries |
| 484 | "USE_GPL_LIBS=1" ; proudly | 574 | (string-append "CC=" |
| 575 | #$(cc-for-target)) | ||
| 485 | 576 | ||
| 486 | ,@(if (target-x86-64?) | 577 | #$@(if (target-x86-64?) |
| 487 | `("USE_BLAS64=1" | 578 | `("USE_BLAS64=1" |
| 488 | "LIBBLAS=-lopenblas64_" | 579 | "LIBBLAS=-lopenblas64_" |
| 489 | "LIBBLASNAME=libopenblas64_") | 580 | "LIBBLASNAME=libopenblas64_") |
| 490 | `("USE_BLAS64=0" | 581 | `("USE_BLAS64=0" "LIBBLAS=-lopenblas" |
| 491 | "LIBBLAS=-lopenblas" | 582 | "LIBBLASNAME=libopenblas")) |
| 492 | "LIBBLASNAME=libopenblas")) | ||
| 493 | 583 | ||
| 494 | (string-append "UTF8PROC_INC=" | 584 | (string-append "UTF8PROC_INC=" |
| 495 | (assoc-ref %build-inputs "utf8proc") | 585 | (assoc-ref %build-inputs "utf8proc") |
| 496 | "/include") | 586 | "/include") |
| 497 | ;; Make.inc expects a static library for libuv. | 587 | ;; Make.inc expects a static library for libuv. |
| 498 | (string-append "LIBUV=" | 588 | (string-append "LIBUV=" |
| 499 | (assoc-ref %build-inputs "libuv") | 589 | (search-input-file %build-inputs |
| 500 | "/lib/libuv.a") | 590 | "/lib/libuv.a")) |
| 501 | (string-append "LIBUV_INC=" | 591 | (string-append "LIBUV_INC=" |
| 502 | (assoc-ref %build-inputs "libuv") | 592 | (dirname |
| 503 | "/include")))) | 593 | (search-input-file |
| 504 | (inputs | 594 | %build-inputs "/include/uv.h")))))) |
| 505 | `(("bash-minimal" ,bash-minimal) | 595 | (inputs (list coreutils ;for bindings to "mkdir" and the like |
| 506 | ("coreutils" ,coreutils) ; for bindings to "mkdir" and the like | 596 | curl-ssh |
| 507 | ("curl" ,curl-ssh) | 597 | gfortran |
| 508 | ("gfortran" ,gfortran) | 598 | `(,gfortran "lib") ;required for libgcc_s.so |
| 509 | ;; required for libgcc_s.so | 599 | gmp |
| 510 | ("gfortran:lib" ,gfortran "lib") | 600 | lapack |
| 511 | ("gmp" ,gmp) | 601 | libblastrampoline |
| 512 | ("lapack" ,lapack) | 602 | libgit2-1.5 |
| 513 | ("libblastrampoline" ,libblastrampoline) | 603 | `(,nghttp2 "lib") |
| 514 | ("libgit2" ,libgit2-1.3) | 604 | libssh2 |
| 515 | ("libnghttp2" ,nghttp2 "lib") | 605 | libunwind-julia |
| 516 | ("libssh2" ,libssh2) | 606 | libuv-julia |
| 517 | ("libunwind" ,libunwind-julia) | 607 | llvm-14-julia |
| 518 | ("libuv" ,libuv-julia) | 608 | lld-14 |
| 519 | ("llvm" ,llvm-julia) | 609 | mbedtls-apache |
| 520 | ("mbedtls" ,mbedtls-lts) | 610 | mpfr |
| 521 | ("mpfr" ,mpfr) | 611 | (if (target-x86-64?) openblas-ilp64 openblas) |
| 522 | ,@(if (target-x86-64?) | 612 | openlibm |
| 523 | `(("openblas" ,openblas-ilp64)) | 613 | p7zip |
| 524 | `(("openblas" ,openblas))) | 614 | pcre2 |
| 525 | ("openlibm" ,openlibm) | 615 | suitesparse |
| 526 | ("p7zip" ,p7zip) | 616 | utf8proc-2.7.0 |
| 527 | ("pcre2" ,pcre2) | 617 | wget |
| 528 | ("suitesparse" ,suitesparse) | 618 | which |
| 529 | ("utf8proc" ,utf8proc-2.7.0) | 619 | zlib |
| 530 | ("wget" ,wget) | 620 | ;; Find dependencies versions here: |
| 531 | ("which" ,which) | 621 | ;; https://raw.githubusercontent.com/JuliaLang/julia/v1.6.0/deps/Versions.make |
| 532 | ("zlib" ,zlib) | 622 | dsfmt |
| 533 | ;; Find dependencies versions here: | 623 | libwhich)) |
| 534 | ;; https://raw.githubusercontent.com/JuliaLang/julia/v1.6.0/deps/Versions.make | 624 | (native-inputs (list openssl perl patchelf pkg-config python)) |
| 535 | ("dsfmt" ,dsfmt) | ||
| 536 | ("libwhich" ,libwhich))) | ||
| 537 | (native-inputs | ||
| 538 | `(("openssl" ,openssl) | ||
| 539 | ("perl" ,perl) | ||
| 540 | ("patchelf" ,patchelf) | ||
| 541 | ("pkg-config" ,pkg-config) | ||
| 542 | ("python" ,python))) | ||
| 543 | (native-search-paths | 625 | (native-search-paths |
| 544 | (list (search-path-specification | 626 | (list (search-path-specification |
| 545 | (variable "JULIA_LOAD_PATH") | 627 | (variable "JULIA_LOAD_PATH") |
| 546 | (files (list "share/julia/loadpath/"))) | 628 | (files (list "share/julia/loadpath/"))) |
| 547 | (search-path-specification | 629 | (search-path-specification |
| 548 | (variable "JULIA_DEPOT_PATH") | 630 | (variable "JULIA_DEPOT_PATH") |
| 549 | (files (list "share/julia/"))) | 631 | (files (list "share/julia/"))) |
| 550 | $SSL_CERT_FILE)) | 632 | $SSL_CERT_FILE)) |
| 551 | ;; Julia only officially supports some of our platforms: | 633 | ;; Julia only officially supports some of our platforms: |
| 552 | ;; https://julialang.org/downloads/#supported_platforms | 634 | ;; https://julialang.org/downloads/#supported_platforms |
| 553 | (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux")) | 635 | (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux")) |
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index f1058ebbc95..7d446585595 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014, 2016, 2018 Eric Bavier <bavier@member.fsf.org> | 2 | ;;; Copyright © 2014, 2016, 2018 Eric Bavier <bavier@member.fsf.org> |
| 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
| 4 | ;;; Copyright © 2015, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> | 4 | ;;; Copyright © 2015, 2017-2021, 2024 Ludovic Courtès <ludo@gnu.org> |
| 5 | ;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com> | 5 | ;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com> |
| 6 | ;;; Copyright © 2016, 2018, 2019, 2020, 2021, 2023, 2025 Ricardo Wurmus <rekado@elephly.net> | 6 | ;;; Copyright © 2016, 2018, 2019, 2020, 2021, 2023, 2025 Ricardo Wurmus <rekado@elephly.net> |
| 7 | ;;; Copyright © 2017 Roel Janssen <roel@gnu.org> | 7 | ;;; Copyright © 2017 Roel Janssen <roel@gnu.org> |
| @@ -2337,22 +2337,36 @@ LLVM.")))) | |||
| 2337 | LLVM bitcode files.") | 2337 | LLVM bitcode files.") |
| 2338 | (license license:expat))) | 2338 | (license license:expat))) |
| 2339 | 2339 | ||
| 2340 | (define-public llvm-julia | 2340 | (define-public llvm-14-julia |
| 2341 | (package | 2341 | (package |
| 2342 | (inherit llvm-13) | 2342 | (inherit llvm-14) |
| 2343 | (version "14.0.6-3-julia") | ||
| 2344 | (source | ||
| 2345 | (origin | ||
| 2346 | (method git-fetch) | ||
| 2347 | (uri (git-reference (url "https://github.com/JuliaLang/llvm-project") | ||
| 2348 | (commit "julia-14.0.6-3"))) | ||
| 2349 | (file-name (git-file-name "llvm-project-julia" "14.0.6-3")) | ||
| 2350 | (sha256 | ||
| 2351 | (base32 | ||
| 2352 | "16ynl9g4paksvglk6asfxdr15gy21bzvsjdkqb1msbcnkz2x610x")))) | ||
| 2343 | (arguments | 2353 | (arguments |
| 2344 | (substitute-keyword-arguments (package-arguments llvm-13) | 2354 | (substitute-keyword-arguments (package-arguments llvm-14) |
| 2345 | ((#:configure-flags flags ''()) | 2355 | ((#:configure-flags flags |
| 2356 | ''()) | ||
| 2357 | ; FIXME: I think we should basically duplicate | ||
| 2358 | ; https://github.com/JuliaLang/julia/blob/master/deps/llvm.mk | ||
| 2346 | #~(cons* "-DLLVM_BUILD_LLVM_DYLIB=ON" | 2359 | #~(cons* "-DLLVM_BUILD_LLVM_DYLIB=ON" |
| 2347 | "-DLLVM_LINK_LLVM_DYLIB=ON" | 2360 | "-DLLVM_LINK_LLVM_DYLIB=ON" |
| 2348 | ;; "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=NVPTX" | 2361 | "-DLLVM_SHLIB_SYMBOL_VERSION:STRING=JL_LLVM_14.0" |
| 2349 | "-DLLVM_VERSION_SUFFIX:STRING=jl" ; Perhaps not needed. | 2362 | "-DLLVM_VERSION_SUFFIX:STRING=jl" ;Perhaps not needed. |
| 2350 | #$(string-append "-DLLVM_TARGETS_TO_BUILD=" | 2363 | #$(string-append "-DLLVM_TARGETS_TO_BUILD=NVPTX;AMDGPU;" |
| 2351 | (system->llvm-target)) | 2364 | (system->llvm-target)) |
| 2352 | (delete "-DBUILD_SHARED_LIBS:BOOL=TRUE" #$flags))) | 2365 | (delete "-DBUILD_SHARED_LIBS:BOOL=TRUE" |
| 2353 | ((#:build-type _) "Release"))) | 2366 | #$flags))) |
| 2354 | (properties `((hidden? . #t) | 2367 | ((#:build-type _) |
| 2355 | ,@(package-properties llvm-13))))) | 2368 | "Release"))) |
| 2369 | (properties `((hidden? . #t) ,@(package-properties llvm-14))))) | ||
| 2356 | 2370 | ||
| 2357 | (define llvm-cling-base llvm-16) | 2371 | (define llvm-cling-base llvm-16) |
| 2358 | 2372 | ||
diff --git a/gnu/packages/patches/julia-1.9-build-tweaks.patch b/gnu/packages/patches/julia-1.9-build-tweaks.patch new file mode 100644 index 00000000000..25f220b0126 --- /dev/null +++ b/gnu/packages/patches/julia-1.9-build-tweaks.patch | |||
| @@ -0,0 +1,152 @@ | |||
| 1 | Adjust the Julia 1.9 build system to unbundle libraries and otherwise fix things | ||
| 2 | here and there. | ||
| 3 | |||
| 4 | diff --git a/Make.inc b/Make.inc | ||
| 5 | index 5bbb52617a..7e1215a2de 100644 | ||
| 6 | --- a/Make.inc | ||
| 7 | +++ b/Make.inc | ||
| 8 | @@ -40,33 +40,39 @@ OPENBLAS_USE_THREAD:=1 | ||
| 9 | # Flags for using libraries available on the system instead of building them. | ||
| 10 | # Please read the notes around usage of SYSTEM flags in README.md | ||
| 11 | # Issues resulting from use of SYSTEM versions will generally not be accepted. | ||
| 12 | -USE_SYSTEM_CSL:=0 | ||
| 13 | -USE_SYSTEM_LLVM:=0 | ||
| 14 | -USE_SYSTEM_LIBUNWIND:=0 | ||
| 15 | +USE_SYSTEM_CSL:=1 | ||
| 16 | +USE_SYSTEM_LLVM:=1 | ||
| 17 | +USE_SYSTEM_LIBUNWIND:=1 | ||
| 18 | DISABLE_LIBUNWIND:=0 | ||
| 19 | -USE_SYSTEM_PCRE:=0 | ||
| 20 | +USE_SYSTEM_PCRE:=1 | ||
| 21 | USE_SYSTEM_LIBM:=0 | ||
| 22 | -USE_SYSTEM_OPENLIBM:=0 | ||
| 23 | +USE_SYSTEM_OPENLIBM:=1 | ||
| 24 | UNTRUSTED_SYSTEM_LIBM:=0 | ||
| 25 | -USE_SYSTEM_DSFMT:=0 | ||
| 26 | -USE_SYSTEM_LIBBLASTRAMPOLINE:=0 | ||
| 27 | -USE_SYSTEM_BLAS:=0 | ||
| 28 | -USE_SYSTEM_LAPACK:=0 | ||
| 29 | -USE_SYSTEM_GMP:=0 | ||
| 30 | -USE_SYSTEM_MPFR:=0 | ||
| 31 | -USE_SYSTEM_LIBSUITESPARSE:=0 | ||
| 32 | -USE_SYSTEM_LIBUV:=0 | ||
| 33 | -USE_SYSTEM_UTF8PROC:=0 | ||
| 34 | -USE_SYSTEM_MBEDTLS:=0 | ||
| 35 | -USE_SYSTEM_LIBSSH2:=0 | ||
| 36 | -USE_SYSTEM_NGHTTP2:=0 | ||
| 37 | -USE_SYSTEM_CURL:=0 | ||
| 38 | -USE_SYSTEM_LIBGIT2:=0 | ||
| 39 | -USE_SYSTEM_PATCHELF:=0 | ||
| 40 | -USE_SYSTEM_LIBWHICH:=0 | ||
| 41 | -USE_SYSTEM_ZLIB:=0 | ||
| 42 | -USE_SYSTEM_P7ZIP:=0 | ||
| 43 | -USE_SYSTEM_LLD:=0 | ||
| 44 | +USE_SYSTEM_DSFMT:=1 | ||
| 45 | +USE_SYSTEM_LIBBLASTRAMPOLINE:=1 | ||
| 46 | +USE_SYSTEM_BLAS:=1 | ||
| 47 | +USE_SYSTEM_LAPACK:=1 | ||
| 48 | +USE_SYSTEM_GMP:=1 | ||
| 49 | +USE_SYSTEM_MPFR:=1 | ||
| 50 | +USE_SYSTEM_LIBSUITESPARSE:=1 | ||
| 51 | +USE_SYSTEM_LIBUV:=1 | ||
| 52 | +USE_SYSTEM_UTF8PROC:=1 | ||
| 53 | +USE_SYSTEM_MBEDTLS:=1 | ||
| 54 | +USE_SYSTEM_LIBSSH2:=1 | ||
| 55 | +USE_SYSTEM_NGHTTP2:=1 | ||
| 56 | +USE_SYSTEM_CURL:=1 | ||
| 57 | +USE_SYSTEM_LIBGIT2:=1 | ||
| 58 | +USE_SYSTEM_PATCHELF:=1 | ||
| 59 | +USE_SYSTEM_LIBWHICH:=1 | ||
| 60 | +USE_SYSTEM_ZLIB:=1 | ||
| 61 | +USE_SYSTEM_P7ZIP:=1 | ||
| 62 | +USE_SYSTEM_LLD:=1 | ||
| 63 | + | ||
| 64 | +# Guix override | ||
| 65 | +USE_INTEL_JITEVENTS:=0 | ||
| 66 | +USE_PERF_JITEVENTS:=0 | ||
| 67 | +USE_BINARYBUILDER:=0 | ||
| 68 | + | ||
| 69 | |||
| 70 | # Link to the LLVM shared library | ||
| 71 | USE_LLVM_SHLIB := 1 | ||
| 72 | @@ -1124,7 +1130,8 @@ else | ||
| 73 | endif | ||
| 74 | |||
| 75 | ifeq ($(USE_SYSTEM_UTF8PROC), 1) | ||
| 76 | - LIBUTF8PROC := -lutf8proc | ||
| 77 | + # Point to the static lib in Guix | ||
| 78 | + LIBUTF8PROC := GUIX_LIBUTF8PROC | ||
| 79 | UTF8PROC_INC := $(LOCALBASE)/include | ||
| 80 | else | ||
| 81 | LIBUTF8PROC := $(build_libdir)/libutf8proc.a | ||
| 82 | diff --git a/Makefile b/Makefile | ||
| 83 | index ef0ade09e2..6b9177df60 100644 | ||
| 84 | --- a/Makefile | ||
| 85 | +++ b/Makefile | ||
| 86 | @@ -11,7 +11,8 @@ all: debug release | ||
| 87 | # sort is used to remove potential duplicates | ||
| 88 | DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/stdlib $(build_man1dir)) | ||
| 89 | ifneq ($(BUILDROOT),$(JULIAHOME)) | ||
| 90 | -BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src src/flisp src/support src/clangsa cli doc deps stdlib test test/clangsa test/embedding test/gcext test/llvmpasses) | ||
| 91 | +# FIXME: do not build doc yet | ||
| 92 | +BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src src/flisp src/support src/clangsa cli deps stdlib test test/clangsa test/embedding test/gcext test/llvmpasses) | ||
| 93 | BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) $(BUILDROOT)/sysimage.mk | ||
| 94 | DIRS := $(DIRS) $(BUILDDIRS) | ||
| 95 | $(BUILDDIRMAKE): | $(BUILDDIRS) | ||
| 96 | @@ -64,6 +65,16 @@ julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia | ||
| 97 | # `julia-stdlib` depends on `julia-deps` so that the fake JLL stdlibs can copy in their Artifacts.toml files. | ||
| 98 | julia-stdlib: | $(DIRS) julia-deps | ||
| 99 | @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/stdlib | ||
| 100 | + # These files are checked-out during the build phase, but need to be fixed | ||
| 101 | + # before the actual build, therefore we sed with a variable we'll fix before | ||
| 102 | + # the build phase. It's twisted but it's the only working way I could find. | ||
| 103 | + # The " are important to avoid double substitution when doing 'make' then | ||
| 104 | + # 'make check'. | ||
| 105 | + sed -i 's|"libcholmod"|"GUIX_LIBCHOLMOD"|' usr/share/julia/stdlib/v1.9/SparseArrays/src/solvers/cholmod.jl | ||
| 106 | + sed -i 's|:libsuitesparseconfig|"GUIX_LIBSC"|' usr/share/julia/stdlib/v1.9/SparseArrays/src/solvers/cholmod.jl | ||
| 107 | + sed -i 's|:libcholmod|"GUIX_LIBCHOLMOD"|' usr/share/julia/stdlib/v1.9/SparseArrays/src/solvers/LibSuiteSparse.jl | ||
| 108 | + sed -i 's|:libspqr|"GUIX_LIBSPQR"|' usr/share/julia/stdlib/v1.9/SparseArrays/src/solvers/LibSuiteSparse.jl | ||
| 109 | + sed -i 's|:libumfpack|"GUIX_LIBUMFPACK"|' usr/share/julia/stdlib/v1.9/SparseArrays/src/solvers/LibSuiteSparse.jl | ||
| 110 | |||
| 111 | julia-base: julia-deps $(build_sysconfdir)/julia/startup.jl $(build_man1dir)/julia.1 $(build_datarootdir)/julia/julia-config.jl | ||
| 112 | @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/base | ||
| 113 | @@ -236,7 +247,9 @@ define stringreplace | ||
| 114 | endef | ||
| 115 | |||
| 116 | |||
| 117 | -install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html | ||
| 118 | +# Guix FIXME: building the doc requires internet. We should build them in a | ||
| 119 | +# separate build phase. | ||
| 120 | +install: $(build_depsbindir)/stringreplace # $(BUILDROOT)/doc/_build/html/en/index.html | ||
| 121 | @$(MAKE) $(QUIET_MAKE) $(JULIA_BUILD_MODE) | ||
| 122 | @for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir) $(private_libexecdir); do \ | ||
| 123 | mkdir -p $(DESTDIR)$$subdir; \ | ||
| 124 | diff --git a/base/Makefile b/base/Makefile | ||
| 125 | index 0ea0359c8c..9cee86aeec 100644 | ||
| 126 | --- a/base/Makefile | ||
| 127 | +++ b/base/Makefile | ||
| 128 | @@ -239,7 +239,10 @@ endif | ||
| 129 | ifneq (,$(LIBGFORTRAN_VERSION)) | ||
| 130 | $(eval $(call symlink_system_library,CSL,libgfortran,$(LIBGFORTRAN_VERSION))) | ||
| 131 | endif | ||
| 132 | -$(eval $(call symlink_system_library,CSL,libquadmath,0)) | ||
| 133 | + | ||
| 134 | +# libquadmath is not available on all architectures. | ||
| 135 | +# https://github.com/JuliaLang/julia/issues/41613 | ||
| 136 | +$(eval $(call symlink_system_library,CSL,libquadmath,0,ALLOW_FAILURE)) | ||
| 137 | $(eval $(call symlink_system_library,CSL,libstdc++,6)) | ||
| 138 | # We allow libssp, libatomic and libgomp to fail as they are not available on all systems | ||
| 139 | $(eval $(call symlink_system_library,CSL,libssp,0,ALLOW_FAILURE)) | ||
| 140 | diff --git a/cli/Makefile b/cli/Makefile | ||
| 141 | index 7ba238e0de..6540f6384a 100644 | ||
| 142 | --- a/cli/Makefile | ||
| 143 | +++ b/cli/Makefile | ||
| 144 | @@ -7,7 +7,7 @@ include $(JULIAHOME)/deps/llvm-ver.make | ||
| 145 | |||
| 146 | HEADERS := $(addprefix $(SRCDIR)/,jl_exports.h loader.h) $(addprefix $(JULIAHOME)/src/,julia_fasttls.h support/platform.h support/dirpath.h jl_exported_data.inc jl_exported_funcs.inc) | ||
| 147 | |||
| 148 | -LOADER_CFLAGS = $(JCFLAGS) -I$(BUILDROOT)/src -I$(JULIAHOME)/src -I$(JULIAHOME)/src/support -I$(build_includedir) -ffreestanding | ||
| 149 | +LOADER_CFLAGS = -D_GNU_SOURCE $(JCFLAGS) -I$(BUILDROOT)/src -I$(JULIAHOME)/src -I$(JULIAHOME)/src/support -I$(build_includedir) -ffreestanding | ||
| 150 | LOADER_LDFLAGS = $(JLDFLAGS) -ffreestanding -L$(build_shlibdir) -L$(build_libdir) | ||
| 151 | |||
| 152 | ifeq ($(OS),WINNT) | ||
diff --git a/gnu/packages/patches/julia-Use-MPFR-4.2.patch b/gnu/packages/patches/julia-Use-MPFR-4.2.patch deleted file mode 100644 index 73a395c89e9..00000000000 --- a/gnu/packages/patches/julia-Use-MPFR-4.2.patch +++ /dev/null | |||
| @@ -1,228 +0,0 @@ | |||
| 1 | This patch backports part of Julia upstream commit: | ||
| 2 | |||
| 3 | 1e5fdb29f8858f3244f6aff116ee12e4c8247f3a | ||
| 4 | Author: Simon Byrne <simon.byrne@gmail.com> | ||
| 5 | AuthorDate: Tue Jan 10 14:52:36 2023 -0800 | ||
| 6 | Commit: GitHub <noreply@github.com> | ||
| 7 | CommitDate: Tue Jan 10 17:52:36 2023 -0500 | ||
| 8 | |||
| 9 | update MPFR to 4.2.0 (#48165) | ||
| 10 | |||
| 11 | Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> | ||
| 12 | |||
| 13 | 6 files changed, 112 insertions(+), 79 deletions(-) | ||
| 14 | base/mpfr.jl | 34 ++++++++++++++-- | ||
| 15 | deps/checksums/mpfr | 68 ++++++++++++++++---------------- | ||
| 16 | deps/mpfr.version | 2 +- | ||
| 17 | stdlib/MPFR_jll/Project.toml | 2 +- | ||
| 18 | stdlib/MPFR_jll/test/runtests.jl | 2 +- | ||
| 19 | test/math.jl | 83 +++++++++++++++++++++------------------- | ||
| 20 | |||
| 21 | |||
| 22 | diff -ur julia-1.8.3-orig/base/mpfr.jl julia-1.8.3-patch/base/mpfr.jl | ||
| 23 | --- julia-1.8.3-orig/base/mpfr.jl 2023-04-13 17:50:58.394891391 +0200 | ||
| 24 | +++ julia-1.8.3-patch/base/mpfr.jl 2023-04-13 20:42:52.551833467 +0200 | ||
| 25 | @@ -16,7 +16,8 @@ | ||
| 26 | cosh, sinh, tanh, sech, csch, coth, acosh, asinh, atanh, lerpi, | ||
| 27 | cbrt, typemax, typemin, unsafe_trunc, floatmin, floatmax, rounding, | ||
| 28 | setrounding, maxintfloat, widen, significand, frexp, tryparse, iszero, | ||
| 29 | - isone, big, _string_n, decompose | ||
| 30 | + isone, big, _string_n, decompose, minmax, | ||
| 31 | + sinpi, cospi, sincospi, sind, cosd, tand, asind, acosd, atand | ||
| 32 | |||
| 33 | import ..Rounding: rounding_raw, setrounding_raw | ||
| 34 | |||
| 35 | @@ -745,7 +746,7 @@ | ||
| 36 | end | ||
| 37 | |||
| 38 | # Functions for which NaN results are converted to DomainError, following Base | ||
| 39 | -for f in (:sin, :cos, :tan, :sec, :csc, :acos, :asin, :atan, :acosh, :asinh, :atanh) | ||
| 40 | +for f in (:sin, :cos, :tan, :sec, :csc, :acos, :asin, :atan, :acosh, :asinh, :atanh, :sinpi, :cospi) | ||
| 41 | @eval begin | ||
| 42 | function ($f)(x::BigFloat) | ||
| 43 | isnan(x) && return x | ||
| 44 | @@ -756,6 +757,7 @@ | ||
| 45 | end | ||
| 46 | end | ||
| 47 | end | ||
| 48 | +sincospi(x::BigFloat) = (sinpi(x), cospi(x)) | ||
| 49 | |||
| 50 | function atan(y::BigFloat, x::BigFloat) | ||
| 51 | z = BigFloat() | ||
| 52 | @@ -763,6 +765,32 @@ | ||
| 53 | return z | ||
| 54 | end | ||
| 55 | |||
| 56 | +# degree functions | ||
| 57 | +for f in (:sin, :cos, :tan) | ||
| 58 | + @eval begin | ||
| 59 | + function ($(Symbol(f,:d)))(x::BigFloat) | ||
| 60 | + isnan(x) && return x | ||
| 61 | + z = BigFloat() | ||
| 62 | + ccall(($(string(:mpfr_,f,:u)), :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Culong, MPFRRoundingMode), z, x, 360, ROUNDING_MODE[]) | ||
| 63 | + isnan(z) && throw(DomainError(x, "NaN result for non-NaN input.")) | ||
| 64 | + return z | ||
| 65 | + end | ||
| 66 | + function ($(Symbol(:a,f,:d)))(x::BigFloat) | ||
| 67 | + isnan(x) && return x | ||
| 68 | + z = BigFloat() | ||
| 69 | + ccall(($(string(:mpfr_a,f,:u)), :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Culong, MPFRRoundingMode), z, x, 360, ROUNDING_MODE[]) | ||
| 70 | + isnan(z) && throw(DomainError(x, "NaN result for non-NaN input.")) | ||
| 71 | + return z | ||
| 72 | + end | ||
| 73 | + end | ||
| 74 | +end | ||
| 75 | +function atand(y::BigFloat, x::BigFloat) | ||
| 76 | + z = BigFloat() | ||
| 77 | + ccall((:mpfr_atan2u, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Ref{BigFloat}, Culong, MPFRRoundingMode), z, y, x, 360, ROUNDING_MODE[]) | ||
| 78 | + return z | ||
| 79 | +end | ||
| 80 | + | ||
| 81 | + | ||
| 82 | # Utility functions | ||
| 83 | ==(x::BigFloat, y::BigFloat) = ccall((:mpfr_equal_p, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}), x, y) != 0 | ||
| 84 | <=(x::BigFloat, y::BigFloat) = ccall((:mpfr_lessequal_p, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}), x, y) != 0 | ||
| 85 | @@ -1018,7 +1046,7 @@ | ||
| 86 | isfinite(x) || return string(Float64(x)) | ||
| 87 | _prettify_bigfloat(string_mpfr(x, fmt)) | ||
| 88 | end | ||
| 89 | -_string(x::BigFloat) = _string(x, "%.Re") | ||
| 90 | +_string(x::BigFloat) = _string(x, "%Re") | ||
| 91 | _string(x::BigFloat, k::Integer) = _string(x, "%.$(k)Re") | ||
| 92 | |||
| 93 | string(b::BigFloat) = _string(b) | ||
| 94 | diff -ur julia-1.8.3-orig/test/math.jl julia-1.8.3-patch/test/math.jl | ||
| 95 | --- julia-1.8.3-orig/test/math.jl 2023-04-13 17:50:58.382891276 +0200 | ||
| 96 | +++ julia-1.8.3-patch/test/math.jl 2023-04-13 21:13:55.377279761 +0200 | ||
| 97 | @@ -411,47 +411,51 @@ | ||
| 98 | @test rad2deg(pi + (pi/3)*im) ≈ 180 + 60im | ||
| 99 | end | ||
| 100 | |||
| 101 | +# ensure zeros are signed the same | ||
| 102 | +⩲(x,y) = typeof(x) == typeof(y) && x == y && signbit(x) == signbit(y) | ||
| 103 | +⩲(x::Tuple, y::Tuple) = length(x) == length(y) && all(map(⩲,x,y)) | ||
| 104 | + | ||
| 105 | @testset "degree-based trig functions" begin | ||
| 106 | - @testset "$T" for T = (Float32,Float64,Rational{Int}) | ||
| 107 | + @testset "$T" for T = (Float32,Float64,Rational{Int},BigFloat) | ||
| 108 | fT = typeof(float(one(T))) | ||
| 109 | fTsc = typeof( (float(one(T)), float(one(T))) ) | ||
| 110 | for x = -400:40:400 | ||
| 111 | - @test sind(convert(T,x))::fT ≈ convert(fT,sin(pi/180*x)) atol=eps(deg2rad(convert(fT,x))) | ||
| 112 | - @test cosd(convert(T,x))::fT ≈ convert(fT,cos(pi/180*x)) atol=eps(deg2rad(convert(fT,x))) | ||
| 113 | + @test sind(convert(T,x))::fT ≈ sin(pi*convert(fT,x)/180) atol=eps(deg2rad(convert(fT,x))) | ||
| 114 | + @test cosd(convert(T,x))::fT ≈ cos(pi*convert(fT,x)/180) atol=eps(deg2rad(convert(fT,x))) | ||
| 115 | |||
| 116 | s,c = sincosd(convert(T,x)) | ||
| 117 | - @test s::fT ≈ convert(fT,sin(pi/180*x)) atol=eps(deg2rad(convert(fT,x))) | ||
| 118 | - @test c::fT ≈ convert(fT,cos(pi/180*x)) atol=eps(deg2rad(convert(fT,x))) | ||
| 119 | + @test s::fT ≈ sin(pi*convert(fT,x)/180) atol=eps(deg2rad(convert(fT,x))) | ||
| 120 | + @test c::fT ≈ cos(pi*convert(fT,x)/180) atol=eps(deg2rad(convert(fT,x))) | ||
| 121 | end | ||
| 122 | @testset "sind" begin | ||
| 123 | - @test sind(convert(T,0.0))::fT === zero(fT) | ||
| 124 | - @test sind(convert(T,180.0))::fT === zero(fT) | ||
| 125 | - @test sind(convert(T,360.0))::fT === zero(fT) | ||
| 126 | - T != Rational{Int} && @test sind(convert(T,-0.0))::fT === -zero(fT) | ||
| 127 | - @test sind(convert(T,-180.0))::fT === -zero(fT) | ||
| 128 | - @test sind(convert(T,-360.0))::fT === -zero(fT) | ||
| 129 | + @test sind(convert(T,0.0))::fT ⩲ zero(fT) | ||
| 130 | + @test sind(convert(T,180.0))::fT ⩲ zero(fT) | ||
| 131 | + @test sind(convert(T,360.0))::fT ⩲ zero(fT) | ||
| 132 | + T != Rational{Int} && @test sind(convert(T,-0.0))::fT ⩲ -zero(fT) | ||
| 133 | + @test sind(convert(T,-180.0))::fT ⩲ -zero(fT) | ||
| 134 | + @test sind(convert(T,-360.0))::fT ⩲ -zero(fT) | ||
| 135 | if T <: AbstractFloat | ||
| 136 | @test isnan(sind(T(NaN))) | ||
| 137 | end | ||
| 138 | end | ||
| 139 | @testset "cosd" begin | ||
| 140 | - @test cosd(convert(T,90))::fT === zero(fT) | ||
| 141 | - @test cosd(convert(T,270))::fT === zero(fT) | ||
| 142 | - @test cosd(convert(T,-90))::fT === zero(fT) | ||
| 143 | - @test cosd(convert(T,-270))::fT === zero(fT) | ||
| 144 | + @test cosd(convert(T,90))::fT ⩲ zero(fT) | ||
| 145 | + @test cosd(convert(T,270))::fT ⩲ zero(fT) | ||
| 146 | + @test cosd(convert(T,-90))::fT ⩲ zero(fT) | ||
| 147 | + @test cosd(convert(T,-270))::fT ⩲ zero(fT) | ||
| 148 | if T <: AbstractFloat | ||
| 149 | @test isnan(cosd(T(NaN))) | ||
| 150 | end | ||
| 151 | end | ||
| 152 | @testset "sincosd" begin | ||
| 153 | - @test sincosd(convert(T,-360))::fTsc === ( -zero(fT), one(fT) ) | ||
| 154 | - @test sincosd(convert(T,-270))::fTsc === ( one(fT), zero(fT) ) | ||
| 155 | - @test sincosd(convert(T,-180))::fTsc === ( -zero(fT), -one(fT) ) | ||
| 156 | - @test sincosd(convert(T, -90))::fTsc === ( -one(fT), zero(fT) ) | ||
| 157 | - @test sincosd(convert(T, 0))::fTsc === ( zero(fT), one(fT) ) | ||
| 158 | - @test sincosd(convert(T, 90))::fTsc === ( one(fT), zero(fT) ) | ||
| 159 | - @test sincosd(convert(T, 180))::fTsc === ( zero(fT), -one(fT) ) | ||
| 160 | - @test sincosd(convert(T, 270))::fTsc === ( -one(fT), zero(fT) ) | ||
| 161 | + @test sincosd(convert(T,-360))::fTsc ⩲ ( -zero(fT), one(fT) ) | ||
| 162 | + @test sincosd(convert(T,-270))::fTsc ⩲ ( one(fT), zero(fT) ) | ||
| 163 | + @test sincosd(convert(T,-180))::fTsc ⩲ ( -zero(fT), -one(fT) ) | ||
| 164 | + @test sincosd(convert(T, -90))::fTsc ⩲ ( -one(fT), zero(fT) ) | ||
| 165 | + @test sincosd(convert(T, 0))::fTsc ⩲ ( zero(fT), one(fT) ) | ||
| 166 | + @test sincosd(convert(T, 90))::fTsc ⩲ ( one(fT), zero(fT) ) | ||
| 167 | + @test sincosd(convert(T, 180))::fTsc ⩲ ( zero(fT), -one(fT) ) | ||
| 168 | + @test sincosd(convert(T, 270))::fTsc ⩲ ( -one(fT), zero(fT) ) | ||
| 169 | if T <: AbstractFloat | ||
| 170 | @test_throws DomainError sincosd(T(Inf)) | ||
| 171 | @test all(isnan.(sincosd(T(NaN)))) | ||
| 172 | @@ -463,22 +467,22 @@ | ||
| 173 | "sincospi" => (x->sincospi(x)[1], x->sincospi(x)[2]) | ||
| 174 | ) | ||
| 175 | @testset "pi * $x" for x = -3:0.3:3 | ||
| 176 | - @test sinpi(convert(T,x))::fT ≈ convert(fT,sin(pi*x)) atol=eps(pi*convert(fT,x)) | ||
| 177 | - @test cospi(convert(T,x))::fT ≈ convert(fT,cos(pi*x)) atol=eps(pi*convert(fT,x)) | ||
| 178 | + @test sinpi(convert(T,x))::fT ≈ sin(pi*convert(fT,x)) atol=eps(pi*convert(fT,x)) | ||
| 179 | + @test cospi(convert(T,x))::fT ≈ cos(pi*convert(fT,x)) atol=eps(pi*convert(fT,x)) | ||
| 180 | end | ||
| 181 | |||
| 182 | - @test sinpi(convert(T,0.0))::fT === zero(fT) | ||
| 183 | - @test sinpi(convert(T,1.0))::fT === zero(fT) | ||
| 184 | - @test sinpi(convert(T,2.0))::fT === zero(fT) | ||
| 185 | - T != Rational{Int} && @test sinpi(convert(T,-0.0))::fT === -zero(fT) | ||
| 186 | - @test sinpi(convert(T,-1.0))::fT === -zero(fT) | ||
| 187 | - @test sinpi(convert(T,-2.0))::fT === -zero(fT) | ||
| 188 | + @test sinpi(convert(T,0.0))::fT ⩲ zero(fT) | ||
| 189 | + @test sinpi(convert(T,1.0))::fT ⩲ zero(fT) | ||
| 190 | + @test sinpi(convert(T,2.0))::fT ⩲ zero(fT) | ||
| 191 | + T != Rational{Int} && @test sinpi(convert(T,-0.0))::fT ⩲ -zero(fT) | ||
| 192 | + @test sinpi(convert(T,-1.0))::fT ⩲ -zero(fT) | ||
| 193 | + @test sinpi(convert(T,-2.0))::fT ⩲ -zero(fT) | ||
| 194 | @test_throws DomainError sinpi(convert(T,Inf)) | ||
| 195 | |||
| 196 | - @test cospi(convert(T,0.5))::fT === zero(fT) | ||
| 197 | - @test cospi(convert(T,1.5))::fT === zero(fT) | ||
| 198 | - @test cospi(convert(T,-0.5))::fT === zero(fT) | ||
| 199 | - @test cospi(convert(T,-1.5))::fT === zero(fT) | ||
| 200 | + @test cospi(convert(T,0.5))::fT ⩲ zero(fT) | ||
| 201 | + @test cospi(convert(T,1.5))::fT ⩲ zero(fT) | ||
| 202 | + @test cospi(convert(T,-0.5))::fT ⩲ zero(fT) | ||
| 203 | + @test cospi(convert(T,-1.5))::fT ⩲ zero(fT) | ||
| 204 | @test_throws DomainError cospi(convert(T,Inf)) | ||
| 205 | end | ||
| 206 | @testset "Check exact values" begin | ||
| 207 | @@ -489,8 +493,8 @@ | ||
| 208 | @test sincospi(one(T)/convert(T,6))[1] == 0.5 | ||
| 209 | @test_throws DomainError sind(convert(T,Inf)) | ||
| 210 | @test_throws DomainError cosd(convert(T,Inf)) | ||
| 211 | - T != Float32 && @test cospi(one(T)/convert(T,3)) == 0.5 | ||
| 212 | - T != Float32 && @test sincospi(one(T)/convert(T,3))[2] == 0.5 | ||
| 213 | + fT == Float64 && @test isapprox(cospi(one(T)/convert(T,3)), 0.5) | ||
| 214 | + fT == Float64 && @test isapprox(sincospi(one(T)/convert(T,3))[2], 0.5) | ||
| 215 | T == Rational{Int} && @test sinpi(5//6) == 0.5 | ||
| 216 | T == Rational{Int} && @test sincospi(5//6)[1] == 0.5 | ||
| 217 | end | ||
| 218 | @@ -538,8 +542,8 @@ | ||
| 219 | end | ||
| 220 | end | ||
| 221 | end | ||
| 222 | - @test @inferred(sinc(0//1)) === 1.0 | ||
| 223 | - @test @inferred(cosc(0//1)) === -0.0 | ||
| 224 | + @test @inferred(sinc(0//1)) ⩲ 1.0 | ||
| 225 | + @test @inferred(cosc(0//1)) ⩲ -0.0 | ||
| 226 | |||
| 227 | # test right before/after thresholds of Taylor series | ||
| 228 | @test sinc(0.001) ≈ 0.999998355066745 rtol=1e-15 | ||
