Trying to build Julia environment for NextJournal

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
# NextJournal requires JSON
julia -e 'using Pkg; pkg"up; add JSON; precompile; test JSON"'

Install more Julia packages

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

CategoricalArrays, DataFrames and CSV failed to precompile!

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

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()'

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.precompile(); Pkg.status()'

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.precompile(); Pkg.status()'

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!

Runtimes (2)