Trying to build Julia environment for NextJournal

ARCHIVE_NAME="julia-1.6.2-linux-x86_64.tar.gz"
ARCHIVE_URL="https://julialang-s3.julialang.org/bin/linux/x64/1.6/$ARCHIVE_NAME"
echo "Downloading..."
wget -q --show-progress --progress=bar:force $ARCHIVE_URL
mv $ARCHIVE_NAME /results/
echo "Installing to $JULIA_PATH..."
mkdir -p "$JULIA_PATH"
tar -xzf "/results/$ARCHIVE_NAME" -C "$JULIA_PATH" --strip-components 1
julia -v
8.3s
# NextJournal requires JSON
julia -e 'using Pkg; pkg"up; add JSON; precompile; test JSON"'
53.9s

Install more Julia packages

# Install some useful packages
julia -e 'using Pkg; pkg"up; add CSV DataFrames Distributions LoopVectorization BenchmarkTools; build; precompile"'
120.6s

CategoricalArrays, DataFrames and CSV failed to precompile!

julia -e 'using Pkg; Pkg.status()'
1.6s

Pkg attempted to install outdated packages:

  • CSV v0.4.0 (current version 0.8.5)

  • DataFrames v0.19.4 (current version 1.2.2!)

  • CategoricalArrays v0.6.0 (current version 0.9.7)

Well, that didn't go as planned (some packages failed to precompile)... Let's attempt to install all packages one by one.

First, remove all packages:

julia -e 'using Pkg; Pkg.rm(["BenchmarkTools", "CSV", "DataFrames", "Distributions", "LoopVectorization"], mode=Pkg.PKGMODE_MANIFEST); Pkg.gc(); Pkg.status()'
7.9s

Then, reinstall the same packages one by one:

julia -e 'using Pkg; Pkg.add("CSV"); Pkg.add("DataFrames"); Pkg.add("Distributions"); Pkg.add("LoopVectorization"); Pkg.add("BenchmarkTools"); Pkg.build(); Pkg.precompile(); Pkg.status()'
25.5s

The same packages still fail to precompile. Pkg attempted to install very outdated versions again!

Install with `PRESERVE_NONE`

Remove everything again and install without preservation (`PRESERVE_NONE`):

julia -e 'using Pkg; Pkg.rm(["BenchmarkTools", "CSV", "DataFrames", "Distributions", "LoopVectorization"], mode=Pkg.PKGMODE_MANIFEST); Pkg.gc()'
julia -e 'using Pkg; Pkg.add("CSV", preserve=Pkg.PRESERVE_NONE); Pkg.add("DataFrames", preserve=Pkg.PRESERVE_NONE); Pkg.add("Distributions", preserve=Pkg.PRESERVE_NONE); Pkg.add("LoopVectorization", preserve=Pkg.PRESERVE_NONE); Pkg.add("BenchmarkTools", preserve=Pkg.PRESERVE_NONE); Pkg.build(); Pkg.precompile(); Pkg.status()'
93.0s

Now we're talking! Installed the latest versions of CSV and DataFrames

Using the new runtime

  1. Click "Add new content"

  2. Choose "Code cell: Julia"

  3. In the top left corner of the cell choose "Change runtime"

  4. Start typing "Julia" until you see the name of the runtime developed here ("Julia 1.6")

  5. Choose that runtime

  6. Run Julia code!

versioninfo()
1.8s
Runtimes (2)