2

For those interested in solution please skip to continuation and solution.
So, I am using Strawberry Perl 5.32.1.1-64, from zip, no msi, under Windows 11. Want to use pdl. The information on the internet over that issue is very poor and the support as well. I've seen others having similar problem, but didn't find a solution.
Problem: According to first steps like specified here https://pdl.perl.org/?page=FirstSteps Then I did this as specified on the site:

cpan PDL::Graphics::Simple

So, when starting that commands again I get these one for PDL::Graphics::Simple:

pdl> use PDL::Graphics::Simple
PDL::Graphics::Simple::register: PDL::Graphics::Simple::Prima is out of date - winging it at 
perlhome/perl/site/lib/PDL/Graphics/Simple.pm line 
1397, <DATA> line 209.

How exactly a fresh install from cpan is out of date?... I did not notice any difference with invoking or without invoking use PDL::AutoLoader
Then for img command, failed:

pdl>  imag (sin(rvals(200,200)+1))                                                                                                                                                                                                                                                              
Trying gnuplot (PDL::Graphics::Gnuplot)...nope
Trying pgplot (PDL::Graphics::PGPLOT::Window)...nope
Trying plplot (PDL::Graphics::PLplot)...nope
Trying prima (PDL::Graphics::Prima)...nope
Sorry, all known plotting engines failed.  Install one and try again.

Tried to install install the plots, and every single install failed, even after installing gnuplot itself. I am having NO problems using gnuplot in Julia, all works there exactly as specified in documentation. I literally want to make Perl to work. But could not make Strawberry Perl nor ActiveState Perl working with pdl. Similar topics on stackoverflow did not help much.
The continuation and solution is here

armagedescu
  • 1,758
  • 2
  • 20
  • 31
  • I was able to install [PDL::Graphics::Gnuplot](https://metacpan.org/pod/PDL::Graphics::Gnuplot) (I am on Windows 11), but it seems there are some issue with interactive usage of gnuplot from the pdl shell.. – Håkon Hægland Oct 02 '22 at 11:42
  • The example in synopsis of this page https://metacpan.org/pod/PDL::Graphics::Gnuplot is working fine from perldl here.. – Håkon Hægland Oct 02 '22 at 11:54
  • @HåkonHægland Could you please provide some information that could help me solve the problem? – armagedescu Oct 02 '22 at 12:05
  • Seems like the "dashed" and "persist" terminal options are not supported, see [line 150](https://metacpan.org/release/ETJ/PDL-Graphics-Simple-1.007/source/lib/PDL/Graphics/Simple/Gnuplot.pm#L150). If I remove them from line 150 and also comment out line 148, I am able to do `imag (sin(rvals(200,200)+1))` from a noninteractive terminal – Håkon Hægland Oct 02 '22 at 18:39
  • Also if I comment out line 142 I am able to run `imag (sin(rvals(200,200)+1))` from the interactive pdl prompt (as in the tutorial) – Håkon Hægland Oct 02 '22 at 18:42
  • See also https://github.com/PDLPorters/PDL-Graphics-Simple/issues/2 – Håkon Hægland Oct 02 '22 at 18:51
  • @HåkonHægland tried to comment out that line 148 and removed "dashed" and "persist" properties from line 150. Same behavior. To be sure that path executes, I tested it with a ```die```, and it dies if I throw it. So, the plot window is empty, and even frozen, exactly as before changes. I had to kill gnuplot each time from Task Manager. – armagedescu Oct 03 '22 at 13:20
  • Did you also comment out line 142? – Håkon Hægland Oct 03 '22 at 15:09
  • @HåkonHægland Now I did. Still does not work. Check the **UPDATE 2** for more details – armagedescu Oct 04 '22 at 10:39
  • *"PDL::Graphics::Gnuplot: ERROR: the gnuplot backend issued an error"* Can you try run [this](https://pastebin.com/WFkYjL7r) standalone script? (Not from the `pdl>` prompt but from the command prompt, by executing `perl script.pl`) When I do this I get no errors, and the window is showing the parabola curve. – Håkon Hægland Oct 04 '22 at 19:39
  • @HåkonHægland Just tried. With errors but working. Don't know it works correctly. Details in **UPDATE 3**. In fact, the part which did not involve ```PDL::Graphics::Simple``` worked like this since very beginning. Only thing, the Gnuplot had shown errors during installing, I did a kind of force install and ignore all errors in the first place. – armagedescu Oct 05 '22 at 11:59
  • *"I did a kind of force install and ignore all errors"* Maybe you should start here. Install a new (fresh) version of Strawberry Perl with PDL, then try to install PDL::Graphics::Gnuplot and take a note of the errors you get. I suggest you post a new question here describing those errors, and we can work from there. – Håkon Hægland Oct 06 '22 at 08:41
  • @HåkonHægland I deployed new clean strawberry perl pdl edition package from zip. Did two single cpan installs, ```PDL::Graphics::Simple``` and ```PDL::Graphics::Gnuplot```. The new topic with full output is here: https://stackoverflow.com/questions/73973973/perldl-failing-to-plot-gnuplot-fails-to-deploy-with-cpan – armagedescu Oct 06 '22 at 12:45

0 Answers0