# Building Julia from source on WSL2 - Ubuntu

**URL:** https://discourse.julialang.org/t/building-julia-from-source-on-wsl2-ubuntu/101994
**Category:** General Usage
**Tags:** question
**Created:** [July 23, 2023, 11:54pm UTC](https://discourse.julialang.org/t/building-julia-from-source-on-wsl2-ubuntu/101994 "2023-07-23T23:54:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![C1Ron](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c1ron/32/51758_2.png) [@C1Ron](https://discourse.julialang.org/u/C1Ron)
#### Post date: [July 23, 2023, 11:54pm UTC](https://discourse.julialang.org/t/building-julia-from-source-on-wsl2-ubuntu/101994/1 "2023-07-23T23:54:12Z")

</div>

I’ve tried to build Julia v1.9.2 from source following the instructions on Github on WSL2 - Ubuntu.  
I’m able to build the executable:

```julia
$ make

```

but when I run

```julia
$ make testall

```

the process fails with summary:

```julia
Test Summary: | Pass Error Broken Total Time
  Overall | 28473073 4 25056 28498133 28m07.3s
    LinearAlgebra/structuredbroadcast | 670 670 1m26.6s
    LinearAlgebra/blas | 1630 1630 2m17.8s
    LinearAlgebra/hessenberg | 632 632 2m35.6s
    LinearAlgebra/svd | 606 606 2m48.0s
    LinearAlgebra/uniformscaling | 446 446 2m50.8s
    LinearAlgebra/qr | 4705 4705 3m44.6s
    LinearAlgebra/adjtrans | 475 475 1m00.8s
    LinearAlgebra/lapack | 803 803 1m17.7s
    LinearAlgebra/tridiag | 1601 1601 1m50.9s
    LinearAlgebra/lu | 1380 1380 4m28.3s
    LinearAlgebra/givens | 1991 1991 21.7s
    LinearAlgebra/cholesky | 2511 2511 4m31.2s
    LinearAlgebra/ldlt | 8 8 1.9s
    LinearAlgebra/factorization | 80 16 96 7.6s
    LinearAlgebra/eigen | 951 951 3m11.6s
    ambiguous | 108 2 110 8.6s
    compiler/datastructures | 294 294 5.0s
    compiler/validation | 28 28 0.9s
    compiler/effects | 556 1 557 3.7s
    LinearAlgebra/lq | 3098 3098 1m59.8s
    LinearAlgebra/pinv | 500 500 21.8s
    compiler/irpasses | 249 4 253 9.9s
    compiler/contextual | 12 12 4.8s
    compiler/ssair | 135 135 17.4s
    compiler/inline | 268 3 271 13.5s
    LinearAlgebra/schur | 496 496 1m13.6s
    compiler/inference | 1263 4 1267 28.4s
    LinearAlgebra/generic | 644 1 645 1m22.3s
    compiler/codegen | 183 183 19.2s
    strings/search | 876 876 10.6s
    strings/io | 12764 12764 6.6s
    strings/basic | 87696 87696 17.5s
    unicode/utf8 | 19 19 0.2s
    compiler/EscapeAnalysis/interprocedural | 32 4 36 22.9s
    strings/types | 2302691 2302691 5.9s
    strings/util | 1152 1152 25.8s
    compiler/EscapeAnalysis/local | 347 21 368 32.7s
    keywordargs | 154 154 3.9s
    LinearAlgebra/bunchkaufman | 5689 5689 1m44.3s
    worlds | 103 103 12.6s
    triplequote | 29 29 0.1s
    char | 1639 1639 4.7s
    intrinsics | 364 364 7.2s
    compiler/AbstractInterpreter | 24 24 50.3s
    iobuffer | 209 209 3.1s
    staged | 67 67 6.2s
    atomics | 3448 3448 39.1s
    subtype | 337952 42 337994 43.2s
    hashing | 14436 14436 39.1s
    dict | 144450 144450 58.8s
    tuple | 670 670 22.0s
    reduce | 8598 8598 44.3s
    intfuncs | 227917 227917 20.1s
    offsetarray | 513 3 516 1m32.9s
    simdloop | 240 240 4.0s
    vecelement | 678 678 14.9s
    LinearAlgebra/special | 3008 3008 7m49.7s
    copy | 556 556 7.8s
    LinearAlgebra/bidiag | 4792 4792 8m07.1s
    numbers | 1584929 1 1584930 2m44.7s
    fastmath | 946 946 17.9s
    core | 8445963 3 8445966 3m01.8s
    functional | 98 98 14.7s
    rational | 98695 2 98697 1m01.9s
    path | 373 12 385 3.0s
    operators | 13055 13055 19.8s
    ordering | 37 37 13.7s
    parse | 16098 16098 8.8s
    gmp | 2445 2445 11.9s
    reducedim | 1225 6 1231 2m55.6s
    spawn | 242 4 246 35.2s
    math | 1909858 1909858 2m15.2s
    backtrace | 39 1 40 3.4s
    exceptions | 70 70 2.8s
    arrayops | 2122 5 2127 4m06.5s
    version | 2453 2453 2.3s
    namedtuple | 218 218 6.2s
    file | 1072 1072 16.5s
    LinearAlgebra/dense | 8561 8561 10m45.7s
    LinearAlgebra/diagonal | 1 1 10m58.7s
    loading | 140378 140378 2m12.8s
    floatapprox | 49 49 4.2s
    read | 3812 3812 52.9s
    mpfr | 1137 1 1138 45.8s
    regex | 142 142 6.7s
    sysinfo | 4 4 0.4s
    env | 76 76 1.1s
    complex | 8480 2 8482 30.6s
    reflection | 434 434 12.7s
    mod2pi | 80 80 0.6s
    float16 | 762093 762093 11.4s
    euler | 12 12 2.6s
    combinatorics | 170 170 14.6s
    client | 5 5 4.3s
    rounding | 150016 150016 11.6s
    goto | 19 19 0.3s
    llvmcall | 20 20 1.6s
    llvmcall2 | 20 20 0.3s
    ryu | 31217 31217 2.8s
    some | 72 72 1.8s
    abstractarray | 55663 24806 80469 4m51.9s
    meta | 69 69 3.4s
    stacktraces | 48 48 13.7s
    docs | 239 239 10.6s
    errorshow | 249 249 24.6s
    iterators | 86616 86616 3m29.0s
    binaryplatforms | 341 341 11.2s
    enums | 102 102 9.2s
    atexit | 68 68 26.1s
    interpreter | 3 3 1.5s
    ccall | 5400 5400 3m40.5s
    int | 736188 736188 22.7s
    bitset | 200 200 9.9s
    sets | 3644 1 3645 1m11.4s
    error | 83 83 6.2s
    ranges | 1 1 1m32.2s
    show | 128982 8 128990 1m28.7s
    checked | 1239 1239 33.7s
    osutils | 1000 1000 2.1s
    boundscheck | None 21.8s
    iostream | 50 50 3.2s
    specificity | 175 175 0.3s
    secretbuffer | 30 30 4.1s
    cartesian | 349 3 352 18.1s
    corelogging | 235 235 10.6s
    broadcast | 526 526 2m36.1s
    smallarrayshrink | 36 36 1.8s
    opaque_closure | 68 1 69 3.1s
    filesystem | 6 6 0.8s
    syntax | 1679 1 1680 19.7s
    SparseArrays/allowscalar | 9 9 0.8s
    misc | 1282251 1282251 1m31.1s
    SparseArrays/ambiguous | 1 1 6.7s
    asyncmap | 307 307 21.0s
    bitarray | 940200 8 940208 5m43.9s
    channels | 259 259 44.9s
    LinearAlgebra/symmetric | 2853 2853 13m35.4s
    SparseArrays/fixed | 58 58 16.4s
    reinterpretarray | 421 421 46.3s
    download | None 31.8s
    missing | 574 1 575 54.2s
    LinearAlgebra/matmul | 1496 1496 14m09.2s
    subarray | 459022 459022 9m24.1s
    sorting | 1 1 5m30.9s
    LibGit2/online | 10 10 9.4s
    SparseArrays/spqr | 98 98 44.4s
    Dates/accessors | 7723858 7723858 11.8s
    Dates/query | 1004 1004 2.4s
    Dates/adjusters | 3149 3149 14.0s
    SparseArrays/linalg_solvers | 364 364 1m26.8s
    Dates/rounding | 315 315 6.6s
    Dates/types | 232 232 4.2s
    SparseArrays/cholmod | 612 612 1m56.4s
    Dates/periods | 953 953 34.9s
    Dates/arithmetic | 385 385 14.9s
    Dates/conversions | 160 160 2.1s
    Dates/ranges | 350639 350639 34.9s
    Base64 | 2031 2031 4.8s
    Artifacts | 1453 1453 7.7s
    CompilerSupportLibraries_jll | 4 4 1.3s
    CRC32c | 664 664 1.8s
    Dates/io | 361 361 30.9s
    ArgTools | 180 180 14.3s
    Future | None 0.0s
    GMP_jll | 1 1 2.2s
    DelimitedFiles | 89 89 12.5s
    LLD_jll | 2 2 0.9s
    LLVMLibUnwind_jll | None 0.8s
    LibGit2/libgit2 | 1 1 1m20.5s
    LazyArtifacts | 4 4 7.7s
    LibCURL | 6 6 2.0s
    LibCURL_jll | 1 1 0.1s
    SparseArrays/sparsematrix_ops | 675 675 2m24.8s
    LibSSH2_jll | None 1.5s
    LibGit2_jll | 2 2 3.2s
    LibUV_jll | 1 1 0.9s
    LibUnwind_jll | 1 1 0.8s
    MPFR_jll | 1 1 0.7s
    SparseArrays/umfpack | 345 345 2m01.3s
    MbedTLS_jll | 1 1 0.4s
    Logging | 40 40 2.9s
    MozillaCACerts_jll | 1 1 0.0s
    Libdl | 79 1 80 4.1s
    OpenBLAS_jll | 1 1 0.1s
    OpenLibm_jll | 1 1 1.0s
    NetworkOptions | 3518 3518 2.4s
    PCRE2_jll | 7 7 0.8s
    SparseArrays/issues | 349 349 2m42.9s
    Markdown | 257 257 11.7s
    floatfuncs | 232 232 3m59.8s
    InteractiveUtils | 301 301 42.3s
    Printf | 1017 1017 28.4s
    Mmap | 140 140 35.1s
    Serialization | 131 1 132 14.5s
    SparseArrays/linalg | 4631 4631 3m28.8s
    SuiteSparse | None 1.3s
    SuiteSparse_jll | 1 1 0.8s
    Sockets | 173 173 29.9s
    REPL | 1583 3 1586 1m03.2s
    Downloads | 238 238 1m52.2s
    UUIDs | 1029 1029 0.7s
    TOML | 582 45 627 33.7s
    Zlib_jll | 1 1 0.8s
    dSFMT_jll | 1 1 0.7s
    libLLVM_jll | 1 1 0.7s
    libblastrampoline_jll | 1 1 0.0s
    nghttp2_jll | 1 1 0.1s
    p7zip_jll | 1 1 0.0s
    Unicode | 795 795 9.5s
    SparseArrays/higherorderfns | 7172 1 7173 4m17.3s
    Tar | 3227 11 3238 46.0s
    SHA | 107 107 1m38.7s
    FileWatching | 681 681 2m25.3s
    cmdlineargs | 275 5 280 6m16.0s
    Random | 204840 204840 2m03.7s
    Test | 458 17 475 1m06.1s
    Statistics | 810 810 1m56.5s
    SparseArrays/sparsematrix_constructors_indexing | 1915 1915 5m16.6s
    LinearAlgebra/triangular | 37908 37908 20m06.8s
    Profile | 116 116 3m56.6s
    SparseArrays/sparsevector | 10509 4 10513 6m29.4s
    LinearAlgebra/addmul | 13644 13644 24m00.1s
    Pkg | 3258 1 3259 11m53.0s
    precompile | 228 228 41.6s
    SharedArrays | 118 118 23.0s
    threads | 51 51 1m47.3s
    Distributed | 15 15 3m17.8s
    stress | 118 118 11.3s
    FAILURE

```

I’ll post error-messages if needed 🙂

PS - I’ve been trying to build binaries for Windows on MSYS2 which also have failed. And I’ve tried to build for Linux on a VM VirtualBox Ubuntu 22.4. The VirtualBox attempt resulted in a successfull `make` but the `make testall` still failed there as well.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [July 24, 2023, 12:30am UTC](https://discourse.julialang.org/t/building-julia-from-source-on-wsl2-ubuntu/101994/2 "2023-07-24T00:30:10Z")

</div>

Why are you building from source? That should be possible, but I’m not aware you need to build for WSL2 (or on WSL2). You can just use the Linux binaries on WSL2 in Windows, right?

---

<div class="post-metadata">

### Author: ![C1Ron](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c1ron/32/51758_2.png) [@C1Ron](https://discourse.julialang.org/u/C1Ron)
#### Post date: [July 24, 2023, 12:40am UTC](https://discourse.julialang.org/t/building-julia-from-source-on-wsl2-ubuntu/101994/3 "2023-07-24T00:40:39Z")

</div>

The reason I’m building from source is for practice as I think it’s an important skill to master working with software. And once I’ve started I get a little obsessed… 🙈

---

<div class="post-metadata">

### Author: ![C1Ron](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c1ron/32/51758_2.png) [@C1Ron](https://discourse.julialang.org/u/C1Ron)
#### Post date: [July 24, 2023, 12:47am UTC](https://discourse.julialang.org/t/building-julia-from-source-on-wsl2-ubuntu/101994/4 "2023-07-24T00:47:36Z")

</div>

I’m getting a lot of exceptions related to this file: **stdlib/v1.9/Distributed/src/remotecall.jl**. I also get some **TCPSocket** related issues. I’m beginning to think that _Norton Antivirus_ is messing with me…

---

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [July 24, 2023, 1:30pm UTC](https://discourse.julialang.org/t/building-julia-from-source-on-wsl2-ubuntu/101994/5 "2023-07-24T13:30:16Z")

</div>

I use WSL2 as well, and I build from source. I hadn’t ever run the tests, but I also get errors in `make testall`. I haven’t noticed failures in my own code - but my tests aren’t very probing, or even cover very much yet.

I gather from the errors, that it might mean that WSL2 is [technically a “tier 2” platform](https://julialang.org/downloads/#supported_platforms)?

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [July 24, 2023, 1:46pm UTC](https://discourse.julialang.org/t/building-julia-from-source-on-wsl2-ubuntu/101994/6 "2023-07-24T13:46:00Z")

</div>

> **[Issues · JuliaLang/julia](https://github.com/JuliaLang/julia/issues?q=is%3Aopen%2Blabel%3Awindows%2Blabel%3Abuild)**
>
> The Julia Programming Language. Contribute to JuliaLang/julia development by creating an account on GitHub.

Note, that Julia on WSL2 is known to not work as well in all cases (that’s an upstream issue), and harder too look for since there’s no specific WSL label:

> <https://github.com/JuliaLang/julia/issues/37029>
>
> This was originally a comment on \[an issue with Revise.jl\](https://github.com/ti…mholy/Revise.jl/issues/514), but Tim Holy recommended filing this as a Julia bug, so this is what I'm doing now.
> 
> It seems \`FileWatching\` has problems with \[WSL2\](https://docs.microsoft.com/en-us/windows/wsl/wsl2-index). Below is what I can reproduce. The gist of it seems to be that \`FileWatching\` works within the "native" file system of WSL, but ceases to work in the normal Windows file system. (One funny thing is that it makes a slight difference if the file is modified from a WSL program - but only if you watch the directory it's in. That's the last working case below.)
> 
> julia\> using FileWatching
> 
> julia\> watch\_file("/tmp/")
> # change /tmp/foo from WSL bash
> FileWatching.FileEvent(false, true, false) 
> 
> julia\> watch\_file("/tmp/foo")
> # change /tmp/foo from WSL bash
> FileWatching.FileEvent(false, true, false)
> 
> julia\> watch\_file("/tmp/")
> # change /tmp/foo from Windows-Emacs
> FileWatching.FileEvent(false, true, false) 
> 
> julia\> watch\_file("/tmp/foo")
> # change /tmp/foo from Windows-Emacs
> FileWatching.FileEvent(false, true, false)
> 
> julia\> watch\_file("/mnt/c/Users/edi/Desktop")
> # change c:/Users/edi/Desktop/foo from WSL bash
> FileWatching.FileEvent(false, true, false)
> 
> julia\> watch\_file("/mnt/c/Users/edi/Desktop/foo")
> # change c:/Users/edi/Desktop/foo from WSL bash
> # NOTHING HAPPENS
> 
> julia\> watch\_file("/mnt/c/Users/edi/Desktop")
> # change c:/Users/edi/Desktop/foo from Windows-Emacs
> # NOTHING HAPPENS
> 
> julia\> watch\_file("/mnt/c/Users/edi/Desktop/foo")
> # change c:/Users/edi/Desktop/foo from Windows-Emacs
> # NOTHING HAPPENS
> 
> julia\> versioninfo()
> Julia Version 1.4.2
> Commit 44fa15b150\* (2020-05-23 18:35 UTC)
> Platform Info:
> OS: Linux (x86\_64-pc-linux-gnu)
> CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
> WORD\_SIZE: 64
> LIBM: libopenlibm
> LLVM: libLLVM-8.0.1 (ORCJIT, skylake)

I believe Julia on WSL2 is in some case better though, for I/O too, since WSL2 is faster for I/O in than regular Windows.

I believe people want Julia to work fully on WSL2, though its less of a priority. WSL2 doesn’t officially have any tier, but it seems tier 2 would be most correct. I understand it works for a lot of things. It seems (the errors for e.g.) ranges (and sorting) is very fundamental, not sure why it’s failing (false alarm?), while e.g. LinearAlgebra/diagonal may not be used by as many users.
