Build caffe2 operators failed, 'sorry, unimplemented: non-trivial designated initializers not supported'

Ryan95: <p>i want to build caffe2 server operators to test fbgemm, but i meet thest problems:</p>
<p>/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h: In instantiation of ‘caffe2::ConvOp&lt;T, Context&gt;::RunOnDeviceWithOrderNCHW()::&lt;lambda(caffe2::Tensor*)&gt; [with T = float; Context = caffe2::CPUContext]’:<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:173:13: required from ‘struct caffe2::ConvOp&lt;T, Context&gt;::RunOnDeviceWithOrderNCHW() [with T = float; Context = caffe2::CPUContext]::&lt;lambda(class caffe2::Tensor*)&gt;’<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:181:3: required from ‘bool caffe2::ConvOp&lt;T, Context&gt;::RunOnDeviceWithOrderNCHW() [with T = float; Context = caffe2::CPUContext]’<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op.cc:209:1: required from here<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:118:15: error：redeclration of ‘const int&amp; C’<br>
C * X_HxW,<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:98:53: note：‘const int&amp; C’ previously declared here<br>
math::Im2Col&lt;T, Context, StorageOrder::NCHW&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:145:45: error：redeclration of ‘const int&amp; G’<br>
math::GemmStridedBatched&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:131:13: note：‘const int&amp; G’ previously declared here<br>
if (G == 1) {<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:149:15: error：redeclration of ‘const int&amp; M’<br>
M / G,<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int&amp; M’ previously declared here<br>
math::Gemm&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:149:15: error：redeclration of ‘const int&amp; G’<br>
M / G,<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:131:13: note：‘const int&amp; G’ previously declared here<br>
if (G == 1) {<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:145:45: error：redeclration of ‘const int&amp; Y_HxW’<br>
math::GemmStridedBatched&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int&amp; Y_HxW’ previously declared here<br>
math::Gemm&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:145:45: error：redeclration of ‘const int&amp; kernel_dim’<br>
math::GemmStridedBatched&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int&amp; kernel_dim’ previously declared here<br>
math::Gemm&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:156:25: error：redeclration of ‘const int&amp; buffer_size’<br>
buffer_size / G,<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:116:55: note：‘const int&amp; buffer_size’ previously declared here<br>
math::Im2ColNd&lt;T, Context, StorageOrder::NCHW&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:156:25: error：redeclration of ‘const int&amp; G’<br>
buffer_size / G,<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:131:13: note：‘const int&amp; G’ previously declared here<br>
if (G == 1) {<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:159:22: error：redeclration of ‘const int&amp; G’<br>
Y_stride / G,<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:131:13: note：‘const int&amp; G’ previously declared here<br>
if (G == 1) {<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:165:31: error：redeclration of ‘const int&amp; M’<br>
math::Gemm&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int&amp; M’ previously declared here<br>
math::Gemm&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:165:31: error：redeclration of ‘const int&amp; Y_HxW’<br>
math::Gemm&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:132:31: note：‘const int&amp; Y_HxW’ previously declared here<br>
math::Gemm&lt;T, Context&gt;(<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:179:14: error：redeclration of ‘const int&amp; Y_stride’<br>
Y_data += Y_stride;<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:159:22: note：‘const int&amp; Y_stride’ previously declared here<br>
Y_stride / G,<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h: In instantiation of ‘bool caffe2::ConvOp&lt;T, Context&gt;::RunOnDeviceWithOrderNCHW() [with T = float; Context = caffe2::CPUContext]’:<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op.cc:209:1: required from here<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
const auto func = [&amp;](Tensor* col_buffer) {<br>
^<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported<br>
/data/home/ryankang/Workspace/pytorch/caffe2/operators/conv_op_impl.h:92:21: sorry, unimplemented: non-trivial designated initializers not supported</p>
<p>here is my environment and CMakelists.txt options:</p>
<ul>
<li>PyTorch Version (e.g., 1.0): 1.0</li>
<li>OS (e.g., Linux): Red Hat Linux</li>
<li>GCC version: 5.1.0</li>
<li>How you installed PyTorch ( <code>conda</code> ,  <code>pip</code> , source): source</li>
<li>Build command you used (if compiling from source):cmake … &amp;&amp; make install -j</li>
<li>Python version: 2.7</li>
<li>CUDA/cuDNN version: 9.1.85</li>
<li>GPU models and configuration:<br>
GPU 0: Tesla K80<br>
GPU 1: Tesla K80<br>
GPU 2: Tesla K80<br>
GPU 3: Tesla K80</li>
</ul>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/3/33a0754e7d1263e7b2818dc95534ed8242374945.png" data-download-href="https://discuss.pytorch.org/uploads/default/33a0754e7d1263e7b2818dc95534ed8242374945" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/2X/3/33a0754e7d1263e7b2818dc95534ed8242374945_2_471x499.png" alt="image" data-base62-sha1="7mI88bLDuL0AVDpi1Y16rctyal7" width="471" height="499" srcset="https://discuss.pytorch.org/uploads/default/optimized/2X/3/33a0754e7d1263e7b2818dc95534ed8242374945_2_471x499.png, https://discuss.pytorch.org/uploads/default/optimized/2X/3/33a0754e7d1263e7b2818dc95534ed8242374945_2_706x748.png 1.5x, https://discuss.pytorch.org/uploads/default/original/2X/3/33a0754e7d1263e7b2818dc95534ed8242374945.png 2x" data-dominant-color="2C2C2F"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">841×892 150 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>