Skip Menu |

This queue is for tickets about the Algorithm-SVM CPAN distribution.

Report information
The Basics
Id: 43669
Status: open
Priority: 0/
Queue: Algorithm-SVM

People
Owner: Nobody in particular
Requestors: MSTEVENS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.13
Fixed in: (no value)



Subject: Installation failure via CPAN.pm
Hi. I'm trying to install Algorithm::SVM via CPAN.pm on perl 5.8.9. I've attached details of my perl version, the system is Ubuntu 8.10. I get a build failure as follows: *, ...)’, declared with attribute warn_unused_result libsvm.cpp:2805: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result libsvm.cpp:2812: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result libsvm.cpp:2873: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result libsvm.cpp:2882: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result g++ -c -Wall -O3 -DVERSION=\"0.13\" -DXS_VERSION=\"0.13\" -fPIC "-I/home/msdianomi/tools/perl-5.8.9/lib/5.8.9/i686-linux/CORE" bindings.cpp bindings.cpp: In constructor ‘DataSet::DataSet(double)’: bindings.cpp:22: error: ‘malloc’ was not declared in this scope bindings.cpp: In destructor ‘DataSet::~DataSet()’: bindings.cpp:33: error: ‘free’ was not declared in this scope bindings.cpp: In member function ‘void DataSet::realign(svm_node*)’: bindings.cpp:39: error: ‘memcpy’ was not declared in this scope bindings.cpp:40: error: ‘free’ was not declared in this scope bindings.cpp: In member function ‘void DataSet::setAttribute(int, double)’: bindings.cpp:48: error: ‘malloc’ was not declared in this scope bindings.cpp:50: error: ‘memcpy’ was not declared in this scope bindings.cpp:86: error: ‘realloc’ was not declared in this scope bindings.cpp: In member function ‘void SVM::free_x_space()’: bindings.cpp:160: error: ‘free’ was not declared in this scope bindings.cpp: In member function ‘int SVM::train(int)’: bindings.cpp:180: error: ‘free’ was not declared in this scope bindings.cpp:186: error: ‘malloc’ was not declared in this scope bindings.cpp:191: error: ‘malloc’ was not declared in this scope bindings.cpp:195: error: ‘free’ was not declared in this scope bindings.cpp:196: error: ‘free’ was not declared in this scope bindings.cpp:197: error: ‘free’ was not declared in this scope bindings.cpp:203: error: ‘free’ was not declared in this scope bindings.cpp:219: error: ‘free’ was not declared in this scope bindings.cpp: In member function ‘double SVM::crossValidate(int)’: bindings.cpp:308: error: ‘rand’ was not declared in this scope bindings.cpp:331: error: ‘malloc’ was not declared in this scope bindings.cpp:377: error: ‘free’ was not declared in this scope bindings.cpp: In destructor ‘SVM::~SVM()’: bindings.cpp:427: error: ‘free’ was not declared in this scope make: *** [bindings.o] Error 1 LAIRDM/Algorithm-SVM-0.13.tar.gz /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: LAIRDM/Algorithm-SVM-0.13.tar.gz : make NO
Subject: perl-version
Download perl-version
application/octet-stream 2.1k

Message body not shown because it is not plain text.

