Skip to content

Link to 'igraph' package? #88

Closed

Description

@szhorvat

Comment:

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'.

Activity

  1. xylar commented on Jun 30, 2024

    @xylar
    Contributor

    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.

  2. szhorvat commented on Jun 30, 2024

    @szhorvat
    Author

    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.

  3. xylar commented on Jun 30, 2024

    @xylar
    Contributor

    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.

  4. szhorvat commented on Jun 30, 2024

    @szhorvat
    Author

    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.

  5. vtraag commented on Jul 4, 2024

    @vtraag
    Contributor

    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.

  6. vtraag commented on Jul 4, 2024

    @vtraag
    Contributor

    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.

  7. xylar commented on Jul 7, 2024

    @xylar
    Contributor

    My opinion, for what it's worth, would be that these changes would be best made in python-igraph and propagated to conda-forge in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions