Tutorial 0: Getting Started with Macro
The interactive version of this tutorial can be found here.
This tutorial will guide you through the steps to install Macro, a solver, and all the necessary dependencies.
Installing Macro
Before installing Macro, make sure you have the following requirements installed:
- Julia: you can download it here.
- Git: you can download it here.
- (optional) Jupyter Notebook: you can install it using the following command:
pip install notebook
Download Macro
Since Macro is a public repository, you can simply clone it using:
git clone https://github.com/macroenergy/MacroEnergy.jl.git
If you want to clone a specific branch, you can use:
git clone -b <branch-name> https://github.com/macroenergy/MacroEnergy.jl.git
Installation steps
- Navigate to the repository:
cd MacroEnergy.jl
- Install Macro and all the dependencies:
julia --project=. -e "using Pkg; Pkg.instantiate(); Pkg.precompile()"
Setting up Jupyter Notebook
Once Macro is installed, to enable Jupyter Notebook support, you can run the following command:
julia --project=.
in the terminal. Then, you can install the IJulia package and install the Macro kernel with the following commands:
julia> ]
(MacroEnergy) pkg> add IJulia
julia> using IJulia; IJulia.installkernel("MacroEnergy", "--project=@.")
Once the kernel is installed, you can run Jupyter Notebook with one of the following commands:
jupyter lab
or
jupyter notebook
Testing the installation
To test the installation, you can run the following command:
using MacroEnergy
in a Jupyter Notebook cell or in a Julia terminal. If everything is set up correctly, you should see no errors and the package should load without any issues.