mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Build failed with unordered_map init?

Open xlvector opened this issue 9 years ago • 3 comments

For bugs or installation issues, please provide the following information. The more information you provide, the more likely people will be able to help you.

Environment info

Operating System: linux debian

Compiler: nvcc

Package used (Python/R/Scala/Julia): python

MXNet version: master

Or if installed from source:

MXNet commit hash (git rev-parse HEAD):

If you are using python package, please provide

Python version and distribution:

If you are using R package, please provide

R sessionInfo():

Error Message:

g++ -std=c++11 -DMSHADOW_FORCE_STREAM -Wall -O3 -I/home/tiger/mxnet/mshadow/ -I/home/tiger/mxnet/dmlc-core/include -fPIC -I/home/tiger/mxnet/nnvm/include -Iinclude -funroll-loops -Wno-unused-parameter -Wno-unknown-pragmas -msse3 -I/usr/local/cuda/include -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DMSDHADOW_USE_PASCAL=0 -DMXNET_USE_OPENCV=1 -I/usr/include/opencv -fopenmp -DMSHADOW_USE_CUDNN=1 -DMXNET_USE_DIST_KVSTORE -I/home/tiger/mxnet/ps-lite/include -I/home/tiger/mxnet/deps/include -fopenmp -DMXNET_USE_NVRTC=0 -MM -MT build/src/operator/tensor/elemwise_unary_op.o src/operator/tensor/elemwise_unary_op.cc >build/src/operator/tensor/elemwise_unary_op.d g++ -std=c++11 -c -DMSHADOW_FORCE_STREAM -Wall -O3 -I/home/tiger/mxnet/mshadow/ -I/home/tiger/mxnet/dmlc-core/include -fPIC -I/home/tiger/mxnet/nnvm/include -Iinclude -funroll-loops -Wno-unused-parameter -Wno-unknown-pragmas -msse3 -I/usr/local/cuda/include -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DMSDHADOW_USE_PASCAL=0 -DMXNET_USE_OPENCV=1 -I/usr/include/opencv -fopenmp -DMSHADOW_USE_CUDNN=1 -DMXNET_USE_DIST_KVSTORE -I/home/tiger/mxnet/ps-lite/include -I/home/tiger/mxnet/deps/include -fopenmp -DMXNET_USE_NVRTC=0 -c src/operator/tensor/elemwise_unary_op.cc -o build/src/operator/tensor/elemwise_unary_op.o src/operator/tensor/elemwise_unary_op.cc: In lambda function: src/operator/tensor/elemwise_unary_op.cc:41:62: error: converting to ‘std::unordered_map<std::basic_string, std::basic_string >’ from initializer list would use explicit constructor ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Key = std::basic_string; _Tp = std::basic_string; _Hash = std::hash<std::basic_string >; _Pred = std::equal_to<std::basic_string >; _Alloc = std::allocator<std::pair<const std::basic_string, std::basic_string > >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<std::basic_string >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<std::basic_string >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = std::allocator<std::pair<const std::basic_string, std::basic_string > >]’ auto lhs = MakeGradNode("_backward_copy", n, ograds, {});

xlvector avatar Dec 29 '16 14:12 xlvector

seems change {} to std::unordered_map<std::string, std::string>() works.

May be its related with GCC.

xlvector avatar Dec 29 '16 14:12 xlvector

Yeah this is a gcc version issue. Could you PR a fix?

piiswrong avatar Dec 30 '16 02:12 piiswrong

@xlvector

Yes, it works but all MakeGradNode constructor calls should be fixed. mxnet currently cannot be compiled in gcc 4.9.2.

mcxkarakoc avatar Jan 07 '17 19:01 mcxkarakoc