cvondrick / vatic

Efficiently Scaling Up Video Annotation with Crowdsourced Marketplaces. IJCV 2012
http://mit.edu/vondrick/vatic/
MIT License
603 stars 255 forks source link

Command 'gcc' failed with exit status 1 #65

Closed arbues6 closed 7 years ago

arbues6 commented 7 years ago

Dear all,

I've been trying to install Vatic in my computer (OS X), but I always get the attached error when introducing to the terminal the command ./vatic-install.sh

Besides, as you can see, there are many issues regarding the enum class. Could someone help me with that?

Thank you very much,

vision/svm.cpp:1379:72: error: ISO C++ forbids forward references to 'enum' types static CYTHON_INLINE PyObject Pyx_PyInt_From_enumsolver_type(enum solver_t... ^ vision/svm.cpp:6605:15: error: no matching function for call to 'Pyx_PyInt_From_enumsolver_type' pyx_t_1 = Pyx_PyInt_From_enum__solver_type(L2R_L2LOSS_SVC_DUAL); i... ^~~~~~~~~~ vision/svm.cpp:1379:32: note: candidate function not viable: no known conversion from '(anonymous enum at vision/liblinear/linear.h:22:1)' to 'enum solver_type' for 1st argument static CYTHON_INLINE PyObject Pyx_PyInt_From_enum__solver_type(enum s... ^ vision/svm.cpp:6618:15: error: no matching function for call to 'Pyx_PyInt_From_enumsolver_type' pyx_t_1 = Pyx_PyInt_From_enumsolver_type(L2R_L2LOSS_SVC_DUAL); i... ^~~~~~~~~~ vision/svm.cpp:1379:32: note: candidate function not viable: no known conversion from '(anonymous enum at vision/liblinear/linear.h:22:1)' to 'enum solver_type' for 1st argument static CYTHON_INLINE PyObject __Pyx_PyInt_From_enum__solver_type(enum s... ^ vision/svm.cpp:9174:98: error: variable has incomplete type 'enum solver_type' ...PyObject Pyx_PyInt_From_enumsolver_type(enum solver_type value) { ^ vision/svm.cpp:1379:72: note: forward declaration of 'solver_type' static CYTHON_INLINE PyObject* Pyx_PyInt_From_enumsolver_type(enum solver_t... ^ vision/svm.cpp:9175:28: error: variable has incomplete type 'const enum solver_type' const enum solver_type neg_one = (enum solver_type) -1, const_zero ... ^ vision/svm.cpp:1379:72: note: forward declaration of 'solver_type' static CYTHON_INLINE PyObject __Pyx_PyInt_From_enum__solver_type(enum solver_t... ^ vision/svm.cpp:9175:61: error: variable has incomplete type 'const enum solver_type' const enum solver_type neg_one = (enum solver_type) -1, const_zero ... ^ vision/svm.cpp:1379:72: note: forward declaration of 'solver_type' static CYTHON_INLINE PyObject Pyx_PyInt_From_enumsolver_type(enum solver_t... ^ vision/svm.cpp:9178:13: error: invalid application of 'sizeof' to an incomplete type 'enum solver_type' if (sizeof(enum solver_type) < sizeof(long)) { ^ ~~~~~~ vision/svm.cpp:1379:72: note: forward declaration of 'solver_type' static CYTHON_INLINE PyObject* Pyx_PyInt_From_enumsolver_type(enum solver_t... ^ vision/svm.cpp:9180:20: error: invalid application of 'sizeof' to an incomplete type 'enum solver_type' } else if (sizeof(enum solver_type) <= sizeof(unsigned long)) { ^ ~~~~~~ vision/svm.cpp:1379:72: note: forward declaration of 'solver_type' static CYTHON_INLINE PyObject __Pyx_PyInt_From_enum__solver_type(enum solver_t... ^ vision/svm.cpp:9183:20: error: invalid application of 'sizeof' to an incomplete type 'enum solver_type' } else if (sizeof(enum solver_type) <= sizeof(unsigned PY_LONG_LONG)) { ^ ~~~~~~ vision/svm.cpp:1379:72: note: forward declaration of 'solver_type' static CYTHON_INLINE PyObject Pyx_PyInt_From_enumsolver_type(enum solver_t... ^ vision/svm.cpp:9188:13: error: invalid application of 'sizeof' to an incomplete type 'enum solver_type' if (sizeof(enum solver_type) <= sizeof(long)) { ^ ~~~~~~ vision/svm.cpp:1379:72: note: forward declaration of 'solver_type' static CYTHON_INLINE PyObject* Pyx_PyInt_From_enumsolver_type(enum solver_t... ^ vision/svm.cpp:9191:20: error: invalid application of 'sizeof' to an incomplete type 'enum solver_type' } else if (sizeof(enum solver_type) <= sizeof(PY_LONG_LONG)) { ^ ~~~~~~ vision/svm.cpp:1379:72: note: forward declaration of 'solver_type' static CYTHON_INLINE PyObject __Pyx_PyInt_From_enum__solver_type(enum solver_t... ^ vision/svm.cpp:9199:45: error: invalid application of 'sizeof' to an incomplete type 'enum solver_type' return _PyLong_FromByteArray(bytes, sizeof(enum solver_type), ^ ~~~~~~ vision/svm.cpp:1379:72: note: forward declaration of 'solver_type' static CYTHON_INLINE PyObject __Pyx_PyInt_From_enum__solver_type(enum solver_t... ^ 12 errors generated. error: command 'gcc' failed with exit status 1

natanielruiz commented 7 years ago

Hi,

This is a problem with the newer version of Cython. Downgrade to cython 0.20 and try again. Cheers

arbues6 commented 7 years ago

Thanks @natanielruiz !

Timebutt commented 7 years ago

I am getting the exact same error, but downgrading Cython to version 0.20 doesn't help me.

timebutt@DESKTOP-1M0N4G1:/mnt/c/Users/ibcn/Documents/pyvision$ sudo pip freeze
appdirs==1.4.3
Cython==0.20
numpy==1.12.1
olefile==0.44
packaging==16.8
Pillow==4.1.1
PyOpenGL==3.0.2
pyparsing==2.2.0
Pyrex==0.9.8.5
six==1.10.0
SQLAlchemy==1.1.9
turkic==0.2.5
wsgilog==0.3.1

This is the error I am getting:

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
vision/svm.cpp:1379:72: error: use of enum ‘solver_type’ without previous declaration
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__solver_type(enum solver_type value);
                                                                        ^
vision/svm.cpp:9174:86: error: use of enum ‘solver_type’ without previous declaration
               static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__solver_type(enum solver_type value) {
                                                                                      ^
vision/svm.cpp: In function ‘PyObject* __Pyx_PyInt_From_enum__solver_type(int)’:
vision/svm.cpp:9175:16: error: use of enum ‘solver_type’ without previous declaration
     const enum solver_type neg_one = (enum solver_type) -1, const_zero = (enum solver_type) 0;
                ^
vision/svm.cpp:9175:44: error: use of enum ‘solver_type’ without previous declaration
     const enum solver_type neg_one = (enum solver_type) -1, const_zero = (enum solver_type) 0;
                                            ^
vision/svm.cpp:9176:39: error: ‘const_zero’ was not declared in this scope
     const int is_unsigned = neg_one > const_zero;
                                       ^
vision/svm.cpp:9178:25: error: use of enum ‘solver_type’ without previous declaration
         if (sizeof(enum solver_type) < sizeof(long)) {
                         ^
vision/svm.cpp:9180:32: error: use of enum ‘solver_type’ without previous declaration
         } else if (sizeof(enum solver_type) <= sizeof(unsigned long)) {
                                ^
vision/svm.cpp:9183:32: error: use of enum ‘solver_type’ without previous declaration
         } else if (sizeof(enum solver_type) <= sizeof(unsigned PY_LONG_LONG)) {
                                ^
vision/svm.cpp:9188:25: error: use of enum ‘solver_type’ without previous declaration
         if (sizeof(enum solver_type) <= sizeof(long)) {
                         ^
vision/svm.cpp:9191:32: error: use of enum ‘solver_type’ without previous declaration
         } else if (sizeof(enum solver_type) <= sizeof(PY_LONG_LONG)) {
                                ^
vision/svm.cpp:9199:57: error: use of enum ‘solver_type’ without previous declaration
         return _PyLong_FromByteArray(bytes, sizeof(enum solver_type),
                                                         ^
vision/svm.cpp:9200:47: error: in argument to unary !
                                      little, !is_unsigned);
                                               ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Any idea what may be causing my problem?

maartenvds commented 7 years ago

I can confirm, same error after downgrading Cython to 0.20

Timebutt commented 7 years ago

I ended up using the Docker container and get the VATIC tool running that way.

maartenvds commented 7 years ago

Thanks, that worked for me too

ahmedmostafa commented 7 years ago

Hi Guys, Sorry I am new to this tool & environment, I am stuck at the same error and I am not able to overcome, could you please till me how to install the Docker container ?

wecacuee commented 6 years ago

After you downgrade to Cython=0.20, make sure you clean the pyvision directory so that the Cython generated files are regenerated.