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

Use meson-python to package GSAS-II #40

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

kif
Copy link

@kif kif commented Jul 12, 2024

Suggest a way to compile C, Fortran and Cython files for GSAS-II and install them together with Python files.

There are no C++ files --> why is there a dependency on pybind11 ?
Not all extensions have been converted.
The way the Fortran binding is currently polluting the source tree which is not very nice.
Only linux has been tested so far.

@briantoby
Copy link
Collaborator

This is very much of interest. My plan was to move to meson for py3.12, and was waiting for help from someone more experienced with meson. Could you expand on the source tree issue?

@kif
Copy link
Author

kif commented Jul 13, 2024

Well, it is not really an issue but it is not as clean as one would expect:

To compile/bind the fortran code, one needs to call f2py with the proper options which creates 2 additional files, one fortran and the other one C. Then to compile all 3 files together to build the python extension. This is currently done in the source folder, leaving 2 computer generated files in the source folder, moreover untracked in git.

The documentation of f2py (https://numpy.org/doc/stable/f2py/buildtools/meson.html) suggests to use the custom_target() meson function which generates the 2 binding files in the build directory and then the compilation of the 3 files (2 in build directory and one in the source directory) fails. I did not manage to get it working, or maybe I did not try long enough. One option would be to copy the source fortran file to the same place as the binding files and compile them together in the build directory.

@kif kif changed the title Usr meson-python to package GSAS-II Use meson-python to package GSAS-II Nov 4, 2024
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