{"action":"created","issue":{"url":"https://api.github.com/repos/dmlc/mxnet/issues/1172","labels_url":"https://api.github.com/repos/dmlc/mxnet/issues/1172/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/mxnet/issues/1172/comments","events_url":"https://api.github.com/repos/dmlc/mxnet/issues/1172/events","html_url":"https://github.com/dmlc/mxnet/issues/1172","id":124955596,"number":1172,"title":"install mxnet under centos","user":{"login":"JulySouthWind","id":3745064,"avatar_url":"https://avatars.githubusercontent.com/u/3745064?v=3","gravatar_id":"","url":"https://api.github.com/users/JulySouthWind","html_url":"https://github.com/JulySouthWind","followers_url":"https://api.github.com/users/JulySouthWind/followers","following_url":"https://api.github.com/users/JulySouthWind/following{/other_user}","gists_url":"https://api.github.com/users/JulySouthWind/gists{/gist_id}","starred_url":"https://api.github.com/users/JulySouthWind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulySouthWind/subscriptions","organizations_url":"https://api.github.com/users/JulySouthWind/orgs","repos_url":"https://api.github.com/users/JulySouthWind/repos","events_url":"https://api.github.com/users/JulySouthWind/events{/privacy}","received_events_url":"https://api.github.com/users/JulySouthWind/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-05T12:09:13Z","updated_at":"2016-01-06T09:48:35Z","closed_at":null,"body":"I  am installing mxnet under centos, I builded opencv and openblas from source,but these error happened when run make -j4.\r\nAnyone can help me? Thanks\r\n/usr/local/bin/g++ -DMSHADOW_FORCE_STREAM -Wall -O3 -I./mshadow/ -I./dmlc-core/include -fPIC -Iinclude -msse3 -funroll-loops -Wno-unused-parameter -Wno-unknown-pragmas -DMSHADOW_USE_CUDA=0 -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DMXNET_USE_OPENCV=1 -I/data2/opencv/opencv-2.4/build/include  -fopenmp -I/usr/local/openblas/include -DMXNET_USE_NVRTC=0 -std=c++0x  -o bin/im2rec tools/im2rec.cc build/resource.o build/c_api/c_api.o build/c_api/c_api_error.o build/c_api/c_predict_api.o build/common/mxrtc.o build/common/tblob_op_registry.o build/engine/engine.o build/engine/naive_engine.o build/engine/threaded_engine.o build/engine/threaded_engine_perdevice.o build/engine/threaded_engine_pooled.o build/io/io.o build/io/iter_csv.o build/io/iter_image_recordio.o build/io/iter_mnist.o build/kvstore/kvstore.o build/ndarray/ndarray.o build/ndarray/ndarray_function.o build/ndarray/unary_function.o build/operator/activation.o build/operator/batch_norm.o build/operator/block_grad.o build/operator/concat.o build/operator/convolution.o build/operator/crop.o build/operator/cross_device_copy.o build/operator/cudnn_batch_norm.o build/operator/deconvolution.o build/operator/dropout.o build/operator/elementwise_binary_op.o build/operator/elementwise_binary_scalar_op.o build/operator/elementwise_sum.o build/operator/embedding.o build/operator/fully_connected.o build/operator/identity_attach_KL_sparse_reg.o build/operator/leaky_relu.o build/operator/lrn.o build/operator/native_op.o build/operator/ndarray_op.o build/operator/operator.o build/operator/pooling.o build/operator/regression_output.o build/operator/reshape.o build/operator/slice_channel.o build/operator/softmax_activation.o build/operator/softmax_output.o build/operator/swapaxis.o build/operator/upsampling.o build/optimizer/optimizer.o build/optimizer/sgd.o build/storage/storage.o build/symbol/graph_executor.o build/symbol/static_graph.o build/symbol/symbol.o dmlc-core/libdmlc.a -pthread -lm -lopenblas -lrt -L/data2/opencv/opencv-2.4/build/lib -L/usr/local/openblas/lib\r\n/tmp/ccd27Zq4.o: In function `cv::Mat::~Mat()':\r\nim2rec.cc:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x79): undefined reference to `cv::Mat::deallocate()'\r\nim2rec.cc:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x69): undefined reference to `cv::fastFree(void*)'\r\n/tmp/ccd27Zq4.o: In function `main':\r\nim2rec.cc:(.text.startup+0x1e54): undefined reference to `vtable for cv::_InputArray'\r\nim2rec.cc:(.text.startup+0x1ea0): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'\r\nim2rec.cc:(.text.startup+0x200d): undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Range const&, cv::Range const&)'\r\nim2rec.cc:(.text.startup+0x21ea): undefined reference to `cv::fastFree(void*)'\r\nim2rec.cc:(.text.startup+0x225d): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'\r\nim2rec.cc:(.text.startup+0x2270): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'\r\nim2rec.cc:(.text.startup+0x2290): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'\r\nim2rec.cc:(.text.startup+0x22b0): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'\r\nim2rec.cc:(.text.startup+0x22cc): undefined reference to `cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'\r\nim2rec.cc:(.text.startup+0x23ca): undefined reference to `cv::Mat::deallocate()'\r\nim2rec.cc:(.text.startup+0x243c): undefined reference to `cv::fastFree(void*)'\r\nim2rec.cc:(.text.startup+0x2460): undefined reference to `cv::Mat::deallocate()'\r\nim2rec.cc:(.text.startup+0x24d5): undefined reference to `cv::fastFree(void*)'\r\nim2rec.cc:(.text.startup+0x2c6a): undefined reference to `cv::Mat::copySize(cv::Mat const&)'\r\nim2rec.cc:(.text.startup+0x2cc6): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'\r\nim2rec.cc:(.text.startup+0x2cd9): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'\r\nim2rec.cc:(.text.startup+0x2cf9): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'\r\nim2rec.cc:(.text.startup+0x2deb): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'\r\nim2rec.cc:(.text.startup+0x2df6): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'\r\nim2rec.cc:(.text.startup+0x2f5a): undefined reference to `cv::Mat::deallocate()'\r\nim2rec.cc:(.text.startup+0x2fd3): undefined reference to `cv::fastFree(void*)'\r\n……\r\nbuild/io/iter_image_recordio.o: In function `mxnet::io::ImageRecordIOParser::Init(std::vector<std::pair<std::string, std::string>, std::allocator<std::pair<std::string, std::string> > > const&)':\r\niter_image_recordio.cc:(.text._ZN5mxnet2io19ImageRecordIOParser4InitERKSt6vectorISt4pairISsSsESaIS4_EE[_ZN5mxnet2io19ImageRecordIOParser4InitERKSt6vectorISt4pairISsSsESaIS4_EE]+0x334): undefined reference to `cv::Mat::create(int, int const*, int)'\r\niter_image_recordio.cc:(.text._ZN5mxnet2io19ImageRecordIOParser4InitERKSt6vectorISt4pairISsSsESaIS4_EE[_ZN5mxnet2io19ImageRecordIOParser4InitERKSt6vectorISt4pairISsSsESaIS4_EE]+0x3de): undefined reference to `cv::fastFree(void*)'\r\niter_image_recordio.cc:(.text._ZN5mxnet2io19ImageRecordIOParser4InitERKSt6vectorISt4pairISsSsESaIS4_EE[_ZN5mxnet2io19ImageRecordIOParser4InitERKSt6vectorISt4pairISsSsESaIS4_EE]+0x6c9): undefined reference to `cv::Mat::deallocate()'\r\ncollect2: error: ld returned 1 exit status\r\nmake: *** [bin/im2rec] Error 1\r\n"},"comment":{"url":"https://api.github.com/repos/dmlc/mxnet/issues/comments/169279635","html_url":"https://github.com/dmlc/mxnet/issues/1172#issuecomment-169279635","issue_url":"https://api.github.com/repos/dmlc/mxnet/issues/1172","id":169279635,"user":{"login":"leoli2012","id":13852887,"avatar_url":"https://avatars.githubusercontent.com/u/13852887?v=3","gravatar_id":"","url":"https://api.github.com/users/leoli2012","html_url":"https://github.com/leoli2012","followers_url":"https://api.github.com/users/leoli2012/followers","following_url":"https://api.github.com/users/leoli2012/following{/other_user}","gists_url":"https://api.github.com/users/leoli2012/gists{/gist_id}","starred_url":"https://api.github.com/users/leoli2012/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leoli2012/subscriptions","organizations_url":"https://api.github.com/users/leoli2012/orgs","repos_url":"https://api.github.com/users/leoli2012/repos","events_url":"https://api.github.com/users/leoli2012/events{/privacy}","received_events_url":"https://api.github.com/users/leoli2012/received_events","type":"User","site_admin":false},"created_at":"2016-01-06T09:48:35Z","updated_at":"2016-01-06T09:48:35Z","body":"build mxnet under centos have a little complex, i spend several days to resolve this issue...however, i success last....\r\nmy os is centos 5.8 ,run on VM.\r\ncd /home\r\nmyPath='install_mxnet'\r\nif [ -x \"$myPath\" ]; then \r\nrm -rf \"$myPath\" \r\nfi \r\nmkdir install_mxnet\r\ncd install_mxnet\r\nyum -y install git\r\nif [ \"$?\" == \"0\"]; then\r\n  echo \"git install fail\"\r\n  exit 0\r\nfi\r\n\r\n######update gcc to 4.8.2,if you gcc version <4.8,you must update gcc first \r\nnew_gcc='/opt/rh/devtoolset-2/root/usr/bin/gcc'\r\ncd /etc/yum.repos.d\r\nwget http://people.centos.org/tru/devtools-2/devtools-2.repo\r\nyum -y install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++\r\nif [ ! -f \"$new_gcc\" ]; then\r\n  echo \"gcc install fail\"\r\n  exit 0\r\nfi\r\n###centos 5.8 gcc version is 4.1.2, you should rename gcc.bakxxx, which depend  your gcc version\r\nmv -f /usr/bin/gcc /usr/bin/gcc.bak4.1.2\r\nmv -f /usr/bin/c++ /usr/bin/c++.bak4.1.2\r\nmv -f /usr/bin/g++ /usr/bin/g++.bak4.1.2\r\n\r\nln -s /opt/rh/devtoolset-2/root/usr/bin/gcc /usr/bin/gcc\r\nln -s /opt/rh/devtoolset-2/root/usr/bin/c++ /usr/bin/c++\r\nln -s /opt/rh/devtoolset-2/root/usr/bin/g++ /usr/bin/g++\r\ncd -\r\n\r\n\r\n######atlas\r\nlibcblas='/usr/lib64/atlas/libcblas.so'\r\nrpm -ivh http://mirrors.yun-idc.com/epel/5Server/x86_64/epel-release-5-4.noarch.rpm\r\nyum -y install atlas-devel\r\nif [ ! -f \"$libcblas\" ]; then\r\n  echo \"atlas install fail\"\r\n  exit 0\r\nfi\r\nln -s /usr/lib64/atlas/libcblas.so /usr/lib/libcblas.so\r\n\r\n######update python, if your python version <2.7, update python to 2.7 first\r\nnew_python='/usr/local/bin/python2.7'\r\nyum -y groupinstall 'Development Tools'\r\nyum -y install openssl-devel* ncurses-devel* zlib*.x86_64\r\nyum -y install bzip2 bzip2-devel bzip2-libs\r\n\r\nwget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz\r\ntar -xzf Python-2.7.9.tgz\r\ncd Python-2.7.9\r\n./configure\r\nmake\r\nmake install\r\nif [ ! -f \"$new_python\" ]; then\r\n  echo \"python update fail\"\r\n  exit 0\r\nfi\r\nmv /usr/bin/python /usr/bin/python2.4.3\r\nln -s /usr/local/bin/python2.7 /usr/bin/python\r\nsed -i 's/#!\\/usr\\/bin\\/python/#!\\/usr\\/bin\\/python2.4.3/g'  /usr/bin/yum \r\ncd -\r\n\r\n#######install setuptools\r\nwget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py\r\npython ez_setup.py --insecure\r\n\r\n######install numpy\r\nwget http://sourceforge.net/projects/numpy/files/NumPy/1.10.2/numpy-1.10.2.tar.gz\r\nif [ \"$?\" == \"0\" ];then\r\n  echo \"numpy download fail\"\r\n  exit 0\r\nfi\r\ntar -xzf numpy-1.10.2.tar.gz \r\ncd numpy-1.10.2\r\npython setup.py build\r\npython setup.py install\r\ncd -\r\n\r\n######install mxnet\r\ngit clone --recursive https://github.com/dmlc/mxnet\r\nif [ \"$?\" == \"0\" ]; then\r\n  echo \"mxnet download fail\"\r\n  exit 0\r\nfi\r\ncd mxnet\r\ncp make/config.mk .\r\nsed -i 's/USE_OPENCV = 1/USE_OPENCV = 0/g' config.mk     \r\nsed -i 's/USE_DIST_KVSTORE = 0/USE_DIST_KVSTORE = 1/g' config.mk\r\nsed -i 's/wget/wget\\ --no-check-certificate/g' ps-lite/make/deps.mk\r\nmake -j4\r\n-----------------------------------------\r\nhave a try ~"}}