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.


In reply to Re: Unable to build and test Algorithm::SVM module on Windows 10 with Perl v.5.30.1 by stevieb
in thread Unable to build and test Algorithm::SVM module on Windows 10 with Perl v.5.30.1 by zubenel0

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.