Skip to content

ENH: Allow NPY_PKG_CONFIG_PATH environment variable override - #14495

Merged
rgommers merged 1 commit into
numpy:masterfrom
esben:env-npy-pkg-config-path
Sep 13, 2019
Merged

rgommers merged 1 commit into
numpy:masterfrom
esben:env-npy-pkg-config-path

Conversation

@esben

@esben esben commented Sep 12, 2019

Copy link
Copy Markdown
Contributor

Allow overriding npy-pkg-config directory using the NPY_PKG_CONFIG_PATH
environment variable, making it easier to use numpy in cross-compilation
setups.

With this in place, you can arrange for cross-compilation npy-pkg-config files in an alternative
location, and use that instead of the host versions when cross compiling.

@charris

charris commented Sep 12, 2019

Copy link
Copy Markdown
Member

This needs to be documented somewhere, maybe ./doc/source/reference/distutils.rst. I'm not familiar with this problem, but there are also functions like add_npy_pkg_config that might be relevant, have you investigated them?

@rgommers

Copy link
Copy Markdown
Member

I think tests aren't required for this, but docstring updates would indeed be nice, plus perhaps a mention in a separate place in the distutils guide.

I'd suggest a note in the get_npy_pkg_dir docstring, as well as in https://numpy.org/devdocs/reference/distutils.html#numpy.distutils.misc_util.Configuration.add_npy_pkg_config. The Notes section of the latter talks about standard and in-place builds. Cross-compilation can be mentioned there.

@rgommers

Copy link
Copy Markdown
Member

Other than that, change LGTM.

@esben
esben force-pushed the env-npy-pkg-config-path branch from c99407b to d2b1e04 Compare September 13, 2019 07:03
@esben

esben commented Sep 13, 2019

Copy link
Copy Markdown
Contributor Author

I don't see how I can meaninfully add something to ./doc/source/reference/distutils.rst about this.
I have added to docstrings for both add_npy_pkg_config() and get_npy_pkg_dir(). I do think that the addition to add_npy_pkg_config() docstring is a bit out of place, but if you like it there, it is fine with me.

I don't have any desire to or idea for how to add support for NPY_PKG_CONFIG_PATH to add_npy_pkg_config().

Allow overriding npy-pkg-config directory using the NPY_PKG_CONFIG_PATH
environment variable, making it easier to use numpy in cross-compilation
setups.
@esben
esben force-pushed the env-npy-pkg-config-path branch from d2b1e04 to 153fc14 Compare September 13, 2019 07:59
@rgommers
rgommers merged commit 09d5473 into numpy:master Sep 13, 2019
@rgommers

Copy link
Copy Markdown
Member

don't see how I can meaninfully add something to ./doc/source/reference/distutils.rst about this.

Agreed. Would be nice to have something there about cross-compiling in general, and then this envvar would fall under that. But given that we don't have it, there's no good place to add anything to in that guide. What you added in the docstring is already quite nice.

I have added to docstrings for both add_npy_pkg_config() and get_npy_pkg_dir(). I do think that the addition to add_npy_pkg_config() docstring is a bit out of place, but if you like it there, it is fine with me.

It's nice content to have, and it can be found when people search the package for "cross compiling". So let's worry about the rest whenever someone writes up a longer story about cross-compiling.

I don't have any desire to or idea for how to add support for NPY_PKG_CONFIG_PATH to add_npy_pkg_config().

agreed. that's not what I meant.

Merged, thanks @esben!

@rgommers rgommers added this to the 1.18.0 release milestone Sep 13, 2019
@esben
esben deleted the env-npy-pkg-config-path branch September 16, 2019 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants