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

CMake: Use non-deprecated method for finding python #108

Merged
merged 2 commits into from
May 20, 2022
Merged

CMake: Use non-deprecated method for finding python #108

merged 2 commits into from
May 20, 2022

Conversation

jth
Copy link

@jth jth commented May 19, 2022

Building vectorscan did not work out of the box for me on MacOS 12.3.1 on M1 because CMake could not find the Python installed via homebrew.
After doing some digging I've found that the method currently used to find Python is deprecated (CMake Manual). I've adapted CMakeLists.txt to the method currently recommended.

Tested on Ubuntu 22.04 and macOS

@jth jth changed the title Use non-deprecated method of finding python CMake: Use non-deprecated method for finding python May 19, 2022
@markos
Copy link

markos commented May 19, 2022

Hi @jth, thank you for your PR. Unfortunately it fails on all other platforms tested on jenkins.

https://jenkins.vectorcamp.gr/blue/organizations/jenkins/VectorCamp%2Fvectorscan-ci/detail/vectorscan-ci/89/pipeline

(please click on ok at the 404 error, it's a bug in the blueocean plugin in Jenkins).

I think it's best if you would add this check under a conditional for MacOS. Strangely enough, I was able to build vectorscan fine on my M1 (12.1), however only default python (2.7.18) version installed. Perhaps a check for a brew python version should be added as well.

@jth
Copy link
Author

jth commented May 19, 2022

Hi @markos, thanks for your reply and the link to the pipeline result.

Turns out Apple removed Python 2.7. with Monterey (https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes), which explains why CMake wasn't able to find the default Python on my machine.
Another factor might be that the FindPython-feature became available with CMake 3.12 (released mid 2018), is it possible that the Jenkins instance uses an older version?

Since Python 2 is EOL since 2020, it might also be an option to convert the bundled scripts to Python3 and set the minimum CMake Version to 3.12 and require Python 3. The changes to the scripts aren't that bad, see 85a77e3

However, dropping Python 2 support might be too big of a step and leave legacy systems in the dust, so your opinion on that is certainly welcome.

@markos markos merged commit 73695e4 into VectorCamp:master May 20, 2022
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