Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: MAC Perl EXTERN.H Make Issues

by localshop (Monk)
on Oct 26, 2018 at 19:50 UTC ( [id://1224751]=note: print w/replies, xml ) Need Help??


in reply to Re: MAC Perl EXTERN.H Make Issues
in thread MAC Perl EXTERN.H Make Issues

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.

Replies are listed 'Best First'.
Re^3: MAC Perl EXTERN.H Make Issues
by stevieb (Canon) on Oct 26, 2018 at 20:04 UTC
    "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.

Re^3: MAC Perl EXTERN.H Make Issues
by Your Mother (Archbishop) on Oct 26, 2018 at 20:26 UTC

    …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.

        ++ And that's why I hadn't seen it. It's only three years old, I update rarely from being burned by trying to stay too current, have been busy at work, and was about a year without a desktop Mac after hurricane Irma. Still, I think I like it. I appreciate Apple taking some of this stuff and general customer security seriously.

Log In?
Username:
Password:

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

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





    Results (22 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.