Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: MAC Perl EXTERN.H Make Issues

by Your Mother (Archbishop)
on Oct 26, 2018 at 18:32 UTC ( [id://1224749]=note: print w/replies, xml ) Need Help??


in reply to MAC Perl EXTERN.H Make Issues

And for posterity and the record: MacPerl is not Perl. They are not mixable and it’s a bad idea to use the term unless you’re talking about the actual port: http://wiki.c2.com/?MacPerl. OS X Perl is just Perl. MacPerl is/was for OS 9 and friends. The installation issues on Macs today—excepting those revolving around C-libs for things like images, as Corion noted—are the same across almost all OSes that run Perl.

Replies are listed 'Best First'.
Re^2: MAC Perl EXTERN.H Make Issues
by localshop (Monk) on Oct 26, 2018 at 19:50 UTC
    I've found the OSX system Perl more restrictive than most in that even as root you are unable to write to /usr/bin and similar trees which makes the binding of external libraries significantly more problematic.

    I'd always ended up installing another version on OSX and things would stabilise but I always felt a little dirty running multiple versions. Thanks for the advice - I now at least feel somewhat better informed and now also know not to write the system Perl as Mac Perl.

    Another take-away for me was also that brew install perl != perlbrew. I think that spending a little more time exploring these on a new setup has given me a little more confidence as to what is going on. Next on the list is writing some local modules with C library bindings which is something I've always wanted to do but never got around to - while playing around this level and with a little time on my hands I think I'll have a crack.

    Thanks for the advice.

      "Next on the list is writing some local modules with C library bindings"

      I've done this quite a few times.

      My WiringPi::API might be a reasonable example for you to have a look at. The API.xs file contains a few custom C functions that are provided to Perl, as well as the list of the majority of functions that are accessed from the shared wiringPi library itself.

      The API.pm Perl module file loads the XS file, and provides direct access to the C functions directly, and optionally presents the equivalent Perl wrappers (the software can be used in Object Oriented or functional style).

      The Makefile.PL file, specifically the LIBS and INC directives show how to link in the shared libraries, and how to include your required files respectively.

      …OSX system Perl more restrictive than most in that even as root you are unable to write to /usr/bin and similar trees…

      moo@cow[93]/usr/bin>sudo touch monkey
      Password: 🔑
      touch: monkey: Operation not permitted
      

      That’s very interesting… I don’t recall bumping up against that in the past. Nice call out.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-09-15 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (21 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.