Skip to content

KNITROAMPL: use \$KNITRODIR/knitroampl/knitroampl for executable#3979

Open
yemine0x01 wants to merge 2 commits into
Pyomo:mainfrom
yemine0x01:knitroampl
Open

KNITROAMPL: use \$KNITRODIR/knitroampl/knitroampl for executable#3979
yemine0x01 wants to merge 2 commits into
Pyomo:mainfrom
yemine0x01:knitroampl

Conversation

@yemine0x01

Copy link
Copy Markdown
Contributor

Fixes # .

NA

Summary/Motivation:

Some KNITRO users install it as a standalone package (not via the Python knitro module) and rely on the KNITRODIR environment variable to locate their installation. Previously, _default_executable() only checked the knitro Python package path first, then fell back to a plain PATH search, meaning users with a KNITRODIR-based installation but no Python package would only succeed if knitroampl happened to be on their PATH.

This PR adds an explicit lookup for $KNITRODIR/knitroampl/knitroampl as the highest-priority candidate, reflecting the standard layout of a standalone KNITRO installation.

Changes proposed in this PR:

AI-Use Disclosure

  • AI tools were NOT used during the preparation of this PR

or

  • AI tools contributed to the development of this PR

    • AI tools generated documentation (including the PR description/comments, code comments, and/or Sphinx documentation)
    • AI tools generated tests (baselines, examples, and/or code)
    • AI tools generated code (apart from tests)

    Review process (select ONE):

    • Rewritten: All AI-generated content was rewritten by me before being committed.
    • Reviewed/verified: I retained AI-generated content and verified it before committing. Verification included (as applicable):
      • Ran the code and fixed issues
      • Added and ran tests
      • Checked correctness/logic of code and tests
      • Checked for alignment with the contribution guide
      • Considered security implications
    • As-is: AI-generated content was commited directly to the repository

Notes for reviewers (optional):

AI was used only for generating the commit message.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

…ookup

Add \$KNITRODIR/knitroampl/knitroampl as the first candidate in
_default_executable(), before the knitro Python package path and the
system PATH fallback. This allows users with a standalone Knitro
installation (no Python package) to be picked up automatically via the
KNITRODIR environment variable.
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.

1 participant