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

 
 

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

Submitter:  Rafael Laboissière <rlaboiss>
Submitted:  Sat 13 Aug 2016 01:18:55 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * other Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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:


#include "config.h"


Rafael Laboissière <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:


$ sudo aptitude install libsvm-dev
$ hg clone http://hg.code.sf.net/p/octave/NaN nan-hg
$ cd nan-hg
$ ./configure
$ mv svm.h svm.h-away


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:


$ make
[…]
mkoctfile -o &quot;svm_model_octave.o&quot; -c &quot;svm_model_matlab.c&quot;
svm_model_matlab.c:64:19: fatal error: svm.h: No such file or directory
   #include &quot;svm.h&quot;
                   ^
compilation terminated.
Makefile:121: recipe for target 'svm_model_octave.o' failed
make: *** [svm_model_octave.o] Error 1


The problem is fixed by adding:


#include &quot;config.h&quot;


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

Rafael Laboissière <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>
Group Member
Mon 14 Aug 2017 12:59:39 PM UTC, comment #4: 

Thanks.  Closing report.

John W. Eaton <jwe>
Group 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 Laboissière <rlaboiss>
Sat 13 Aug 2016 04:12:40 PM UTC, comment #1: 

Adding package maintainer to CC.

Carnë Draug <carandraug>
Group 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 Laboissière <rlaboiss>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-14 jwe StatusNone Fixed
        Open/ClosedOpen Closed
    2017-08-13 jwe Summarynan: Link against the shared library libsvm [octave forge] (nan) Link against the shared library libsvm
    2016-08-13 carandraug Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code