cvondrick / vatic

Efficiently Scaling Up Video Annotation with Crowdsourced Marketplaces. IJCV 2012

Home Page:http://mit.edu/vondrick/vatic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: use of enum ‘solver_type’ without previous declaration

corentin87 opened this issue · comments

Hi,
When running ./vatic-install.sh, I am getting the following errors during compilation:

`building vision.sv' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c vision/svm.cpp -o build/temp.linux-x86_64-2.7/vision/svm.o -w
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;

etc.....
`

I managed to fix it by changing the file linear.h in pyvision/vision/liblinear, the enum is missing the solver_type name. Why?

I modify the code to have
enum solver_type { L2R_LR, L2R_L2LOSS_SVC_DUAL, L2R_L2LOSS_SVC, L2R_L1LOSS_SVC_DUAL, MCSVM_CS, L1R_L2LOSS_SVC, L1R_LR } ;

You can change the version of cython to 0.20 and try again.

The solution by @corentin87 worked for me during installation. I initally tried using cython 0.20 version without any success.

the solution by @corentin87 worked for me as well

also worked for me, thanks to @corentin87

@corentin87 Thank you,saved me lots of time!