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_URLmv $ARCHIVE_NAME /results/echo "Installing to $JULIA_PATH..."mkdir -p "$JULIA_PATH"tar -xzf "/results/$ARCHIVE_NAME" -C "$JULIA_PATH" --strip-components 1julia -v# NextJournal requires JSONjulia -e 'using Pkg; pkg"up; add JSON; precompile; test JSON"'Install more Julia packages
# Install some useful packagesjulia -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.build(); 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.build(); Pkg.precompile(); Pkg.status()'Now we're talking! Installed the latest versions of CSV and DataFrames
Using the new runtime
Click "Add new content"
Choose "Code cell: Julia"
In the top left corner of the cell choose "Change runtime"
Start typing "Julia" until you see the name of the runtime developed here ("Julia 1.6")
Choose that runtime
Run Julia code!
versioninfo()