rbgirshick / fast-rcnn

Fast R-CNN
Other
3.34k stars 1.57k forks source link

Build Fail with WITH_PYTHON_LAYER := 1 in Makefile.config #52

Open CyrusChiu opened 9 years ago

CyrusChiu commented 9 years ago

WITH_PYTHON_LAYER := 1 in makefile.config

If use WITH_PYTHON_LAYER := 0 in Makefile.config, then build without error. If use WITH_PYTHON_LAYER := 1 in Makefile.config, then it will build fail with command "make -j8 " The error message will pop out:

CXX/LD -o .build_release/examples/siamese/convert_mnist_siamese_data.bin
.build_release/lib/libcaffe.so: undefined reference to「boost::re_detail::raise_runtime_error(std::runtime_error const&)」
.build_release/lib/libcaffe.so: undefined reference to「boost::re_detail::put_mem_block(void*)」
.build_release/lib/libcaffe.so: undefined reference to「boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, st
d::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<_
_gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*
, std::string> > > > const&)」
..... 

The following is my step:

  1. Clone the Fast R-CNN repository and build the Cython modules.
  2. I build caffe using WITH_PYTHON_LAYER := 0 without any error and I can successfully run the demo.
  3. I want to train FRCN on my own dataset. So I change WITH_PYTHON_LAYER from 0 to 1 in Makefile.config.
  4. Then I execute "make clean" after change the variable WITH_PYTHON_LAYER.
  5. Build caffe again, execute "make -j8", then I got those error message.

I have search from the Internet, it seems related to libboost_regex link problem. But I am not familar with Makefile now, could you provide some hint?

awayhome113 commented 9 years ago

You can refer to this link for help: https://groups.google.com/forum/#!topic/caffe-users/cI1omAfHxNw, and Have you install libboost-python-dev and python-dev?

ethanhe42 commented 8 years ago

I have this problem too. I solve it by add boost_regex to LIBRARIES in Makefile 263 LIBRARIES += boost_thread stdc++ boost_regex

andeyeluguo commented 6 years ago

brother yihui's solution can sovle my problem ,thank you.

YIFanH commented 6 years ago

@andeyeluguo I met the same question with you, how did you resolve it on boost_regex? thank you and wait for you relay.....

andeyeluguo commented 6 years ago

I solve it by add boost_regex to LIBRARIES in Makefile just like this 263 LIBRARIES += boost_thread stdc++ boost_regex maybe you miss the boost_regex

YIFanH commented 6 years ago

@andeyeluguo I add boost_regex in Makefile,but can not solve question

andeyeluguo commented 6 years ago

then I have no idea,sorry

YIFanH commented 6 years ago

@andeyeluguo which your version of boost ?

YIFanH commented 6 years ago

I solve this question with boost version of 1.62.0 and modify the Makefile with add boost_regex

EnriqueSolarte commented 6 years ago

I am compiling the repository from https://github.com/weiliu89/caffe/tree/ssd ...the same issue, nevertheless @yihui-he advice solved my problem. I have compiled the repository but when I run make test -j8 I got a reference error: .build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation::transform_primary(char const, char const) const' Could someone help me?

haoxuhao commented 6 years ago

where did you add the boost_regex to solve this problem @YIFanH

YIFanH commented 6 years ago

@haoxuhao 265 line in Makefile; LIBRARIES += boost_thread stdc++ changed to LIBRARIES += boost_thread stdc++ boost_regex

Gesalat commented 6 years ago

I'm facing the same problem (while compiling ssd caffe; caffe and py-faster-rcnn I already succesfully compiled), but unfortunately adding boost_regex to the LIBRARIES doesn't help. My boost version is also 1.62.0 and I use g++-5.

@YIFanH what version of ubuntu are you using?

I would be very happy about any other ideas how to solve this problem.

YIFanH commented 6 years ago

@Gesalat Hi, my linux is centos and g++ -version is 4.8.4

WUhailing commented 6 years ago

@Gesalat I ran into this error with same boost and g++ version, did you solve it?

Gesalat commented 6 years ago

@WUhailing yes I solved it by compiling ssd caffe on a clean ubuntu 17.04 and also on a 17.10 machine with gcc-6 and cuda 9.1(if you do sudo apt install nvidia-cuda-toolkit you will get cuda 8 and this could be one problem)

further details:

I hope this helps :-) I think next time I would choose ubuntu 16.04, there might be less version troubles.

JiangStein commented 6 years ago

I've solved my problem by the way provided by yihui. Some differences are here: The error message I met was: boost::program_options::xxxxx undefined so I added boost_program_options to LIBRARIES in Makefile like this: 265 LIBRARIES += boost_thread stdc++ boost_program_options and no more error message was shown. I guess that the correct library should be added.

Azure-Sky-L commented 6 years ago

@YIFanH I add boost_regex in Makefile,but can not solve question

Yrij-Zhavoronkov commented 6 years ago

how to do it with CMAKE ? MakeFile not contain "LIBRARES += ...." to append it "boost_thread stdc++ boost_regex"

lunana123 commented 6 years ago

.build_release/lib/libcaffe.so: undefined reference to cblas_sgemv' .build_release/lib/libcaffe.so: undefined reference tocblas_dgemm' .build_release/lib/libcaffe.so: undefined reference to cblas_sscal' .build_release/lib/libcaffe.so: undefined reference tocblas_dgemv' .build_release/lib/libcaffe.so: undefined reference to cblas_saxpy' .build_release/lib/libcaffe.so: undefined reference tocblas_ddot' .build_release/lib/libcaffe.so: undefined reference to cblas_dasum' .build_release/lib/libcaffe.so: undefined reference tocblas_sgemm' .build_release/lib/libcaffe.so: undefined reference to cblas_dscal' .build_release/lib/libcaffe.so: undefined reference tocblas_scopy' .build_release/lib/libcaffe.so: undefined reference to cblas_sasum' .build_release/lib/libcaffe.so: undefined reference tocblas_daxpy' .build_release/lib/libcaffe.so: undefined reference to cblas_dcopy' .build_release/lib/libcaffe.so: undefined reference tocblas_sdot' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/caffe.bin] Error 1

lironghua318 commented 5 years ago

I am compiling the repository from https://github.com/weiliu89/caffe/tree/ssd ...the same issue, nevertheless @yihui-he advice solved my problem. I have compiled the repository but when I run make test -j8 I got a reference error: .build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation::transform_primary(char const, char const) const' Could someone help me? 可能是装了多个boost版本,你可以查看/usr/local/lib/和/usr/lib/ 下boost是否安装了不同版本,如果是删掉一个就可以了,比如删除/usr/local/include/下的boost 和/usr/local/lib/下boost相关的文件,然后make clean,make all 就好了

leaf918 commented 5 years ago

I have this problem too. I solve it by add boost_regex to LIBRARIES in Makefile 263 LIBRARIES += boost_thread stdc++ boost_regex

谢谢,我的环境是少了regex

BirdeeChen commented 5 years ago

I am compiling the repository from https://github.com/weiliu89/caffe/tree/ssd ...the same issue, nevertheless @yihui-he advice solved my problem. I have compiled the repository but when I run make test -j8 I got a reference error: .build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation::transform_primary(char const, char const) const' Could someone help me? 可能是装了多个boost版本,你可以查看/usr/local/lib/和/usr/lib/ 下boost是否安装了不同版本,如果是删掉一个就可以了,比如删除/usr/local/include/下的boost 和/usr/local/lib/下boost相关的文件,然后make clean,make all 就好了

this solved my problem