http://qs1969.pair.com?node_id=11111203

zubenel0 has asked for the wisdom of the Perl Monks concerning the following question:

Dear Perl Monks,

I wanted to run an example from PDL Book http://pdl.perl.org/?page=FirstSteps and for that I needed PDL::Graphics::Simple module. I used Strawberry Perl PDL edition v.5.30.1 on Windows 10 and tried to install this module with cpanm PDL::Graphics::Simple function but encountered an error. The last lines of log file show that several tests failed:
Test Summary Report ------------------- t/simple.t (Wstat: 1536 Tests: 85 Failed: 6) Failed tests: 5, 73-74, 78, 80, 82 Non-zero exit status: 6 Files=1, Tests=85, 2 wallclock secs ( 0.05 usr + 0.00 sys = 0.05 CPU) Result: FAIL Failed 1/1 test programs. 6/85 subtests failed. gmake: *** [Makefile:871: test_dynamic] Error 6 -> FAIL Installing PDL::Graphics::Simple failed.
I found that there were more people having problems with this module and CPAN Testers matrix shows many failures. Thanks for any help on how to solve this in order to run examples from PDL book.

Replies are listed 'Best First'.
Re: Failure to install PDL::Graphics::Simple on Windows 10
by pryrt (Abbot) on Jan 08, 2020 at 21:05 UTC

    I just tried with strawberry 5.30.0_64_PDL, and got similar results. The tests numbered 73 and above are all failing the automated suite because it is asking for user interaction, and the since the cpanm test/install isn't passing those questions on to the user, they don't get answered, and they fail. If I use cpanm --look PDL::Graphics::Simple and then run gmake test, those tests all pass. However, test #5 still fails. That appears to be one of the "engine" tests (gnuplot pgplot plplot prima). It may be that one (or more) of those engines aren't included by default with the strawberry PDL bundle. My guess (and it is only a guess) is that if the --look / gmake test sequence above shows graphs appearing, that it's working "well enough". So you could either try cpanm --notest (to skip the tests), or do a gmake install inside the cpanm --look PDL::Graphics::Simple without requiring gmake test to work. No guarantees the module will work for you, but given that the tests seemed to be effective, even though not passing, tells me that it probably will work for you.

Re: Failure to install PDL::Graphics::Simple on Windows 10
by vr (Curate) on Jan 09, 2020 at 00:02 UTC
    Note also, to prevent further disappointment, PDL::Graphics::Simple is mentioned only briefly in the "First steps" chapter, but further ahead almost 100 pages describe, in detail, PDL::Graphics::PGPLOT and PDL::Graphics::PLplot. Which I'm not sure are easy/possible to be used in Windows. It's either time to setup a double boot, or get ready to adjust all examples of "PDL Book" to PDL::Graphics::Gnuplot (installed with Strawberry).
      Recently a lot of work has been done by the mighty Zaki Mughal on the PDL interfaces to Gnuplot, PGPLOT and PLplot to improve their continuous integration on GitHub. At least the Gnuplot and PLplot ones work great on Windows, and the PGPLOT one is a work in progress to get it also working there. I'd say PDL::Graphics::Simple will therefore not only work on Windows, but you have at least a couple of options of driver.

      Please give it a go and report any problems!

Re: Failure to install PDL::Graphics::Simple on Windows 10
by thechartist (Monk) on Feb 19, 2020 at 13:59 UTC

    I ran into a similar problem with Perl 5.26.1 and PDL 2.019. If the goal is getting the exercises to run on Windows, use gnuplot.

    I think Prima also had an update, so it might be worth checking that out too.

      The GitHub versions of PDL::Drawing::Prima and PDL::Graphics::Prima install without errors (which have been updated for a change in Prima, from fillWindings to fillModes), but then segfault when run through the currently-being-updated PDL::Graphics::Simple. Caveat emptor.
Re: Failure to install PDL::Graphics::Simple on Windows 10
by thechartist (Monk) on Feb 19, 2020 at 17:46 UTC

    The CPAN test data is interesting in that there are more passes than fails. But my experience is similar to the OP, with Prima build failures: Prima CPAN Matrix

Re: Failure to install PDL::Graphics::Simple on Windows 10
by dk (Chaplain) on Feb 19, 2020 at 07:26 UTC
    Try to install prima; if needed, without tests
      I have installed Prima successfully, but installation of PDL::Graphics::Prima failed with errors building prerequisite:

      Building PDL-Drawing-Prima gcc -c -I"C:\sw\pdl\perl\vendor\lib\PDL\Core" -I"C:\sw\pdl\perl\site\l +ib\Prima\CORE" -I"C:\sw\pdl\perl\site\lib\Prima\CORE\generic" -I"C:\s +w\pdl\c\include\libpng16" -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__U +SE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT - +DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bit +fields -s -O2 "-DVERSION=\"0.12\"" "-DXS_VERSION=\"0.12\"" -I"C:\sw\p +dl\perl\lib\CORE" -I"C:\sw\pdl\c\include" -o "lib\PDL\Drawing\Prima.o +" "lib\PDL\Drawing\Prima.c" ====================================================================== lib/PDL/Drawing/Prima.pm.PL: In function 'pdl_prima_fillpolys_readdata +': lib/PDL/Drawing/Prima.pm.PL:949:45: error: 'struct _Drawable_vmt' has +no member named 'get_fillWinding' curr_$singular = orig_$singular = $uncast my->get_$singular(widget +_handle); ^~ lib/PDL/Drawing/Prima.pm.PL:952:26: error: 'struct _Drawable_vmt' has +no member named 'get_fillWinding' orig_$singular = $uncast my->get_$singular(widget_handle); ^~ lib/PDL/Drawing/Prima.pm.PL:954:6: error: 'struct _Drawable_vmt' has n +o member named 'set_fillWinding' my->set_$singular(widget_handle, $cast curr_$singular); ====================================================================== error building xs.dll file from 'lib\PDL\Drawing\Prima.c' at C:/sw/pdl +/perl/lib/ExtUtils/CBuilder/Platform/Windows.pm line 128. -> FAIL Installing PDL::Drawing::Prima failed. See C:\sw\pdl\data\.cpa +nm\work\1582130333.17256\build.log for details. Retry with --force to + force install it. -> FAIL Installing the dependencies failed: Module 'PDL::Drawing::Prim +a' is not installed -> FAIL Bailing out the installation for PDL-Graphics-Prima-0.17.