This tutorial guides you in installing the Mojo Software Development Kit (SDK) and setting up your programming environment on Ubuntu Linux and macOS systems. Please note that Mojo is not available for Windows OS at this time.



Preparation for Installation

Before starting the installation process, make sure that your system meets the following requirements:

For Linux:

  • Ubuntu 20.04/22.04 LTS.
  • x86-64 CPU with SSE4.2 or newer.
  • At least 8 GiB of memory.
  • Python 3.8 - 3.11 installed.
  • g++ or clang++ C++ compiler.

For Mac:

  • An Apple silicon (M1 or M2 processor).
  • macOS Monterey (12) or newer.
  • Python 3.8 - 3.11 installed.
  • Command-line tools for Xcode, or Xcode itself.

Downloading and Installing the Mojo SDK

The Mojo SDK is the foundation for local Mojo development, providing the Mojo standard library and command-line interface (CLI) needed to build applications. Here's how you can download and install the SDK on your Ubuntu Linux or macOS system:

  1. Visit the Mojo official website and click "Download Now" to access the Modular developer console.
  2. Download and install the Modular CLI tool, which is a package manager for managing Mojo components.
  3. Once the Modular CLI is installed, install the Mojo SDK with the following command:
    modular install mojo
    
  4. After the installation process completes, you can verify that the Mojo SDK was installed correctly by running:
    mojo --version
    

Updating Mojo and the Modular CLI

Keeping your development tools up-to-date is crucial for security, performance, and accessing the latest features. For Mojo developers, this means regularly updating both the Mojo SDK and the Modular CLI tool. Below are detailed instructions for performing these updates on Ubuntu Linux and macOS systems.

  1. To keep Mojo up-to-date, you need to use the Modular CLI tool. The command is simple and the same for both Ubuntu and macOS:
    modular update mojo
    
  2. For updating the Modular CLI on Linux, execute:
     sudo apt update
    sudo apt install modular
  3. If you're using Homebrew, the popular package manager for macOS, you can update all your installed packages, including the Modular CLI, with:
    brew update
    
  4. After updating the package list with Homebrew, you can upgrade the Modular CLI specifically by running:
    brew upgrade modular
    

Exploring Mojo with the Mojo Playground

If you prefer to avoid installing the SDK, the Mojo Playground offers a convenient web-based interface to code online in Mojo. Below are the steps to get started with the Mojo Playground:

  • Log in to the Mojo Playground via the Mojo website.
  • Utilize the Jupyter Notebook environment to experiment with Mojo.
  • Ensure to rename any edited notebooks to maintain your changes against updates.

Conclusion

With Mojo installed on your system, you can access to its robust features. Whether you choose the SDK or the Mojo Playground, you have everything you need to start developing with Mojo.



Found This Page Useful? Share It!
Get the Latest Tutorials and Updates
Join us on Telegram