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

libtensorflow_2: add TensorFlow 2 as a library #103292

Merged
merged 1 commit into from Jan 13, 2021

Conversation

mikesperber
Copy link
Contributor

Motivation for this change

libtensorflow is currently TensorFlow 1. Tensorflow 2 is available as a Python library, but not as a C library. I went with the naming convention of the Python TensorFlow 2.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Comment on lines 13 to 20
system =
if stdenv.isLinux then "linux"
else if stdenv.isDarwin then "darwin"
else unavailable;

platform =
if stdenv.isx86_64 then "x86_64"
else unavailable;
Copy link
Member

Choose a reason for hiding this comment

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

Why all of this? Isn't meta.platforms enough?

@mikesperber
Copy link
Contributor Author

It's the same way in bin.nix. I'd be happy to fix it, but I suggest doing that in a separate commit, and then for both bin.nix and bin_2.nix in the same way.

@SuperSandro2000 Thanks for looking at this!

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 103292 run on x86_64-darwin 1

1 package built:
  • libtensorflow_2 (libtensorflow-bin_2)

@mikesperber
Copy link
Contributor Author

@SuperSandro2000 Sorry for the long delay - for some reason, I did not see the check failure. Fixed it now. Anything I can do to move it along?


with stdenv.lib;
let
unavailable = throw "libtensorflow is not available for this platform!";
Copy link
Member

Choose a reason for hiding this comment

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

Please use broken and do not throw here or better platforms. I think that should be enough.


packages = import ./binary-hashes_2.nix;
packageName = "${tfType}-${system}-${platform}";
url = packages.${packageName} or unavailable;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
url = packages.${packageName} or unavailable;

optionals cudaSupport [ cudatoolkit.out cudatoolkit.lib cudnn nvidia_x11 ]);

packages = import ./binary-hashes_2.nix;
packageName = "${tfType}-${system}-${platform}";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
packageName = "${tfType}-${system}-${platform}";

@Mic92
Copy link
Member

Mic92 commented Jan 13, 2021

Result of nixpkgs-review pr 103292 run on x86_64-linux 1

1 package built:
  • libtensorflow-bin

@Mic92 Mic92 merged commit 9de67ac into NixOS:master Jan 13, 2021
@mikesperber
Copy link
Contributor Author

@Mic92 Thanks!

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

3 participants