Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44182 > unrolled thread

distutils and libraries

Started byNick Gnedin <ngnedin@gmail.com>
First post2013-04-23 09:29 -0500
Last post2013-04-23 09:29 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  distutils and libraries Nick Gnedin <ngnedin@gmail.com> - 2013-04-23 09:29 -0500

#44182 — distutils and libraries

FromNick Gnedin <ngnedin@gmail.com>
Date2013-04-23 09:29 -0500
Subjectdistutils and libraries
Message-ID<mailman.974.1366727411.3114.python-list@python.org>
Folks,

I would like to install a Python module from a complete library. So, my 
question: if I already have a fully build Python module libMyModule.so, 
is there a way to use setup.py to just install it, skipping the build step?

Here are details if needed:

My build process consists of 2 steps - first, I build a static library 
libtemp.a (using CMake) that depends on 3rd party software. From that 
library I build a python module by compiling the file my_py.cpp that 
contains PyInit_MyModule function etc for proper module initialization.

I can build that module in two ways: by using CMake or distutils. CMake 
builds the module properly, finding all dependencies, and when I install 
it manually, everything works just fine - but then the problem is that 
it has to be installed manually. With distutils, when I use

module1 = Extension('ifrit',
                     libraries = ['temp'],
                     library_dirs = ['.'],
                     sources = ['my_py.cpp'])

the module is build and installed, but when I import it, it does not 
find the 3rd party libraries and complain about undefined symbols.

Adding all 3rd party library paths to setup.py is not an option - those 
can be installed by a user anywhere. So, ideally, I would like to do 
something like that

module1 = Extension('ifrit',
                     libraries = ['MyModule'],
                     sources = [])

where libMyModule.so is a complete Python module build by CMake, but 
that does not work because setup.py still tries to build the module from 
an already existing complete module, and just creates an empty library.

So, my question again: if I already have a fully build Python module 
libMyModule.so, is there a way to use setup.py to just install it, 
skipping the build step?

Many thanks for any help,

Nick Gnedin



[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web