Last active
February 10, 2021 01:08
-
-
Save rbvermaa/08f916a63ba4f3f6123f97478309dfa0 to your computer and use it in GitHub Desktop.
Julia Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import <nixpkgs> {}; | |
buildJulia = version: sha256: | |
with pkgs; | |
gcc7Stdenv.mkDerivation { | |
makeFlags = [ | |
"ARCH=x86_64" | |
"MARCH=x86-64" | |
"JULIA_CPU_TARGET=x86-64" | |
"USE_BINARYBUILDER=0" | |
"PREFIX=$(out)" | |
"prefix=$(out)" | |
"OS=Linux" | |
]; | |
name = "julia-${version}"; | |
patches = [ | |
(fetchurl { | |
url = | |
"https://raw.githubusercontent.com/NixOS/nixpkgs/9fa09748565e917f80db47006ecec48489cdb603/pkgs/development/compilers/julia/allow_nix_mtime.patch"; | |
sha256 = "0r4zlrk1jxz0jghb3l0ry3lzqf0ddbp0c4s8qs1vhwk43b73w459"; | |
}) | |
]; | |
src = pkgs.fetchzip { | |
url = | |
"https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz"; | |
inherit sha256; | |
}; | |
enableParallelBuilding = true; | |
buildInputs = [ m4 python gfortran which perl ]; | |
doCheck = false; | |
NIX_CFLAGS_COMPILE = if stdenv.isLinux then "-L${gfortran.cc.lib}/lib" else null; | |
separateDebugInfo = true; | |
preConfigure = '' | |
export PATH=$PATH:${cmake}/bin | |
sed -e '/^install:/s@[^ ]*/doc/[^ ]*@@' -i Makefile | |
sed -e '/[$](DESTDIR)[$](docdir)/d' -i Makefile | |
''; | |
}; | |
in { | |
julia_142 = buildJulia "1.4.2" "14jghi9mw0wdi6y9saarf0nzary9i21jx43zznddzrq48v4nlayj"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the
gcc7Stdenv
was necessary due to compatibility with the BinaryBuilder artifacts that gets downloaded by the Julia package manager.