Developing

Here is some basic information for developing.

Juliaup

Juliaup is the official version manager for Julia. It allows multiple Julia versions to be installed side by side, provides a simple way to switch between them or select a specific version when starting Julia, and keeps installed versions up to date. Juliaup manages the Julia executables themselves, while packages and package environments continue to be managed separately through Julia's built-in package manager (Pkg).

Install with:

curl -fsSL https://install.julialang.org | sh

Install the latest stable release:

juliaup add release

Set the default:

juliaup default release

Then

julia

starts the default version. To run a specific version without changing the default:

julia +lts

Update the release version:

juliaup update release

Separate development and release environments

It is useful to have separate development and release environments.

mkdir -p ~/julia-envs/dev
mkdir -p ~/julia-envs/rel

Now set up the development environment:

julia --project=~/julia-envs/dev

Then:

using Pkg
Pkg.develop(path=expanduser("~/Oscar.jl"))
Pkg.develop(path=expanduser("~/TensorCategories.jl"))
Pkg.add("Revise")
Pkg.instantiate()

Set up the release environment:

julia --project=~/julia-envs/rel
using Pkg
Pkg.add("Oscar")
Pkg.add("TensorCategories")
Pkg.instantiate()

Add Bash aliases:

alias jldev='julia --project=$HOME/julia-envs/dev'
alias jlrel='julia --project=$HOME/julia-envs/rel'

Building documentation

Only once initialize the docs environment:

cd ~/TensorCategories.jl
julia --project=docs
using Pkg
Pkg.develop(path=pwd())
Pkg.instantiate()

Then build the docs with:

julia --project=docs docs/make.jl

When working on a remote machine, clone the built documentation to the local machine for viewing:

rsync -avz --delete remote:~/TensorCategories.jl/docs/build/ tc-docs

On the local machine it's best to serve the documentation via little web server:

python3 -m http.server 8000

Then open:

http://localhost:8000

For convenience, add a script serv.sh for starting the server:

python3 -m http.server 8000

Moreover, a script pull.sh to pull the documentation from the server:

rsync -avz --delete --exclude='/pull.sh' --exclude='/serv.sh' remote:~/TensorCategories.jl/docs/build/ .