Setup the FUSE environment
This guide walks you through setting up everything you need to run FUSE: the Julia language, the FUSE package, the fusebot helper, and an optional JupyterLab environment with Julia kernels.
Julia installation
Desktop and laptop (juliaup)
We recommend Juliaup on personal machines:
- Mac & Linux:
curl -fsSL https://install.julialang.org | sh - Windows:
winget install julia -s msstore --accept-source-agreements --accept-package-agreements
After installation, restart your terminal so the julia command is available.
HPC systems (environment modules)
On many clusters—including NERSC Perlmutter—Julia is provided by the site module system instead of juliaup:
module load julia
julia --versionSee On NERSC (Perlmutter) for depot layout, fusebot, and Jupyter notes specific to NERSC.
FUSE installation
FUSE and related packages are registered at the FuseRegistry. Start Julia (julia at the terminal), then:
Add the
FuseRegistryand theFUSEpackage (a fresh install can take 5+ minutes):using Pkg Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git")) Pkg.Registry.add("General") Pkg.add("FUSE")Import FUSE:
using FUSEInstall the
fusebothelper (optional but recommended).fusebotis a small command-line tool bundled with FUSE; its main job is to install the Julia Jupyter kernels (fusebot install_IJulia), plus a few related utilities. Install directory is picked byinstall_fusebot()automatically - the juliaupbindirectory on a laptop, or~/.local/binundermodule load juliaon HPC:FUSE.install_fusebot() # auto: juliaup bin, or ~/.local/bin on HPC FUSE.install_fusebot(; setup_shell=true) # HPC: also add ~/.local/bin to your shell PATH FUSE.install_fusebot("/custom/bin"; setup_shell=true) # optional: explicit install directoryOn HPC (
module load julia), the site Julia module does not put user tools onPATHthe way juliaup does, so passsetup_shell=trueonce to add the install directory to your shell startup file. See On NERSC (Perlmutter) for details.Verify the install works with a quick smoke test:
using FUSE ini, act = FUSE.case_parameters(:ITER) dd = FUSE.init(ini, act) # if this completes without error, your install is workingRun the regression tests (optional; can take 1+ hour). At the Julia prompt, typing
]switches to the package prompt:julia ] test FUSEExit Julia and clone
FuseExamplesin your working directory:git clone https://github.com/ProjectTorreyPines/FuseExamplesUpdate later with
git fetch && git reset --hard origin/master(this discards local changes to those examples).
On a personal machine with juliaup, the full sequence is (after typing julia at the terminal):
using Pkg
Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git"))
Pkg.Registry.add("General")
Pkg.add("FUSE")
using FUSE
FUSE.install_fusebot()Install Jupyter-Lab with Julia support
Python on PATH
fusebot install_IJulia runs Pkg.build("IJulia"), which requires a Python interpreter on your PATH. If build fails with a missing-Python error:
- Activate a conda environment, or
- Install Python and Jupyter, or
- On HPC,
module load python(site-specific) before running the install.
A known-good optional stack is provided in docs/jupyter_environment.yml. That file ships inside the FUSE package, so its location depends on whether FUSE is installed under ~/.julia/packages (a normal Pkg.add) or ~/.julia/dev (a Pkg.develop checkout). Let Julia resolve the path for you with pkgdir(FUSE, ...) so the commands are copy-paste regardless of where FUSE lives. Run this in your terminal (it calls julia for you to locate the file - you do not need to start the Julia prompt yourself). julia must be on your PATH: with juliaup it already is, while on HPC you need module load julia first. The guarded line below loads the module on HPC and is a harmless no-op on a laptop:
command -v module >/dev/null && module load julia # HPC only; skipped automatically on a laptop
conda env create -f "$(julia -e 'using FUSE; print(pkgdir(FUSE, "docs", "jupyter_environment.yml"))')"
conda activate fuseTo edit FUSE itself, run:
using Pkg
Pkg.develop("FUSE") # any package registered in the FuseRegistry or General registryThis clones the source into the standard editable location ~/.julia/dev/FUSE and points your environment at it (instead of the read-only versioned copy under ~/.julia/packages), so local edits take effect immediately.
The same works for any package you want to develop - for example a FUSE dependency like IMAS or TJLF, or a third-party package. The package does not have to be registered; Pkg.develop accepts three forms:
- By name (
Pkg.develop("Foo")) - requires the package to be in a registry you have added (General or the FuseRegistry), since Julia reads the repo URL from there to clone it into~/.julia/dev/Foo. - By URL (
Pkg.develop(url="https://github.com/Org/Foo.jl")) - for unregistered packages; Julia clones directly from the given URL. - By path (
Pkg.develop(path="/path/to/Foo")) - no registration needed; points the environment at an existing local checkout (clone it yourself first).
Run Pkg.free("Foo") to stop developing and return to the registered, versioned copy.
Install Jupyter / JupyterLab
Install JupyterLab if it is not already available.
The WebIO JupyterLab extension is needed for Interact.jl.
- JupyterLab 3.x: check with
python -m jupyter labextension list. You should seewebio-jupyterlab-providerenabled. - Classic Notebook below version 7: check with
python -m jupyter nbextension listforwebio-jupyter-nbextension. - Notebook 7+ no longer uses classic
nbextensioncommands; use the Lab extension only.
If extensions conflict, pin JupyterLab 3.x (for example conda install jupyterlab=3.6.7) and keep WebIO/Interact up to date. Python 3.11 is a good compatibility target for Interact.
Install IJulia kernels
In your terminal (with Python on your PATH, and fusebot installed earlier):
fusebot install_IJuliaThis installs single- and multi-thread Julia kernels. Thread count for the multi-thread kernel follows JULIA_NUM_THREADS (default: number of CPUs). Re-run after installing a new Julia version.
Kernels are written directly under ~/.local/share/jupyter/kernels (or $JUPYTER_DATA_DIR/kernels), so registration does not depend on the jupyter command being on PATH. Listing kernels still requires Jupyter:
python -m jupyter kernelspec listStart JupyterLab
Linux and macOS:
python -m jupyter labWindows (prefer the Python module form so the correct environment is used):
python -m jupyter labIf python is not on PATH, use the launcher from your conda or Python install, for example py -m jupyter lab.
Open the cloned FuseExamples folder and run the tutorial notebooks.
Updating FUSE
Watch the FUSE repository for releases.
Update like any Julia package, from the
]package prompt (type]at the Julia prompt):julia ] up
See Managing packages in the Julia manual.
Updating Julia
With juliaup
juliaup update- In the new Julia version:
using Pkg; Pkg.add("FUSE") fusebot install_IJulia
With environment modules
Load the new Julia module, reinstall FUSE in that version's depot if needed, then run fusebot install_IJulia.
Cluster-specific notes
Troubleshooting
Commands in this guide run in one of two places, indicated by the code-block label and the lead-in text:
- Terminal (your shell) - blocks marked
bash/powershell, e.g.module load julia,git ...,conda ...,fusebot ...,python -m jupyter .... - Julia prompt - blocks marked
julia, run after you start Julia's interactive session by typingjuliain the terminal. These useusing,Pkg,FUSE., or the]package prompt.
The install directory is not on your PATH in the current shell. Either open a new login shell, or add it now and re-run, for example export PATH="$HOME/.local/bin:$PATH". To make this permanent, run FUSE.install_fusebot(; setup_shell=true) (or FUSE.setup_fusebot_shell!() if fusebot is already installed).
Pkg.build("IJulia") needs a Python interpreter on your PATH. Activate a conda environment, install Python/Jupyter, or on HPC module load python (site-specific) before re-running.
Make sure git is installed and that you can reach GitHub. Behind a proxy or offline node, configure your proxy first. You can re-run the registry/add commands; they are safe to repeat.
fusebot install_IJulia registers single- and multi-thread Julia kernels. In JupyterLab pick the kernel matching the Julia version you installed FUSE into; list them with python -m jupyter kernelspec list.
Next steps
- Follow the introductory tutorial.
- Explore the
FuseExamplesnotebooks. - Stuck or have questions? Join the Discord community.