Your Mother has asked for the wisdom of the Perl Monks concerning the following question:
In the imortal words of the single greatest character in all media, in all history, Jar Jar Binks: My give up.
FFI::Platypus was sagely recommended here before. I read the doc and watched the youtube talks; read a few of the example scripts and tests. I am really excited to try it.
I cannot even get the most simplistic lib check—on the libraries I’m interested in using—to work. I have tried about 100 minor variations of this basic formula (including paths all over my drive and variations and guesses on lib names and adding recurse => 1) to no avail.
perl -MFFI::CheckLib -E 'say "OK" if find_lib_or_exit lib => "archive" +' OK
# Tried MANY variations on this theme with lib_path and recurse too. perl -MFFI::CheckLib -E 'find_lib_or_exit lib => "dcmdata"' library not found: dcmdata at -e line 1.
DCMTK is definitely installed on my system; as a binary, I think, I don’t remember building/installing it. I can find the libraries manually, I think. I tried using their various paths. The tools are in the regular $PATH, e.g. /usr/local/bin/dcmodify. The packages I am interested in wrapping up and using in Perl include those here DCMTK Documentation.
What am I doing wrong? Surely something, I hope something, simple.
The simple problem—finding the library—is solved with a local tweak thanks to swl pointing out the platform specific regex. They use the extension “a.”
find /usr/local/lib | ack dcmdata /usr/local/lib/libdcmdata.a
# Change in FFI::CheckLib. push @$pattern, qr{^lib(.*?)(?:\.([0-9]+(?:\.[0-9]+)*))?\.(?:dylib|b +undle|a)$}; # add "a"
perl -MFFI::CheckLib -E 'say "OK" if find_lib_or_exit lib => "dcmdata" +' OK
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FFI::Platypus; trouble finding non-standard, but present, libs
by swl (Prior) on Oct 30, 2019 at 05:24 UTC | |
by Your Mother (Archbishop) on Oct 30, 2019 at 05:38 UTC | |
by swl (Prior) on Oct 30, 2019 at 10:43 UTC | |
by Your Mother (Archbishop) on Oct 30, 2019 at 16:37 UTC | |
by swl (Prior) on Oct 30, 2019 at 20:58 UTC | |
|
Re: FFI::Platypus; trouble finding non-standard, but present, libs
by Anonymous Monk on Oct 30, 2019 at 06:37 UTC |