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

Does not compile on python>=3.12 #52

Open
DaveOri opened this issue Jul 23, 2024 · 3 comments
Open

Does not compile on python>=3.12 #52

DaveOri opened this issue Jul 23, 2024 · 3 comments

Comments

@DaveOri
Copy link
Collaborator

DaveOri commented Jul 23, 2024

The problem is that distutils has been removed from python3.12 and also numpy
scipy and numpy and others have moved to meson as a build system
f2py (which comes with numpy) now calls meson and meson appears to be less permissive than our standard Makefile setup

Need to decide if we want to keep the Makefile and fix, or switch entirely to meson and perhaps have pamtra packaged (the second is actually preferred)

@maahn
Copy link
Collaborator

maahn commented Aug 15, 2024

An alternative could be https://scikit-build-core.readthedocs.io/en/latest/ or https://scikit-build.readthedocs.io/en/latest/ Both would support Fortran https://github.com/scikit-build/scikit-build-sample-projects/tree/main/projects/pi-fortran https://scikit-build-core.readthedocs.io/en/latest/getting_started.html but I guess we need someone familiar with Cmake to takle this... But I think packaging Pamtra for Conda would be fantastic!

@DaveOri
Copy link
Collaborator Author

DaveOri commented Aug 19, 2024

There is a compiling-not-functioning branch mesonpy now.
It installs like a charm with pip install . but at runtime it does not map python data to fortran (i.e. the pam.p values are ok, but runPamtra() throws assertation errors because Hgt is uninitialized).

Not sure what is causing this. Might be also compiler/f2py version dependent (new GCC is much less permissive with old-style fortran). There are a lot of suspicious warnings at compile time to be investigated. Also, it does not make use of .f2py_cmap and incorrect typing is likely.

However:
During my warm-up with meson-python I made some progress on different (simpler) projects that might be useful:

  • pytmatrix fork called mesonpytmatrix works great https://github.com/DaveOri/pytmatrix
  • py_usStandard works perfectly, it is packaged already and can even be installed with pip from testpypi
    pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ usStandard==2.1.4
    but I am not sure for how long testpypi keeps packages online

so, there is hope.
If anyone wants to join or take the cmake path as suggested by Max ... the party is open

@DaveOri
Copy link
Collaborator Author

DaveOri commented Oct 30, 2024

Hey friends, with 6d286d1 it works!!!!

  • One can already install it by just downloading the package in the mesonpy branch and running pip install .
  • I need to upload and test things on testpy and if there is no issue I can also upload everything on pypi, so one can just pip install pyPamtra !!!
  • It only requires an additional meson.build file and a pyproject.toml, , no changes to the source, so the old Makefile can stay there until fully deprecated. It also can already be merged to master without risks of conflicts.
  • It is a question what to do with pyusstandard, at the moment it is a dependency and needs to be installed as a separate package (already no need to git clone --recursive which accounts for 99% of install issues in my mailbox), but it can even be streamlined more by making it part of the pamtra suite, I guess @maahn might have an opinion on that
  • It might be a good idea to revisit the documentation before publishing

cheers
Davide

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

No branches or pull requests

2 participants