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 | shAt the following prompt, select the appropriate option:
# PromptsDo you want to install with these default configuration choices?
# Options> Proceed with installation> Customize installation> Cancel installationTo verify that Julia is installed, open Terminal and run the following command:
# Open Terminal and type below$ juliaStep 2: Install Julia Packages
Launch Julia REPL
Run julia in your Terminal.
$ juliaInstall 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 packagespkg> add JuMPpkg> add Gurobipkg> add Ipoptpkg> add PowerModelspkg> add JSONpkg> add CSVpkg> add DataFramespkg> add MATpkg> 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 installationsjulia> 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 firstpkg> registry update
# Or update all packagespkg> update
# If specific package fails, try:pkg> add PackageName@latestStep 3: Install Gurobi Solver
Get Academic License
Note: You must be eligible for an academic license as defined by Gurobi.
- Register at gurobi.com/academia
- Verify your academic email
- Navigate to User Portal > Licenses > Request
- Request free academic license that matches your situation
- Generate license key
- Install the Gurobi license by following the instructions provided during license creation
# Copy and paste the following command to a prompt$ grbgetkey license-keySelect 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)?.
# PromptsIn which directory would you like to store the Gurobi license file?[hit Enter to store it in <home directory>]:Install Gurobi
- Visit Gurobi Download Center
- Download the installer that matches your system (Windows, macOS, or Linux).
- Run the installer
- If the installer prompts you to install Rosetta, allow the installation to proceed.
- Test your license by running
gurobi_clin Terminal. If the license file is not configured correctly, this command will reporterror 10009. Troubleshooting: If you getError 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 keyStep 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)x²
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)
- Download the installer
KPG Run_<version>.dmgfile from the KPG Run release page. - Open the installer and drag KPG Run.app into your Applications folder.
Download KPG193 Data
- Download KPG193
.zipfile from project website - Extract the file into your
Test System Folder
For more detailed information, refer to KPG Test System Documentation.
Step 6: First Launch
Verify Functionality
- Open KPG Run
- Select DC-OPF solver
- Specify Test System Folder (e.g.
KPG193_ver1_5) - Set Day 200
- 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 foundIndicates 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 REPLpkg> add JuMP Gurobi Ipopt PowerModelsIssue 2: Gurobi License Error
ERROR: Gurobi Error 10009: Failed to obtain a valid licenseOccurs 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 --licenseIssue 3: Permission Denied
Permission denied: /Applications/Julia-<version>.appIndicates 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>.appPlatform-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 REPLpkg> update
# Or update specific packagepkg> update JuMP GurobiUninstallation
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/resultsRemove 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 REPLpkg> 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 uninstallRemove 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 ~/.zshrcNext Steps
- Start using: Getting Started Guide →
- Learn interface: User Interface Guide →
- Understand models: Formulations →
- See examples: Complete Workflows →
Getting Help
Report Issues
If problems persist:
- Collect error messages
- Note KPG Run/Julia/Solvers versions
- 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:
- Julia Documentation: docs.julialang.org
- JuMP Documentation: jump.dev
- Gurobi Support: support.gurobi.com