From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] Add Julia. Date: Fri, 20 Mar 2015 12:16:12 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYuuk-0004qU-Il for guix-devel@gnu.org; Fri, 20 Mar 2015 07:16:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYuud-0008UC-HM for guix-devel@gnu.org; Fri, 20 Mar 2015 07:16:30 -0400 Received: from pegasus.bbbm.mdc-berlin.de ([141.80.25.20]:46454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYuud-0008Te-14 for guix-devel@gnu.org; Fri, 20 Mar 2015 07:16:23 -0400 Received: from localhost (localhost [127.0.0.1]) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTP id 421C5380AB9 for ; Fri, 20 Mar 2015 12:16:20 +0100 (CET) Received: from pegasus.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (pegasus.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i0c7A0xjgLJA for ; Fri, 20 Mar 2015 12:16:13 +0100 (CET) Received: from HTCAONE.mdc-berlin.net (mab.citx.mdc-berlin.de [141.80.36.102]) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTP for ; Fri, 20 Mar 2015 12:16:12 +0100 (CET) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel --=-=-= Content-Type: text/plain Hi Guix, attached is a patch to add Julia, a language for technical computing, and one more library it depends on: double-conversion. The release tarball comes with all dependencies bundled, but I tried hard to make it build against system libraries. This didn't always work, unfortunately. libuv : Julia comes with a modified version of libuv and it won't build with our libuv package at this point. This has been confirmed upstream[1]. dSMFT : Upstream's Makefile does not have targets to build dSMFT as a library. The Makefile is only used to build test programmes. I have a rudimentary package for dSMFT ready, but it would have to include a patch to the Makefile to actually build libraries. rmath : Julia uses a version of rmath that is patched to use the dSMFT random number generator. Upstream highly recommends using the patched library. suitesparse : Unfortunately, suitesparse only builds static libraries, not shared ones, while Julia expects to find shared libraries. I'm not sure what to patch here: Julia's build system so that it builds shared libs from the suitesparse package output (rather than the bundled tarball) or suitesparse such that it also provides shared libs. This package depends on a couple of other packages that are still awaiting review: - double-conversion (patch attached below) - openblas[2] (needed because Julia doesn't build against Atlas) - utf8proc[3] TIA for the review! ~~ Ricardo ---------- [1]: https://github.com/JuliaLang/julia/issues/10246#issuecomment-75029026 [2]: http://lists.gnu.org/archive/html/guix-devel/2015-03/msg00557.html [3]: http://lists.gnu.org/archive/html/guix-devel/2015-03/msg00563.html --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0001-gnu-Add-double-conversion.patch" >From dfe39329d60b38b684141cc0ce1d2bccd7ab637e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 20 Mar 2015 12:11:35 +0100 Subject: [PATCH 1/2] gnu: Add double-conversion. * gnu/packages/maths.scm (double-conversion): New variable. --- gnu/packages/maths.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 0d2efdd..cb6fa66 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -92,6 +92,32 @@ effectively as a scientific calculator.") (license license:gpl3+) (home-page "http://www.gnu.org/software/units/"))) +(define-public double-conversion + (package + (name "double-conversion") + (version "1.1.5") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/floitsch/double-conversion/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83")))) + (build-system cmake-build-system) + (arguments + '(#:test-target "test" + #:configure-flags '("-DBUILD_SHARED_LIBS=ON" + "-DBUILD_TESTING=ON"))) + (home-page "https://github.com/floitsch/double-conversion") + (synopsis "Conversion routines for IEEE doubles") + (description + "The double-conversion library provides binary-decimal and decimal-binary +routines for IEEE doubles. The library consists of efficient conversion +routines that have been extracted from the V8 JavaScript engine.") + (license license:bsd-3))) + (define-public dionysus (package (name "dionysus") -- 2.1.0 --=-=-= Content-Type: text/x-patch; charset="utf-8" Content-Disposition: inline; filename="0002-gnu-Add-Julia.patch" Content-Transfer-Encoding: quoted-printable >From 41550ffafa8da05b2cf8dfad66d44e6f43c9042c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 20 Mar 2015 11:26:23 +0100 Subject: [PATCH 2/2] gnu: Add Julia. * gnu/packages/julia.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- gnu-system.am | 1 + gnu/packages/julia.scm | 172 +++++++++++++++++++++++++++++++++++++++++++= ++++++ 2 files changed, 173 insertions(+) create mode 100644 gnu/packages/julia.scm diff --git a/gnu-system.am b/gnu-system.am index 2bed50f..75a98bf 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -156,6 +156,7 @@ GNU_SYSTEM_MODULES =3D \ gnu/packages/iso-codes.scm \ gnu/packages/java.scm \ gnu/packages/jrnl.scm \ + gnu/packages/julia.scm \ gnu/packages/kde.scm \ gnu/packages/key-mon.scm \ gnu/packages/language.scm \ diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm new file mode 100644 index 0000000..844f1b2 --- /dev/null +++ b/gnu/packages/julia.scm @@ -0,0 +1,172 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2015 Ricardo Wurmus +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (a= t +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages julia) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages algebra) + #:use-module (gnu packages base) + #:use-module (gnu packages elf) + #:use-module (gnu packages gcc) + #:use-module (gnu packages llvm) + #:use-module (gnu packages libunwind) + #:use-module (gnu packages maths) + #:use-module (gnu packages multiprecision) ; mpfr + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages textutils) + #:use-module (gnu packages version-control)) + +(define-public julia + (package + (name "julia") + (version "0.3.6") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/JuliaLang/julia/releases/downloa= d/v" + version "/julia-" version "_0c24dca65c.tar.gz")) + (sha256 + (base32 + "1hnbc2blzr9bc27m3vsr127fhg0h5imgqlrx00jakf0my0ccw8gr"))= )) + (build-system gnu-build-system) + (arguments + '(#:test-target "test" + #:modules ((ice-9 match) + (guix build gnu-build-system) + (guix build utils)) + #:phases + (alist-cons-after + 'unpack 'hardcode-soname-map + ;; ./src/ccall.cpp creates a map from library names to paths usi= ng the + ;; output of "/sbin/ldconfig -p". Since ldconfig is not used in= Guix, + ;; we patch ccall.cpp to contain a static map. + (lambda* (#:key inputs #:allow-other-keys) + (use-modules (ice-9 match)) + (substitute* "src/ccall.cpp" + (("jl_read_sonames.*;") + (string-join + (map (match-lambda + ((input libname soname) + (string-append + "sonameMap[\"" libname "\"] =3D " + "\"" (assoc-ref inputs input) "/lib/" soname "\";"= ))) + '(("libc" "libc" "libc.so.6") + ("pcre" "libpcre" "libpcre.so") + ("mpfr" "libmpfr" "libmpfr.so") + ("openblas" "libblas" "libopenblas.so") + ("arpack-ng" "libarpack" "libarpack.so") + ("lapack" "liblapack" "liblapack.so") + ("gmp" "libgmp" "libgmp.so") + ("openlibm" "libopenlibm" "libopenlibm.so") + ("openspecfun" "libopenspecfun" "libopenspecfun.so"= ) + ("fftw" "libfftw3" "libfftw3.so") + ("fftwf" "libfftw3f" "libfftw3f.so")))))= )) + (alist-cons-before + 'build 'replace-default-shell + (lambda _ + (substitute* "base/client.jl" + (("/bin/sh") (which "sh")))) + (alist-cons-before + 'build 'patch-include-path + (lambda _ + (substitute* "deps/Makefile" + (("/usr/include/double-conversion") + (string-append (assoc-ref %build-inputs "double-conversio= n") + "/include/double-conversion")))) + (alist-cons-before + 'check 'disable-broken-test + ;; One test fails because it produces slightly different outp= ut. + (lambda _ + (substitute* "test/repl.jl" + (("@test output") "# @test output"))) + ;; no configure script + (alist-delete 'configure %standard-phases))))) + #:make-flags + (list + (string-append "prefix=3D" (assoc-ref %outputs "out")) + "CONFIG_SHELL=3Dbash" ;needed to build bundled libraries + "USE_SYSTEM_LIBUV=3D0" ;Julia expects a modified libuv + "USE_SYSTEM_DSFMT=3D0" ;not packaged for Guix and upstream ha= s no + ;build system for a shared library. + "USE_SYSTEM_RMATH=3D0" ;Julia uses a bundled version of R's m= ath + ;library, patched to use the DSFMT RNG. + + "USE_SYSTEM_LAPACK=3D1" + "USE_SYSTEM_BLAS=3D1" + "USE_BLAS64=3D0" ;needed when USE_SYSTEM_BLAS=3D1 + + "USE_SYSTEM_FFTW=3D1" + "LIBFFTWNAME=3Dlibfftw3" + "LIBFFTWFNAME=3Dlibfftw3f" + + ;; TODO: Suitesparse does not install shared libraries, so we ca= nnot + ;; use the suitesparse package. + ;; "USE_SYSTEM_SUITESPARSE=3D1" + ;; (string-append "SUITESPARSE_INC=3D-I " + ;; (assoc-ref %build-inputs "suitesparse") + ;; "/include") + + "USE_SYSTEM_GRISU=3D1" ;for double-conversion + "USE_SYSTEM_UTF8PROC=3D1" + "USE_SYSTEM_LLVM=3D1" + "USE_SYSTEM_LIBUNWIND=3D1" + "USE_SYSTEM_PCRE=3D1" + "USE_SYSTEM_OPENLIBM=3D1" + "USE_SYSTEM_GMP=3D1" + "USE_SYSTEM_MPFR=3D1" + "USE_SYSTEM_ARPACK=3D1" + "USE_SYSTEM_LIBGIT2=3D1" + "USE_SYSTEM_OPENSPECFUN=3D1"))) + (inputs + `(("llvm" ,llvm-3.5) + ("arpack-ng" ,arpack-ng) + ("lapack" ,lapack) + ("openblas" ,openblas) ;Julia does not build with Atlas + ("libunwind" ,libunwind) + ("openlibm" ,openlibm) + ("openspecfun" ,openspecfun) + ("double-conversion" ,double-conversion) + ("fftw" ,fftw) + ("fftwf" ,fftwf) + ("fortran" ,gfortran-4.8) + ("pcre" ,pcre) + ("utf8proc" ,utf8proc) + ("git" ,git) + ("mpfr" ,mpfr) + ("gmp" ,gmp))) + (native-inputs + `(("perl" ,perl) + ("patchelf" ,patchelf) + ("pkg-config" ,pkg-config) + ("python" ,python-2) + ("which" ,which))) + (home-page "http://julialang.org/") + (synopsis "High-performance dynamic language for technical computing= ") + (description + "Julia is a high-level, high-performance dynamic programming langua= ge for +technical computing, with syntax that is familiar to users of other tech= nical +computing environments. It provides a sophisticated compiler, distribut= ed +parallel execution, numerical accuracy, and an extensive mathematical fu= nction +library.") + (license license:expat))) --=20 2.1.0 --=-=-=--