[Users] External library detection script in Perl

Erik Schnetter schnetter at gmail.com
Mon Feb 29 13:35:59 CST 2016


As discussed earlier today in the telecon, I rewrite the detection
(but not the build) script of the FFTW3 package in Perl. I attach the
Perl script for your consumption; otherwise, please look at the "perl"
branch of this thorn.

I am pleasantly surprised by the result. The Perl code was easier to
write than the Bash code. The resulting code is also cleaner and
easier to read. Support for arrays, scoped variables, and
differentiating between "empty string" and "undefined variable" help a
lot. Two 20-line Bash helper scripts turned into 2 lines of Perl each.
I also took the opportunity to add a few self checks.

There were only two minor hiccups, namely finding the equivalents of
"mkdir -p" and "date" in Perl. I solved both easily via Google
("make_path", "localtime" / "strftime").

Finally I want to remark that this script is still stand-alone.
Translating another script, comparing to Steve's MPI script, and
looking at Frank's bash_utils should easily identify common functions
that should be put into a module.

Steve -- could you as Perl expert do me a favour and scrutinize the
script for errors or ways to improve it?

-erik

-- 
Erik Schnetter <schnetter at gmail.com>
http://www.perimeterinstitute.ca/personal/eschnetter/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: detect.pl
Type: text/x-perl-script
Size: 7765 bytes
Desc: not available
Url : http://lists.einsteintoolkit.org/pipermail/users/attachments/20160229/0a712d43/attachment.bin 


More information about the Users mailing list