weiliu89 / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
4.77k stars 1.68k forks source link

about the boost problem when make #54

Open zimenglan-sysu-512 opened 8 years ago

zimenglan-sysu-512 commented 8 years ago

when i run make -j8, i got an error as below:

/usr/include/boost/property_tree/detail/json_parser_read.hpp: In constructor ‘boost::property_tree::json_parser::json_grammar<Ptree>::definition<Scanner>::definition(const boost::property_tree::json_parser::json_grammar<Ptree>&)’:
/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array

my version of boost is 1.55. does any one meet this problem before? @weiliu89 can you do me a favor? thanks.

weiliu89 commented 8 years ago

Please use CUDA 7.5. I guess you are using CUDA 8.0.

zimenglan-sysu-512 commented 8 years ago

@weiliu89 i use cuda 8.0 for 1080P. Thanks. Btw, when will you update to support cuda 8.0?

weiliu89 commented 8 years ago

I am guessing there is conflict between boost (specifically the property_tree) and cuda 8.0. I don't know what is the reason. I guess it might be some cuda, boost or gcc bug. If you find any solution to it, please let me know. Thanks!

zimenglan-sysu-512 commented 8 years ago

@weiliu89 i git clone down the caffe(BVLC), and run make -j8, find that there is not problem. i try to merge caffe (BVLC) with your ssd branch, when run make -j8, this problem occurs again. maybe as you say, there is a confict bewteen boost (property_tree) and cuda 8.0. but i don't know how to solve it, since i search for google, and found nothing.

zimenglan-sysu-512 commented 8 years ago

@weiliu89 btw, which the version of gcc or g++ do you use?

cyren commented 8 years ago

@zimenglan-sysu-512 I had the same problem, since I installed cuda 8.0rc with gcc/g++ 4.8, after installing cuda, switch back to gcc/g++ 5.4 will solve this problem.

vj-1988 commented 8 years ago

I think the issue is purely because of the GCC version. In one of my PC (GCC 5.3, since I have not installed updates on this PC) I am not getting this error, but on another PC (GCC 5.4, since GCC 5.3 is updated with GCC 5.4 ) , I am facing this issue. Both the PCs are running on Ubuntu 16.04 LTS.

weiliu89 commented 8 years ago

It works fine with gcc 4.8 + cuda 7.5. I guess there is some conflict with cuda8.0 and gcc 4.8. But happy to know that gcc 5.4 works fine :)

vj-1988 commented 8 years ago

@weiliu89 : Sorry, I was not clear in my previous post. I was able to compile the project with gcc 5.3 on CPU mode. I will try installing with GPU mode enabled and post the update.

zimenglan-sysu-512 commented 8 years ago

@weiliu89 i use gtx 980+cuda.7.5+cudnn v4 to compile successfully, and use 1080p+cuda8.0+cudnnv4 to run successfully. it's so wired.

VincentChong123 commented 8 years ago

after installing cuda, switch back to gcc/g++ 5.4 will solve this problem. commands sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-5 g++-5 sudo apt-get update

below 2 lines might be different actual successful code and corrections are welcome sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 3 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 3

vj-1988 commented 7 years ago

I am able to compile SSD on cuda 8.0 + cudnn 5.1 on ubuntu 16.04 now without any issues. I guess gcc/g++ 5.4 is added as a dependency on the latest cuda.

bikong2 commented 7 years ago

hello, it sames that i have the same problem with you. is there any methods to solve this problem? i get error bellow: [ 1%] Built target proto [ 84%] Built target caffe [ 85%] Linking CXX executable upgrade_solver_proto_text /usr/bin/ld: warning: libpcre.so.1, needed by //home/lixihua/anaconda2/lib/libglib-2.0.so.0, not found (try using -rpath or -rpath-link) ../lib/libcaffe.so.1.0.0-rc3: undefined reference to boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const' ../lib/libcaffe.so.1.0.0-rc3: undefined reference toboost::re_detail::cpp_regex_traits_implementation::transform(char const, char const) const' ../lib/libcaffe.so.1.0.0-rc3: undefined reference to boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)' ../lib/libcaffe.so.1.0.0-rc3: undefined reference toboost::re_detail::put_mem_block(void*)' ../lib/libcaffe.so.1.0.0-rc3: undefined reference to `boost::re_detail::get_mem_block()'

in face if i clone the newest version of caffe and i can compoile ok it. but when i clone rrc_detection which has some modification on ssd, i get error above. my ubuntu info is: ubuntu 16.04 cuda8 boost 1.58 g++ version 5.4

any methods? thanks for you reply

thanks for all, i found the methods: https://github.com/weiliu89/caffe/issues/5

GuoxiaWang commented 6 years ago

@weiliu89 Today, I want to test the SSD. When I compile the SSD, I encounter the "json_parser_read" problem. I try to find the solution on the Internet. In conclusion, I think it is main reason due to the boost version problem but gcc/g++ and cuda version.

I test on two ubuntu system. 1) ubuntu 14.04, cuda 8.0, g++ 4.8, boost 1.54, GTX 1080, cudnn 6.0(but I comment) 2) ubuntu 14.04, cuda 7.5, g++ 4.8, boost 1.54, GTX 970, cudnn 4.0

When I switch the environment, the problem still exists. I change the boost from boost 1.54, 1.55, 1.58, to 1.65. Finally, I pass compiling the caffe-ssd. And I found out that there is no "json_parser_read.hpp" header file from boost 1.60 version.

And maybe the conflict between boost version and g++, because some people solve the problem by upgrading the g++ from 4.8 version to 5.4.

Finally, the solution to this problem: 1) upgrade the boost minimum version to 1.60 2) upgrade the g++ version to 5.4 3) comment the 257 line code in "json_parser_read.hpp", as the below:

                /*escape
                    =   chset_p(detail::widen<Str>("\"\\/bfnrt").c_str())
                            [typename Context::a_escape(self.c)]
                    |   'u' >> uint_parser<unsigned long, 16, 4, 4>()
                            [typename Context::a_unicode(self.c)]
                    ;*/
rayinbeijing commented 6 years ago

Add boost_regex to LIBRARIES in Makefile will solve this problem.