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. |