diff --git a/pkgs/development/compilers/julia/0.6.nix b/pkgs/development/compilers/julia/0.6.nix deleted file mode 100644 index fcf486b3b41a..000000000000 --- a/pkgs/development/compilers/julia/0.6.nix +++ /dev/null @@ -1,203 +0,0 @@ -{ stdenv, fetchurl, fetchzip -# build tools -, gfortran, m4, makeWrapper, patchelf, perl, which, python2 -, paxctl -# libjulia dependencies -, libunwind, readline, utf8proc, zlib -, llvm -# standard library dependencies -, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2 -# linear algebra -, openblas, arpack, suitesparse -# Darwin frameworks -, CoreServices, ApplicationServices -}: - -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 = "d8ab1c6a33e77bf155facb54215dd8798e13825d"; - libuv = fetchurl { - url = "https://api.github.com/repos/JuliaLang/libuv/tarball/${libuvVersion}"; - sha256 = "0q5ahc9dzca2yc6cjbhpfi9nwc4yhhjbgxgsychksn13d24gv7ba"; - }; - - rmathVersion = "0.1"; - rmath-julia = fetchurl { - url = "https://api.github.com/repos/JuliaLang/Rmath-julia/tarball/v${rmathVersion}"; - sha256 = "1qyps217175qhid46l8f5i1v8i82slgp23ia63x2hzxwfmx8617p"; - }; - - virtualenvVersion = "15.0.0"; - virtualenv = fetchurl { - url = "mirror://pypi/v/virtualenv/virtualenv-${virtualenvVersion}.tar.gz"; - sha256 = "06fw4liazpx5vf3am45q2pdiwrv0id7ckv7n6zmpml29x6vkzmkh"; - }; - - majorVersion = "0"; - minorVersion = "6"; - maintenanceVersion = "4"; - version = "${majorVersion}.${minorVersion}.${maintenanceVersion}"; -in - -stdenv.mkDerivation rec { - pname = "julia"; - inherit version; - name = "${pname}-${version}"; - - src = fetchzip { - url = "https://github.com/JuliaLang/${pname}/releases/download/v${version}/${name}.tar.gz"; - sha256 = "09axkkj914al7lzvcvhb33hz5wp083lk18llsvrn622fqhmyqabl"; - }; - prePatch = '' - mkdir deps/srccache - cp "${dsfmt}" "./deps/srccache/dsfmt-${dsfmtVersion}.tar.gz" - cp "${rmath-julia}" "./deps/srccache/Rmath-julia-${rmathVersion}.tar.gz" - cp "${libuv}" "./deps/srccache/libuv-${libuvVersion}.tar.gz" - cp "${virtualenv}" "./deps/srccache/virtualenv-${virtualenvVersion}.tar.gz" - ''; - - patches = [ - ./0001.1-use-system-utf8proc.patch - ./0002-use-system-suitesparse.patch - ] ++ stdenv.lib.optional stdenv.needsPax ./0004-hardened.patch; - - postPatch = '' - patchShebangs . contrib - for i in backtrace replutil cmdlineargs compile; do - mv test/$i.jl{,.off} - touch test/$i.jl - done - - sed -e 's/Invalid Content-Type:/invalid Content-Type:/g' -i test/libgit2.jl - sed -e 's/Failed to resolve /failed to resolve /g' -i test/libgit2.jl - ''; - - buildInputs = [ - arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr - pcre2.dev openblas openlibm openspecfun readline suitesparse utf8proc - zlib llvm - ] - ++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices] - ; - - nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ] - ++ stdenv.lib.optional stdenv.needsPax paxctl; - - makeFlags = - let - arch = head (splitString "-" stdenv.system); - march = { "x86_64" = "x86-64"; "i686" = "pentium4"; }."${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" - "LLVM_VER=3.9.1" - - "USE_SYSTEM_MPFR=1" - "USE_SYSTEM_OPENLIBM=1" - "USE_SYSTEM_OPENSPECFUN=1" - "USE_SYSTEM_PATCHELF=1" - "USE_SYSTEM_PCRE=1" - "PCRE_CONFIG=${pcre2.dev}/bin/pcre2-config" - "PCRE_INCL_PATH=${pcre2.dev}/include/pcre2.h" - "USE_SYSTEM_READLINE=1" - "USE_SYSTEM_UTF8PROC=1" - "USE_SYSTEM_ZLIB=1" - ]; - - NIX_CFLAGS_COMPILE = [ "-fPIC" ]; - - LD_LIBRARY_PATH = makeLibraryPath [ - arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm - openspecfun pcre2 suitesparse llvm - ]; - - dontStrip = true; - dontPatchELF = true; - - enableParallelBuilding = true; - - doCheck = !stdenv.isDarwin; - checkTarget = "testall"; - # Julia's tests require read/write access to $HOME - preCheck = '' - export HOME="$NIX_BUILD_TOP" - ''; - - preBuild = '' - sed -e '/^install:/s@[^ ]*/doc/[^ ]*@@' -i Makefile - sed -e '/[$](DESTDIR)[$](docdir)/d' -i Makefile - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} - ''; - - postInstall = '' - # Symlink shared libraries from LD_LIBRARY_PATH into lib/julia, - # as using a wrapper with LD_LIBRARY_PATH causes segmentation - # faults when program returns an error: - # $ julia -e 'throw(Error())' - find $(echo $LD_LIBRARY_PATH | sed 's|:| |g') -maxdepth 1 -name '*.${if stdenv.isDarwin then "dylib" else "so"}*' | while read lib; do - if [[ ! -e $out/lib/julia/$(basename $lib) ]]; then - ln -sv $lib $out/lib/julia/$(basename $lib) - fi - done - ''; - - passthru = { - inherit majorVersion minorVersion maintenanceVersion; - site = "share/julia/site/v${majorVersion}.${minorVersion}"; - }; - - meta = { - description = "High-level performance-oriented dynamical language for technical computing"; - homepage = https://julialang.org/; - license = stdenv.lib.licenses.mit; - maintainers = with stdenv.lib.maintainers; [ raskin ]; - platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; - broken = stdenv.isi686; - }; -} diff --git a/pkgs/development/compilers/julia/0001-use-system-utf8proc.patch b/pkgs/development/compilers/julia/0001-use-system-utf8proc.patch deleted file mode 100644 index b93654a88965..000000000000 --- a/pkgs/development/compilers/julia/0001-use-system-utf8proc.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 54a66b5728ec98f44a1768f064509be4fd3f2ef6 Mon Sep 17 00:00:00 2001 -From: Thomas Tuegel -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 - diff --git a/pkgs/development/compilers/julia/0003-no-ldconfig.patch b/pkgs/development/compilers/julia/0003-no-ldconfig.patch deleted file mode 100644 index 06d1a57ed627..000000000000 --- a/pkgs/development/compilers/julia/0003-no-ldconfig.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8802fe583eda93a928739cb3bc3517e19d1a6fa1 Mon Sep 17 00:00:00 2001 -From: Thomas Tuegel -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"); - if (ldc == NULL) return; // ignore errors in running ldconfig (other than whatever might have been printed to stderr) - - while (!feof(ldc)) { --- -2.5.2 - diff --git a/pkgs/development/compilers/julia/0004-hardened-0.4.7.patch b/pkgs/development/compilers/julia/0004-hardened-0.4.7.patch deleted file mode 100644 index 1950cd7836a2..000000000000 --- a/pkgs/development/compilers/julia/0004-hardened-0.4.7.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0bdbe60325a22202f8e250a9578407648a0d29b9 Mon Sep 17 00:00:00 2001 -From: Will Dietz -Date: Wed, 1 Feb 2017 06:09:49 -0600 -Subject: [PATCH] Set pax flags on julia binaries to disable memory protection. - ---- - Makefile | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Makefile b/Makefile -index 8d45a1baa..91ea33b21 100644 ---- a/Makefile -+++ b/Makefile -@@ -61,6 +61,8 @@ julia-src-release julia-src-debug : julia-src-% : julia-deps - - julia-ui-release julia-ui-debug : julia-ui-% : julia-src-% - @$(MAKE) $(QUIET_MAKE) -C ui julia-$* -+ @echo "setting PaX flags on $(JULIA_EXECUTABLE_$*)" -+ @paxctl -czexm $(JULIA_EXECUTABLE_$*) - - julia-inference : julia-base julia-ui-$(JULIA_BUILD_MODE) $(build_prefix)/.examples - @$(MAKE) $(QUIET_MAKE) $(build_private_libdir)/inference.ji JULIA_BUILD_MODE=$(JULIA_BUILD_MODE) --- -2.11.0 - diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix index a504dc2ea463..84fdf8f9786d 100644 --- a/pkgs/development/compilers/julia/default.nix +++ b/pkgs/development/compilers/julia/default.nix @@ -1,8 +1,9 @@ -{ stdenv, fetchurl +{ stdenv, fetchurl, fetchzip # build tools , gfortran, m4, makeWrapper, patchelf, perl, which, python2, paxctl # libjulia dependencies -, libunwind, llvm, readline, utf8proc, zlib +, libunwind, readline, utf8proc, zlib +, llvm # standard library dependencies , curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2 # linear algebra @@ -21,9 +22,6 @@ in let arpack = arpack_.override { inherit openblas; }; suitesparse = suitesparse_.override { inherit openblas; }; - llvmShared = if stdenv.isDarwin - then llvm.override { enableSharedLibraries = true; } - else llvm; in let @@ -33,10 +31,10 @@ let sha256 = "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"; }; - libuvVersion = "efb40768b7c7bd9f173a7868f74b92b1c5a61a0e"; + libuvVersion = "d8ab1c6a33e77bf155facb54215dd8798e13825d"; libuv = fetchurl { url = "https://api.github.com/repos/JuliaLang/libuv/tarball/${libuvVersion}"; - sha256 = "1znkxyv1cy9pjap7afypipzsn04533ni3pqjd191fdgw2sv9cal7"; + sha256 = "0q5ahc9dzca2yc6cjbhpfi9nwc4yhhjbgxgsychksn13d24gv7ba"; }; rmathVersion = "0.1"; @@ -44,40 +42,59 @@ let url = "https://api.github.com/repos/JuliaLang/Rmath-julia/tarball/v${rmathVersion}"; sha256 = "1qyps217175qhid46l8f5i1v8i82slgp23ia63x2hzxwfmx8617p"; }; + + virtualenvVersion = "15.0.0"; + virtualenv = fetchurl { + url = "mirror://pypi/v/virtualenv/virtualenv-${virtualenvVersion}.tar.gz"; + sha256 = "06fw4liazpx5vf3am45q2pdiwrv0id7ckv7n6zmpml29x6vkzmkh"; + }; + + majorVersion = "0"; + minorVersion = "6"; + maintenanceVersion = "4"; + version = "${majorVersion}.${minorVersion}.${maintenanceVersion}"; in stdenv.mkDerivation rec { pname = "julia"; - version = "0.4.7"; + inherit version; name = "${pname}-${version}"; - src = fetchurl { + src = fetchzip { url = "https://github.com/JuliaLang/${pname}/releases/download/v${version}/${name}.tar.gz"; - sha256 = "09f531jhs8pyd1xng5c26x994w7q0sxxr28mr3qfw9wpkbmsc2pf"; + sha256 = "09axkkj914al7lzvcvhb33hz5wp083lk18llsvrn622fqhmyqabl"; }; - prePatch = '' - cp "${dsfmt}" "./deps/dsfmt-${dsfmtVersion}.tar.gz" - cp "${rmath-julia}" "./deps/Rmath-julia-${rmathVersion}.tar.gz" - cp "${libuv}" "./deps/libuv-${libuvVersion}.tar.gz" + mkdir deps/srccache + cp "${dsfmt}" "./deps/srccache/dsfmt-${dsfmtVersion}.tar.gz" + cp "${rmath-julia}" "./deps/srccache/Rmath-julia-${rmathVersion}.tar.gz" + cp "${libuv}" "./deps/srccache/libuv-${libuvVersion}.tar.gz" + cp "${virtualenv}" "./deps/srccache/virtualenv-${virtualenvVersion}.tar.gz" ''; patches = [ - ./0001-use-system-utf8proc.patch + ./0001.1-use-system-utf8proc.patch ./0002-use-system-suitesparse.patch - ./0003-no-ldconfig.patch - ] ++ stdenv.lib.optional stdenv.needsPax ./0004-hardened-0.4.7.patch; + ] ++ stdenv.lib.optional stdenv.needsPax ./0004-hardened.patch; postPatch = '' patchShebangs . contrib + for i in backtrace replutil cmdlineargs compile; do + mv test/$i.jl{,.off} + touch test/$i.jl + done + + sed -e 's/Invalid Content-Type:/invalid Content-Type:/g' -i test/libgit2.jl + sed -e 's/Failed to resolve /failed to resolve /g' -i test/libgit2.jl ''; buildInputs = [ - arpack fftw fftwSinglePrec gmp libgit2 libunwind llvmShared mpfr + arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr pcre2.dev openblas openlibm openspecfun readline suitesparse utf8proc - zlib - ] ++ - stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices] ; + zlib llvm + ] + ++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices] + ; nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ] ++ stdenv.lib.optional stdenv.needsPax paxctl; @@ -85,7 +102,7 @@ stdenv.mkDerivation rec { makeFlags = let arch = head (splitString "-" stdenv.system); - march = { "x86_64" = "x86-64"; "i686" = "i686"; }."${arch}" + march = { "x86_64" = "x86-64"; "i686" = "pentium4"; }."${arch}" or (throw "unsupported architecture: ${arch}"); # Julia requires Pentium 4 (SSE2) or better cpuTarget = { "x86_64" = "x86-64"; "i686" = "pentium4"; }."${arch}" @@ -116,7 +133,10 @@ stdenv.mkDerivation rec { "USE_SYSTEM_GMP=1" "USE_SYSTEM_LIBGIT2=1" "USE_SYSTEM_LIBUNWIND=1" + "USE_SYSTEM_LLVM=1" + "LLVM_VER=3.9.1" + "USE_SYSTEM_MPFR=1" "USE_SYSTEM_OPENLIBM=1" "USE_SYSTEM_OPENSPECFUN=1" @@ -133,38 +153,50 @@ stdenv.mkDerivation rec { LD_LIBRARY_PATH = makeLibraryPath [ arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm - openspecfun pcre2 suitesparse + openspecfun pcre2 suitesparse llvm ]; - NIX_LDFLAGS = optionalString stdenv.isDarwin "-rpath ${llvmShared}/lib"; - dontStrip = true; dontPatchELF = true; enableParallelBuilding = true; - doCheck = true; + doCheck = !stdenv.isDarwin; checkTarget = "testall"; # Julia's tests require read/write access to $HOME preCheck = '' export HOME="$NIX_BUILD_TOP" ''; + preBuild = '' + sed -e '/^install:/s@[^ ]*/doc/[^ ]*@@' -i Makefile + sed -e '/[$](DESTDIR)[$](docdir)/d' -i Makefile + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} + ''; + postInstall = '' - for prog in "$out/bin/julia" "$out/bin/julia-debug"; do - wrapProgram "$prog" \ - --prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH" \ - --prefix PATH : "${stdenv.lib.makeBinPath [ curl ]}" + # Symlink shared libraries from LD_LIBRARY_PATH into lib/julia, + # as using a wrapper with LD_LIBRARY_PATH causes segmentation + # faults when program returns an error: + # $ julia -e 'throw(Error())' + find $(echo $LD_LIBRARY_PATH | sed 's|:| |g') -maxdepth 1 -name '*.${if stdenv.isDarwin then "dylib" else "so"}*' | while read lib; do + if [[ ! -e $out/lib/julia/$(basename $lib) ]]; then + ln -sv $lib $out/lib/julia/$(basename $lib) + fi done ''; + passthru = { + inherit majorVersion minorVersion maintenanceVersion; + site = "share/julia/site/v${majorVersion}.${minorVersion}"; + }; + meta = { description = "High-level performance-oriented dynamical language for technical computing"; homepage = https://julialang.org/; license = stdenv.lib.licenses.mit; maintainers = with stdenv.lib.maintainers; [ raskin ]; platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; - #broken = stdenv.isi686; - broken = true; # 2018-04-10 + broken = stdenv.isi686; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fbdc13605f82..0c379980f7ce 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6799,14 +6799,7 @@ with pkgs; jikes = callPackage ../development/compilers/jikes { }; - julia_04 = callPackage ../development/compilers/julia { - gmp = gmp6; - openblas = openblasCompat; - inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; - llvm = llvm_37; - }; - - julia_06 = callPackage ../development/compilers/julia/0.6.nix { + julia = callPackage ../development/compilers/julia { gmp = gmp6; openblas = openblasCompat; inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; @@ -6820,8 +6813,6 @@ with pkgs; llvm = llvm_39; }); - julia = julia_06; - jwasm = callPackage ../development/compilers/jwasm { }; kotlin = callPackage ../development/compilers/kotlin { };