Julia language: update to a fresh version

Update julia and some of its dependencies

Split PCRE because a lot of packages depend on it and I am not sure we
want to test them in a hurry (and Julia specifies exact version).
This commit is contained in:
Michael Raskin 2012-08-01 19:03:52 +04:00
parent 4f972b793f
commit 901574fe8a
8 changed files with 154 additions and 179 deletions

View file

@ -1,35 +1,46 @@
{ stdenv, fetchgit, gfortran, perl, m4, llvm, gmp, pcre, blas, liblapack
{ stdenv, fetchgit, gfortran, perl, m4, llvm, gmp, pcre
, readline, fftwSinglePrec, fftw, libunwind, suitesparse, glpk, fetchurl
, ncurses, libunistring, lighttpd, patchelf
, ncurses, libunistring, lighttpd, patchelf, openblas, liblapack
} :
let
liblapackShared = liblapack.override{shared=true;};
realGcc = stdenv.gcc.gcc;
in
stdenv.mkDerivation rec {
pname = "julia";
date = "20120501";
date = "20120801";
name = "${pname}-git-${date}";
grisu_ver = "1.1";
grisu_ver = "1.1.1";
dsfmt_ver = "2.1";
arpack_ver = "3.1.0";
openblas_ver = "v0.2.2";
lapack_ver = "3.4.1";
arpack_ver = "3.1.1";
clp_ver = "1.14.5";
lighttpd_ver = "1.4.29";
grisu_src = fetchurl {
url = "http://double-conversion.googlecode.com/files/double-conversion-${grisu_ver}.tar.gz";
sha256 = "addee31d11350e4dde2b19c749eda648cb0ab38a68b0dd0d0a45dc49c7346fe7";
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 = "e9d3e04bc984ec3b14033342f5ebdcd5202d8d8e40128dd737f566945612378f";
};
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/376/get/";
url = "http://forge.scilab.org/index.php/p/arpack-ng/downloads/417/get/";
name = "arpack-ng_${arpack_ver}.tar.gz";
sha256 = "65b7856126f06ecbf9ec450d50df92ca9260d4b0d21baf02497554ac230d6feb";
sha256 = "be250947a7d6eac7dff8c058102fce9922c524aa06be2a090b6e0bb2d1e228cd";
};
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";
@ -43,16 +54,17 @@ stdenv.mkDerivation rec {
src = fetchgit {
url = "git://github.com/JuliaLang/julia.git";
rev = "990ffabb00f0e51d326911888facdbc473fb634d";
sha256 = "dfcf41b2d7b62dd490bfd6f6fb962713c920de3f00afaee47423bd26eba7e3b2";
rev = "3b413ec24957e400c984002f7cdf6232f5391a7e";
sha256 = "c019b724df9203899a1da5815f85d79291778191bbffc1361d2213ff7d2bbc1d";
};
buildInputs = [ gfortran perl m4 gmp pcre llvm blas liblapackShared readline
buildInputs = [ gfortran perl m4 gmp pcre llvm readline
fftw fftwSinglePrec libunwind suitesparse glpk ncurses libunistring patchelf
openblas liblapack
];
configurePhase = ''
for i in GMP LLVM PCRE BLAS LAPACK READLINE FFTW LIBUNWIND SUITESPARSE GLPK;
for i in GMP LLVM PCRE LAPACK OPENBLAS BLAS READLINE FFTW LIBUNWIND SUITESPARSE GLPK LIGHTTPD;
do
sed -e "s@USE_SYSTEM_$i=0@USE_SYSTEM_$i=1@" -i Make.inc;
done
@ -62,52 +74,44 @@ stdenv.mkDerivation rec {
cp "$1" "$2/$(basename "$1" | sed -e 's/^[a-z0-9]*-//')"
}
for i in "${grisu_src}" "${dsfmt_src}" "${arpack_src}" "${clp_src}" "${lighttpd_src}" ; do
for i in "${grisu_src}" "${dsfmt_src}" "${arpack_src}" "${clp_src}" ; do
copy_kill_hash "$i" deps
done
copy_kill_hash "${dsfmt_src}" deps/random
sed -e '/cd SuiteSparse-SYSTEM/,+1s@find /lib /usr/lib /usr/local/lib@find ${suitesparse}/lib@' -i deps/Makefile
${if realGcc ==null then "" else
''export NIX_LDFLAGS="$NIX_LDFLAGS -L${realGcc}/lib -L${realGcc}/lib64 -lpcre -llapack -lm -lfftw3f -lfftw3 -lglpk -lunistring "''}
sed -e 's@ cpp @ gcc -E @g' -i base/Makefile
sed -e '1s@#! */bin/bash@#!${stdenv.shell}@' -i deps/*.sh
export LDFLAGS="-L${suitesparse}/lib"
export GLPK_PREFIX="${glpk}/include"
mkdir -p "$out/lib"
sed -e "s@/usr/local/lib@$out/lib@g" -i deps/Makefile
sed -e "s@/usr/lib@$out/lib@g" -i deps/Makefile
sed -e '/libumfpack.a/s@find @find ${suitesparse}/lib @' -i deps/Makefile
export makeFlags="$makeFlags PREFIX=\"$out\" USR=\"$out\""
sed -e 's@openblas@blas@' -i base/*.jl
sed -e '/install -v julia-release-webserver/d' -i Makefile
export makeFlags="$makeFlags PREFIX=$out"
export dontPatchELF=1
'';
preBuild = ''
make -C test/unicode all
make -C extras glpk_h.jl GLPK_PREFIX="$GLPK_PREFIX"
'';
postInstall = ''
ln -s "$out/share/julia/julia" "$out/bin"
ld -E --whole-archive --shared ${suitesparse}/lib/lib*[a-z].a -o "$out"/lib/libsuitesparse-shared.so
for i in umfpack cholmod amd camd colamd ; do
ln -s "libsuitesparse-shared.so" "$out/lib/lib$i.so"
done
ln -s "${lighttpd}/sbin/lighttpd" "$out/sbin/"
ln -s "${lighttpd}/lib/"* "$out/lib/"
mkdir -p "$out/share/julia/ui/"
cp -r ui/website "$out/share/julia/ui/"
cp deps/lighttpd.conf "$out/share/julia/ui/"
mkdir -p "$out/share/julia/ui/webserver/"
cp -r ui/webserver/{*.jl,*.h} "$out/share/julia/ui/webserver/"
echo -e '#!/bin/sh' >> "$out/bin/julia-webserver"
echo -e "cd \"$out/share/julia\"" >> "$out/bin/julia-webserver"
echo -e '${lighttpd}/sbin/lighttpd -D -f ./ui/lighttpd.conf &' >> "$out/bin/julia-webserver"
echo -e "'$out/bin/julia-release-webserver' -p 2001" >> "$out/bin/julia-webserver"
chmod a+x "$out/bin/julia-webserver"
cp -r test examples "$out/lib/julia"
ls -R > "$out/ls-R"
'';
meta = {

View file

@ -1,15 +1,19 @@
{fetchurl, stdenv, builderDefs, stringsWithDeps, singlePrecision ? false}:
let localDefs = builderDefs.passthru.function {
{fetchurl, stdenv, builderDefs, stringsWithDeps, singlePrecision ? false, pthreads ? false}:
let
version = "3.3.2";
localDefs = builderDefs.passthru.function {
src =
fetchurl {
url = ftp://ftp.fftw.org/pub/fftw/fftw-3.2.2.tar.gz;
sha256 = "13vnglardq413q2518zi4a8pam3znydrz28m9w09kss9xrjsx9va";
url = "ftp://ftp.fftw.org/pub/fftw/fftw-${version}.tar.gz";
sha256 = "b1236a780ca6e66fc5f8eda6ef0665d680e8253d9f01d7bf211b714a50032d01";
};
buildInputs = [];
configureFlags = ["--enable-shared" "--enable-openmp"]
configureFlags = ["--enable-shared"]
# some distros seem to be shipping both versions within the same package?
# why does --enable-float still result in ..3f.so instead of ..3.so?
++ (if singlePrecision then [ "--enable-single" ] else [ ])
++ (stdenv.lib.optional (!pthreads) "--enable-openmp")
++ (stdenv.lib.optional pthreads "--enable-threads")
# I think all i686 has sse
++ (if (stdenv.isi686 || stdenv.isx86_64) && singlePrecision then [ "--enable-sse" ] else [ ])
# I think all x86_64 has sse2
@ -18,8 +22,8 @@ let localDefs = builderDefs.passthru.function {
};
in with localDefs;
stdenv.mkDerivation {
name = "fftw-3.2.2" + ( if singlePrecision then "-single" else "-double" );
builder = writeScript "fftw-3.2.1-builder"
name = "fftw-3.3.2" + ( if singlePrecision then "-single" else "-double" );
builder = writeScript "fftw-3.3.2-builder"
(textClosure localDefs [doConfigure doMakeInstall doForceShare]);
meta = {
description = "Fastest Fourier Transform in the West library";

View file

@ -0,0 +1,38 @@
{ stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true }:
stdenv.mkDerivation rec {
name = "pcre-8.30";
src = fetchurl {
url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${name}.tar.bz2";
sha256 = "c1113fd7db934e97ad8b3917d432e5b642e9eb9afd127eb797804937c965f4ac";
};
# The compiler on Darwin crashes with an internal error while building the
# C++ interface. Disabling optimizations on that platform remedies the
# problem. In case we ever update the Darwin GCC version, the exception for
# that platform ought to be removed.
configureFlags = ''
${if unicodeSupport then "--enable-unicode-properties" else ""}
${if !cplusplusSupport then "--disable-cpp" else ""}
'' + stdenv.lib.optionalString stdenv.isDarwin "CXXFLAGS=-O0";
doCheck = !stdenv.isCygwin; # XXX: test failure on Cygwin
meta = {
homepage = "http://www.pcre.org/";
description = "A library for Perl Compatible Regular Expressions";
license = "BSD-3";
longDescription = ''
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics as
Perl 5. PCRE has its own native API, as well as a set of wrapper
functions that correspond to the POSIX regular expression API. The
PCRE library is free, even for building proprietary software.
'';
platforms = stdenv.lib.platforms.all;
maintainers = [ stdenv.lib.maintainers.simons ];
};
}

View file

@ -4,10 +4,10 @@ let
usedLibExtension = if shared then ".so" else ".a";
in
stdenv.mkDerivation {
name = "liblapack-3.4.0";
name = "liblapack-3.4.1";
src = fetchurl {
url = "http://www.netlib.org/lapack/lapack-3.4.0.tgz";
sha256 = "1sf30v1ps5icg67dvw5sbx5yhypx13am470gqg2f7l04f3wrw4x7";
url = "http://www.netlib.org/lapack/lapack-3.4.1.tgz";
sha256 = "93b910f94f6091a2e71b59809c4db4a14655db527cfc5821ade2e8c8ab75380f";
};
propagatedBuildInputs = [ atlasMaybeShared ];

View file

@ -0,0 +1,36 @@
{ stdenv, fetchurl, gfortran, perl }:
stdenv.mkDerivation rec {
version = "0.2.2";
lapack_version = "3.4.1";
lapack_src = fetchurl {
url = "http://www.netlib.org/lapack/lapack-${lapack_version}.tgz";
sha256 = "93b910f94f6091a2e71b59809c4db4a14655db527cfc5821ade2e8c8ab75380f";
};
name = "openblas-${version}";
src = fetchurl {
url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
sha256 = "13kdx3knff5ajnmgn419g0dnh83plin07p7akwamr3v7z5qfrzqr";
name = "openblas-${version}.tar.gz";
};
preBuild = "cp ${lapack_src} lapack-${lapack_version}.tgz";
buildInputs = [gfortran perl];
cpu = builtins.head (stdenv.lib.splitString "-" stdenv.system);
target = if cpu == "i686" then "P6" else
if cpu == "x86_64" then "CORE2" else
# allow autodetect
"";
makeFlags = "${if target != "" then "TARGET=" else ""}${target} FC=gfortran CC=cc PREFIX=\"\$(out)\"";
meta = {
description = "Basic Linear Algebra Subprograms";
license = stdenv.lib.licenses.bsd3;
homepage = "https://github.com/xianyi/OpenBLAS";
};
}

View file

@ -1,9 +1,10 @@
{ stdenv, fetchurl, blas, liblapack, gfortran } :
stdenv.mkDerivation {
name = "suitesparse";
stdenv.mkDerivation rec {
version = "4.0.0";
name = "suitesparse-${version}";
src = fetchurl {
url = http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-3.5.0.tar.gz ;
sha256 = "0npn7c1j5qag5m2r0cmh3bwc42c1jk8k2yg2cfyxlcrp0h7wn4rc";
url = "http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-${version}.tar.gz" ;
sha256 = "1nvbdw10wa6654k8sa2vhr607q6fflcywyji5xd767cqpwag4v5j";
};
buildInputs = [blas liblapack gfortran] ;
patches = [./disable-metis.patch];
@ -14,6 +15,8 @@ stdenv.mkDerivation {
mkdir -p $out/include
'';
makeFlags = ''PREFIX=\"$(out)\" INSTALL_LIB=$(out)/lib INSTALL_INCLUDE=$(out)/include'';
NIX_CFLAGS = "-fPIC";
}

View file

@ -1,140 +1,18 @@
diff -Nrc SuiteSparse/UFconfig/Makefile SuiteSparse-new/UFconfig/Makefile
*** SuiteSparse/UFconfig/Makefile 2009-11-11 20:59:08.000000000 +0100
--- SuiteSparse-new/UFconfig/Makefile 2010-08-02 13:14:04.000000000 +0200
***************
*** 25,31 ****
# install UFconfig
install:
! $(CP) Lib/libufconfig.a $(INSTALL_LIB)/libufconfig.$(VERSION).a
( cd $(INSTALL_LIB) ; ln -s libufconfig.$(VERSION).a libufconfig.a )
$(CP) UFconfig.h $(INSTALL_INCLUDE)
--- 25,31 ----
# install UFconfig
install:
! $(CP) libufconfig.a $(INSTALL_LIB)/libufconfig.$(VERSION).a
( cd $(INSTALL_LIB) ; ln -s libufconfig.$(VERSION).a libufconfig.a )
$(CP) UFconfig.h $(INSTALL_INCLUDE)
diff -Nrc SuiteSparse/UFconfig/UFconfig.mk SuiteSparse-new/UFconfig/UFconfig.mk
*** SuiteSparse/UFconfig/UFconfig.mk 2010-06-02 17:40:42.000000000 +0200
--- SuiteSparse-new/UFconfig/UFconfig.mk 2010-08-02 14:55:27.000000000 +0200
***************
*** 34,40 ****
# performance. You should select the optimization parameters that are best
# for your system. On Linux, use "CFLAGS = -O3 -fexceptions" for example.
CC = cc
! CFLAGS = -O3 -fexceptions
# C++ compiler (also uses CFLAGS)
CPLUSPLUS = g++
--- 34,40 ----
# performance. You should select the optimization parameters that are best
# for your system. On Linux, use "CFLAGS = -O3 -fexceptions" for example.
CC = cc
! CFLAGS = -O3 -fexceptions -fPIC
# C++ compiler (also uses CFLAGS)
CPLUSPLUS = g++
***************
*** 71,78 ****
# MAKE = gmake
# For "make install"
! INSTALL_LIB = /usr/local/lib
! INSTALL_INCLUDE = /usr/local/include
#------------------------------------------------------------------------------
# BLAS and LAPACK configuration:
--- 71,78 ----
# MAKE = gmake
# For "make install"
! INSTALL_LIB = $(out)/lib
! INSTALL_INCLUDE = $(out)/include
#------------------------------------------------------------------------------
# BLAS and LAPACK configuration:
***************
*** 127,134 ****
# The path is relative to where it is used, in CHOLMOD/Lib, CHOLMOD/MATLAB, etc.
# You may wish to use an absolute path. METIS is optional. Compile
# CHOLMOD with -DNPARTITION if you do not wish to use METIS.
! METIS_PATH = ../../metis-4.0
! METIS = ../../metis-4.0/libmetis.a
# If you use CHOLMOD_CONFIG = -DNPARTITION then you must use the following
# options:
--- 127,134 ----
# The path is relative to where it is used, in CHOLMOD/Lib, CHOLMOD/MATLAB, etc.
# You may wish to use an absolute path. METIS is optional. Compile
# CHOLMOD with -DNPARTITION if you do not wish to use METIS.
! #METIS_PATH = ../../metis-4.0
! #METIS =
# If you use CHOLMOD_CONFIG = -DNPARTITION then you must use the following
# options:
***************
*** 189,195 ****
# -DNSUNPERF for Solaris only. If defined, do not use the Sun
# Performance Library
! CHOLMOD_CONFIG =
#------------------------------------------------------------------------------
# SuiteSparseQR configuration:
--- 189,195 ----
# -DNSUNPERF for Solaris only. If defined, do not use the Sun
# Performance Library
! CHOLMOD_CONFIG = -DNPARTITION
#------------------------------------------------------------------------------
# SuiteSparseQR configuration:
***************
*** 203,209 ****
# -DHAVE_TBB enable the use of Intel's Threading Building Blocks (TBB)
# default, without timing, without TBB:
! SPQR_CONFIG =
# with timing and TBB:
# SPQR_CONFIG = -DTIMING -DHAVE_TBB
# with timing
--- 203,209 ----
# -DHAVE_TBB enable the use of Intel's Threading Building Blocks (TBB)
# default, without timing, without TBB:
! SPQR_CONFIG = -DNPARTITION
# with timing and TBB:
# SPQR_CONFIG = -DTIMING -DHAVE_TBB
# with timing
diff -Nrc SuiteSparse/UMFPACK/Demo/Makefile SuiteSparse-new/UMFPACK/Demo/Makefile
*** SuiteSparse/UMFPACK/Demo/Makefile 2009-11-11 21:09:45.000000000 +0100
--- SuiteSparse-new/UMFPACK/Demo/Makefile 2010-08-02 12:53:16.000000000 +0200
***************
*** 40,51 ****
*** 40,46 ****
../../CAMD/Lib/libcamd.a:
( cd ../../CAMD ; $(MAKE) library )
- ../../metis-4.0/libmetis.a:
- ( cd ../../metis-4.0/Lib ; $(MAKE) )
- $(METIS):
- ( cd $(METIS_PATH) && $(MAKE) )
UMFPACK = ../Lib/libumfpack.a ../../AMD/Lib/libamd.a \
../../CHOLMOD/Lib/libcholmod.a ../../COLAMD/Lib/libcolamd.a \
! ../../CAMD/Lib/libcamd.a ../../metis-4.0/libmetis.a \
../../CCOLAMD/Lib/libccolamd.a
libs: $(UMFPACK)
--- 40,49 ----
--- 40,44 ----
../../CAMD/Lib/libcamd.a:
( cd ../../CAMD ; $(MAKE) library )
UMFPACK = ../Lib/libumfpack.a ../../AMD/Lib/libamd.a \
../../CHOLMOD/Lib/libcholmod.a ../../COLAMD/Lib/libcolamd.a \
! ../../CAMD/Lib/libcamd.a \
../../CCOLAMD/Lib/libccolamd.a
libs: $(UMFPACK)

View file

@ -2365,7 +2365,13 @@ let
jikes = callPackage ../development/compilers/jikes { };
julia = callPackage ../development/compilers/julia { };
julia = callPackage ../development/compilers/julia {
llvm = llvm_3_1;
pcre = pcre_8_30;
liblapack = liblapack.override {shared = true;};
fftw = fftw.override {pthreads = true;};
fftwSinglePrec = fftwSinglePrec.override {pthreads = true;};
};
lazarus = builderDefsPackage (import ../development/compilers/fpc/lazarus.nix) {
inherit makeWrapper gtk glib pango atk gdk_pixbuf;
@ -4552,6 +4558,11 @@ let
cplusplusSupport = !stdenv ? isDietLibC;
};
pcre_8_30 = callPackage ../development/libraries/pcre/8.30.nix {
unicodeSupport = getConfig ["pcre" "unicode"] true;
cplusplusSupport = !stdenv ? isDietLibC;
};
pdf2xml = callPackage ../development/libraries/pdf2xml {} ;
phonon = callPackage ../development/libraries/phonon { };
@ -8367,6 +8378,7 @@ let
liblapack = callPackage ../development/libraries/science/math/liblapack { };
openblas = callPackage ../development/libraries/science/math/openblas { };
### SCIENCE/LOGIC