Re: [Numpy-discussion] Problems using add_npy_pkg_config

2015-08-14 Thread Christian Engwer
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

2015-08-13 Thread Christian Engwer
  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


[Numpy-discussion] Problems using add_npy_pkg_config

2015-08-12 Thread Christian Engwer
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