Install a 64-bit Ubuntu OS (Gurobi requires a 64-bit OS):
- Download Raspberry Pi Imager at https://www.raspberrypi.com/software/ and install it on a regular computer.
- Download the Ubuntu Image for Raspberry Pi at Install Ubuntu on a Raspberry Pi | Ubuntu onto the regular computer that you just installed the Raspberry Pi Imager. I chose the 64-bit Ubuntu Desktop 22.04.1 LTS. The Server version is good too, but it only operates on command lines and it will be less intuitive to set up wifi connections and copy commands from online tutorials.
- Insert the SD card into the regular computer, run the Imager, erase the previous OS on the SD card, and flash the Ubuntu image into the SD card.
- Power on your Raspberry Pi and the installation process will start automatically. You will be asked to change the root password. The initial username and password are both ubuntu.
Install Julia
cd /opt
sudo wget https://julialang-s3.julialang.org/bin/linux/aarch64/1.8/julia-1.8.0-linux-aarch64.tar.gz
sudo tar zxvf julia-1.8.0-linux-aarch64.tar.gz
sudo nano ~/.bashrc
Add the following sentence to the end of the ~/.bashrc file:
export PATH="$PATH:/opt/julia-1.8.0/bin"
Install JuMP and GLPK Solver
julia
import Pkg
Pkg.add("JuMP")
Pkg.add("GLPK")
Now you have the GLPK solver, you don’t have to have the Gurobi solver, but you could still install Gurobi for fun.
Install Gurobi
- Download the Gurobi Optimizer for arm64 Linux at https://www.gurobi.com/downloads/gurobi-software/
- Save the file with the .tar.gz extension to the /opt folder.
- Use the following command to extract the files (please pay attention to the file name, it changes depending on the version):
tar xvfz gurobi9.5.2_armlinux64.tar.gz
- Add the environment variables by using the following command:
sudo nano ~/.bashrc
Then add the following lines to the end of the file and save the file.
export GUROBI_HOME="/opt/gurobi952/armlinux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
- Apply for a Gurobi academic license, and enter the grbgetkey XXXXXXXXXXXXXXXXX command into the command window. Activate the key and save the license in the default folder.
- Restart your Raspberry Pi.
- Open the terminal, run Julia and add the Gurobi package to Julia:
julia
import Pkg
Pkg.add("Gurobi")
Pkg.build("Gurobi")
- Now you should be able to run a Julia JuMP problem with a Gurobi solver.