hi, had a similar problem running Debian but fixed it by installing manually. The problem is with the CPP/H source code. (i) Open a new command window, and go to the directory where the package was downloaded and un-tarred (you will need to sudo to get access rights) xx@debian:~$cd /home/xx/.cpan/build/Algorithm-SVM-0.13-iNvnlY debian:/home/xx/.cpan/build/Algorithm-SVM-0.13-iNvnlY# ls -all total 577 drwx------ 4 root root 768 2009-01-21 18:46 . drwxr-xr-x 12 root root 912 2009-01-21 18:47 .. -rw-r--r-- 1 508 1000025 9745 2008-01-22 16:14 bindings.cpp -rw-r--r-- 1 508 1000025 2245 2009-01-21 18:46 bindings.h <-- this is the file you want debian:/home/xx/.cpan/build/Algorithm-SVM-0.13-iNvnlY# Edit bindings.h and add the marked lines. #ifndef __BINDINGS_H__ #define __BINDINGS_H__ using namespace std; #include <vector> #include <map> #include <assert.h> #include <cstdlib> <===== Add these #include <string.h> <===== two lines #include "libsvm.h" class DataSet { friend class SVM; private: double label; struct svm_node *attributes; . . . (iii) Build the package from the command line using make and then make install. This should automatically build and install the package into the perl repository. To check, return to your CPAN prompt cpan[2]> install Algorithm::SVM Algorithm::SVM is up to date (0.13). This was done on Debian with GCC4.3 (I had the same problem with GCC4.1) i'm not sure why these include statements are missing from the source code, nor why the installation worked fine on perl5.8. My C++ is pretty rusty these days ... I can email you a pretty PDF doc of these instructions if you want. On Thu Feb 26 11:54:48 2009, MSTEVENS wrote: Show quoted text
> Hi. > > I'm trying to install Algorithm::SVM via CPAN.pm on perl 5.8.9. > > I've attached details of my perl version, the system is Ubuntu 8.10. > > I get a build failure as follows: > > *, ...)’, declared with attribute warn_unused_result > libsvm.cpp:2805: warning: ignoring return value of ‘int fscanf(FILE*, > const char*, ...)’, declared with attribute warn_unused_result > libsvm.cpp:2812: warning: ignoring return value of ‘int fscanf(FILE*, > const char*, ...)’, declared with attribute warn_unused_result > libsvm.cpp:2873: warning: ignoring return value of ‘int fscanf(FILE*, > const char*, ...)’, declared with attribute warn_unused_result > libsvm.cpp:2882: warning: ignoring return value of ‘int fscanf(FILE*, > const char*, ...)’, declared with attribute warn_unused_result > g++ -c -Wall -O3 -DVERSION=\"0.13\" -DXS_VERSION=\"0.13\" -fPIC > "-I/home/msdianomi/tools/perl-5.8.9/lib/5.8.9/i686-linux/CORE" > bindings.cpp > bindings.cpp: In constructor ‘DataSet::DataSet(double)’: > bindings.cpp:22: error: ‘malloc’ was not declared in this scope > bindings.cpp: In destructor ‘DataSet::~DataSet()’: > bindings.cpp:33: error: ‘free’ was not declared in this scope > bindings.cpp: In member function ‘void DataSet::realign(svm_node*)’: > bindings.cpp:39: error: ‘memcpy’ was not declared in this scope > bindings.cpp:40: error: ‘free’ was not declared in this scope > bindings.cpp: In member function ‘void DataSet::setAttribute(int,
double)’: Show quoted text
> bindings.cpp:48: error: ‘malloc’ was not declared in this scope > bindings.cpp:50: error: ‘memcpy’ was not declared in this scope > bindings.cpp:86: error: ‘realloc’ was not declared in this scope > bindings.cpp: In member function ‘void SVM::free_x_space()’: > bindings.cpp:160: error: ‘free’ was not declared in this scope > bindings.cpp: In member function ‘int SVM::train(int)’: > bindings.cpp:180: error: ‘free’ was not declared in this scope > bindings.cpp:186: error: ‘malloc’ was not declared in this scope > bindings.cpp:191: error: ‘malloc’ was not declared in this scope > bindings.cpp:195: error: ‘free’ was not declared in this scope > bindings.cpp:196: error: ‘free’ was not declared in this scope > bindings.cpp:197: error: ‘free’ was not declared in this scope > bindings.cpp:203: error: ‘free’ was not declared in this scope > bindings.cpp:219: error: ‘free’ was not declared in this scope > bindings.cpp: In member function ‘double SVM::crossValidate(int)’: > bindings.cpp:308: error: ‘rand’ was not declared in this scope > bindings.cpp:331: error: ‘malloc’ was not declared in this scope > bindings.cpp:377: error: ‘free’ was not declared in this scope > bindings.cpp: In destructor ‘SVM::~SVM()’: > bindings.cpp:427: error: ‘free’ was not declared in this scope > make: *** [bindings.o] Error 1 > LAIRDM/Algorithm-SVM-0.13.tar.gz > /usr/bin/make -- NOT OK > Running make test > Can't test without successful make > Running make install > Make had returned bad status, install seems impossible > Failed during this command: > LAIRDM/Algorithm-SVM-0.13.tar.gz : make NO
From: michael [...] styer.net
The GCC maintainers are cleaning up the header includes; see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28080. It's a Good Thing, but it does break some old code (like this). You can still install this package using CPAN, though; open a subshell in the package directory using 'look Algorithm::SVM', make the changes, then continue with the CPAN build process.
Thank you guys for sharing these hints. They helped me installing the module (opensuse 11.4, GCC 4.5.0). Lutz