Skip to content

Compiling in Quantal (Ubuntu 12.10) #7

Open

Description

@arski

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?

Activity

  1. arski commented on Jan 8, 2013

    @arski
    Author

    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. eventmachine/eventmachine#345 - should be an easy enough fix.

    Cheers

  2. tomz commented on Jan 8, 2013

    @tomz
    Owner

    I think this was fixed in liblinear-ruby-swig with this pull request tomz/liblinear-ruby-swig@719b307, 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

  3. added a commit that references this issue on Mar 24, 2013
  4. hh commented on Sep 9, 2013

    @hh

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

  5. LogIN- commented on Nov 30, 2014

    @LogIN-

    👍

  6. amiraliakbari commented on Apr 27, 2015

    @amiraliakbari

    +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
    
  7. msegado commented on Nov 6, 2015

    @msegado

    +1. Ubuntu 14.04

  8. msegado commented on Nov 6, 2015

    @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
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions