You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be better at this point if 'python-igraph' just linked to igraph? Otherwise we are missing out on LTO (which makes a noticeable performance difference). It is insufficient to compile with LTO if linking isn't also done with it (not currently the case).
Doing this also guarantees that packages like 'leidenalg' always link to the same 'igraph' version as 'python-igraph'.
In general, it would be much more consistent with conda-forge's overall approach if were linking to igraph, rather than building it here. I would be very much in favor of switching to doing that.
I'm sure there was a reason to do so, but I can't recall what, and if it's still valid. Let's wait for a response from @vtraag.
Technically, each 'python-igraph' release is guaranteed to be compatible only with one specific 'igraph' release. This is mostly because of potential changes to experimental functions (which are in practice rare). If we do link to 'igraph', then the maintainer must be careful in managing compatible versions of the two packages, which might be an overhead that @vtraag does not want to deal with.
Another reason to use static linking is bug-for-bug consistency with the PyPI release.
I now switched to linking to C/igraph from python-igraph in MacPorts, and didn't find it to be a burden, but then I do track all changes to igraph closely.
I'll certainly defer to you and @vtraag but I'm happy to help make sure the igraph dependency in igraph-python is managed correctly if we head down that road. conda-forge has a pretty strong preference for shared libraries but I can understand that, even so, there are cases where static linking is just easier.
I do support this change. The upcoming python-igraph 0.11.6 (which will be based on C/igraph 0.10.13) would be a good opportunity to make this transition.
Yes, I have always been in favour of linking to igraph from python-igraph in conda. This has benefits overall, reducing duplication, facilitating installation, and making it indeed easier to use consistent libraries across different packages that build on igraph (indeed including python-igraph and leidenalg). In addition, it allows to easily upgrade to newer igraph versions for necessary bugfixes, even without new releases of a python-igraph interface.
Previously, you were arguing against this (and perhaps @ntamas as well, I don't recall exactly) because it would invite problems with potentially incompatible versions. Given the versioning system of conda, I don't think this should ever be a problem, but it indeed does require the Python interface to indicate minimal compatible igraph versions. This should be relatively easy to gather from the submodule igraph in the python-igraph GitHub repo for a particular release.
However, it does require that python-igraph changes its build system. That is, at the moment it is not possible to build against an external build system on Windows (both MSVC and MinGW).
In leidenalg I approached this by making the building of the Python interface extremely simple (from the Python perspective), and just assume that a proper library can be linked to when building the Python interface, leaving it to a user who is compiling the Python interface to correctly configure all necessary flags to ensure that the C library can be found. I prepared separate build scripts to facilitate the building, and demonstrate how the approach works. Since binary wheels are now widespread, almost no one will ever manually build the interface, but it does mean that the approach is very flexible and can be accommodated easily in whatever approach is needed. That is, regardless of whether cibuildwheels is used (which relies on the build scripts) or a conda build, both can be configured to work. In fact, in conda it is very simple: it just specifies the dependencies, which are then already automatically installed in the correct directory, and the appropriate link/include directories are immediately correctly configured in such cases.
In short, good idea to do this, but it requires some changes to python-igraph before we're able to do this. We could also patch it here in conda to first simply get it working here, and then possibly propagate back up to python-igraph.
Activity
xylar commentedon Jun 30, 2024
In general, it would be much more consistent with conda-forge's overall approach if were linking to igraph, rather than building it here. I would be very much in favor of switching to doing that.
szhorvat commentedon Jun 30, 2024
I'm sure there was a reason to do so, but I can't recall what, and if it's still valid. Let's wait for a response from @vtraag.
Technically, each 'python-igraph' release is guaranteed to be compatible only with one specific 'igraph' release. This is mostly because of potential changes to experimental functions (which are in practice rare). If we do link to 'igraph', then the maintainer must be careful in managing compatible versions of the two packages, which might be an overhead that @vtraag does not want to deal with.
Another reason to use static linking is bug-for-bug consistency with the PyPI release.
I now switched to linking to C/igraph from python-igraph in MacPorts, and didn't find it to be a burden, but then I do track all changes to igraph closely.
xylar commentedon Jun 30, 2024
I'll certainly defer to you and @vtraag but I'm happy to help make sure the igraph dependency in igraph-python is managed correctly if we head down that road. conda-forge has a pretty strong preference for shared libraries but I can understand that, even so, there are cases where static linking is just easier.
szhorvat commentedon Jun 30, 2024
I do support this change. The upcoming python-igraph 0.11.6 (which will be based on C/igraph 0.10.13) would be a good opportunity to make this transition.
vtraag commentedon Jul 4, 2024
Yes, I have always been in favour of linking to
igraphfrompython-igraphin conda. This has benefits overall, reducing duplication, facilitating installation, and making it indeed easier to use consistent libraries across different packages that build onigraph(indeed includingpython-igraphandleidenalg). In addition, it allows to easily upgrade to newerigraphversions for necessary bugfixes, even without new releases of apython-igraphinterface.Previously, you were arguing against this (and perhaps @ntamas as well, I don't recall exactly) because it would invite problems with potentially incompatible versions. Given the versioning system of conda, I don't think this should ever be a problem, but it indeed does require the Python interface to indicate minimal compatible
igraphversions. This should be relatively easy to gather from the submoduleigraphin thepython-igraphGitHub repo for a particular release.However, it does require that
python-igraphchanges its build system. That is, at the moment it is not possible to build against an external build system on Windows (both MSVC and MinGW).In
leidenalgI approached this by making the building of the Python interface extremely simple (from the Python perspective), and just assume that a proper library can be linked to when building the Python interface, leaving it to a user who is compiling the Python interface to correctly configure all necessary flags to ensure that the C library can be found. I prepared separate build scripts to facilitate the building, and demonstrate how the approach works. Since binary wheels are now widespread, almost no one will ever manually build the interface, but it does mean that the approach is very flexible and can be accommodated easily in whatever approach is needed. That is, regardless of whethercibuildwheelsis used (which relies on the build scripts) or acondabuild, both can be configured to work. In fact, incondait is very simple: it just specifies the dependencies, which are then already automatically installed in the correct directory, and the appropriate link/include directories are immediately correctly configured in such cases.vtraag commentedon Jul 4, 2024
In short, good idea to do this, but it requires some changes to
python-igraphbefore we're able to do this. We could also patch it here incondato first simply get it working here, and then possibly propagate back up topython-igraph.xylar commentedon Jul 7, 2024
My opinion, for what it's worth, would be that these changes would be best made in
python-igraphand propagated to conda-forge in the next release.