-
Notifications
You must be signed in to change notification settings - Fork 193
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
Questions related to Meson+Pythran #2170
Comments
Happy new year @paugier!
Sure, happy to submit a PR after we finish discussing in this issue.
+1. I'm not sure if it's possible to tell Pythran to not look at
For compiler selection the standard
I have no knowledge of what cmd = [pythran, '-E', '@INPUT@', '-o', '@OUTDIR@/_rbfinterp_pythran.cpp']
if host_machine().system() == 'linux'
cmd += ['--config pythran.complex_hook=pythran_complex_hook']
endif
_rbfinterp_pythran = custom_target('_rbfinterp_pythran',
output: ['_rbfinterp_pythran.cpp'],
input: '_rbfinterp_pythran.py',
command: cmd,
)
_rbfinterp_pythran = py.extension_module('_rbfinterp_pythran',
_rbfinterp_pythran,
cpp_args: cpp_args_pythran,
dependencies: [pythran_dep, np_dep],
install: true,
subdir: 'scipy/interpolate'
)
I need to double-check this in SciPy, will circle back. Pythran is certainly looking for To add the flag, it looks like you can simply add |
This should help reproducible builds. Related to #2170
This should help reproducible builds. Related to #2170
Thanks for your answers @rgommers. Regarding For Fluidsim, I now use:
and (in the main
I wouldn't be against some helpers given by meson-python to simplify this, but I don't know if it would be possible (one can't define functions or macros in Meson). I defined the option
Is there a better way to do that with Meson and meson-python ? |
This should help reproducible builds. Related to #2170
This should help reproducible builds. Related to #2170
This should help reproducible builds. Related to #2170
This should help reproducible builds. Related to #2170
This should help reproducible builds. Related to #2170
With #2171, one can ignore
A good point is that it can already be done (with no effect for pythran<=0.15.0). |
Ah right - I think that's the difference between using
This unvendoring was reverted ~8 months ag, as it was not a good idea: conda-forge/pythran-feedstock#76
The two "build modes" make perfect sense, but I'm not sure that it needs a package-defined build option. You can simply put
For dependency detection I have the same clumsiness with |
I'll note that this is done in numpy/numpy#25730 and mesonbuild/meson#12799, it should be available in Meson 1.4.0 / NumPy 2.0.0. Once that's in use without hiccups, it'd be nice to do the same for Pythran. Or do it now, since it's fairly safe (it's more or less a copy of what already worked for |
I'm a bit late to the party :-)
It's been improving recently (in addition to what @rgommers already wrote)
This part seems fixed:
I agree that for reproducibility, it's better to either force no pythranrc, or use a local one, shipped with the package.
That's now in the doc ;-)
I think it's fine to have different values for different environment there.
Passing the option through a local pythranrc (or custom pythran flags through |
Happy new year Serge and @rgommers !
I'm trying to build my packages using Pythran through Transonic with Meson. I tried to follow https://pythran.readthedocs.io/en/latest/MANUAL.html#integration-into-a-python-package and what is done in Scipy. Overall we now have a working solution (described in particular in these documents: Packaging when using Transonic and Build Fluidsim), however, I'm still unsure about what should be done for few questions related to Pythran.
Warning for @rgommers: beware if you look at the ugly things we do in meson.build files with Transonic. Python source directories with their
meson.build
files are generated from othermeson.build
files. I realize that it does not follow the Meson philosophy but it works and it's convenient. Anyway, this issue is not about that.Pythran's documentation is quite minimalist about Meson and it might be useful to add few notes.
~/.pythranrc
With Meson, Pythran is used only to produce C++ code. Hence, many of the options in the .pythranrc files are not used. Anyway, it seems reasonable that a build of a package would be reproducible and not depend at all on a ~/.pythranrc file. I don't know if it is possible to tell Pythran to not consider ~/.pythranrc. I tried with
PYTHRANRC="" pythran ...
but it seems that pythran is happy with this and continues to consider ~/.pythranrc.[compiler]
sectionIt would be nice to have a short note (or just a link) explaining how to do with meson-python what is usually done with the
[compiler]
section of Pythran configuration files. What is recommended? Just environment variables?complex_hook
The only Pythran option that I really use affecting C++ code generation is
complex_hook
. So with Meson, we call Pythran with--config pythran.complex_hook=pythran_complex_hook
and we have a Meson optionpythran-complex-hook
.In https://pythran.readthedocs.io/en/latest/MANUAL.html#customizing-your-pythranrc there is
I don't know if it means that it could be reasonable to build wheels uploaded on PyPI to set pythran-complex-hook to true on Linux and false elsewhere? Also I don't know what would be the best way to do that with meson-python...
USE_XSIMD
and-Ofast -march=native
It seems to me that Scipy build does not use
USE_XSIMD
. I wonder if it is because it would not be portable enough? However, for my case, I'd like to be able when installing from source to use this flag and also-Ofast -march=native
. Moreover, it is not clear to me how this should be done with Meson-python.The text was updated successfully, but these errors were encountered: