Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FindPython settings for ESMX #306

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

danrosen25
Copy link
Member

Fixes #305
Find the most generic Python interpreter in standard paths

  • skip frameworks
  • use unversioned Python interpreter names

* Find the most generic Python interpreter in standard paths
@danrosen25 danrosen25 self-assigned this Oct 12, 2024
@danrosen25
Copy link
Member Author

@uturuncoglu @oehmke
I think these changes will lead the ESMX build infrastructure to prioritize the version of python interpreter typically called by users. The default for FindPython.cmake seems to prioritize a framework.

Copy link
Contributor

@oehmke oehmke left a comment

Choose a reason for hiding this comment

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

I haven't done a lot of CMake, so it's hard for me to tell exactly what this will do. However, if you think that this'll be more likely to grab the user's version/the default version, then it sounds good to me. Once we get it merged we can have Gabor try the next snapshot. Thanks for doing this so quickly!

@uturuncoglu
Copy link
Contributor

@danrosen25 since this is draft. I did not check carefully. I wonder if we could those changes optional. Is it possible to introduce a an option when we are calling ESMX build. So, user might have flexibility to chose the desired way. We could also make the existing default doe it would be backward compatible.

@danrosen25
Copy link
Member Author

@danrosen25 since this is draft. I did not check carefully. I wonder if we could those changes optional. Is it possible to introduce a an option when we are calling ESMX build. So, user might have flexibility to chose the desired way. We could also make the existing default doe it would be backward compatible.

@uturuncoglu - Not organically. The build needs to find Python (with pyyaml) before processing the build options. There's a way to use CMake variables to control ESMX build options. I added an option for --cmake-args="-DFOO=BAR" to the ESMX_Builder script. This allows users to pass something like --cmake-args="-DPython_EXECUTABLE=/opt/homebrew/bin/python3.11". I left the default to find the un-versioned/non-framework Python version. Let me know if you like this better?

@oehmke
Copy link
Contributor

oehmke commented Oct 14, 2024 via email

@uturuncoglu
Copy link
Contributor

@danrosen25 Yes. That is great. Thanks. BTW, user will have flexibility.

@uturuncoglu
Copy link
Contributor

@oehmke I wonder if we need to test this version of ESMF in Gabor case once it is in develop to see how it goes.

@oehmke
Copy link
Contributor

oehmke commented Oct 14, 2024 via email

@uturuncoglu
Copy link
Contributor

@oehmke I think he also success since he sand a mail indicates that after installing pyyaml into python 3.9 (which is not the default python version on his machine), he could able to compile the code.

@danrosen25
Copy link
Member Author

@uturuncoglu @oehmke
I'm going to wait until Wednesday to merge this since we haven't discussed it on a core call. Also, in case you're curious here's the block of code provided by CMake that will find Python. The changes in this PR will skip over the FIND_FRAMEWORK and FIND_REGISTRY, which have special paths. It then finds Python around line 1998, which doesn't use NO_SYSTEM_ENVIRONMENT_PATH
https://github.com/Kitware/CMake/blob/8c622959e9716e1abf7dde9c18e77fedaf1f2b1b/Modules/FindPython/Support.cmake#L1930

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.

Python yaml module in ESMX build
3 participants