bugGNU Octave - Bugs: bug #48771, [octave forge] (nan) Link against...

 
 

bug #48771: [octave forge] (nan) Link against the shared library libsvm

Submitted by:  Rafael Laboissiere <rlaboiss>
Submitted on:  Sat 13 Aug 2016 01:18:55 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: otherOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 31 Aug 2017 06:34:23 AM UTC, comment #8:

N.B.: My previous comment was screwed. I obviously meant:

Rafael Laboissiere <rlaboiss>
Thu 31 Aug 2017 06:26:57 AM UTC, comment #7:

It does not seem to be working very well. This is what I did:

Moving the svm.h file away as I did above should have no effect on the compilation, because the code should include the sytem-wide file &lt;libsvm/svm.h&gt;. However, I get the following when trying to build the package:

The problem is fixed by adding:

to files svm_model_matlab.c, svmpredict_mex.cpp, and svmtrain_mex.cpp.

Rafael Laboissiere <rlaboiss>
Wed 30 Aug 2017 09:57:49 PM UTC, comment #6:

The change set 616:2b12bc73975c adds autoconf support for
HAVE_EXTERNAL_LIBLINEAR
HAVE_EXTERNAL_LIBSVM

and it seems to work when compiling from within
octave-NaN/src

./configure && make

will link to libsvm/liblinear from the system when available at compile time

svmpredict_mex.mex:
libsvm.so.3 => /usr/lib/libsvm.so.3 (0x00007f2147a4d000)
svmtrain_mex.mex:
libsvm.so.3 => /usr/lib/libsvm.so.3 (0x00007fafde70f000)
train.mex:
liblinear.so.3 => /usr/lib/x86_64-linux-gnu/liblinear.so.3 (0x00007f7511226000)

and link to the internal code if not.

This ist tested on Debian 9 with
apt-get install liblinear-dev libsvm-dev -y
apt-get remove liblinear-dev libsvm-dev -y

Please test whether this does the job.

Cheers
Alois

Alois Schlögl <schloegl>
Mon 21 Aug 2017 06:51:41 PM UTC, comment #5:

For what is worth, the fix does not really use the external libsvm if available.

Unless I missed something and there's more besides this change http://hg.code.sf.net/p/octave/NaN/rev/12d9cc5f158e then one still needs to define HAVE_EXTERNAL_LIBLINEAR

Defining HAVE_EXTERNAL_LIBLINEAR should be done with a configure script.

Carnë Draug <carandraug>
Project Member
Mon 14 Aug 2017 12:59:39 PM UTC, comment #4:

Thanks. Closing report.

John W. Eaton <jwe>
Project Administrator
Mon 14 Aug 2017 12:19:59 PM UTC, comment #3:

In Nov 2016, the problem was addressed by the following changes:

- external libsvm is used when available
- internal libsvm has been upgraded to compatible version, and is used when no external libsvm is available.

Releases of nan-package 3.1.0 and later have this included. Let me know, if this fix is not working. Otherwise, I suggest to close this bug.

Alois

Alois Schlögl <schloegl>
Sun 14 Aug 2016 03:59:04 PM UTC, comment #2:

The patch indicated in the original report does not work, because it does not take into account the change in the API of the libsvm library, version 3.21, related to the svm_model structure (introduction of field sv_indices). Please, consider this improved version of the patch.

Rafael Laboissière

Rafael Laboissiere <rlaboiss>
Sat 13 Aug 2016 04:12:40 PM UTC, comment #1:

Adding package maintainer to CC.

Carnë Draug <carandraug>
Project Member
Sat 13 Aug 2016 01:18:55 PM UTC, original submission:

A bug report has been filed against the octave-nan package of Debian, which requires the building of the package against the shared library available in the Debian package libsvm3.

For fixing this "bug" I created a trivial patch for the nan package, which will be included in version 3.0.2-2 of the octave-nan package in Debian. This patch may not be appropriate for inclusion upstream. It would be better to detect the presence of the libsvm library in the system and adjust src/Makefile accordingly.

Please, consider implementing that in a future release of nan.

Rafael Laboissière

Rafael Laboissiere <rlaboiss>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by schloegl (Posted a comment)
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by carandraug (Alois Schloegl - maintainer of NaN package)
  • -unavailable- added by rlaboiss (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 14 Aug 2017 12:59:39 PM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sun 13 Aug 2017 02:00:13 PM UTCjweSummarynan: Link against the shared library libsvm=>[octave forge] (nan) Link against the shared library libsvm
    Sat 13 Aug 2016 04:12:41 PM UTCcarandraugCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1