Merge branch 'julia-0.4'
This commit is contained in:
commit
ae49c91569
@ -1,143 +0,0 @@
|
||||
{ stdenv, fetchgit, gfortran, perl, m4, llvm, gmp, pcre, zlib
|
||||
, readline, fftwSinglePrec, fftw, libunwind, suitesparse, glpk, fetchurl
|
||||
, ncurses, libunistring, lighttpd, patchelf, openblas
|
||||
, tcl, tk, xproto, libX11, git, mpfr
|
||||
} :
|
||||
let
|
||||
realGcc = stdenv.cc.cc;
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "julia";
|
||||
version = "0.2.1";
|
||||
name = "${pname}-${version}";
|
||||
|
||||
grisu_ver = "1.1.1";
|
||||
dsfmt_ver = "2.2";
|
||||
openblas_ver = "v0.2.2";
|
||||
lapack_ver = "3.4.1";
|
||||
arpack_ver = "3.1.3";
|
||||
clp_ver = "1.14.5";
|
||||
lighttpd_ver = "1.4.29";
|
||||
patchelf_ver = "0.6";
|
||||
pcre_ver = "8.31";
|
||||
|
||||
grisu_src = fetchurl {
|
||||
url = "http://double-conversion.googlecode.com/files/double-conversion-${grisu_ver}.tar.gz";
|
||||
sha256 = "e1cabb73fd69e74f145aea91100cde483aef8b79dc730fcda0a34466730d4d1d";
|
||||
};
|
||||
dsfmt_src = fetchurl {
|
||||
url = "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-${dsfmt_ver}.tar.gz";
|
||||
name = "dsfmt-${dsfmt_ver}.tar.gz";
|
||||
sha256 = "bc3947a9b2253a869fcbab8ff395416cb12958be9dba10793db2cd7e37b26899";
|
||||
};
|
||||
openblas_src = fetchurl {
|
||||
url = "https://github.com/xianyi/OpenBLAS/tarball/${openblas_ver}";
|
||||
name = "openblas-${openblas_ver}.tar.gz";
|
||||
sha256 = "19ffec70f9678f5c159feadc036ca47720681b782910fbaa95aa3867e7e86d8e";
|
||||
};
|
||||
arpack_src = fetchurl {
|
||||
url = "http://forge.scilab.org/index.php/p/arpack-ng/downloads/607/get/";
|
||||
name = "arpack-ng-${arpack_ver}.tar.gz";
|
||||
sha256 = "039w7j3dr1xy35a3hp92zg2g92gmjq6xsv0g4awlb4cffy09nr2d";
|
||||
};
|
||||
lapack_src = fetchurl {
|
||||
url = "http://www.netlib.org/lapack/lapack-${lapack_ver}.tgz";
|
||||
name = "lapack-${lapack_ver}.tgz";
|
||||
sha256 = "93b910f94f6091a2e71b59809c4db4a14655db527cfc5821ade2e8c8ab75380f";
|
||||
};
|
||||
clp_src = fetchurl {
|
||||
url = "http://www.coin-or.org/download/source/Clp/Clp-${clp_ver}.tgz";
|
||||
name = "clp-${clp_ver}.tar.gz";
|
||||
sha256 = "e6cabe8b4319c17a9bbe6fe172194ab6cd1fe6e376f5e9969d3040636ea3a817";
|
||||
};
|
||||
lighttpd_src = fetchurl {
|
||||
url = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${lighttpd_ver}.tar.gz";
|
||||
sha256 = "ff9f4de3901d03bb285634c5b149191223d17f1c269a16c863bac44238119c85";
|
||||
};
|
||||
patchelf_src = fetchurl {
|
||||
url = "http://hydra.nixos.org/build/1524660/download/2/patchelf-${patchelf_ver}.tar.bz2";
|
||||
sha256 = "00bw29vdsscsili65wcb5ay0gvg1w0ljd00sb5xc6br8bylpyzpw";
|
||||
};
|
||||
pcre_src = fetchurl {
|
||||
url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${pcre_ver}.tar.bz2";
|
||||
sha256 = "0g4c0z4h30v8g8qg02zcbv7n67j5kz0ri9cfhgkpwg276ljs0y2p";
|
||||
};
|
||||
|
||||
src = fetchgit {
|
||||
url = "git://github.com/JuliaLang/julia.git";
|
||||
rev = "refs/tags/v${version}";
|
||||
sha256 = "7ee0f267bc1ae286764ced3c0c695c335a6f8d67bd7b3ca7e4de259333c9426a";
|
||||
};
|
||||
|
||||
buildInputs = [ gfortran perl m4 gmp pcre llvm readline zlib
|
||||
fftw fftwSinglePrec libunwind suitesparse glpk ncurses libunistring patchelf
|
||||
openblas tcl tk xproto libX11 git mpfr
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
for i in GMP LLVM PCRE LAPACK OPENBLAS BLAS READLINE FFTW LIBUNWIND SUITESPARSE GLPK LIGHTTPD ZLIB MPFR;
|
||||
do
|
||||
makeFlags="$makeFlags USE_SYSTEM_$i=1 "
|
||||
done
|
||||
makeFlags="$makeFlags JULIA_CPU_TARGET=core2";
|
||||
|
||||
copy_kill_hash(){
|
||||
cp "$1" "$2/$(basename "$1" | sed -e 's/^[a-z0-9]*-//')"
|
||||
}
|
||||
|
||||
for i in "${grisu_src}" "${dsfmt_src}" "${arpack_src}" "${clp_src}" "${patchelf_src}" "${pcre_src}" ; do
|
||||
copy_kill_hash "$i" deps
|
||||
done
|
||||
copy_kill_hash "${dsfmt_src}" deps/random
|
||||
|
||||
${if realGcc ==null then "" else
|
||||
''export NIX_LDFLAGS="$NIX_LDFLAGS -L${realGcc}/lib -L${realGcc}/lib64 -lpcre -lopenblas -lm -lfftw3f -lfftw3 -lglpk -lunistring -lz -lgmp -lmpfr"''}
|
||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC "
|
||||
|
||||
export LDFLAGS="-L${suitesparse}/lib -L$out/lib/julia -Wl,-rpath,$out/lib/julia"
|
||||
|
||||
export GLPK_PREFIX="${glpk}/include"
|
||||
|
||||
sed -e "s@/usr/local/lib@$out/lib@g" -i deps/Makefile
|
||||
sed -e "s@/usr/lib@$out/lib@g" -i deps/Makefile
|
||||
|
||||
export makeFlags="$makeFlags PREFIX=$out SHELL=${stdenv.shell}"
|
||||
|
||||
export dontPatchELF=1
|
||||
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/usr/lib:$PWD/usr/lib/julia"
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
mkdir -p usr/lib
|
||||
|
||||
mkdir -p "$out/lib"
|
||||
ln -s "${openblas}/lib/libopenblas.so" "$out/lib/libblas.so"
|
||||
ln -s "${openblas}/lib/libopenblas.so" "$out/lib/liblapack.so"
|
||||
|
||||
echo "$out"
|
||||
(
|
||||
cd "$(mktemp -d)"
|
||||
for i in "${suitesparse}"/lib/lib*.a; do
|
||||
ar -x $i
|
||||
done
|
||||
gcc *.o --shared -o "$out/lib/libsuitesparse.so"
|
||||
)
|
||||
cp "$out/lib/libsuitesparse.so" usr/lib
|
||||
for i in umfpack cholmod amd camd colamd spqr; do
|
||||
ln -s libsuitesparse.so "$out"/lib/lib$i.so;
|
||||
ln -s libsuitesparse.so "usr"/lib/lib$i.so;
|
||||
done
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "High-level performance-oriented dynamical language for technical computing";
|
||||
homepage = "http://julialang.org/";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
maintainers = [ stdenv.lib.maintainers.raskin ];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
};
|
||||
}
|
@ -1,154 +0,0 @@
|
||||
{ stdenv, fetchgit, fetchurl
|
||||
# build tools
|
||||
, gfortran, git, m4, patchelf, perl, which, python2
|
||||
# libjulia dependencies
|
||||
, libunwind, llvm, readline, utf8proc, zlib
|
||||
# standard library dependencies
|
||||
, double_conversion, fftwSinglePrec, fftw, glpk, gmp, mpfr, pcre
|
||||
# linear algebra
|
||||
, openblas, arpack, suitesparse
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
# All dependencies should use the same OpenBLAS.
|
||||
let
|
||||
arpack_ = arpack;
|
||||
suitesparse_ = suitesparse;
|
||||
in
|
||||
let
|
||||
arpack = arpack_.override { inherit openblas; };
|
||||
suitesparse = suitesparse_.override { inherit openblas; };
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "julia";
|
||||
version = "0.3.11";
|
||||
name = "${pname}-${version}";
|
||||
|
||||
src = fetchgit {
|
||||
url = "git://github.com/JuliaLang/julia.git";
|
||||
rev = "refs/tags/v${version}";
|
||||
sha256 = "06xmv2l8hskdh1s5y2dh28vpb5pc0gzmfl5a03yp0qjjsl5cb284";
|
||||
name = "julia-git-v${version}";
|
||||
};
|
||||
|
||||
patches = [ ./0001-work-around-buggy-wcwidth.patch ];
|
||||
|
||||
extraSrcs =
|
||||
let
|
||||
dsfmt_ver = "2.2";
|
||||
|
||||
dsfmt_src = fetchurl {
|
||||
url = "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-${dsfmt_ver}.tar.gz";
|
||||
name = "dsfmt-${dsfmt_ver}.tar.gz";
|
||||
md5 = "cb61be3be7254eae39684612c524740d";
|
||||
};
|
||||
|
||||
in [ dsfmt_src ];
|
||||
|
||||
prePatch = ''
|
||||
copy_kill_hash(){
|
||||
cp "$1" "$2/$(basename "$1" | sed -e 's/^[a-z0-9]*-//')"
|
||||
}
|
||||
|
||||
for i in $extraSrcs; do
|
||||
copy_kill_hash "$i" deps
|
||||
done
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
sed -i deps/Makefile \
|
||||
-e "s@/usr/local/lib@$out/lib@g" \
|
||||
-e "s@/usr/lib@$out/lib@g" \
|
||||
-e "s@/usr/include/double-conversion@${double_conversion}/include/double-conversion@g"
|
||||
|
||||
patchShebangs . contrib
|
||||
|
||||
# ldconfig doesn't seem to ever work on NixOS; system-wide ldconfig cache
|
||||
# is probably not what we want anyway on non-NixOS
|
||||
sed -e "s@/sbin/ldconfig@true@" -i src/ccall.*
|
||||
'';
|
||||
|
||||
buildInputs = [
|
||||
arpack double_conversion fftw fftwSinglePrec glpk gmp libunwind
|
||||
llvm mpfr pcre openblas readline suitesparse utf8proc zlib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ gfortran git m4 patchelf perl python2 which ];
|
||||
|
||||
makeFlags =
|
||||
let
|
||||
arch = head (splitString "-" stdenv.system);
|
||||
march = { "x86_64" = "x86-64"; "i686" = "i686"; }."${arch}"
|
||||
or (throw "unsupported architecture: ${arch}");
|
||||
in [
|
||||
"ARCH=${arch}"
|
||||
"MARCH=${march}"
|
||||
"JULIA_CPU_TARGET=${march}"
|
||||
"PREFIX=$(out)"
|
||||
"prefix=$(out)"
|
||||
"SHELL=${stdenv.shell}"
|
||||
|
||||
"USE_SYSTEM_BLAS=1"
|
||||
"LIBBLAS=-lopenblas"
|
||||
"LIBBLASNAME=libopenblas"
|
||||
|
||||
"USE_SYSTEM_LAPACK=1"
|
||||
"LIBLAPACK=-lopenblas"
|
||||
"LIBLAPACKNAME=libopenblas"
|
||||
|
||||
"USE_SYSTEM_ARPACK=1"
|
||||
"USE_SYSTEM_FFTW=1"
|
||||
"USE_SYSTEM_GLPK=1"
|
||||
"USE_SYSTEM_GMP=1"
|
||||
"USE_SYSTEM_GRISU=1"
|
||||
"USE_SYSTEM_LIBUNWIND=1"
|
||||
"USE_SYSTEM_LLVM=1"
|
||||
"USE_SYSTEM_MPFR=1"
|
||||
"USE_SYSTEM_PATCHELF=1"
|
||||
"USE_SYSTEM_PCRE=1"
|
||||
"USE_SYSTEM_READLINE=1"
|
||||
"USE_SYSTEM_SUITESPARSE=1"
|
||||
"USE_SYSTEM_UTF8PROC=1"
|
||||
"USE_SYSTEM_ZLIB=1"
|
||||
];
|
||||
|
||||
GLPK_PREFIX = "${glpk}/include";
|
||||
|
||||
NIX_CFLAGS_COMPILE = [ "-fPIC" ];
|
||||
|
||||
# Julia tries to load these libraries dynamically at runtime, but they can't be found.
|
||||
# Easier by far to link against them as usual.
|
||||
# These go in LDFLAGS, where they affect only Julia itself, and not NIX_LDFLAGS,
|
||||
# where they would also be used for all the private libraries Julia builds.
|
||||
LDFLAGS = [
|
||||
"-larpack"
|
||||
"-lfftw3_threads"
|
||||
"-lfftw3f_threads"
|
||||
"-lglpk"
|
||||
"-lgmp"
|
||||
"-lmpfr"
|
||||
"-lopenblas"
|
||||
"-lpcre"
|
||||
"-lsuitesparse"
|
||||
"-lz"
|
||||
];
|
||||
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# Test fail on i686 (julia version 0.3.10)
|
||||
doCheck = !stdenv.isi686;
|
||||
checkTarget = "testall";
|
||||
|
||||
meta = {
|
||||
description = "High-level performance-oriented dynamical language for technical computing";
|
||||
homepage = "http://julialang.org/";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
maintainers = with stdenv.lib.maintainers; [ raskin ttuegel ];
|
||||
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
From 54a66b5728ec98f44a1768f064509be4fd3f2ef6 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Tuegel <ttuegel@gmail.com>
|
||||
Date: Sat, 10 Oct 2015 13:09:48 -0500
|
||||
Subject: [PATCH 1/3] use system utf8proc
|
||||
|
||||
---
|
||||
src/flisp/Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/flisp/Makefile b/src/flisp/Makefile
|
||||
index bec8624..5437b5c 100644
|
||||
--- a/src/flisp/Makefile
|
||||
+++ b/src/flisp/Makefile
|
||||
@@ -24,9 +24,9 @@ DOBJS = $(SRCS:%.c=$(BUILDDIR)/%.dbg.obj)
|
||||
LLTDIR = ../support
|
||||
LLT_release = $(BUILDDIR)/$(LLTDIR)/libsupport.a
|
||||
LLT_debug = $(BUILDDIR)/$(LLTDIR)/libsupport-debug.a
|
||||
-LIBFILES_release = $(LLT_release) $(LIBUV) $(LIBUTF8PROC)
|
||||
-LIBFILES_debug = $(LLT_debug) $(LIBUV) $(LIBUTF8PROC)
|
||||
-LIBS =
|
||||
+LIBFILES_release = $(LLT_release) $(LIBUV)
|
||||
+LIBFILES_debug = $(LLT_debug) $(LIBUV)
|
||||
+LIBS = $(LIBUTF8PROC)
|
||||
ifneq ($(OS),WINNT)
|
||||
LIBS += -lpthread
|
||||
endif
|
||||
--
|
||||
2.5.2
|
||||
|
@ -0,0 +1,25 @@
|
||||
From e2b0ed6664fe4adfd0f9ce8fa14732d47b30ab5c Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Tuegel <ttuegel@gmail.com>
|
||||
Date: Sat, 10 Oct 2015 16:18:53 -0500
|
||||
Subject: [PATCH 2/3] use system suitesparse
|
||||
|
||||
---
|
||||
base/sparse/cholmod.jl | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/base/sparse/cholmod.jl b/base/sparse/cholmod.jl
|
||||
index ec7e980..f834cc1 100644
|
||||
--- a/base/sparse/cholmod.jl
|
||||
+++ b/base/sparse/cholmod.jl
|
||||
@@ -151,7 +151,7 @@ function __init__()
|
||||
|
||||
# Register gc tracked allocator if CHOLMOD is new enough
|
||||
if current_version >= v"3.0.0"
|
||||
- cnfg = cglobal((:SuiteSparse_config, :libsuitesparseconfig), Ptr{Void})
|
||||
+ cnfg = cglobal((:SuiteSparse_config, :libsuitesparse), Ptr{Void})
|
||||
unsafe_store!(cnfg, cglobal(:jl_malloc, Ptr{Void}), 1)
|
||||
unsafe_store!(cnfg, cglobal(:jl_calloc, Ptr{Void}), 2)
|
||||
unsafe_store!(cnfg, cglobal(:jl_realloc, Ptr{Void}), 3)
|
||||
--
|
||||
2.5.2
|
||||
|
29
pkgs/development/compilers/julia/0003-no-ldconfig.patch
Normal file
29
pkgs/development/compilers/julia/0003-no-ldconfig.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From 8802fe583eda93a928739cb3bc3517e19d1a6fa1 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Tuegel <ttuegel@gmail.com>
|
||||
Date: Sun, 11 Oct 2015 07:19:42 -0500
|
||||
Subject: [PATCH 3/3] no ldconfig
|
||||
|
||||
---
|
||||
src/ccall.cpp | 6 +-----
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/ccall.cpp b/src/ccall.cpp
|
||||
index 22015ff..2821192 100644
|
||||
--- a/src/ccall.cpp
|
||||
+++ b/src/ccall.cpp
|
||||
@@ -13,11 +13,7 @@ extern "C" DLLEXPORT void jl_read_sonames(void)
|
||||
{
|
||||
char *line=NULL;
|
||||
size_t sz=0;
|
||||
-#if defined(__linux__)
|
||||
- FILE *ldc = popen("/sbin/ldconfig -p", "r");
|
||||
-#else
|
||||
- FILE *ldc = popen("/sbin/ldconfig -r", "r");
|
||||
-#endif
|
||||
+ FILE *ldc = popen("true", "r");
|
||||
|
||||
while (!feof(ldc)) {
|
||||
ssize_t n = getline(&line, &sz, ldc);
|
||||
--
|
||||
2.5.2
|
||||
|
157
pkgs/development/compilers/julia/default.nix
Normal file
157
pkgs/development/compilers/julia/default.nix
Normal file
@ -0,0 +1,157 @@
|
||||
{ stdenv, fetchgit, fetchurl
|
||||
# build tools
|
||||
, gfortran, m4, makeWrapper, patchelf, perl, which, python2
|
||||
# libjulia dependencies
|
||||
, libunwind, llvm, readline, utf8proc, zlib
|
||||
# standard library dependencies
|
||||
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
|
||||
# linear algebra
|
||||
, openblas, arpack, suitesparse
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
# All dependencies must use the same OpenBLAS.
|
||||
let
|
||||
arpack_ = arpack;
|
||||
suitesparse_ = suitesparse;
|
||||
in
|
||||
let
|
||||
arpack = arpack_.override { inherit openblas; };
|
||||
suitesparse = suitesparse_.override { inherit openblas; };
|
||||
in
|
||||
|
||||
let
|
||||
dsfmtVersion = "2.2.3";
|
||||
dsfmt = fetchurl {
|
||||
url = "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-${dsfmtVersion}.tar.gz";
|
||||
sha256 = "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42";
|
||||
};
|
||||
|
||||
libuvVersion = "28f5f06b5ff6f010d666ec26552e0badaca5cdcd";
|
||||
libuv = fetchurl {
|
||||
url = "https://api.github.com/repos/JuliaLang/libuv/tarball/${libuvVersion}";
|
||||
sha256 = "1ksns0aiayxmxffvq2kc96904mxlmbkfc30xxck69xnidr2jvr4a";
|
||||
};
|
||||
|
||||
rmathVersion = "0.1";
|
||||
rmath-julia = fetchurl {
|
||||
url = "https://api.github.com/repos/JuliaLang/Rmath-julia/tarball/v${rmathVersion}";
|
||||
sha256 = "0ai5dhjc43zcvangz123ryxmlbm51s21rg13bllwyn98w67arhb4";
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "julia";
|
||||
version = "0.4.0";
|
||||
name = "${pname}-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/JuliaLang/${pname}/releases/download/v${version}/${name}.tar.gz";
|
||||
sha256 = "00k53hzbawpqvmkkyzcvbmf1d0ycshzdqk19nwsifv1rmiwjj7ss";
|
||||
};
|
||||
|
||||
prePatch = ''
|
||||
cp "${dsfmt}" "./deps/dsfmt-${dsfmtVersion}.tar.gz"
|
||||
cp "${rmath-julia}" "./deps/Rmath-julia-${rmathVersion}.tar.gz"
|
||||
cp "${libuv}" "./deps/libuv-${libuvVersion}.tar.gz"
|
||||
'';
|
||||
|
||||
patches = [
|
||||
./0001-use-system-utf8proc.patch
|
||||
./0002-use-system-suitesparse.patch
|
||||
./0003-no-ldconfig.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs . contrib
|
||||
'';
|
||||
|
||||
buildInputs = [
|
||||
arpack fftw fftwSinglePrec gmp libgit2 libunwind llvm mpfr
|
||||
pcre2 openblas openlibm openspecfun readline suitesparse utf8proc
|
||||
zlib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ];
|
||||
|
||||
makeFlags =
|
||||
let
|
||||
arch = head (splitString "-" stdenv.system);
|
||||
march = { "x86_64" = "x86-64"; "i686" = "i686"; }."${arch}"
|
||||
or (throw "unsupported architecture: ${arch}");
|
||||
# Julia requires Pentium 4 (SSE2) or better
|
||||
cpuTarget = { "x86_64" = "x86-64"; "i686" = "pentium4"; }."${arch}"
|
||||
or (throw "unsupported architecture: ${arch}");
|
||||
in [
|
||||
"ARCH=${arch}"
|
||||
"MARCH=${march}"
|
||||
"JULIA_CPU_TARGET=${cpuTarget}"
|
||||
"PREFIX=$(out)"
|
||||
"prefix=$(out)"
|
||||
"SHELL=${stdenv.shell}"
|
||||
|
||||
"USE_SYSTEM_BLAS=1"
|
||||
"USE_BLAS64=${if openblas.blas64 then "1" else "0"}"
|
||||
"LIBBLAS=-lopenblas"
|
||||
"LIBBLASNAME=libopenblas"
|
||||
|
||||
"USE_SYSTEM_LAPACK=1"
|
||||
"LIBLAPACK=-lopenblas"
|
||||
"LIBLAPACKNAME=libopenblas"
|
||||
|
||||
"USE_SYSTEM_SUITESPARSE=1"
|
||||
"SUITESPARSE_LIB=-lsuitesparse"
|
||||
"SUITESPARSE_INC=-I${suitesparse}/include"
|
||||
|
||||
"USE_SYSTEM_ARPACK=1"
|
||||
"USE_SYSTEM_FFTW=1"
|
||||
"USE_SYSTEM_GMP=1"
|
||||
"USE_SYSTEM_LIBGIT2=1"
|
||||
"USE_SYSTEM_LIBUNWIND=1"
|
||||
"USE_SYSTEM_LLVM=1"
|
||||
"USE_SYSTEM_MPFR=1"
|
||||
"USE_SYSTEM_OPENLIBM=1"
|
||||
"USE_SYSTEM_OPENSPECFUN=1"
|
||||
"USE_SYSTEM_PATCHELF=1"
|
||||
"USE_SYSTEM_PCRE=1"
|
||||
"USE_SYSTEM_READLINE=1"
|
||||
"USE_SYSTEM_UTF8PROC=1"
|
||||
"USE_SYSTEM_ZLIB=1"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = [ "-fPIC" ];
|
||||
|
||||
LD_LIBRARY_PATH = makeSearchPath "lib" [
|
||||
arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm
|
||||
openspecfun pcre2 suitesparse
|
||||
];
|
||||
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
doCheck = true;
|
||||
checkTarget = "testall";
|
||||
# Julia's tests require read/write access to $HOME
|
||||
preCheck = ''
|
||||
export HOME="$NIX_BUILD_TOP"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
for prog in "$out/bin/julia" "$out/bin/julia-debug"; do
|
||||
wrapProgram "$prog" \
|
||||
--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH" \
|
||||
--prefix PATH : "${curl}/bin"
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "High-level performance-oriented dynamical language for technical computing";
|
||||
homepage = "http://julialang.org/";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
maintainers = with stdenv.lib.maintainers; [ raskin ttuegel ];
|
||||
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
@ -14,9 +14,17 @@ in stdenv.mkDerivation rec {
|
||||
./no-rule-aarch64.patch # http://llvm.org/bugs/show_bug.cgi?id=16625
|
||||
# Patch needed for Julia, backports fixes from LLVM 3.5
|
||||
(fetchurl {
|
||||
url = "https://raw.githubusercontent.com/JuliaLang/julia/3bdda3750efc4ebf8ce7eda8a0888ffef3851605/deps/llvm-3.3.patch";
|
||||
url = "https://raw.githubusercontent.com/JuliaLang/julia/release-0.4/deps/llvm-3.3.patch";
|
||||
sha256 = "0j6chyx4k8zr1qha5dks8lqlcraqrj4q1hwnk2kj3qi6cajsd8k3";
|
||||
})
|
||||
(fetchurl {
|
||||
url = "https://raw.githubusercontent.com/JuliaLang/julia/release-0.4/deps/instcombine-llvm-3.3.patch";
|
||||
sha256 = "161frq3wxrkxah78krb24hp4zkcnphzcgnvkwfq1abq2vjx3f8sn";
|
||||
})
|
||||
(fetchurl {
|
||||
url = "https://raw.githubusercontent.com/JuliaLang/julia/release-0.4/deps/int128-vector.llvm-3.3.patch";
|
||||
sha256 = "0lzkv6hvsdaalwsyf6sq0vdrf8x5nk58qg6nn5dlw7n3hxaxpm4m";
|
||||
})
|
||||
];
|
||||
|
||||
buildInputs = [ perl groff cmake python libffi ];
|
||||
|
23
pkgs/development/libraries/pcre2/default.nix
Normal file
23
pkgs/development/libraries/pcre2/default.nix
Normal file
@ -0,0 +1,23 @@
|
||||
{ stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "pcre2-10.20";
|
||||
src = fetchurl {
|
||||
url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.20.tar.bz2";
|
||||
sha256 = "0yj8mm9ll9zj3v47rvmmqmr1ybxk72rr2lym3rymdsf905qjhbik";
|
||||
};
|
||||
|
||||
configureFlags = [
|
||||
"--enable-pcre2-16"
|
||||
"--enable-pcre2-32"
|
||||
"--enable-jit"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Perl Compatible Regular Expressions";
|
||||
homepage = "http://www.pcre.org/";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
maintainers = [ stdenv.lib.maintainers.ttuegel ];
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
@ -6,6 +6,8 @@
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let blas64_ = blas64; in
|
||||
|
||||
let local = config.openblas.preferLocalBuild or false;
|
||||
binary =
|
||||
{ i686-linux = "32";
|
||||
@ -18,11 +20,11 @@ let local = config.openblas.preferLocalBuild or false;
|
||||
];
|
||||
localFlags = config.openblas.flags or
|
||||
optionals (hasAttr "target" config.openblas) [ "TARGET=${config.openblas.target}" ];
|
||||
blas64Orig = blas64;
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.2.14";
|
||||
blas64 = if blas64_ != null then blas64_ else hasPrefix "x86_64" stdenv.system;
|
||||
|
||||
version = "0.2.14";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "openblas-${version}";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
|
||||
@ -30,6 +32,8 @@ stdenv.mkDerivation rec {
|
||||
name = "openblas-${version}.tar.gz";
|
||||
};
|
||||
|
||||
inherit blas64;
|
||||
|
||||
preBuild = "cp ${liblapack.src} lapack-${liblapack.meta.version}.tgz";
|
||||
|
||||
nativeBuildInputs = optionals stdenv.isDarwin [coreutils] ++ [gfortran perl];
|
||||
@ -50,7 +54,8 @@ stdenv.mkDerivation rec {
|
||||
"INTERFACE64=${if blas64 then "1" else "0"}"
|
||||
];
|
||||
|
||||
blas64 = if blas64Orig != null then blas64Orig else hasPrefix "x86_64" stdenv.system;
|
||||
doCheck = true;
|
||||
checkTarget = "tests";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Basic Linear Algebra Subprograms";
|
||||
|
19
pkgs/development/libraries/science/math/openlibm/default.nix
Normal file
19
pkgs/development/libraries/science/math/openlibm/default.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "openlibm-0.4.1";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/JuliaLang/openlibm/archive/v0.4.1.tar.gz";
|
||||
sha256 = "0cwqqqlblj3kzp9aq1wnpfs1fl0qd1wp1xzm5shb09w06i4rh9nn";
|
||||
};
|
||||
|
||||
makeFlags = [ "prefix=$(out)" ];
|
||||
|
||||
meta = {
|
||||
description = "High quality system independent, portable, open source libm implementation";
|
||||
homepage = "http://www.openlibm.org/";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
maintainers = [ stdenv.lib.maintainers.ttuegel ];
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
{ stdenv, fetchurl, gfortran }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "openspecfun-0.4";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/JuliaLang/openspecfun/archive/v0.4.tar.gz";
|
||||
sha256 = "0nsa3jjmlhcqkw5ba5ypbn3n0c8b6lc22zzlxnmxkxi9shhdx65z";
|
||||
};
|
||||
|
||||
makeFlags = [ "prefix=$(out)" ];
|
||||
|
||||
nativeBuildInputs = [ gfortran ];
|
||||
|
||||
meta = {
|
||||
description = "A collection of special mathematical functions";
|
||||
homepage = "https://github.com/JuliaLang/openspecfun";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
maintainers = [ stdenv.lib.maintainers.ttuegel ];
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
@ -42,7 +42,7 @@ stdenv.mkDerivation {
|
||||
for i in "$out"/lib/lib*.a; do
|
||||
ar -x $i
|
||||
done
|
||||
gcc *.o --shared -o "$out/lib/libsuitesparse.so"
|
||||
gcc *.o --shared -o "$out/lib/libsuitesparse.so" -lopenblas
|
||||
)
|
||||
for i in umfpack cholmod amd camd colamd spqr; do
|
||||
ln -s libsuitesparse.so "$out"/lib/lib$i.so;
|
||||
|
@ -1,14 +1,12 @@
|
||||
{ stdenv, fetchFromGitHub }:
|
||||
{ stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "utf8proc-${version}";
|
||||
version = "v1.2";
|
||||
version = "1.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "JuliaLang";
|
||||
repo = "utf8proc";
|
||||
rev = "${version}";
|
||||
sha256 = "1ryjlcnpfm7fpkq6444ybi576hbnh2l0w7kjhbqady5lxwjyg3pf";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/JuliaLang/utf8proc/archive/v${version}.tar.gz";
|
||||
sha256 = "07r7djkmd399wl9cn0s2iqjhmm7l5iifp5h1yf2in9s366mlhkkg";
|
||||
};
|
||||
|
||||
makeFlags = [ "prefix=$(out)" ];
|
||||
|
@ -4137,16 +4137,12 @@ let
|
||||
|
||||
jikes = callPackage ../development/compilers/jikes { };
|
||||
|
||||
julia02 = callPackage ../development/compilers/julia/0.2.nix {
|
||||
julia = callPackage ../development/compilers/julia {
|
||||
gmp = gmp6;
|
||||
llvm = llvm_33;
|
||||
suitesparse = suitesparse_4_2;
|
||||
openblas = openblasCompat;
|
||||
};
|
||||
|
||||
julia03 = callPackage ../development/compilers/julia/0.3.nix {
|
||||
llvm = llvm_33;
|
||||
};
|
||||
julia = julia03;
|
||||
|
||||
lazarus = callPackage ../development/compilers/fpc/lazarus.nix {
|
||||
fpc = fpc;
|
||||
};
|
||||
@ -6356,6 +6352,7 @@ let
|
||||
|
||||
gmp4 = callPackage ../development/libraries/gmp/4.3.2.nix { }; # required by older GHC versions
|
||||
gmp5 = callPackage ../development/libraries/gmp/5.1.x.nix { };
|
||||
gmp6 = callPackage ../development/libraries/gmp/6.x.nix { };
|
||||
gmp = gmp5;
|
||||
gmpxx = appendToName "with-cxx" (gmp.override { cxx = true; });
|
||||
|
||||
@ -7824,6 +7821,8 @@ let
|
||||
unicodeSupport = config.pcre.unicode or true;
|
||||
};
|
||||
|
||||
pcre2 = callPackage ../development/libraries/pcre2 { };
|
||||
|
||||
pdf2xml = callPackage ../development/libraries/pdf2xml {} ;
|
||||
|
||||
phonon = callPackage ../development/libraries/phonon/qt4 {};
|
||||
@ -14266,13 +14265,17 @@ let
|
||||
# standard BLAS and LAPACK.
|
||||
openblasCompat = openblas.override { blas64 = false; };
|
||||
|
||||
openlibm = callPackage ../development/libraries/science/math/openlibm {};
|
||||
|
||||
openspecfun = callPackage ../development/libraries/science/math/openspecfun {};
|
||||
|
||||
mathematica = callPackage ../applications/science/math/mathematica { };
|
||||
mathematica9 = callPackage ../applications/science/math/mathematica/9.nix { };
|
||||
|
||||
sage = callPackage ../applications/science/math/sage { };
|
||||
|
||||
metis = callPackage ../development/libraries/science/math/metis {};
|
||||
|
||||
sage = callPackage ../applications/science/math/sage { };
|
||||
|
||||
suitesparse_4_2 = callPackage ../development/libraries/science/math/suitesparse/4.2.nix { };
|
||||
suitesparse_4_4 = callPackage ../development/libraries/science/math/suitesparse {};
|
||||
suitesparse = suitesparse_4_4;
|
||||
|
Loading…
Reference in New Issue
Block a user