Re: [Numpy-discussion] Problems using add_npy_pkg_config
On Fri, Aug 14, 2015 at 11:25 PM, Christian Engwer christian.eng...@uni-muenster.de wrote: Dear Ralf, I stared at it for a while, and can't figure it out despite you following the example in the add_npy_pkg_config docstring pretty much to the letter. When you see that the error is generated in a function that starts with ``# XXX: another ugly workaround to circumvent distutils brain damage.``, you're usually in trouble. what a pity... do you have an alternative suggestion? Is there a good alternative, e.g. using cmake, to distribute python modules? I wouldn't give up on distutils here (yet). For distributing/installing python packages, PyPi + pip are the de-facto standard and pip is currently tied to distutils/setuptools unfortunately. That I can't figure out your issue in 20 minutes doesn't mean it's not fixable, it just means that I'm not smart enough to keep the distutils design in my head:) The code you're trying to use isn't well tested because while a lot of packages use numpy.distutils with compiled code, very few Python packages expose a C API. For example Scipy doesn't use `add_npy_pkg_config` or `add_installed_library` at all. Those functions work for numpy itself though, so they can't be completely broken. If no one has an answer here, what I would do if I were you is break out your debugger and figure out what's in `pkg` when you build numpy itself and why it's None when you build your own code. Ralf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Problems using add_npy_pkg_config
On Sat, Aug 15, 2015 at 11:19 AM, Ralf Gommers ralf.gomm...@gmail.com wrote: On Fri, Aug 14, 2015 at 11:25 PM, Christian Engwer christian.eng...@uni-muenster.de wrote: Dear Ralf, I stared at it for a while, and can't figure it out despite you following the example in the add_npy_pkg_config docstring pretty much to the letter. When you see that the error is generated in a function that starts with ``# XXX: another ugly workaround to circumvent distutils brain damage.``, you're usually in trouble. what a pity... do you have an alternative suggestion? Is there a good alternative, e.g. using cmake, to distribute python modules? I wouldn't give up on distutils here (yet). For distributing/installing python packages, PyPi + pip are the de-facto standard and pip is currently tied to distutils/setuptools unfortunately. Correction: the above is only completely true if you rely on source builds. You can't avoid those with PyPi on Linux, but if you only need to support Windows and OS X nowadays you can get away with no disutils if you upload only binary wheels for those OSes to PyPi. Regarding alternatives, this discussion is a bit older but mostly still relevant: http://article.gmane.org/gmane.comp.python.numeric.general/27788 Ralf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Problems using add_npy_pkg_config
Dear Ralf, I stared at it for a while, and can't figure it out despite you following the example in the add_npy_pkg_config docstring pretty much to the letter. When you see that the error is generated in a function that starts with ``# XXX: another ugly workaround to circumvent distutils brain damage.``, you're usually in trouble. what a pity... do you have an alternative suggestion? Is there a good alternative, e.g. using cmake, to distribute python modules? Ciao Christian ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Problems using add_npy_pkg_config
This doesn't answer your question but: why? If you're not distributing a Python project, there is no reason to use distutils instead of a sane build system. Come on. We don't take it seriously, and neither do the Python core devs. It's also pretty much completely unsupported. Numpy.distutils is a bit better in that respect than Python distutils, which doesn't even get sane patches merged. Try Scons, Tup, Gradle, Shake, Waf or anything else that's at least somewhat modern and supported. Do not use numpy.distutils unless there's no other mature choice (i.e. you're developing a Python project). Sorry, reading my mail again, it seems that I didn't make this point clear. I have a project which is python + c-lib. The later which should be used by other c-projects as well. The minimal working example is without any python code, as I only have problems with the pkg config file. ... and concerning cmake, yes we tried this as well, but using cmake to distribute the python code is also a pita ;-) ... Christian ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Problems using add_npy_pkg_config
On Thu, Aug 13, 2015 at 8:45 PM, Christian Engwer christian.eng...@uni-muenster.de wrote: This doesn't answer your question but: why? If you're not distributing a Python project, there is no reason to use distutils instead of a sane build system. Come on. We don't take it seriously, and neither do the Python core devs. It's also pretty much completely unsupported. Numpy.distutils is a bit better in that respect than Python distutils, which doesn't even get sane patches merged. Try Scons, Tup, Gradle, Shake, Waf or anything else that's at least somewhat modern and supported. Do not use numpy.distutils unless there's no other mature choice (i.e. you're developing a Python project). Sorry, reading my mail again, it seems that I didn't make this point clear. I have a project which is python + c-lib. The later which should be used by other c-projects as well. Thanks for clarifying. It makes more sense now:) The minimal working example is without any python code, as I only have problems with the pkg config file. I stared at it for a while, and can't figure it out despite you following the example in the add_npy_pkg_config docstring pretty much to the letter. When you see that the error is generated in a function that starts with ``# XXX: another ugly workaround to circumvent distutils brain damage.``, you're usually in trouble. Ralf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Problems using add_npy_pkg_config
I used to use scons, but I've been pretty happy with switching to waf. (Very limited use in both cases: two relatively simple packages.) One of the nicest things is how light it is--no external dependencies, everything can be included in the package itself. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Problems using add_npy_pkg_config
Dear all, I'm trying to use the numpy distutils to install native C libraries. These are part of a larger roject and should be usable standalone. I managed to install headers and libs, but now I experience problems writing the corresponding pkg file. I first tried to do the trick without numpy, but getting all the pathes right in all different setups is really a mess. Please a find a m.w.e. attached to this mail. It consists of foo.c foo.ini.in and setup.py. I'm sure I missed some important part, but somehow the distribution variable in build_src seems to be uniinitalized. Calling python setup.py install --prefix=/tmp/foo.inst fils with ... File /usr/lib/python2.7/dist-packages/numpy/distutils/command/build_src.py, line 257, in build_npy_pkg_config pkg_path = self.distribution.package_dir[pkg] TypeError: 'NoneType' object has no attribute '__getitem__' I also tried to adopt parts of the numpy setup, but these use sub-modules, which I don't need... might this the the cause of my problems? Any help is highly appreciated ;-) Cheers Christian int foo() { return 10; } [meta] Name=@foo@ Version=1.0 Description=dummy description [default] Cflags=-I@prefix@/include Libs= def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('foo',parent_package,top_path) config.set_options(ignore_setup_xxx_py=True, assume_default_configuration=True) config.add_installed_library('foo', sources=['foo.c'], install_dir='lib') config.add_npy_pkg_config('foo.ini.in', 'lib', {'foo': 'bar'}) return config if __name__ == '__main__': from numpy.distutils.core import setup setup (configuration=configuration) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Problems using add_npy_pkg_config
On Wed, Aug 12, 2015 at 6:23 PM, Christian Engwer christian.eng...@uni-muenster.de wrote: Dear all, I'm trying to use the numpy distutils to install native C libraries. These are part of a larger roject and should be usable standalone. I managed to install headers and libs, but now I experience problems writing the corresponding pkg file. I first tried to do the trick without numpy, but getting all the pathes right in all different setups is really a mess. This doesn't answer your question but: why? If you're not distributing a Python project, there is no reason to use distutils instead of a sane build system. Ralf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Problems using add_npy_pkg_config
On Wed, Aug 12, 2015 at 10:50 AM, Ralf Gommers ralf.gomm...@gmail.com wrote: On Wed, Aug 12, 2015 at 6:23 PM, Christian Engwer christian.eng...@uni-muenster.de wrote: Dear all, I'm trying to use the numpy distutils to install native C libraries. These are part of a larger roject and should be usable standalone. I managed to install headers and libs, but now I experience problems writing the corresponding pkg file. I first tried to do the trick without numpy, but getting all the pathes right in all different setups is really a mess. This doesn't answer your question but: why? If you're not distributing a Python project, there is no reason to use distutils instead of a sane build system. Believe it or not, distutils *is* one of the saner build systems when you want something cross platform. Sad, isn't it... Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Problems using add_npy_pkg_config
On Wed, Aug 12, 2015 at 7:23 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 12, 2015 at 10:50 AM, Ralf Gommers ralf.gomm...@gmail.com wrote: On Wed, Aug 12, 2015 at 6:23 PM, Christian Engwer christian.eng...@uni-muenster.de wrote: Dear all, I'm trying to use the numpy distutils to install native C libraries. These are part of a larger roject and should be usable standalone. I managed to install headers and libs, but now I experience problems writing the corresponding pkg file. I first tried to do the trick without numpy, but getting all the pathes right in all different setups is really a mess. This doesn't answer your question but: why? If you're not distributing a Python project, there is no reason to use distutils instead of a sane build system. Believe it or not, distutils *is* one of the saner build systems when you want something cross platform. Sad, isn't it... Come on. We don't take it seriously, and neither do the Python core devs. It's also pretty much completely unsupported. Numpy.distutils is a bit better in that respect than Python distutils, which doesn't even get sane patches merged. Try Scons, Tup, Gradle, Shake, Waf or anything else that's at least somewhat modern and supported. Do not use numpy.distutils unless there's no other mature choice (i.e. you're developing a Python project). Ralf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Problems using add_npy_pkg_config
Why don't you use CMake ? It's pretty standard for C/C++. On Wed, Aug 12, 2015 at 2:35 PM, Ralf Gommers ralf.gomm...@gmail.com wrote: On Wed, Aug 12, 2015 at 7:23 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Aug 12, 2015 at 10:50 AM, Ralf Gommers ralf.gomm...@gmail.com wrote: On Wed, Aug 12, 2015 at 6:23 PM, Christian Engwer christian.eng...@uni-muenster.de wrote: Dear all, I'm trying to use the numpy distutils to install native C libraries. These are part of a larger roject and should be usable standalone. I managed to install headers and libs, but now I experience problems writing the corresponding pkg file. I first tried to do the trick without numpy, but getting all the pathes right in all different setups is really a mess. This doesn't answer your question but: why? If you're not distributing a Python project, there is no reason to use distutils instead of a sane build system. Believe it or not, distutils *is* one of the saner build systems when you want something cross platform. Sad, isn't it... Come on. We don't take it seriously, and neither do the Python core devs. It's also pretty much completely unsupported. Numpy.distutils is a bit better in that respect than Python distutils, which doesn't even get sane patches merged. Try Scons, Tup, Gradle, Shake, Waf or anything else that's at least somewhat modern and supported. Do not use numpy.distutils unless there's no other mature choice (i.e. you're developing a Python project). Ralf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion