tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
fix compilation on gcc7
Yuri Aisaka
7 years ago
e559fa19
8dcd7f0d
+52
-2
2 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
science
math
caffe2
default.nix
fix_compilation_on_gcc7.patch
+6
-2
pkgs/development/libraries/science/math/caffe2/default.nix
···
1
1
-
{ stdenv, lib, config, fetchFromGitHub
1
1
+
{ stdenv, lib, config, fetchFromGitHub, fetchpatch
2
2
, cmake
3
3
, glog, google-gflags, gtest
4
4
, protobuf, snappy
···
56
56
};
57
57
dst = "pybind11";
58
58
};
59
59
+
60
60
+
ccVersion = (builtins.parseDrvName stdenv.cc.name).version;
59
61
in
60
62
61
63
stdenv.mkDerivation rec {
···
84
86
;
85
87
propagatedBuildInputs = [ numpy future six python-protobuf pydot ];
86
88
87
87
-
patches = lib.optional stdenv.cc.isClang [ ./update_clang_cvtsh_bugfix.patch ];
89
89
+
patches = lib.optional (stdenv.cc.isGNU && lib.versionAtLeast ccVersion "7.0.0") [
90
90
+
./fix_compilation_on_gcc7.patch
91
91
+
] ++ lib.optional stdenv.cc.isClang [ ./update_clang_cvtsh_bugfix.patch ];
88
92
89
93
cmakeFlags = [ ''-DBUILD_TEST=OFF''
90
94
''-DBUILD_PYTHON=ON''
+46
pkgs/development/libraries/science/math/caffe2/fix_compilation_on_gcc7.patch
···
1
1
+
diff --git a/caffe2/operators/recurrent_network_op.cc b/caffe2/operators/recurrent_network_op.cc
2
2
+
index dd4fded..5995e8a 100644
3
3
+
--- a/caffe2/operators/recurrent_network_op.cc
4
4
+
+++ b/caffe2/operators/recurrent_network_op.cc
5
5
+
@@ -1,4 +1,4 @@
6
6
+
-#include "recurrent_network_op.h"
7
7
+
+#include "caffe2/operators/recurrent_network_op.h"
8
8
+
#include "caffe2/core/workspace.h"
9
9
+
10
10
+
namespace caffe2 {
11
11
+
diff --git a/caffe2/operators/recurrent_network_op.h b/caffe2/operators/recurrent_network_op.h
12
12
+
index 55328e5..ea898bc 100644
13
13
+
--- a/caffe2/operators/recurrent_network_op.h
14
14
+
+++ b/caffe2/operators/recurrent_network_op.h
15
15
+
@@ -762,8 +762,8 @@ class AccumulateInputGradientOp : public Operator<Context> {
16
16
+
USE_OPERATOR_CONTEXT_FUNCTIONS;
17
17
+
18
18
+
bool RunOnDevice() override {
19
19
+
- const auto t =
20
20
+
- OperatorBase::Input<Tensor<CPUContext>>(0).template data<int32_t>()[0];
21
21
+
+ const auto& t0 = OperatorBase::Input<Tensor<CPUContext>>(0);
22
22
+
+ const auto t = t0.template data<int32_t>()[0];
23
23
+
auto& og = Input(1);
24
24
+
auto* g = Output(0);
25
25
+
26
26
+
diff --git a/caffe2/queue/queue_ops.h b/caffe2/queue/queue_ops.h
27
27
+
index f2c0a33..642343f 100644
28
28
+
--- a/caffe2/queue/queue_ops.h
29
29
+
+++ b/caffe2/queue/queue_ops.h
30
30
+
@@ -17,13 +17,10 @@ class CreateBlobsQueueOp final : public Operator<Context> {
31
31
+
name(operator_def.output().Get(0)) {}
32
32
+
33
33
+
bool RunOnDevice() override {
34
34
+
- const auto capacity =
35
35
+
- OperatorBase::template GetSingleArgument<int>("capacity", 1);
36
36
+
- const auto numBlobs =
37
37
+
- OperatorBase::template GetSingleArgument<int>("num_blobs", 1);
38
38
+
+ const auto capacity = GetSingleArgument("capacity", 1);
39
39
+
+ const auto numBlobs = GetSingleArgument("num_blobs", 1);
40
40
+
const auto enforceUniqueName =
41
41
+
- OperatorBase::template GetSingleArgument<int>(
42
42
+
- "enforce_unique_name", false);
43
43
+
+ GetSingleArgument("enforce_unique_name", false);
44
44
+
const auto fieldNames =
45
45
+
OperatorBase::template GetRepeatedArgument<std::string>("field_names");
46
46
+
CAFFE_ENFORCE_EQ(this->OutputSize(), 1);