I came back to this, and found that if I perform the following actions, things *seem* to work out ok after I manually download, unpack and cd into the distribution directory:
perl Makefile.PL.solaris
gmake
gmake test
gmake install
Here is the standard Makefile.PL, that would be used by default when installing with cpanm:
use ExtUtils::MakeMaker;
$CC = 'g++';
%args = ('CCFLAGS' => '-Wall');
if($^O eq 'cygwin') {
$args{'LDDLFLAGS'} = '-shared -L/usr/local/lib';
}
WriteMakefile('NAME' => 'Algorithm::SVM',
'VERSION_FROM' => 'lib/Algorithm/SVM.pm',
'PREREQ_PM' => {},
($] >= 5.005 ?
(ABSTRACT_FROM => 'lib/Algorithm/SVM.pm',
AUTHOR => 'Matthew Laird <matt@brinkman.mbb.sfu
+.ca>') : ()),
'OPTIMIZE' => '-O3', # segfaults with gcc 2.96 if
+lower (?)
'LIBS' => '-lm',
'CC' => $CC,
'LD' => '$(CC)',
'OBJECT' => 'SVM.o libsvm.o bindings.o',
'XSOPT' => '-C++ -noprototypes',
%args);
...and here's the Makefile.PL.solaris file I used:
use ExtUtils::MakeMaker;
$CC = 'g++';
%args = ();
if($^O eq 'cygwin') {
$args{'LDDLFLAGS'} = '-shared -L/usr/local/lib';
}
WriteMakefile('NAME' => 'Algorithm::SVM',
'VERSION_FROM' => 'lib/Algorithm/SVM.pm',
'PREREQ_PM' => {},
($] >= 5.005 ?
(ABSTRACT_FROM => 'lib/Algorithm/SVM.pm',
AUTHOR => 'Matthew Laird <matt@brinkman.mbb.sfu
+.ca>') : ()),
'OPTIMIZE' => '-O3', # segfaults with gcc 2.96 if
+lower (?)
'LIBS' => '-lm',
'CC' => $CC,
'LD' => '$(CC)',
'CCCDLFLAGS' => '-fPIC',
'LDDLFLAGS' => '-shared',
'LIB_EXT' => '.so',
'OBJECT' => 'SVM.o libsvm.o bindings.o',
'XSOPT' => '-C++',
%args);
The only real difference I see, is that the "solaris" version of the file tells the system to create a shared library, where the default one does not.
The problem/resolution can reliably be reproduced by switching the build to use each of the differing makefiles.
One more note... I had to add #include <cstring> near the top of the bindings.cpp file to rid myself of undefined memcpy errors before the above worked properly.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.