libsvm-ruby-swig icon indicating copy to clipboard operation
libsvm-ruby-swig copied to clipboard

Compiling in Quantal (Ubuntu 12.10)

Open arski opened this issue 12 years ago • 7 comments

Getting these errors:

make compiling libsvm_wrap.cxx libsvm_wrap.cxx: In function ‘void SWIG_Ruby_define_class(swig_type_info_)’: libsvm_wrap.cxx:1284:9: warning: variable ‘klass’ set but not used [-Wunused-but-set-variable] libsvm_wrap.cxx: In function ‘int SWIG_AsCharPtrAndSize(VALUE, char__, size_t_, int_)’: libsvm_wrap.cxx:1707:30: error: ‘STR2CSTR’ was not declared in this scope make: *_* [libsvm_wrap.o] Error 1

Any idea how to fix?

arski avatar Jan 07 '13 17:01 arski

PS. If I try to install the gem from this repo, and not the 'libsvm-ruby-swig', I also get a bunch of errors like the following:

libsvm_wrap.cxx: In function ‘VALUE _wrap_svm_parameter_svm_type_set(int, VALUE*, VALUE)’: libsvm_wrap.cxx:2144:5: error: format not a string literal and no format arguments [-Werror=format-security] libsvm_wrap.cxx:2149:5: error: format not a string literal and no format arguments [-Werror=format-security]

These are the same as in many other gems, e.g. https://github.com/eventmachine/eventmachine/issues/345 - should be an easy enough fix.

Cheers

arski avatar Jan 08 '13 12:01 arski

I think this was fixed in liblinear-ruby-swig with this pull request https://github.com/tomz/liblinear-ruby-swig/commit/719b3076aa8aa81daf0af73a6680fd76ec6d7fc2, looks like we have the same issue here, feel free to patch it the same way. I will take a look at this once I have a dev environment set up for Ubuntu 12.10

tomz avatar Jan 08 '13 16:01 tomz

+1 please relook at this. More and more folks on Ubuntu 12.10 now

hh avatar Sep 09 '13 18:09 hh

:+1:

LogIN- avatar Nov 30 '14 14:11 LogIN-

+1

Error message on Ubuntu 14.10:

compiling libsvm_wrap.cxx
libsvm_wrap.cxx: In function ‘VALUE _wrap_svm_parameter_svm_type_set(int, VALUE*, VALUE)’:
libsvm_wrap.cxx:1396:83: error: format not a string literal and no format arguments [-Werror=format-security]
 #define SWIG_Error(code, msg)              rb_raise(SWIG_Ruby_ErrorType(code), msg)
                                                                                   ^
libsvm_wrap.cxx:1796:45: note: in expansion of macro ‘SWIG_Error’
 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
                                             ^
libsvm_wrap.cxx:2144:5: note: in expansion of macro ‘SWIG_exception_fail’
     SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "svm_parameter *","svm_type", 1, self ));

# many more similar error lines...

libsvm_wrap.cxx:4001:5: note: in expansion of macro ‘SWIG_exception_fail’
     SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "svm_node **","svm_node_matrix_destroy", 1, argv[0] )); 
     ^
cc1plus: some warnings being treated as errors
Makefile:212: recipe for target 'libsvm_wrap.o' failed
make: *** [libsvm_wrap.o] Error 1

make failed, exit code 2

amiraliakbari avatar Apr 27 '15 11:04 amiraliakbari

+1. Ubuntu 14.04

msegado avatar Nov 06 '15 18:11 msegado

...thankfully user EbookGlue has a fork that fixes this. The following worked on Ubuntu 14.04:

gem install specific_install
gem specific_install https://github.com/EbookGlue/libsvm-ruby-swig.git

msegado avatar Nov 06 '15 18:11 msegado