Dev(3pm)
๐ Dev(3pm) โ the manual page, but make it make sense ๐
okay so bestie, welcome to Dev(3pm) from the User Contributed Perl Documentation collection ๐. Yes, the section is 3pm, yes it's a Perl module page, and yes we're about to read the whole thing together. grab a boba, we're doing this ๐งโจ
๐ธ NAME ๐ธ
PDL::Core::Dev โ PDL development module. that's it, that's the name, she's lowkey mysterious but we love her ๐
โจ DESCRIPTION โจ
so like. this module is basically a lil treasure chest ๐. it encapsulates most of the stuff useful for PDL development, and it gets used a LOT from inside Makefile.PL's. like, constantly. it's giving backstage-pass energy โ you don't see it on stage but the whole show falls apart without it ๐ซถ
๐ฆ SYNOPSIS ๐ฆ
the moment you've been waiting for:
use PDL::Core::Dev;
that's it. that's the whole synopsis. iconic behavior honestly ๐
๐ FUNCTIONS ๐
isbigendian ๐
bestie. is the machine big or little endian? this function will tell you. no cap.
print "Your machins is big endian.\n" if isbigendian();
(it says "machins" in the original and honestly? we're keeping it. it's part of the lore now ๐ญ)
- returns
1if the machine is big endian - returns
0if little endian - dies if neither ๐
and how does she know?? she peeks at the "byteorder" element of perl's %Config array. detective work fr fr ๐
my $retval = isbigendian();
trylink ๐
okay this one is basically a perl configure clone. a whole little baby autoconf situation going on. slay.
if (trylink 'libGL', '', 'char glBegin(); glBegin();', '-lGL') {
$libs = '-lGLU -lGL';
$have_GL = 1;
} else {
$have_GL = 0;
}
$maybe =
trylink 'libwhatever', $inc, $body, $libs, $cflags,
{MakeMaker=>1, Hide=>0, Clean=>1};
what she does: tries to link some C-code making up the body of a function, with a given set of library specifiers. like a vibe check but for linking ๐ฅ
returns 1 if successful, 0 otherwise.
trylink $infomsg, $include, $progbody, $libs [,$cflags,{OPTIONS}];
takes 4 + 2 optional arguments. let's go through them one by one, no skips, we're thorough in this house ๐
- an informational message to print (can be empty)
- any commands to be included at the top of the generated C program (typically something like
"#include "mylib.h"") - the body of the program (in function
main) - library flags to use for linking. preprocessing by MakeMaker should be performed as needed (see options and example).
- compilation flags. for example, something like
"-I/usr/local/lib". optional argument. empty if omitted. OPTIONS:
OPTIONS โ the lil config menu ๐
MakeMakerโ preprocess library strings in the way MakeMaker does things. this is advisable to ensure that your code will actually work after the link specs have been processed by MakeMaker. fr, don't skip this one.Hideโ controls if linking output etc is hidden from the user or not. on by default except within the build of the PDL distribution, where the config value set inperldl.confprevails. she's on unless the conf says otherwise ๐ซCleanโ remove temporary files. enabled by default. you might want to switch it off during debugging ๐ (yes bestie, that means the temp files stay around so you can stare at them. debugging arc.)
generate_core_flags ๐๏ธ
prints on "STDOUT" XS text with core flags, for Core.xs.
that's the whole thing. she prints. she's straightforward. we respect a no-nonsense queen ๐
got_complex_version ๐งฎ
PDL::Core::Dev::got_complex_version($func_name, $num_params)
so for a given function appearing in C99's "complex.h", this will return a boolean of whether the system being compiled on has the complex version of that.
like, e.g. for "sin", will test whether csinl exists (before 2.069, would only check for csin, causing build failures on non-C99 compliant libc which mandates long-double versions).
๐ซ yes bestie this is the "why is my build failing on that one weird libc" function. she exists because things broke. she's a survivor.
๐ and that's the whole page ๐
thanks for coming to my ted talk, you now know PDL::Core::Dev better than like 90% of the people who've ever run a Makefile.PL. periodt ๐
this lil beauty lives in perl v5.38.2, dated 2024-04-10, and yes it's the Dev(3pm) page, so if you see it in the wild you'll know exactly what's up ๐ซถโจ mwah, go build something cute ๐
๐ฆ where this page comes from
- ubuntu noble: pdl 1:2.085-1ubuntu1 ยท 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