git.iko.soy/typeable/nixpkgs
on master help sign in
julia: 0.3.11 -> 0.4.0
commit384b828642e534b24eb3d54f4cb7053113b862b9 authorThomas Tuegel <ttuegel@gmail.com> dateSun 11 Oct 2015, 09:15 (11 years ago) parent840f4b0
5 files changed+246−1
pkgs/development/compilers/julia/0001-use-system-utf8proc.patch+29 pkgs/development/compilers/julia/0002-use-system-suitesparse.patch+25 pkgs/development/compilers/julia/0003-no-ldconfig.patch+29 pkgs/development/compilers/julia/default.nix+157 pkgs/top-level/all-packages.nix+6−1
pkgs/development/compilers/julia/0001-use-system-utf8proc.patchnew file+29
@@ -0,0 +1,29 @@
1+From 54a66b5728ec98f44a1768f064509be4fd3f2ef6 Mon Sep 17 00:00:00 2001
2+From: Thomas Tuegel <ttuegel@gmail.com>
3+Date: Sat, 10 Oct 2015 13:09:48 -0500
4+Subject: [PATCH 1/3] use system utf8proc
5+
6+---
7+ src/flisp/Makefile | 6 +++---
8+ 1 file changed, 3 insertions(+), 3 deletions(-)
9+
10+diff --git a/src/flisp/Makefile b/src/flisp/Makefile
11+index bec8624..5437b5c 100644
12+--- a/src/flisp/Makefile
13++++ b/src/flisp/Makefile
14+@@ -24,9 +24,9 @@ DOBJS = $(SRCS:%.c=$(BUILDDIR)/%.dbg.obj)
15+ LLTDIR = ../support
16+ LLT_release = $(BUILDDIR)/$(LLTDIR)/libsupport.a
17+ LLT_debug = $(BUILDDIR)/$(LLTDIR)/libsupport-debug.a
18+-LIBFILES_release = $(LLT_release) $(LIBUV) $(LIBUTF8PROC)
19+-LIBFILES_debug = $(LLT_debug) $(LIBUV) $(LIBUTF8PROC)
20+-LIBS =
21++LIBFILES_release = $(LLT_release) $(LIBUV)
22++LIBFILES_debug = $(LLT_debug) $(LIBUV)
23++LIBS = $(LIBUTF8PROC)
24+ ifneq ($(OS),WINNT)
25+ LIBS += -lpthread
26+ endif
27+--
28+2.5.2
29+
pkgs/development/compilers/julia/0002-use-system-suitesparse.patchnew file+25
@@ -0,0 +1,25 @@
1+From e2b0ed6664fe4adfd0f9ce8fa14732d47b30ab5c Mon Sep 17 00:00:00 2001
2+From: Thomas Tuegel <ttuegel@gmail.com>
3+Date: Sat, 10 Oct 2015 16:18:53 -0500
4+Subject: [PATCH 2/3] use system suitesparse
5+
6+---
7+ base/sparse/cholmod.jl | 2 +-
8+ 1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+diff --git a/base/sparse/cholmod.jl b/base/sparse/cholmod.jl
11+index ec7e980..f834cc1 100644
12+--- a/base/sparse/cholmod.jl
13++++ b/base/sparse/cholmod.jl
14+@@ -151,7 +151,7 @@ function __init__()
15+
16+ # Register gc tracked allocator if CHOLMOD is new enough
17+ if current_version >= v"3.0.0"
18+- cnfg = cglobal((:SuiteSparse_config, :libsuitesparseconfig), Ptr{Void})
19++ cnfg = cglobal((:SuiteSparse_config, :libsuitesparse), Ptr{Void})
20+ unsafe_store!(cnfg, cglobal(:jl_malloc, Ptr{Void}), 1)
21+ unsafe_store!(cnfg, cglobal(:jl_calloc, Ptr{Void}), 2)
22+ unsafe_store!(cnfg, cglobal(:jl_realloc, Ptr{Void}), 3)
23+--
24+2.5.2
25+
pkgs/development/compilers/julia/0003-no-ldconfig.patchnew file+29
@@ -0,0 +1,29 @@
1+From 8802fe583eda93a928739cb3bc3517e19d1a6fa1 Mon Sep 17 00:00:00 2001
2+From: Thomas Tuegel <ttuegel@gmail.com>
3+Date: Sun, 11 Oct 2015 07:19:42 -0500
4+Subject: [PATCH 3/3] no ldconfig
5+
6+---
7+ src/ccall.cpp | 6 +-----
8+ 1 file changed, 1 insertion(+), 5 deletions(-)
9+
10+diff --git a/src/ccall.cpp b/src/ccall.cpp
11+index 22015ff..2821192 100644
12+--- a/src/ccall.cpp
13++++ b/src/ccall.cpp
14+@@ -13,11 +13,7 @@ extern "C" DLLEXPORT void jl_read_sonames(void)
15+ {
16+ char *line=NULL;
17+ size_t sz=0;
18+-#if defined(__linux__)
19+- FILE *ldc = popen("/sbin/ldconfig -p", "r");
20+-#else
21+- FILE *ldc = popen("/sbin/ldconfig -r", "r");
22+-#endif
23++ FILE *ldc = popen("true", "r");
24+
25+ while (!feof(ldc)) {
26+ ssize_t n = getline(&line, &sz, ldc);
27+--
28+2.5.2
29+
pkgs/development/compilers/julia/default.nixnew file+157
@@ -0,0 +1,157 @@
1+{ stdenv, fetchgit, fetchurl
2+# build tools
3+, gfortran, m4, makeWrapper, patchelf, perl, which, python2
4+# libjulia dependencies
5+, libunwind, llvm, readline, utf8proc, zlib
6+# standard library dependencies
7+, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
8+# linear algebra
9+, openblas, arpack, suitesparse
10+}:
11+
12+with stdenv.lib;
13+
14+# All dependencies must use the same OpenBLAS.
15+let
16+ arpack_ = arpack;
17+ suitesparse_ = suitesparse;
18+in
19+let
20+ arpack = arpack_.override { inherit openblas; };
21+ suitesparse = suitesparse_.override { inherit openblas; };
22+in
23+
24+let
25+ dsfmtVersion = "2.2.3";
26+ dsfmt = fetchurl {
27+ url = "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-${dsfmtVersion}.tar.gz";
28+ sha256 = "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42";
29+ };
30+
31+ libuvVersion = "28f5f06b5ff6f010d666ec26552e0badaca5cdcd";
32+ libuv = fetchurl {
33+ url = "https://api.github.com/repos/JuliaLang/libuv/tarball/${libuvVersion}";
34+ sha256 = "1ksns0aiayxmxffvq2kc96904mxlmbkfc30xxck69xnidr2jvr4a";
35+ };
36+
37+ rmathVersion = "0.1";
38+ rmath-julia = fetchurl {
39+ url = "https://api.github.com/repos/JuliaLang/Rmath-julia/tarball/v${rmathVersion}";
40+ sha256 = "0ai5dhjc43zcvangz123ryxmlbm51s21rg13bllwyn98w67arhb4";
41+ };
42+in
43+
44+stdenv.mkDerivation rec {
45+ pname = "julia";
46+ version = "0.4.0";
47+ name = "${pname}-${version}";
48+
49+ src = fetchurl {
50+ url = "https://github.com/JuliaLang/${pname}/releases/download/v${version}/${name}.tar.gz";
51+ sha256 = "00k53hzbawpqvmkkyzcvbmf1d0ycshzdqk19nwsifv1rmiwjj7ss";
52+ };
53+
54+ prePatch = ''
55+ cp "${dsfmt}" "./deps/dsfmt-${dsfmtVersion}.tar.gz"
56+ cp "${rmath-julia}" "./deps/Rmath-julia-${rmathVersion}.tar.gz"
57+ cp "${libuv}" "./deps/libuv-${libuvVersion}.tar.gz"
58+ '';
59+
60+ patches = [
61+ ./0001-use-system-utf8proc.patch
62+ ./0002-use-system-suitesparse.patch
63+ ./0003-no-ldconfig.patch
64+ ];
65+
66+ postPatch = ''
67+ patchShebangs . contrib
68+ '';
69+
70+ buildInputs = [
71+ arpack fftw fftwSinglePrec gmp libgit2 libunwind llvm mpfr
72+ pcre2 openblas openlibm openspecfun readline suitesparse utf8proc
73+ zlib
74+ ];
75+
76+ nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ];
77+
78+ makeFlags =
79+ let
80+ arch = head (splitString "-" stdenv.system);
81+ march = { "x86_64" = "x86-64"; "i686" = "i686"; }."${arch}"
82+ or (throw "unsupported architecture: ${arch}");
83+ # Julia requires Pentium 4 (SSE2) or better
84+ cpuTarget = { "x86_64" = "x86-64"; "i686" = "pentium4"; }."${arch}"
85+ or (throw "unsupported architecture: ${arch}");
86+ in [
87+ "ARCH=${arch}"
88+ "MARCH=${march}"
89+ "JULIA_CPU_TARGET=${cpuTarget}"
90+ "PREFIX=$(out)"
91+ "prefix=$(out)"
92+ "SHELL=${stdenv.shell}"
93+
94+ "USE_SYSTEM_BLAS=1"
95+ "USE_BLAS64=${if openblas.blas64 then "1" else "0"}"
96+ "LIBBLAS=-lopenblas"
97+ "LIBBLASNAME=libopenblas"
98+
99+ "USE_SYSTEM_LAPACK=1"
100+ "LIBLAPACK=-lopenblas"
101+ "LIBLAPACKNAME=libopenblas"
102+
103+ "USE_SYSTEM_SUITESPARSE=1"
104+ "SUITESPARSE_LIB=-lsuitesparse"
105+ "SUITESPARSE_INC=-I${suitesparse}/include"
106+
107+ "USE_SYSTEM_ARPACK=1"
108+ "USE_SYSTEM_FFTW=1"
109+ "USE_SYSTEM_GMP=1"
110+ "USE_SYSTEM_LIBGIT2=1"
111+ "USE_SYSTEM_LIBUNWIND=1"
112+ "USE_SYSTEM_LLVM=1"
113+ "USE_SYSTEM_MPFR=1"
114+ "USE_SYSTEM_OPENLIBM=1"
115+ "USE_SYSTEM_OPENSPECFUN=1"
116+ "USE_SYSTEM_PATCHELF=1"
117+ "USE_SYSTEM_PCRE=1"
118+ "USE_SYSTEM_READLINE=1"
119+ "USE_SYSTEM_UTF8PROC=1"
120+ "USE_SYSTEM_ZLIB=1"
121+ ];
122+
123+ NIX_CFLAGS_COMPILE = [ "-fPIC" ];
124+
125+ LD_LIBRARY_PATH = makeSearchPath "lib" [
126+ arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm
127+ openspecfun pcre2 suitesparse
128+ ];
129+
130+ dontStrip = true;
131+ dontPatchELF = true;
132+
133+ enableParallelBuilding = true;
134+
135+ doCheck = true;
136+ checkTarget = "testall";
137+ # Julia's tests require read/write access to $HOME
138+ preCheck = ''
139+ export HOME="$NIX_BUILD_TOP"
140+ '';
141+
142+ postInstall = ''
143+ for prog in "$out/bin/julia" "$out/bin/julia-debug"; do
144+ wrapProgram "$prog" \
145+ --prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH" \
146+ --prefix PATH : "${curl}/bin"
147+ done
148+ '';
149+
150+ meta = {
151+ description = "High-level performance-oriented dynamical language for technical computing";
152+ homepage = "http://julialang.org/";
153+ license = stdenv.lib.licenses.mit;
154+ maintainers = with stdenv.lib.maintainers; [ raskin ttuegel ];
155+ platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
156+ };
157+}
pkgs/top-level/all-packages.nix+6−1
@@ -4145,7 +4145,12 @@ let
41454145 julia03 = callPackage ../development/compilers/julia/0.3.nix {
41464146 llvm = llvm_33;
41474147 };
4148− julia = julia03;
4148+
4149+ julia = callPackage ../development/compilers/julia {
4150+ gmp = gmp6;
4151+ llvm = llvm_33;
4152+ openblas = openblasCompat;
4153+ };
41494154
41504155 lazarus = callPackage ../development/compilers/fpc/lazarus.nix {
41514156 fpc = fpc;