Some Real World Examples using Mojo (Modular)
-
Follow the steps from Modular docs to install the Modular CLI.
-
Set the
MODULAR_HOME
andPATH
environment variables, as described in the output when you ranmodular install mojo
. For example, if you’re using bash, you can set them as follows:
echo 'export MODULAR_HOME="$HOME/.modular"' >> ~/.bashrc
echo 'export PATH="$MODULAR_HOME/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
- Go to the examples directory and try running
mojo shortest_paths.mojo
.