Skip to content

Comments

Improve cross-platform development setup (solver path handling + dependency conflict)#11

Open
parthdagia05 wants to merge 1 commit intoOSeMOSYS:masterfrom
parthdagia05:fix/cross-platform-dev-setup
Open

Improve cross-platform development setup (solver path handling + dependency conflict)#11
parthdagia05 wants to merge 1 commit intoOSeMOSYS:masterfrom
parthdagia05:fix/cross-platform-dev-setup

Conversation

@parthdagia05
Copy link

Closes #10

Improve Cross-Platform Development Setup (macOS/Linux)

Overview

This PR addresses two issues encountered while attempting to run MUIO from source on macOS (Apple Silicon):

  1. Hard-coded solver paths for non-Windows systems prevented standard macOS/Linux installations from working.
  2. An incompatible dependency pin in requirements.txt prevented clean installation in a fresh virtual environment.

Together, these issues block cross-platform development workflows. This PR resolves both while preserving existing Windows behavior.


1. Cross-Platform Solver Path Resolution

Problem

OsemosysClass.py previously defined solver directories using OS-specific hard-coded paths for non-Windows systems (e.g., glpk-4.65/w64, Cbc-2.10-osx10.15-x86_64-gcc9/bin).

These paths:

  • Do not match standard macOS/Linux installations
  • Are not compatible with Apple Silicon
  • Assume bundled solver binaries that are not present in the repository
  • Prevent running the application from source without manual modification

Solution

Solver path resolution has been centralized in Config.py with the following priority:

  1. Environment variable override:
    • MUIO_GLPK_PATH
    • MUIO_CBC_PATH
  2. Windows default (existing behavior preserved)
  3. PATH-based discovery for macOS/Linux using:
shutil.which("glpsol")
shutil.which("cbc")

- Centralize solver path resolution in Config.py
- Add PATH-based discovery for GLPK and CBC on macOS/Linux
- Preserve existing Windows behavior
- Add environment variable overrides (MUIO_GLPK_PATH, MUIO_CBC_PATH)
- Fix urllib3 version conflict in requirements.txt (compatible with botocore)

This enables running MUIO from source on macOS/Linux and resolves
dependency installation failure in a clean virtual environment.

Refs OSeMOSYS#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve cross-platform development setup (solver path handling + dependency conflict)

1 participant