loadcaffe icon indicating copy to clipboard operation
loadcaffe copied to clipboard

GCC < 4.7 Support

Open DataDrake opened this issue 9 years ago • 13 comments

Your CMake specifies the C'11 standard for compile when only C'0X is necessary. This specifically breaks compatibility with RHEL6 and GCC < 4.7, which are needed by most industry scientific tools as they have yet to offer official RHEL7 support.

DataDrake avatar Sep 24 '15 12:09 DataDrake

yeah I know, there are a few auto calls in cpp file that's it, PR to fix this is much welcome.

szagoruyko avatar Sep 25 '15 16:09 szagoruyko

I can verify working on GCC 4.6.4 with flag set to "-std=c++0X" in the CMakeLists. Shall I put in a PR for that?

DataDrake avatar Sep 27 '15 14:09 DataDrake

let me check that it does not break anything on other systems.

szagoruyko avatar Sep 28 '15 18:09 szagoruyko

Setting -std=c++0x does not seem to work.

ashwinkalyan avatar Nov 09 '15 20:11 ashwinkalyan

-std=c++0x doesn't work for me either. @szagoruyko could you specify where the auto calls in the cpp file are? I get the following error: cc1plus: error: unrecognized command line option ‘-std=c++0X’ Also in order to install the local repo I'm using luarocks make with the new CMakeLists.txt file.

asampat3090 avatar Nov 23 '15 06:11 asampat3090

@asampat3090 are you sure there is no typo? x is not' capital at -std=c++0x

szagoruyko avatar Nov 23 '15 06:11 szagoruyko

Ah yes it looks like I just made a typo. Thanks! After changing it to -std=c++0x in the CMakeLists.txt I ran luarocks make and it worked. For reference, I'm running GCC 4.6.4 on Ubuntu 14.04.

asampat3090 avatar Nov 23 '15 18:11 asampat3090

I can confirm that -std=c++0x fixed this issue for me as well!

MMesch avatar Dec 05 '15 12:12 MMesch

Hi guys, I have the same problme. After changing -std=c++11 to -std=c++0x, another error came out: /home/PPeiMi/torch/install/bin/luajit: /home/PPeiMi/torch/install/share/lua/5.1/trepl/init.lua:384: /home/PPeiMi/torch/install/share/lua/5.1/trepl/init.lua:384: /home/PPeiMi/torch/install/share/lua/5.1/loadcaffe/ffi.lua:10: /home/PPeiMi/torch/install/lib/lua/5.1/libloadcaffe.so: undefined symbol: _ZN6google8protobuf8internal23empty_string_once_init_E

What can I do for this? Thank you.

PPeiMi avatar Aug 18 '16 11:08 PPeiMi

@PPeiMi that looks like a problem with the version of protobuf you are using. It probably isn't supported by this version of libloadcaffe/torch7

DataDrake avatar Aug 18 '16 12:08 DataDrake

@DataDrake I have installed protobuf (luarocks install protobuf in /home/PPeiMi/torch/install/lib/luarocks/rocks/), but the version is only 1.1.1. Also, I find in /usr/local/lib that libprotobuf.so.9 and libprotoc.so.9are also exist. What can I do then?

PPeiMi avatar Aug 19 '16 01:08 PPeiMi

Hi all... I am trying to install this software as a dependency for something else. I am using an Ubuntu VM in vagrant, with gcc 4.6.3, and although I know *nix well, I don't know Ubuntu/Debian that well, nor cmake nor Lua nor C++. When I try to run luarocks install loadcaffe, I get this:

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Torch7 in /home/vagrant/torch/install
-- Found PROTOBUF: /usr/lib/libprotobuf.so 
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_loadcaffe-1.0-0-3405/loadcaffe/build
[ 33%] Running C++ protocol buffer compiler on caffe.proto
Scanning dependencies of target loadcaffe
[ 66%] Building CXX object CMakeFiles/loadcaffe.dir/loadcaffe.cpp.o
cc1plus: error: unrecognized command line option '-std=c++11'
make[2]: *** [CMakeFiles/loadcaffe.dir/loadcaffe.cpp.o] Error 1
make[1]: *** [CMakeFiles/loadcaffe.dir/all] Error 2
make: *** [all] Error 2

I've tried screwing around with the hints I've found by googling, e.g. setting SET(CXX_VERSION "c++0x") in the file CMakeLists.txt, but it's not fixing it. In fact my top level CMakeLists.txt has no reference to -std at all.

Can someone tell me how to get past this and get loadcaffe installed? Thanks very much.

kotodharma avatar Jan 13 '18 06:01 kotodharma

not possible without c++11, you need to use newer compiler. you can download gcc or clang binaries, or install them with anaconda.

szagoruyko avatar Jan 14 '18 13:01 szagoruyko