Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph-tool: 2.16 -> 2.26 #34864

Merged
merged 2 commits into from Apr 9, 2018
Merged

Conversation

ciderale
Copy link
Contributor

Motivation for this change

Reenable support for graph-tool in python3 environments and update to newest version

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions (inside Docker container)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Details:

  • add ncurses: configure links against ncurses and fails otherwise
    configure: error: Could not link test program to Python.
    https://travis-ci.org/NixOS/nixpkgs/builds/48759067
    The given hint (Maybe the main Python library has been installed
    in some non-standard library path) is misleading.
    The config.log reveals that the failure is due to missing ncurses link option

  • with-boost-libdir is need to find Boost::IOStreams/regex/etc.

  • expat/cgal are detected in /usr/lib when not specified explicitly

  • boost > boost159 is needed to have -lboost_python3 (and -lboost_python)

  • set pythonModule = Python;
    => inorder to be used in python.buildEnv { extraLibs = [..]; }

tested on MacOSX and in a linux Docker container with:

> nix-shell -I nixpkgs=. -p python2.pkgs.graph-tool
> nix-shell -I nixpkgs=. -p python3.pkgs.graph-tool
and created a simple graph
>>> import graph_tool
>>> from graph_tool.all import *
>>> g = Graph()
>>> v1 = g.add_vertex()
>>> graph_draw(g, vertex_text=g.vertex_index, vertex_font_size=18,output="one-nodes.png")

- add ncurses: configure links against ncurses and fails otherwise
    configure: error: Could not link test program to Python.
    https://travis-ci.org/NixOS/nixpkgs/builds/48759067
    The given hint (Maybe the main Python library has been installed
    in some non-standard library path) is misleading.
    The config.log reveals that the failure is due to missing ncurses link option
- with-boost-libdir is need to find Boost::IOStreams/regex/etc.
- expat/cgal are detected in /usr/lib when not specified explicitly
- boost > boost159 is needed to have -lboost_python3 (and -lboost_python)

- set pythonModule = Python;
  => inorder to be used in python.buildEnv { extraLibs = [..]; }

tested on MacOSX and in a linux Docker container with:
> nix-shell -I nixpkgs=. -p python2.pkgs.graph-tool
> nix-shell -I nixpkgs=. -p python3.pkgs.graph-tool
name = "${python.libPrefix}-graph-tool-${version}";

pythonModule = python;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to use toPythonModule (stdenv.mkDerivation {...})

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better would be to try and use buildPythonPackage with format = "other";

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the quick feedback. I did try buildPythonPackage earlier, but I did not know about format = "other". With the additional format attribute it works. I only retested on OSX/Py3k tough as the compilation takes ages and I don't think that change will have an effect on the other combination, or will it?

name = "${python.libPrefix}-graph-tool-${version}";

pythonModule = python;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better would be to try and use buildPythonPackage with format = "other";

@ciderale
Copy link
Contributor Author

@FRidh Thanks again for your feedback. I think I addressed your comment, but I'm not sure how if I have to press some button to mark the "Change Requested" as done, or if commenting is enough. Let me know if there are still some open points.

@matthewbauer matthewbauer merged commit db8d8ac into NixOS:master Apr 9, 2018
@dotlambda
Copy link
Member

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

Successfully merging this pull request may close these issues.

None yet

5 participants