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

Enh/boost with numpy extension #32414

Closed

Conversation

tristan0x
Copy link
Contributor

Motivation for this change

Build Boost numpy Python by default.

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

@@ -23,7 +23,7 @@ in
'';

buildInputs = [
libpng python3 (boost.override { python = python3; })
libpng python3Packages.python python3Packages.boost
Copy link
Member

Choose a reason for hiding this comment

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

use python3.pkgs.python and python3.pkgs.boost. No need to make the change everywhere.

@@ -10,7 +10,7 @@
, enablePIC ? false
, enableExceptions ? false
, enablePython ? hostPlatform == buildPlatform
, enableNumpy ? false, numpy ? null
, enableNumpy ? true
Copy link
Member

Choose a reason for hiding this comment

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

This should default to false. numpy/openblas/gfortran is a bit too much for a default boost installation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

numpy is required starting 1.65 because as you can read in the release notes:

The boost::python::numeric API has been removed, as it is being obsoleted by boost::python::numpy.

Without numpy extension, it is not possible to manipulate Python array types anymore.

Copy link
Member

Choose a reason for hiding this comment

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

Numpy doesn't seem to end up in the closure, so that's good. Its just needed during build-time.

Older versions do not require numpy, so can you put this in the function call of 1.65.nix.

@FRidh FRidh self-assigned this Dec 7, 2017
@tristan0x tristan0x force-pushed the enh/boost-with-numpy-extension branch from 0662437 to e532c89 Compare December 8, 2017 07:12
@tristan0x
Copy link
Contributor Author

@FRidh I took your remarks into account, and took the liberty to squashes the changes.

@tristan0x
Copy link
Contributor Author

Hello @FRidh
Are ok with the changes I made according to your remarks?

@tristan0x
Copy link
Contributor Author

Hello @FRidh
numpy is now enabled only in 1.65. Let me know if you want me to squash before your merge.

@FRidh
Copy link
Member

FRidh commented Dec 12, 2017

Pushed to staging 19dbfb6.

@FRidh FRidh closed this Dec 12, 2017
@tristan0x tristan0x mentioned this pull request Dec 19, 2017
8 tasks
@bnikolic
Copy link
Contributor

bnikolic commented Jan 1, 2018

This has a problem in that turns on numpy even when Python is disabled;

nix-repl> (pkgs.boost165.override {enablePython=false; } )                                                                                                                                                         
error: assertion failed at /home/bnikolic/oss/nixpkgs/pkgs/development/libraries/boost/generic.nix:29:1                                                                                                            

And Python is disabled by default when cross building meaning this can cause quite a lot of errors.

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