igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] [python?] unusual igraph installation; help?


From: Tamás Nepusz
Subject: Re: [igraph] [python?] unusual igraph installation; help?
Date: Sun, 10 Nov 2013 12:07:11 +0100

Further to my email below: I have now added a —static switch to interfaces/python/setup.py that will try to find an equivalent static library for each shared library that igraph wishes to link to and use the static library when possible. It is not foolproof yet but it works fine for me on Mac OS X - please try it and let me know whether it needs further improvement. By default, it will look for static library files in the library path detected by setup.py.

The corresponding commit is here; theoretically, you should be able to apply this patch to your own setup.py even if it comes from the 0.6 branch:

https://github.com/igraph/igraph/commit/8cf967d85e9858d194c5afc333fa724d6fdbe8d2

-- 
T.

On Saturday, 9 November 2013 at 20:12, Tamás Nepusz wrote:

The other way would be to just merge the results of the compilations,
I would defnitely try this first if I were you.
 
If this really works, then it seems to be the simpler way. E.g. these
are the .a files I have on my machines, after compilation:

~/works/igraph/github/src (develop)$ ls .libs/*.a
.libs/libarpack.a .libs/libf2c.a .libs/liblapack.a
.libs/libblas.a .libs/libglpk.a .libs/libplfit.a
.libs/libdlamch.a .libs/libigraph.a

You need to merge these with the .a from the Python interface.
The only problem is that no .a file is produced during the compilation of the Python interface. (I believe that Python compiles the .so file straight away, without creating an archive first). However, you can ask Python to link an arbitrary static library (i.e. .a file) into the extension being built if you tweak setup.py a bit. Take a look at the setup.py file and you will find a line like this:

igraph_extension =  Extension(‘igraph._igraph’, sources, \
    library_dirs=library_dirs, libraries=libraries,
    include_dirs=include_dirs)

I think that removing “libraries=libraries” and adding “extra_objects=[…]” should work, assuming that the list passed to extra_objects is the list of .a files that are being built during the compilation of igraph.

— 
T.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]