Skip to content

Installation Guide

KPG Run Installation Guide

Complete step-by-step installation instructions for setting up KPG Run on your system.

System Requirements

Operating System

OSStatusNotes
macOSSupported10.15 (Catalina) or later
WindowsSupported10 or later
LinuxPlannedFuture release

Hardware

Minimum:

  • CPU: Dual-core processor
  • RAM: 8 GB
  • Storage: 2 GB available

Recommended:

  • CPU: Quad-core or better (M1 or later ideal)
  • RAM: 16 GB
  • Storage: 5 GB (includes data and results)

Installation Overview

flowchart TB
    A[Install Julia] --> B[Install Julia Packages]
    
    B --> C[Get Gurobi]
    
    C --> D[Install KPG Run]
    
    D --> E[Verify Installation]
    
    E --> F[Ready to Use!]    

Step 1: Install Julia

Visit julialang.org/downloads and follow the installation instructions:

For macOS:

Install via juliaup

Open the Terminal app on macOS and run the following command:

# Download the latest stable version for macOS
$ curl -fsSL https://install.julialang.org | sh

At the following prompt, select the appropriate option:

# Prompts
Do you want to install with these default configuration choices?
# Options
> Proceed with installation
> Customize installation
> Cancel installation

Verify installation

To verify that Julia is installed, open Terminal and run the following command:

# Open Terminal and type below
$ julia

Step 2: Install Julia Packages

Launch Julia REPL

Run julia in Terminal.

$ julia

Install Required Packages

From the Julia REPL, press ] to enter the Pkg REPL.

# Enter package mode (press ])
julia> ]

To add a package, use the add command:

# Add packages
pkg> add JuMP
pkg> add Gurobi
pkg> add Ipopt
pkg> add KNITRO
pkg> add HiGHS
pkg> add PowerModels
pkg> add JSON
pkg> add JSON3
pkg> add CSV
pkg> add DataFrames
pkg> add MAT
pkg> add OrderedCollections
pkg> add StringEncodings
# Optionally, install multiple packages in a single command
pkg> add JuMP Gurobi Ipopt KNITRO HiGHS PowerModels JSON JSON3 CSV DataFrames MAT OrderedCollections StringEncodings
# Press Backspace to return to the Julia REPL

Verify that the packages have been installed by running the following:

# Test installations
julia> using JuMP, Gurobi, Ipopt, KNITRO, HiGHS, PowerModels, JSON, JSON3, CSV, DataFrames, MAT, OrderedCollections, StringEncodings
julia> println("All packages loaded successfully")
All packages loaded successfully
# If no error message appears, exit Julia
julia> exit()

Troubleshooting:

If package installation fails:

# Update registry first
pkg> registry update
# If specific package fails, try:
pkg> add PackageName@<version>
# Example:
pkg> add JuMP@1.29.3

Step 3: Install Gurobi Solver

Get Academic License

Note: You must meet Gurobi’s academic license eligibility requirements. If you cannot obtain a Gurobi license, skip this step and proceed with Step 4.

  1. Register at gurobi.com/academia
  2. Verify your academic email.
  3. Navigate to User Portal > Licenses > Request.
  4. Request a free academic license that matches your intended use.
  5. Generate a license key.
  6. Install the Gurobi license by following the instructions provided in the license portal.
# Copy and paste the following command in Terminal
$ grbgetkey <license-key>

Replace <license-key> with the key shown in the Gurobi license portal.

Select the location where you want to save your license file when prompted. It is recommended to save the license file in your home directory. If you prefer to place the license file somewhere else, refer to → Where do I place the Gurobi license file (gurobi.lic)?.

# Prompts
In which directory would you like to store the Gurobi license file?
[hit Enter to store it in the <home directory>]:

Install Gurobi

  1. Visit Gurobi Download Center
  2. Download the installer that matches your system (Windows, macOS, or Linux).
  3. Run the installer
    • If the installer prompts you to install Rosetta, allow the installation to proceed.
  4. Test your license by running gurobi_cl --license in Terminal. If the license file is not configured correctly, this command will report error 10009. Troubleshooting: If you get Error 10009, verify that your license file is correctly located in a valid Gurobi license location. For any other error messages, refer to the → Gurobi Help Center for troubleshooting guidance.
# Check license
$ gurobi_cl --license
# If "No license found":
# 1. Check ~/gurobi.lic exists
# 2. Ensure GUROBI_HOME set correctly
# 3. Re-run grbgetkey with correct key

Step 4: Verify Ipopt

Ipopt is installed in Step 2 along with the other Julia packages, but you can verify the installation with the minimal example below:

julia> using Ipopt
julia> using JuMP
julia> model = Model(Ipopt.Optimizer)
A JuMP Model
├ solver: Ipopt
├ objective_sense: FEASIBILITY_SENSE
├ num_variables: 0
├ num_constraints: 0
└ Names registered in the model: none
julia> @variable(model, x >= 0)
x
julia> @objective(model, Min, x^2)
julia> @constraint(model, x >= 1)
x 1
julia> optimize!(model)
This is Ipopt version 3.14.19, running with linear solver MUMPS 5.8.1.
...
EXIT: Optimal Solution Found.

Step 5: Install KPG Run Application

Download the Installer (macOS)

  1. Download the installer KPG Run_<version>.dmg file from the KPG Run release page.
  2. Open the installer and drag KPG Run.app into your Applications folder.

Download KPG 193 Data

  1. Download KPG 193 data from project website
  2. Extract the .zip to a folder of your choice

For more detailed information, refer to KPG Test System Documentation.

Step 6: First Launch

Verify Functionality

  1. Open KPG Run.
  2. Select DC-OPF as the problem type.
  3. Choose the data source folder (e.g. KPG193_ver1_5).
  4. Set Day to 200.
  5. Click Solve.

The optimization should terminate with an optimal status. If the run completes successfully, review the solution in the Results tab.

Troubleshooting

Common Issues

Issue 1: Julia Packages Not Found

ERROR: LoadError: ArgumentError: Package JuMP not found

Indicates that one or more required Julia packages (e.g. JuMP) have not been installed in the current environment.

Solution: Install the required packages in the Julia REPL.

# In Julia REPL
pkg> add JuMP Gurobi Ipopt

Issue 2: Gurobi License Error

ERROR: Gurobi Error 10009: Failed to obtain a valid license

Occurs when Gurobi cannot find or validate a license file.

Solution: Ensure that the license file exists and reactivate the license if necessary.

# Check license file exists
$ ls ~/gurobi.lic
# If not, reactivate
$ cd $GUROBI_HOME/bin
$ ./grbgetkey <license-key>
# Verify
$ gurobi_cl --license

Issue 3: Permission Denied

Permission denied: /Applications/Julia-<version>.app

Indicates that the current user does not have sufficient permissions to access or modify the Julia application.

Solution: Adjust the permissions on the Julia application.

# Fix permissions
$ sudo chmod -R 755 /Applications/Julia-<version>.app

Platform-Specific Notes

Verifying Julia Architecture on macOS

On macOS, you can check which CPU architecture Julia is using with the following command:

# Verify Julia is ARM64 version
$ file "$(which julia)"
Mach-O 64-bit executable arm64 # macOS (Apple Silicon)
Mach-O 64-bit executable x86_64 # macOS (Intel)

Performance: Native ARM64 builds generally run faster than running Julia with Rosetta.

Updating

Update Julia Packages

Use the Julia package manager to update the Julia packages required by KPG Run. You can update all installed packages, or only specific ones such as JuMP and Gurobi:

# In Julia REPL
pkg> update
# Or update specific package
pkg> update JuMP Gurobi

Uninstallation

Remove KPG Run

Delete the KPG Run application and any result files you no longer need.

# Delete application directory
$ rm -rf "/Applications/KPG Run.app"
# Delete results (if desired)
$ rm -rf ~/path/to/results

Uninstall Julia Packages

If you no longer plan to use KPG Run, remove the related Julia packages from your current environment.

# From the Julia REPL
julia> import Pkg
julia> Pkg.rm(["JuMP", "Gurobi", "Ipopt", "KNITRO", "HiGHS", "PowerModels", "JSON", "JSON3", "CSV", "DataFrames", "MAT", "OrderedCollections", "StringEncodings"])
# Optional: remove specific package
julia> Pkg.rm(["KNITRO"])
# If Julia was installed using juliaup
$ juliaup self uninstall
# If Julia was installed via the `.dmg` file
$ rm -rf /Applications/Julia-<version>.app
# Optional: Remove user packages/environments (Julia depot)
$ rm -rf ~/.julia

Remove Gurobi

To fully uninstall Gurobi, remove the application files, license file, and any PATH entries you added during installation.

# Remove application
# For version 13.0.0, replace <version> with 1300
$ sudo rm -rf /Library/gurobi<version>
# Remove license (home directory)
$ rm ~/gurobi.lic
# Remove any Gurobi-related PATH entries from ~/.zshrc

Next Steps

Getting Help

Report Issues

If problems persist:

  1. Collect error messages
  2. Note KPG Run/Julia/Solvers versions
  3. Check GitHub issues or contact support

Additional Resources

For more information on the tools and libraries used by KPG Run, refer to the following resources: