gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / julia.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016, 2020-2022 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2020, 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
5 ;;; Copyright © 2020 Tim Howes <timhowes@lavabit.com>
6 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2021, 2022 Jean-Baptiste Volatier <jbv@pm.me>
8 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
9 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages julia)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix utils)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system gnu)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages algebra)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages curl)
38 #:use-module (gnu packages elf)
39 #:use-module (gnu packages gcc)
40 #:use-module (gnu packages llvm)
41 #:use-module (gnu packages libevent)
42 #:use-module (gnu packages libunwind)
43 #:use-module (gnu packages maths)
44 #:use-module (gnu packages multiprecision) ; mpfr
45 #:use-module (gnu packages pcre)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages python-xyz)
50 #:use-module (gnu packages textutils)
51 #:use-module (gnu packages ssh)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages version-control)
54 #:use-module (gnu packages web)
55 #:use-module (gnu packages wget)
56 #:use-module (ice-9 match))
57
58 (define libunwind-julia
59 ;; The Julia projects requires their patched version.
60 ;; Get from https://github.com/JuliaLang/julia/tree/master/deps/patches
61 (package
62 (inherit libunwind)
63 (name "libunwind-julia")
64 (version "1.3.1")
65 (source
66 (origin
67 (method url-fetch)
68 (uri (string-append "mirror://savannah/libunwind/libunwind-"
69 version ".tar.gz"))
70 (sha256
71 (base32
72 "1y0l08k6ak1mqbfj6accf9s5686kljwgsl4vcqpxzk5n74wpm6a3"))
73 (patches
74 (append
75 ;; Fix linker issue for i686-linux because GCC10 changed default
76 ;; (see '-fno-common' option).
77 (search-patches "libunwind-julia-fix-GCC10-fno-common.patch")
78 (list
79 (julia-patch "libunwind-prefer-extbl"
80 "0lr4dafw8qyfh8sw8hhbwkql1dlhqv8px7k81y2l20hhxfgnh2m1")
81 (julia-patch "libunwind-static-arm"
82 "1jk3bmiw61ypcchqkk1fyg5wh8wpggk574wxyfyaic870zh3lhgq")
83 (julia-patch "libunwind-cfa-rsp"
84 "1aswjhvysahhldbzh1afbf0hsjxrvs6xidsz2i7s1cjkjbdiia1z"))))))
85 (arguments
86 (substitute-keyword-arguments (package-arguments libunwind)
87 ;; Skip tests on this older and patched version of libunwind.
88 ((#:tests? _ #t) #f)))
89 (home-page "https://github.com/JuliaLang/tree/master/deps/")))
90
91 (define (julia-patch-url version name)
92 (string-append "https://raw.githubusercontent.com/JuliaLang/julia/v" version
93 "/deps/patches/" name ".patch"))
94
95 (define-public (julia-patch name sha)
96 (let ((version "1.6.1"))
97 (origin (method url-fetch)
98 (uri (julia-patch-url version name))
99 (sha256 (base32 sha))
100 (file-name name))))
101
102 (define-public libwhich
103 (package
104 (name "libwhich")
105 (version "1.1.0")
106 (source
107 (origin
108 (method git-fetch)
109 (uri (git-reference
110 (url "https://github.com/vtjnash/libwhich")
111 ;; fixes linux-vdso.so related tests
112 (commit "87cffe10080c98e7b5786c5166e420bf1ada1d41")))
113 (file-name (string-append name "-" version "-checkout"))
114 (sha256
115 (base32
116 "1bpa0fcqpa3ai3hm8mz0p13bf76fsq53wsfcx5qw302zh22108xr"))))
117 (arguments
118 `(#:make-flags
119 (list (string-append "CC=" ,(cc-for-target)))
120 #:phases
121 (modify-phases %standard-phases
122 (delete 'configure)
123 (add-before 'check 'set-ld-library-path
124 (lambda* (#:key native-inputs inputs #:allow-other-keys)
125 (setenv "LD_LIBRARY_PATH"
126 (string-append (assoc-ref (or native-inputs inputs) "zlib")
127 "/lib"))))
128 (replace 'install
129 (lambda* (#:key outputs #:allow-other-keys)
130 (let ((out (assoc-ref outputs "out")))
131 (install-file "libwhich" (string-append out "/bin")))
132 #t)))))
133 (native-inputs
134 ;; used for tests
135 (list zlib))
136 (build-system gnu-build-system)
137 (home-page "https://github.com/vtjnash/libwhich")
138 (synopsis "Like @code{which}, for dynamic libraries")
139 (description "@code{libwhich} is like @code{which}, but for dynamic
140 libraries. It is also a bit like @code{ldd} and @code{otool -L}.")
141 (license license:expat)))
142
143 (define-public julia
144 (package
145 (name "julia")
146 (version "1.6.7")
147 (source (origin
148 (method url-fetch)
149 (uri (string-append
150 "https://github.com/JuliaLang/julia/releases/download/v"
151 version "/julia-" version ".tar.gz"))
152 (sha256
153 (base32
154 "0q9xgdpvdkskpzl294w215f6c15c5jk276c9dah5f5w4np3ivbvl"))
155 (patches
156 (search-patches "julia-SOURCE_DATE_EPOCH-mtime.patch"
157 "julia-allow-parallel-build.patch"))))
158 (build-system gnu-build-system)
159 (arguments
160 `(#:test-target "test"
161 #:modules ((ice-9 match)
162 (guix build gnu-build-system)
163 (guix build utils))
164
165 ;; The test suite takes many times longer than building and
166 ;; can easily fail on smaller machines when they run out of memory.
167 #:tests? ,(not (target-aarch64?))
168
169 ;; Do not strip binaries to keep support for full backtraces.
170 ;; See https://github.com/JuliaLang/julia/issues/17831
171 #:strip-binaries? #f
172
173 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
174 ;; gremlin) doesn't support it yet, so skip this phase.
175 #:validate-runpath? #f
176
177 #:phases
178 (modify-phases %standard-phases
179 (delete 'configure)
180 (add-after 'unpack 'prepare-deps
181 (lambda* (#:key inputs #:allow-other-keys)
182 ;; needed by libwhich
183 (setenv "LD_LIBRARY_PATH"
184 (string-join (map (lambda (pkg)
185 (string-append (assoc-ref inputs pkg)
186 "/lib"))
187 '("curl" "dsfmt"
188 "gmp" "lapack"
189 "libssh2" "libnghttp2" "libgit2"
190 "mbedtls" "mpfr"
191 "openblas" "openlibm" "pcre2"
192 "suitesparse" "gfortran:lib"))
193 ":"))))
194 ;; FIXME: Building the documentation requires Julia packages that
195 ;; would be downloaded from the Internet. We should build them in a
196 ;; separate build phase.
197 (add-after 'unpack 'disable-documentation
198 (lambda _
199 (substitute* "Makefile"
200 (("(install: .*) \\$\\(BUILDROOT\\)/doc/_build/html/en/index.html" _ line)
201 (string-append line "\n"))
202 (("src ui doc deps")
203 "src ui deps"))))
204 (add-after 'unpack 'use-system-libwhich
205 (lambda* (#:key inputs #:allow-other-keys)
206 ;; don't build it
207 (substitute* "deps/Makefile"
208 (("DEP_LIBS \\+= libwhich") ""))
209 ;; call our version
210 (substitute* "base/Makefile"
211 (("\\$\\$\\(build_depsbindir\\)/libwhich")
212 (search-input-file inputs "/bin/libwhich")))))
213 (add-after 'unpack 'activate-gnu-source-for-loader
214 (lambda _
215 (substitute* "cli/Makefile"
216 (("LOADER_CFLAGS =") "LOADER_CFLAGS = -D_GNU_SOURCE"))))
217 (add-after 'unpack 'change-number-of-precompile-statements
218 (lambda _
219 ;; Remove nss-certs drops the number of statements below 1200,
220 ;; causing the build to fail prematurely.
221 (substitute* "contrib/generate_precompile.jl"
222 (("1200") "1100"))))
223 ;; For some reason libquadmath is unavailable on this architecture.
224 ;; https://github.com/JuliaLang/julia/issues/41613
225 ,@(if (target-aarch64?)
226 '((add-after 'unpack 'drop-libquadmath-on-aarch64
227 (lambda _
228 (substitute* '("contrib/fixup-libgfortran.sh"
229 "deps/csl.mk"
230 "base/Makefile")
231 ((".*libquadmath.*") ""))
232 (substitute* "Makefile"
233 (("libquadmath ") "")))))
234 '())
235 (add-before 'check 'set-home
236 ;; Some tests require a home directory to be set.
237 (lambda _ (setenv "HOME" "/tmp")))
238 (add-before 'build 'fix-include-and-link-paths
239 (lambda* (#:key inputs #:allow-other-keys)
240 ;; LIBUTF8PROC is a linker flag, not a build target. It is
241 ;; included in the LIBFILES_* variable which is used as a
242 ;; collection of build targets and a list of libraries to link
243 ;; against.
244 (substitute* "src/flisp/Makefile"
245 (("\\$\\(BUILDDIR\\)/\\$\\(EXENAME\\)\\$\\(EXE\\): \\$\\(OBJS\\) \\$\\(LIBFILES_release\\)")
246 "$(BUILDDIR)/$(EXENAME)$(EXE): $(OBJS) $(LLT_release)")
247 (("\\$\\(BUILDDIR\\)/\\$\\(EXENAME\\)-debug$(EXE): \\$\\(DOBJS\\) \\$\\(LIBFILES_debug\\)")
248 "$(BUILDDIR)/$(EXENAME)-debug\\$\\(EXE\\): $(DOBJS) $(LLT_debug)"))
249
250 ;; The REPL must be linked with libuv.
251 (substitute* "cli/Makefile"
252 (("JLDFLAGS \\+= ")
253 (string-append "JLDFLAGS += "
254 (assoc-ref %build-inputs "libuv")
255 "/lib/libuv.so ")))
256
257 (substitute* "base/Makefile"
258 (("\\$\\(build_includedir\\)/uv/errno.h")
259 (search-input-file inputs "/include/uv/errno.h")))))
260 (add-before 'build 'replace-default-shell
261 (lambda _
262 (substitute* "base/client.jl"
263 (("/bin/sh") (which "sh")))))
264 (add-before 'build 'shared-objects-paths
265 (lambda* (#:key inputs #:allow-other-keys)
266 (let ((jlpath
267 (lambda (pkgname)
268 (string-append
269 "stdlib/" pkgname "_jll/src/" pkgname "_jll.jl")))
270 (from
271 (lambda (libname)
272 (string-append "const " libname " = .*\\.so")))
273 (to
274 (lambda* (pkg libname #:optional libname_jl)
275 (string-append
276 "const " (or libname_jl libname) "= \""
277 (assoc-ref inputs pkg) "/lib/" libname ".so"))))
278 (substitute* (jlpath "dSFMT")
279 (((from "libdSFMT")) (to "dsfmt" "libdSFMT")))
280 (substitute* (jlpath "GMP")
281 (((from "libgmp")) (to "gmp" "libgmp"))
282 (((from "libgmpxx")) (to "gmp" "libgmpxx")))
283 (substitute* (jlpath "libLLVM")
284 (((from "libLLVM")) (to "llvm" "libLLVM")))
285 (substitute* (jlpath "LibCURL")
286 (((from "libcurl")) (to "curl" "libcurl")))
287 (substitute* (jlpath "LibGit2")
288 (((from "libgit2")) (to "libgit2" "libgit2")))
289 (substitute* (jlpath "LibSSH2")
290 (((from "libssh2")) (to "libssh2" "libssh2")))
291 (substitute* (jlpath "LibUV")
292 (((from "libuv")) (to "libuv" "libuv")))
293 (substitute* (jlpath "LibUnwind")
294 (((from "libunwind")) (to "libunwind" "libunwind")))
295 (substitute* (jlpath "MPFR")
296 (((from "libmpfr")) (to "mpfr" "libmpfr")))
297 (substitute* (jlpath "MbedTLS")
298 ;; For the newer version of mbedtls-apache:
299 (("libmbedcrypto.so.5") "libmbedcrypto.so.6")
300 (((from "libmbedcrypto")) (to "mbedtls" "libmbedcrypto"))
301 (((from "libmbedtls")) (to "mbedtls" "libmbedtls"))
302 (((from "libmbedx509")) (to "mbedtls" "libmbedx509")))
303 (substitute* (jlpath "nghttp2")
304 (((from "libnghttp2")) (to "libnghttp2" "libnghttp2")))
305 (substitute* (jlpath "OpenBLAS")
306 (((from "libopenblas")) (to "openblas" "libopenblas")))
307 (substitute* (jlpath "OpenLibm")
308 (((from "libopenlibm")) (to "openlibm" "libopenlibm")))
309 (substitute* (jlpath "PCRE2")
310 (((from "libpcre2")) (to "pcre2" "libpcre2" "libpcre2_8")))
311 (substitute* (jlpath "SuiteSparse")
312 (((from "libamd")) (to "suitesparse" "libamd"))
313 (((from "libbtf")) (to "suitesparse" "libbtf"))
314 (((from "libcamd")) (to "suitesparse" "libcamd"))
315 (((from "libccolamd")) (to "suitesparse" "libccolamd"))
316 (((from "libcholmod")) (to "suitesparse" "libcholmod"))
317 (((from "libcolamd")) (to "suitesparse" "libcolamd"))
318 (((from "libklu")) (to "suitesparse" "libklu"))
319 (((from "libldl")) (to "suitesparse" "libldl"))
320 (((from "librbio")) (to "suitesparse" "librbio"))
321 (((from "libspqr")) (to "suitesparse" "libspqr"))
322 (((from "libsuitesparse")) (to "suitesparse" "libsuitesparse"))
323 (((from "libsuitesparseconfig"))
324 (to "suitesparse" "libsuitesparseconfig"))
325 (((from "libumfpack")) (to "suitesparse" "libumfpack")))
326 (substitute* (jlpath "Zlib")
327 (((from "libz")) (to "zlib" "libz"))))))
328 (add-after 'unpack 'enable-parallel-tests
329 (lambda* (#:key parallel-tests? #:allow-other-keys)
330 (setenv "JULIA_CPU_THREADS" (if parallel-tests?
331 (number->string (parallel-job-count))
332 "1"))
333 (format #t "JULIA_CPU_THREADS environment variable set to ~a~%"
334 (getenv "JULIA_CPU_THREADS"))))
335 (add-after 'unpack 'adjust-test-suite
336 (lambda* (#:key inputs #:allow-other-keys)
337 (let ((pcre2 (assoc-ref inputs "pcre2"))
338 (mbedtls-apache (assoc-ref inputs "mbedtls"))
339 (mpfr (assoc-ref inputs "mpfr"))
340 (gmp (assoc-ref inputs "gmp"))
341 (nghttp2 (assoc-ref inputs "libnghttp2"))
342 (zlib (assoc-ref inputs "zlib"))
343 (suitesparse (assoc-ref inputs "suitesparse")))
344 ;; Some tests only check to see if the input is the correct version.
345 (substitute* "stdlib/PCRE2_jll/test/runtests.jl"
346 (("10.40.0") ,(package-version pcre2)))
347 (substitute* "stdlib/MbedTLS_jll/test/runtests.jl"
348 (("2.24.0") ,(package-version mbedtls-apache)))
349 (substitute* "stdlib/MPFR_jll/test/runtests.jl"
350 (("4.1.0") ,(package-version mpfr)))
351 (substitute* "stdlib/GMP_jll/test/runtests.jl"
352 (("6.2.0") ,(package-version gmp)))
353 (substitute* "stdlib/nghttp2_jll/test/runtests.jl"
354 (("1.41.0") ,(package-version nghttp2)))
355 (substitute* "stdlib/Zlib_jll/test/runtests.jl"
356 (("1.2.12") ,(package-version zlib)))
357 (substitute* "stdlib/SuiteSparse_jll/test/runtests.jl"
358 (("5004") ,(string-replace-substring
359 (version-major+minor
360 (package-version suitesparse)) "." "0"))))))
361 (add-before 'check 'disable-broken-tests
362 (lambda _
363 ;; disabling REPL tests because they require a stdin
364 ;; There are some read-only precompile issues in the 1.6 series.
365 ;; https://github.com/JuliaLang/julia/pull/41614
366 ;; https://github.com/JuliaLang/julia/issues/41156
367 (substitute* "test/choosetests.jl"
368 (("\"precompile\",") ""))
369 ;; Dates/io tests fail on master when networking is unavailable
370 ;; https://github.com/JuliaLang/julia/issues/34655
371 (substitute* "stdlib/Dates/test/io.jl"
372 (("using Dates") "import Dates
373 using Dates: @dateformat_str, Date, DateTime, DateFormat, Time"))
374 ;; julia embeds a certificate, we are not doing that
375 (substitute* "stdlib/MozillaCACerts_jll/test/runtests.jl"
376 (("@test isfile\\(MozillaCACerts_jll.cacert\\)")
377 "@test_broken isfile(MozillaCACerts_jll.cacert)"))
378 ;; since certificate is not present some tests are failing in network option
379 (substitute* "usr/share/julia/stdlib/v1.6/NetworkOptions/test/runtests.jl"
380 (("@test isfile\\(bundled_ca_roots\\(\\)\\)")
381 "@test_broken isfile(bundled_ca_roots())")
382 (("@test ispath\\(ca_roots_path\\(\\)\\)")
383 "@test_broken ispath(ca_roots_path())")
384 (("@test ca_roots_path\\(\\) \\!= bundled_ca_roots\\(\\)")
385 "@test_broken ca_roots_path() != bundled_ca_roots()"))
386 ;; WARNING: failed to select UTF-8 encoding, using ASCII
387 ;; Using 'setlocale' doesn't affect the test failures.
388 ;(setlocale LC_ALL "en_US.utf8")
389 ;(setenv "LC_ALL" "en_US.utf8")
390 (substitute* "test/cmdlineargs.jl"
391 (("test v\\[3") "test_broken v[3")
392 (("test isempty\\(v\\[3") "test_broken isempty(v[3"))
393 ;; These test(s) randomly fails because they depend on CPU.
394 (substitute* "test/math.jl"
395 ;; @test_broken cannot be used because if the test randomly
396 ;; passes, then it also raises an error.
397 (("@test isinf\\(log1p\\(-one\\(T\\)\\)\\)")
398 " "))))
399 (add-before 'install 'symlink-libraries
400 (lambda* (#:key inputs outputs #:allow-other-keys)
401 (let ((link
402 (lambda (pkgname dir pred)
403 (map (lambda (file)
404 (unless (file-exists?
405 (string-append dir (basename file)))
406 (symlink file (string-append dir (basename file)))))
407 (find-files (string-append (assoc-ref inputs pkgname)
408 "/lib") pred)))))
409 (link "curl" "usr/lib/" "\\.so") ; missing libpthreads libLLVM-11jl
410 (link "suitesparse" "usr/lib/julia/" "libbtf\\.so")
411 (link "suitesparse" "usr/lib/julia/" "libklu\\.so")
412 (link "suitesparse" "usr/lib/julia/" "libldl\\.so")
413 (link "suitesparse" "usr/lib/julia/" "librbio\\.so")
414 (link "gmp" "usr/lib/julia/" "libgmpxx\\.so")
415 (link "libuv" "usr/lib/julia/" "libuv\\.so")
416 (link "zlib" "usr/lib/julia/" "libz\\.so")
417 (link "libunwind" "usr/lib/julia/" "libunwind\\.so")
418 (symlink (string-append (assoc-ref inputs "p7zip") "/bin/7z")
419 "usr/libexec/7z"))))
420 (add-after 'install 'symlink-llvm-utf8proc
421 (lambda* (#:key inputs outputs #:allow-other-keys)
422 (let* ((out (assoc-ref outputs "out"))
423 (link
424 (lambda (pkgname pred)
425 (map (lambda (file)
426 (unless (file-exists?
427 (string-append out "/lib/julia/"
428 (basename file)))
429 (symlink file (string-append out "/lib/julia/"
430 (basename file)))))
431 (find-files (string-append (assoc-ref inputs pkgname)
432 "/lib") pred)))))
433 (link "llvm" "libLLVM-11jl\\.so")
434 (link "utf8proc" "libutf8proc\\.so"))))
435 (add-after 'install 'make-wrapper
436 (lambda* (#:key inputs outputs #:allow-other-keys)
437 (let* ((out (assoc-ref outputs "out"))
438 (bin (string-append out "/bin"))
439 (program "julia"))
440 (with-directory-excursion bin
441 (wrap-program program
442 `("JULIA_LOAD_PATH" ":" prefix
443 ("" "$JULIA_LOAD_PATH"))
444 `("JULIA_DEPOT_PATH" ":" prefix
445 ("" "$JULIA_DEPOT_PATH"))))))))
446 #:make-flags
447 (list
448 "VERBOSE=1" ;; more helpful logging of what make is doing
449 (string-append "prefix=" (assoc-ref %outputs "out"))
450
451 ;; Passing the MARCH or JULIA_CPU_TARGET flag is necessary to build
452 ;; binary substitutes for the supported architectures. See also
453 ;; https://docs.julialang.org/en/v1/devdocs/sysimg/#Specifying-multiple-system-image-targets
454 ,(match (or (%current-target-system)
455 (%current-system))
456 ("x86_64-linux"
457 ;; These are the flags that upstream uses for their binaries.
458 "JULIA_CPU_TARGET=generic;generic,-cx16,clone_all;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)")
459 ("i686-linux" "MARCH=pentium4")
460 ("armhf-linux" "JULIA_CPU_TARGET=armv7-a,neon")
461 ("powerpc64le-linux" "JULIA_CPU_TARGET=pwr8")
462 ;; Prevent errors when querying this package on unsupported
463 ;; platforms, e.g. when running "guix package --search="
464 ;; and also of targeting the builder's architecture.
465 (_ "JULIA_CPU_TARGET=generic"))
466
467 "CONFIG_SHELL=bash -x" ; needed to build bundled libraries
468 "USE_BINARYBUILDER=0"
469 ;; list (and order!) of "USE_SYSTEM_*" is here:
470 ;; https://github.com/JuliaLang/julia/blob/v1.6.0/Make.inc
471 "USE_SYSTEM_CSL=1"
472 "USE_SYSTEM_LLVM=1"
473 "USE_SYSTEM_LIBUNWIND=1"
474 "USE_SYSTEM_PCRE=1"
475 "USE_SYSTEM_OPENLIBM=1"
476 "USE_SYSTEM_DSFMT=1"
477 "USE_SYSTEM_BLAS=1"
478 "USE_SYSTEM_LAPACK=1"
479 "USE_SYSTEM_GMP=1"
480 "USE_SYSTEM_MPFR=1"
481 "USE_SYSTEM_SUITESPARSE=1"
482 "USE_SYSTEM_LIBUV=1"
483 "USE_SYSTEM_UTF8PROC=1"
484 "USE_SYSTEM_MBEDTLS=1"
485 "USE_SYSTEM_LIBSSH2=1"
486 "USE_SYSTEM_NGHTTP2=1"
487 "USE_SYSTEM_CURL=1"
488 "USE_SYSTEM_LIBGIT2=1"
489 "USE_SYSTEM_PATCHELF=1"
490 "USE_SYSTEM_ZLIB=1"
491 "USE_SYSTEM_P7ZIP=1"
492
493 "NO_GIT=1" ; build from release tarball.
494 "USE_BLAS64=0" ; needed when USE_SYSTEM_BLAS=1
495 "LIBBLAS=-lopenblas"
496 "LIBBLASNAME=libopenblas"
497
498 (string-append "SUITESPARSE_INC=-I "
499 (assoc-ref %build-inputs "suitesparse")
500 "/include")
501 "USE_GPL_LIBS=1" ; proudly
502 (string-append "UTF8PROC_INC="
503 (assoc-ref %build-inputs "utf8proc")
504 "/include")
505 "LLVM_VER=11.0.0"
506
507 "USE_LLVM_SHLIB=1"
508 (string-append "LIBUV="
509 (assoc-ref %build-inputs "libuv")
510 "/lib/libuv.so")
511 (string-append "LIBUV_INC="
512 (assoc-ref %build-inputs "libuv")
513 "/include"))))
514 (inputs
515 `(("coreutils" ,coreutils) ; for bindings to "mkdir" and the like
516 ("curl" ,curl-ssh)
517 ("gfortran" ,gfortran)
518 ;; required for libgcc_s.so
519 ("gfortran:lib" ,gfortran "lib")
520 ("gmp" ,gmp)
521 ("lapack" ,lapack)
522 ("libgit2" ,libgit2-1.1)
523 ("libnghttp2" ,nghttp2 "lib")
524 ("libssh2" ,libssh2)
525 ("libunwind" ,libunwind-julia)
526 ("libuv" ,libuv-julia)
527 ("llvm" ,llvm-julia)
528 ("mbedtls" ,mbedtls-apache)
529 ("mpfr" ,mpfr)
530 ("openblas" ,openblas)
531 ("openlibm" ,openlibm)
532 ("p7zip" ,p7zip)
533 ("pcre2" ,pcre2)
534 ("suitesparse" ,suitesparse)
535 ("utf8proc" ,utf8proc-2.6.1)
536 ("wget" ,wget)
537 ("which" ,which)
538 ("zlib" ,zlib)
539 ;; Find dependencies versions here:
540 ;; https://raw.githubusercontent.com/JuliaLang/julia/v1.6.0/deps/Versions.make
541 ("dsfmt" ,dsfmt)
542 ("libwhich" ,libwhich)))
543 (native-inputs
544 `(("openssl" ,openssl)
545 ("perl" ,perl)
546 ("patchelf" ,patchelf)
547 ("pkg-config" ,pkg-config)
548 ("python" ,python-2)))
549 (native-search-paths
550 (list (search-path-specification
551 (variable "JULIA_LOAD_PATH")
552 (files (list "share/julia/loadpath/")))
553 (search-path-specification
554 (variable "JULIA_DEPOT_PATH")
555 (files (list "share/julia/")))))
556 ;; Julia is not officially released for ARM and MIPS.
557 ;; See https://github.com/JuliaLang/julia/issues/10639
558 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
559 (home-page "https://julialang.org/")
560 (synopsis "High-performance dynamic language for technical computing")
561 (description
562 "Julia is a high-level, high-performance dynamic programming language for
563 technical computing, with syntax that is familiar to users of other technical
564 computing environments. It provides a sophisticated compiler, distributed
565 parallel execution, numerical accuracy, and an extensive mathematical function
566 library.")
567 (license license:expat)))