Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

[SOLVED]: PDL and PGPLOT on Windows XP

by BJ_Covert_Action (Beadle)
on Oct 06, 2010 at 22:57 UTC ( [id://863882]=perlquestion: print w/replies, xml ) Need Help??

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

For the solution to this problem please see the reply node below: [SOLUTION]: Getting PGPLOT running on Windows XP.

Howdy Everyone,

So some of you might have heard me rambling about this in the chatterbox earlier today, but I am having enough trouble that I figured I would make a full fledged post of it. I've been trying to install PDL onto my Windows XP box and have been running into some trouble. Essentially, PDL installs and works just fine, but I cannot seem to use the PGPLOT functionality of the language after installing it. I installed PDL by following the instructions found here for strawberry perl 5.10. So, I used the ppm utility and it seemed like everything installed correctly, including PGPLOT, OpenGL, and even a few dll files I was missing.

However, when I run the perldl shell from my command line, and try a command along the lines of use PDL::Graphics::PGPLOT, I end up getting the following errors:

Can't locate loadable object for module PGPLOT in @INC (@INC contains: + C:/strawberry/perl/lib C:/strawberry/perl/site/lib .) at C:/strawber +ry/perl/site/lib/PDL/Graphics/PGPLOT/Window.pm line 2272 Compilation failed in require at C:/strawberry/perl/site/lib/PDL/Graph +ics/PGPLOT/Window.pm line 2272, <STDIN> line 1. BEGIN failed--compilation aborted at C:/strawberry/perl/site/lib/PDL/G +raphics/PGPLOT/Window.pm line 2272, <STDIN> line 1. Compilation failed in require at C:/strawberry/perl/site/lib/PDL/Graph +ics/PGPLOT.pm line 148, <STDIN> line 1. BEGIN failed--compilation aborted at C:/strawberry/perl/site/lib/PDL/G +raphics/PGPLOT.pm line 148, <STDIN> line 1. Compilation failed in require at (eval 40) line 5, <STDIN> line 1. BEGIN failed--compilation aborted at (eval 40) line 5, <STDIN> line 1.

So far as I can tell, the Window.pm module is having some issues locating whatever is on line 2272: use PGPLOT;. Well the funny thing about that is that I have PGplot.pm installed right where it is supposed to be at: C:\strawberry\perl\site\lib\PDL\Graphics\PGplot.pm

So I have hit a bit of a wall. I did some Googling and found this thread. It appears someone had a similar problem, but managed to fix it by installing PGPlot...which I thought I had already done. I may be misunderstanding the nature of the PGplot.pm, but isn't that a full implementation of the program? Or do I need to be doing an independent install of PGPlot first?

I guess at this point I don't have a lot of ideas, I just know that I am unable to work with the plotting utilities of PDL on my Windows system and it is becoming quite frustrating. Does anyone have any ideas? Please feel free to request more information or details as you deem necessary.

Thank you all in advance.

Replies are listed 'Best First'.
Re: PDL and PGPLOT on Windows XP
by syphilis (Archbishop) on Oct 07, 2010 at 01:02 UTC
    I have PGplot.pm installed right where it is supposed to be at: C:\strawberry\perl\site\lib\PDL\Graphics\PGplot.pm

    That's not the file it "can't locate". The file it can't locate is C:\strawberry\perl\site\lib\auto\PGPLOT\PGPLOT.xs.dll. That file should have been installed when you installed PGPLOT via ppm.
    Does that file exist ? If not, does that directory even exist (and, if it exists, what does it contain) ?

    Might pay to try re-installing PGPLOT:
    ppm remove PGPLOT --force
    (hope that's the right invocation - I think you'll need to use '--force'), then:
    ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/PGPLOT.ppd
    Cheers,
    Rob

      Hmmm. Well it appears that I do have that directory and file installed. Existing within: C:\strawberry\perl\site\lib\auto\PGPLOT, I have the following files:

      • .packlist
      • PGPLOT.bs
      • PGPLOT.xs.dll

      I did a remove command using ppm and tried reinstalling PGPLOT. I also added C:\strawberry\perl\bin to my PATH variable (though I think it might already have been there). After doing so, I tried use PGPLOT; in the perldl shell again and I got this error:

      Attempt to reload PGPLOT.pm aborted. Compilation failed in require at (eval 44) line 4, <STDIN> line 2. at (eval 44) line 4 main::BEGIN() called at (eval 44) line 4 eval {...} called at (eval 44) line 4 eval ' sub { { use PG +PLOT; ; } } ;' called at C:\strawberry\perl\bin/perldl line 657 main::eval_and_report('use PGPLOT;\x{a}') called at C:\strawbe +rry\perl\bin/perldl line 606 main::process_input() called at C:\strawberry\perl\bin/perldl +line 626 eval {...} called at C:\strawberry\perl\bin/perldl line 626 BEGIN failed--compilation aborted at (eval 44) line 4, <STDIN> line 2. at (eval 44) line 4 eval ' sub { { use PG +PLOT; ; } } ;' called at C:\strawberry\perl\bin/perldl line 657 main::eval_and_report('use PGPLOT;\x{a}') called at C:\strawbe +rry\perl\bin/perldl line 606 main::process_input() called at C:\strawberry\perl\bin/perldl +line 626 eval {...} called at C:\strawberry\perl\bin/perldl line 626

      ...which appears to be substantially different, though I can't tell if it is better or worse. Any new ideas? Thanks again for the help thus far.




      EDIT: So, I tried removing and reinstalling PGPLOT one more time using PPM and after reinstalling all of the dll's and exe's in my C:\strawberry\perl\bin\ directory I am back to getting this error:


      Can't locate loadable object for module PGPLOT in @INC (@INC contains: + C:/strawberry/perl/lib C:/strawberry/perl/site/lib .) at (eval 40) l +ine 4 Compilation failed in require at (eval 40) line 4, <STDIN> line 1. BEGIN failed--compilation aborted at (eval 40) line 4, <STDIN> line 1.

      So it might be worth skipping all that junk that got spewed out during my first attempt.

        I am back to getting this error

        Sorry - I've only just now remembered that the DynaLoader that shipped with 5.10.0 was broken as regards the mechanism that loads PGPLOT.xs.dll.
        If you can upgrade to 5.10.1, or just grab a 5.10.1 DynaLoader.pm and stick it in there, then all should be fine.

        Or, if you /msg me your email address I could send you the DynaLoader.pm that I use with 5.10.0.

        Cheers,
        Rob
[SOLUTION]: Getting PGPLOT running on Windows XP
by BJ_Covert_Action (Beadle) on Oct 08, 2010 at 17:22 UTC

    Okay, so I figured out how to get PGPLOT running with strawberry perl 5.10.0 on a win32 system. As syphilis mentioned in his reply, Re^3: PDL and PGPLOT on Windows XP, the problem stemmed from having a DynaLoader.pm module that was not working correctly. This file is located, typically, in the directory: C:\strawberry\perl\lib. In order to fix this problem I had to replace my default version of DynaLoader.pm with a version that was built for strawberry perl 5.10.1. Now, there is probably a legitimate, effective way to do this by finding the appropriate source code somewhere on the strawberry perl website. However, I don't know where to find such things so, instead, I hacked together my own solution.

    In order to get an appropriate build for DynaLoader.pm for strawberry perl version 5.10.1, I downloaded the windows 32 installed for version 5.10.1.3 found on the primary strawberry perl page. I then renamed my C:\strawberry directory on my local computer to C:\strawberry_0 so nothing would get overwritten. I proceeded to install version 5.10.1.3 using the downloaded msi file. This created a new C:\strawberry directory on my computer, which I renamed C:\strawberry_5.10.1. I renamed the original strawberry directory (that I appended the _0 to the end of) back to C:\strawberry. I then proceeded to copy the C:\strawberry_5.10.1\perl\lib\DynaLoader.pm into C:\strawberry\perl\lib after renaming the original DynaLoader.pm file located there to 0_DynaLoader.pm.orig.

    Effectively, I replaced the DynaLoader perl module from the old build with one from the new build. All the renaming just allowed me to preserve all of my original copies in case something went horribly wrong. In order to save folks the trouble of going through this whole install process themselves, I decided to post the contents of my new, perl 5.10.1 DynaLoader.pm file on this thread, below, so that you could just grab the source code from here if you want. If, instead, someone wants to point to another source of the perl code for DynaLoader.pm perl 5.10.1, feel free to do so and I'll delete the source code from this thread to reduce redundancy. Hopefully someone will find this useful.

    Cheers,
    Brady

    Click the "Read more..." section below for the source code.


Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://863882]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found