PDL::I...llGuide(3pm)
π PDL::InstallGuide π β the install guide (aka PDL::I...llGuide(3pm), but like, the whole vibe)
okay bestie, if you've been fighting with getting PDL onto your machine, this is your page. it's literally installation notes for PDL. β¨
πΈ DESCRIPTION πΈ
these are notes that exist purely to help you get PDL installed fr β especially on Windows, MacOS, and Cygwin. it's giving "we've been through this, let us help you."
there's another source of info too, over at <https://pdl.perl.org/?page=install>. π
π INSTALLATION π
step one, bestie: check your Perl isn't ancient. you need 5.14.0 and above. no cap, that's the requirement.
then you just slide cpanm in there like:
cpanm PDL::Basic
and boom, that gets you PDL. π
now listen β there are additional modules you can install for extra features, but for speed of installation and ease of maintenance, they're deliberately not bundled into the package above. tragic? maybe. but you can grab them with a command just like the one above, and any dependencies get installed automatically. slay.
if you wanna contribute to PDL (main character energy fr), go look at PDL::DeveloperGuide and/or PDL::FAQ.
π MacOS X π
want a full distribution of PDL on MacOS X? try <https://github.com/PDLPorters/SciPDL>. π«Ά
there are also plans to bring PDL to Homebrew, so go check that to see if it's landed there yet.
NOTE: the PDL::Graphics::TriD window controls are based on having a mouse with 2 or more buttons. π±οΈ
for Macs with only one button, you can use Ctrl+Click to generate the needed Right-click. you can also configure the Macbook trackpad to generate a secondary click via the control panel. iconic.
πͺ Windows πͺ
for instructions on installing PDL binaries (PPM packages), hit up the wiki: <https://github.com/PDLPorters/pdl/wiki/Installing-PDL-on-Windows>
if you wanna build from source, the best way (at least as of 2024) is to install Strawberry Perl, which includes Minimalist Gnu for Windows (MinGW) β a whole full development environment. π
there's also a Strawberry Perl PDL Edition, with many extra libraries included, along with a version of PDL. double slay.
π§ Cygwin π§
NB: these notes may not be fully up to date. π
this directory contains supplemental build information to configure and install PDL on a windows system with the cygwin toolset (<https://www.cygwin.com>).
the cygwin library provides the missing unix/posix functionality that lets unix applications be ported to windows more easily. a windows PC with cygwin looks like a different flavor of unix. and since cygwin looks like a Unix, [almost] all of the standard perl functionality works and PDL can build pretty much exactly how it does on other unix systems. π
see "Windows" for instructions on building a native Windows PDL.
it is recommended that you build and install PDL based on a full cygwin 1.7.17 or later. please post to the perldl mailing list for help or questions about a cygwin install.
by default, Cygwin has an ~300MB process memory limit. if you work with large data sets, you may wanna use the native win32 PDL with either ActiveState Perl or Strawberry Perl. otherwise, you'll want to set the value of heap_chunk_in_mb to allow for bigger data, as described in the Cygwin Users Guide: <http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html>
WARNING: β οΈ there is a known problem with windows DLL base addresses being scrambled, causing mysterious failures for cygwin builds. see the "rebaseall" directions below for the current workaround. development for recent cygwins appears to be making progress towards fixing this problem.
if you already have a full cygwin install on your PC, the simplest way to get a basic PDL is the cpanm command, as above. this gets you all the functionality supported by existing cygwin package functionality (i.e. available from the standard Setup.exe installs).
π§ rebaseall π§
there's a known issue on cygwin where DLLs have to have their base addresses fixed so runtime conflicts don't occur. the problems hit the external modules and their interfaces using DLLs. the usual sign is that some tests fail mysteriously. π
if you run the failing test by hand, for example:
perl -Mblib t/plplot.t
you may see no error but only 1 test run, or even a message saying the test failed before generating any output. if so, you'll need to run rebaseall:
- Generate a list of additional DLLs to check:
find /usr/lib/perl5 /usr/bin /usr/local /pdl_build_dir/blib -iname '*.dll' > /bin/fixit.list
- Exit all cygwin processes, windows, shells, X server,...
- Start up a windows CMD shell window (Start->Run cmd)
- cd to the cygwin
/bindirectory (cdc:\cygwin\binby default) - Run
ashin that directory (ash) - Run rebaseall (./rebaseall -T fixit.list)
Note that we created thefixit.listfile in thec:\cygwin\binfolder to begin with. If you put it elsewhere, you'll need to use the appropriate pathnames.
- Run peflagsall (./peflagsall -T fixit.list)
- Restart cygwin
after the rebaseall command has completed, you should be able to start up X windows and rerun the failed tests (perl -Mblib t/testname.t) or all tests (make test). π₯
NOTE: from the cygwin-xfree mailing list: > Also, I've found that using a different base address with rebaseall > seems to help with some X problems: > > dash -c "rebaseall -b 0x77000000" > > http://cygwin.com/ml/cygwin/2011-04/msg00306.html > > cgf
πΎ Establishing maximum memory available πΎ
run this as perl filename.pl chunksize_in_MB [seconds_delay]:
#!/usr/bin/perl
use PDL;
my $MB;
my @data;
my $chunk = (scalar @ARGV) ? $ARGV[0] : 1;
for ($MB = 0; $MB < 5000; $MB += $chunk) {
print "Allocating: total data -> ${MB}MB..";
push @data, zeros($chunk,125,1000);
print ".. done\n";
sleep $ARGV[1] if scalar(@ARGV) == 2;
}
print "Got total of $MB!\n";
π Changing Cygwin's maximum memory π
Cygwin's heap is extensible. however, it does start out at a fixed size, and attempts to extend it may run into memory which has been previously allocated by Windows. in some cases this problem can be solved by adding an entry in either the HKEY_LOCAL_MACHINE (to change the limit for all users) or HKEY_CURRENT_USER (for just the current user) section of the registry.
add the DWORD value heap_chunk_in_mb and set it to the desired memory limit in decimal MB. it's preferred to do this in Cygwin using the regtool program included in the Cygwin package. (for more info about regtool or the other Cygwin utilities, see the section called "Cygwin Utilities" or use the --help option of each util.)
You should always be careful when using regtool since damaging your system registry can result in an unusable system. π not a vibe.
this example sets the memory limit to 1024 MB:
regtool -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 1024
regtool -v list /HKLM/Software/Cygwin
exit all running Cygwin processes and restart them. memory can be allocated up to the size of the system swap space minus the size of any running processes. the system swap should be at least as large as the physically installed RAM, and can be modified under the System category of the Control Panel.
here's a small program written by DJ Delorie that tests the memory allocation limit on your system:
main()
{
unsigned int bit=0x40000000, sum=0;
char *x;
while (bit > 4096)
{
x = malloc(bit);
if (x)
sum += bit;
bit >>= 1;
}
printf("%08x bytes (%.1fMb)\n", sum, sum/1024.0/1024.0);
return 0;
}
you can compile this program using:
gcc max_memory.c -o max_memory.exe
run the program and it will output the maximum amount of allocatable memory. π«‘
π«Ά SUPPORT π«Ά
if you have problems building or installing PDL, we suggest contacting the PDL users and developers via the PDL mailing lists. see <https://pdl.perl.org/?page=mailing-lists> to get started. π links to searchable archives of the lists are available on that same page.
and that's the whole page bestie, go forth and install π
this page is from the User Contributed Perl Documentation for PDL::InstallGuide(3pm), documented under perl v5.42.3 and dated 2026-08-20. mwah, go build something cute. π¦πΈπ
π¦ where this page comes from
- ubuntu stonking: pdl 1:2.106-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms