Skip to content

Installation Guide

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

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

Download Julia

Visit julialang.org/downloads and follow the instructions.

For macOS:

Open the Terminal application 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

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 your 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 PowerModels
pkg> add JSON
pkg> add CSV
pkg> add DataFrames
pkg> add MAT
pkg> add OrderedCollections
# Optionally, install multiple packages in a single command
# pkg> add JuMP, Gurobi, Ipopt, PowerModels, JSON, CSV, DataFrames, MAT, OrderedCollections, StringEncodings
# Exit package mode (press backspace)

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

# Test installations
julia> using JuMP, Gurobi, Ipopt, PowerModels, JSON, CSV, DataFrames, MAT, OrderedCollections
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
# Or update all packages
pkg> update
# If specific package fails, try:
pkg> add PackageName@latest

Step 3: Install Gurobi Solver

Get Academic License

Note: You must be eligible for an academic license as defined by Gurobi.

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

Select the location where you want to save your license file after following prompts. It is recommende 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 <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 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: Install Ipopt

Ipopt is installed automatically with the Julia packages in Step 2, but you can verify with the minimal example:

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 KPG193 Data

  1. Download KPG193 .zip file from project website
  2. Extract the file into your Test System Folder

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

Step 6: First Launch

Verify Functionality

  1. Open KPG Run
  2. Select DC-OPF solver
  3. Specify Test System Folder (e.g. KPG193_ver1_5)
  4. Set Day 200
  5. Click Solve

If no errors occur and the run completes with an optimal status, KPG Run switches to 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 PowerModels

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 YOUR-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 bundle.

Solution: Adjust the permissions on the Julia application bundle.

# 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 run 30-50% faster than Rosetta.

Updating

Update Julia Packages

Use the Julia package manager to keep KPG Run dependencies up to date. 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 directory and any result files you no longer need.

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

Remove Julia Packages

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

# In Julia REPL
pkg> rm JuMP Gurobi Ipopt PowerModels
# Or remove entire Julia installation
$ rm -rf /path/to/Julia-<version>.app
$ rm -rf ~/.julia
# If Julia was installed using juliaup
$ juliaup self uninstall

Remove Gurobi

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

# Remove application
$ sudo rm -rf /Library/gurobi<version>
# For version 13.0.0, replace <version> with 1300
# 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: