-
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
Improving pythran-config so SciPy et al can use it #2257
Comments
Hey Ralf,
and eventually Maybe the output of
What about I think we at least need:
It would be good to be able to pass extra configuration parameters like In a similar manner to Any thoughts? |
Yes indeed:) That said,
And $ numpy-config --help
usage: numpy-config [-h] [--version] [--cflags] [--pkgconfigdir]
options:
-h, --help show this help message and exit
--version Print the version and exit.
--cflags Compile flag needed when using the NumPy headers.
--pkgconfigdir Print the pkgconfig directory in which `numpy.pc` is stored (useful for
setting $PKG_CONFIG_PATH). $ pybind11-config --help
usage: pybind11-config [-h] [--version] [--includes] [--cmakedir] [--pkgconfigdir]
options:
-h, --help show this help message and exit
--version Print the version and exit.
--includes Include flags for both pybind11 and Python headers.
--cmakedir Print the CMake module directory, ideal for setting -Dpybind11_ROOT in CMake.
--pkgconfigdir Print the pkgconfig directory, ideal for setting $PKG_CONFIG_PATH.
One question: since Pythran is C++ only, is Other than that, I think I agree. Although I wouldn't use The key point for
That sounds like a good idea to me. As does the Slightly related: can |
technically, only I don't see |
I don't think so. That will turn into a giant mess (as is You want to be setting the flags that are essential for Pythran itself only. No general-purpose flags.
There are no
|
You want to be setting the flags that are essential for Pythran itself only. No
general-purpose flags.
ack
I don't see --libs outputing the linker path (-L) but let's follow common
usage there.
There are no -L flags to add. These should be on the linker search path
already. This is one that python3-config does seem to get right, this looks
reasonable:
$ python3-config --libs
-lpthread -ldl -lutil -lm
-L isn't needed, and if it were then there's no way for pythran-config to know
what the paths should be.
so it should provide location of libpython?
|
No, I think at most it should return I'm honestly not even sure if Footnotes
|
Hey @serge-sans-paille, I am looking at streamlining the SciPy build, and would like to start using
pythran-config
. To get that to work, I need a cleaner output frompythran-config --cflags
though. What it looks like now for me:$ pythran-config --cflags -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_BLAS -I/home/rgommers/code/tmp/pythran/pythran -I/home/rgommers/mambaforge/envs/scipy-dev-py312/lib/python3.12/site-packages/numpy/_core/include -I/home/rgommers/mambaforge/envs/scipy-dev-py312/lib/python3.12/site-packages/numpy/_core/include -I/home/rgommers/mambaforge/envs/scipy-dev-py312/include/python3.12 # or $ pythran-config --cflags --no-python -D__PYTHRAN__=3 -DPYTHRAN_BLAS_BLAS -I/home/rgommers/code/tmp/pythran/pythran
The first flavor is way too much; the second is better but requires:
-DENABLE_PYTHON_MODULE
to still be there (this is pythran-specific, while the Python include paths are not)-DPYTHRAN_BLAS_BLAS
to turn into-DPYTHRAN_BLAS_NONE
Also, it should work without
setuptools
.I'm happy to make the changes needed, but there's a decent amount of design freedom here so I thought it's better to open an issue to discuss first. Options I can think of:
--cflags-pythran-only
flag combined with a--[no-]blas
flag--cflags-pythran-noblas
and--cflags-pythran-blas
--cflags
, e.g.--cflags --pythran-only --no-blas
(this would be a bigger refactor it looks like)The correct/desired output for SciPy as well as scikit-image looks like:
Any preferences?
The text was updated successfully, but these errors were encountered: