Skip to content

Added some options for compatibility with brew and uv.#79

Merged
swryan merged 4 commits into
OpenMDAO:masterfrom
robfalck:uv
May 7, 2025
Merged

Added some options for compatibility with brew and uv.#79
swryan merged 4 commits into
OpenMDAO:masterfrom
robfalck:uv

Conversation

@robfalck
Copy link
Copy Markdown
Contributor

@robfalck robfalck commented May 6, 2025

Summary

Existing values for compiler options (CC, FC, CXX) will no longer be overridden if already set by the user. This was necessary for compatibility with brew compilers on MacOS.

Added --pip-cmd option. If the user specifies --pip-cmd="uv pip", uv will be used to install the package. This is necessary for users who use uv for their environment management.

Related Issues

  • Resolves #

Backwards incompatibilities

None

New Dependencies

None

robfalck added 3 commits May 6, 2025 13:49
…ey want to use uv pip to install pyoptsparse.

Existing values for compiler options (CC, FC, CXX) will no longer be overridden if already set by the user. This
was necessary for compatibility with brew compilers on MacOS.
Copy link
Copy Markdown
Contributor

@swryan swryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should really add a job to the test matrix that builds the env with uv..
I can do that.

Comment thread build_pyoptsparse.py Outdated
os.environ['FC'] = 'ifort'
os.environ.get('CC', 'icc')
os.environ.get('CXX', 'icpc')
os.environ.get('FC', 'ifort')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean these to be something like os.environ.set('CC', os.environ.get('CC', 'icc'))?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the intent here was to not override the user's environment variables if they had set them.
On an arm Mac using homebrew, gcc will just point to the nominal mac gcc, but I need one in /opt/homebrew/bin.

I could set those environment variables, but then the script was just overriding them.

Copy link
Copy Markdown
Contributor

@swryan swryan May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but I don't see that these gets are doing anything at all...

what you are describing is what I was trying to express above.. only set a new value for the var if it is not already set (could be done better as a conditional...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brain issues...fixed :)

@swryan swryan merged commit 5e4e22a into OpenMDAO:master May 7, 2025
20 of 22 checks passed
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.

2 participants