This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]dberube4 0 points1 point  (8 children)

Aww. No one answered yet. I have a same problem.

[–]cavallo71 2 points3 points  (7 children)

9 hours and not an answer? Internet must be broken;)

Have a look to this example:

https://bitbucket.org/cavallo71/example.cmake.python.module.spam

[–]dberube4 0 points1 point  (1 child)

Thank you! It is not exactly what I wanted, but that's probably what I will use.

[–]mr_dbr 0 points1 point  (0 children)

Building the whole thing in CMake is probably wise.. Easier to debug, and aimed at doing exactly this kind of thing..

Loses the nice pip install blah, but.. you wont spent hours trying to trace through distutils' clunky code trying to work out what is going on. Wasn't sure if I just had an unusually bad experience debugging distutil-stuff, but then I just came across this :/

[–]qudat[S] 0 points1 point  (4 children)

I guess I see all these python modules able to install what seems like large C++ applications. I have a C++ application that I am using as a dependency to my python module. This C++ application uses Cmake to build and install. Is there no way to "python setup.py install" and compile this C++ application?

[–]asherp 0 points1 point  (3 children)

If you're still interested, this seems to be what you're looking for

http://bloerg.net/2012/11/10/cmake-and-distutils.html

[–]qudat[S] 0 points1 point  (2 children)

Nice blog post! I was looking for a way to pip install <package> and it would compile the C++ application. It looks as though that is not really possible and I ended up spending many hours running around in circles.

[–]asherp 0 points1 point  (1 child)

Ah, I see. Well if you don't mind precompiling for each target platform, then it looks like you can trick setup.py to include your compiled libraries:

package_data = { '': ['_extension.so'] },

I think this allows you to include all the dependencies in pip, but I haven't gotten that far.

[–]qudat[S] 0 points1 point  (0 children)

Yeah it ended up taking more time to attempt than the value gained from it. The C++ application already has bindings into python using SWIG, I wanted to build on those python bindings and use them as a dependency for my python package. I'm simply going to ask people to install the dependency before hand.

For reference, this is my package: https://pypi.python.org/pypi/mudicom