From 31aa884b7f9108103e244ade50fe3c9ce4d6b9c3 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sun, 3 Feb 2019 15:32:15 +0000 Subject: [PATCH] caffe: move defaults to package file --- pkgs/applications/science/math/caffe/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/science/math/caffe/default.nix b/pkgs/applications/science/math/caffe/default.nix index e56c63e01bf..c0c26d6e453 100644 --- a/pkgs/applications/science/math/caffe/default.nix +++ b/pkgs/applications/science/math/caffe/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, runCommand +{ config, stdenv, lib, runCommand , fetchFromGitHub , fetchurl , cmake @@ -13,8 +13,8 @@ , Accelerate, CoreGraphics, CoreVideo , lmdbSupport ? true, lmdb , leveldbSupport ? true, leveldb, snappy -, cudaSupport ? stdenv.isLinux, cudatoolkit -, cudnnSupport ? false, cudnn ? null +, cudaSupport ? config.cudaSupport or false, cudatoolkit +, cudnnSupport ? cudaSupport, cudnn ? null , ncclSupport ? false, nccl ? null , pythonSupport ? false, python ? null, numpy ? null }: diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 23d20a9682e..4a87efeded7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21850,20 +21850,16 @@ in ### SCIENCE / MATH - caffe = callPackage ../applications/science/math/caffe rec { - cudaSupport = config.caffe.cudaSupport or config.cudaSupport or false; - cudnnSupport = cudaSupport; - # Used only for image loading. - opencv3 = opencv3WithoutCuda; + caffe = callPackage ../applications/science/math/caffe ({ + opencv3 = opencv3WithoutCuda; # Used only for image loading. inherit (darwin.apple_sdk.frameworks) Accelerate CoreGraphics CoreVideo; - }; + } // (config.caffe or {})); caffe2 = callPackage ../development/libraries/science/math/caffe2 (rec { inherit (python36Packages) python future six numpy pydot; protobuf = protobuf3_1; python-protobuf = python36Packages.protobuf.override { inherit protobuf; }; - # Used only for image loading. - opencv3 = opencv3WithoutCuda; + opencv3 = opencv3WithoutCuda; # Used only for image loading. }); cntk = callPackage ../applications/science/math/cntk rec {