Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Installing modules on Mac OS X

by larus (Acolyte)
on Feb 25, 2009 at 19:25 UTC ( #746355=perlquestion: print w/ replies, xml ) Need Help??
larus has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I'm a bit frustrated 'cause I have been trying to install modules on my new mac for a couple of days now. And with no success. I'm quite new to Perl and coming from Windows, so you'll probably understand what I'm talking. So, I have been trying commands from bash shell
~ > cpan cpan> install Spreadsheet::WriteExcel
I this is what I'm getting after all:
------------------------ snip -------------------------- Checking if your kit is complete... Looks good Writing Makefile for Parse::RecDescent -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible Running make for J/JM/JMCNAMARA/Spreadsheet-WriteExcel-2.25.tar.gz Is already unwrapped into directory /Users/larus/.cpan/build/Spreads +heet-WriteExcel-2.25 CPAN.pm: Going to build J/JM/JMCNAMARA/Spreadsheet-WriteExcel-2.25.t +ar.gz -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible -----------------------------------------------------------------
What I'm doing wrong? What should I do? My intention is to learn more Perl, not to get involved with these kinds of problems (sic!). All you wise monks: can you give any support or help please?

Comment on Installing modules on Mac OS X
Select or Download Code
Re: Installing modules on Mac OS X
by perrin (Chancellor) on Feb 25, 2009 at 19:30 UTC
    It sounds like you haven't installed Apple's dev tools, so you don't have make or gcc. You can get them from Apple.
      Thanks for your quick response. Actually just yesterday I installed Xcode on my system. How can check if there was gcc, if that's is the one I'm missing?
Re: Installing modules on Mac OS X
by jhourcle (Prior) on Feb 25, 2009 at 19:31 UTC

    Do you have make installed?

    You likely need to install the developer tools, which are on the OS disk, but not installed by default. And don't forget to install the "BSD Subsystem", so you'll have the perl header files.

      I'm sorry being noob here, how can I check if I have make installed?
        I installed gcc4.0 from the disk and all the other additional developer's tools. I restarted the computer and tried to install Spreadsheet::WriteExcel via Terminal. No luck, same errors as before. What should I do, please help.

        From the command line, type:

        which make

        You should get back a response such as /usr/bin/make. If you get back nothing, it's a sign that the system can't figure out where make is installed. You should be able to do a 'which gcc' as well.

Re: Installing modules on Mac OS X
by Your Mother (Canon) on Feb 26, 2009 at 05:30 UTC

    You might also try-

    rm -rf /Users/larus/.cpan/build/

    That will take out the build files which previously failed and the CPAN shell will try again.

Re: Installing modules on Mac OS X
by Xilman (Friar) on Feb 26, 2009 at 08:42 UTC

    I'm also a relative newbie at installing on MacOS and got into terrible troubles until I learned the magic incantation:

    sudo perl -MCPAN -e shell
    The sudo was the key requirement ...

    Paul

    (Fixed case of the -e switch. Doh!)
      Oh boy, this is producing awful lot of pain. I did type
      ~ > which make /usr/bin/make ~ > which gcc /usr/bin/gcc
      and I used
      sudo rm -rf /Users/larus/.cpan/build/
      and I tried
      sudo perl -MCPAN -e 'install Bundle::CPAN'
      But all I got was errors. After all this hassle I found this
      http://www.mail-archive.com/macosx@perl.org/msg10184.html
      and tried installing manually. After all, I don't know if this procedure installs all the dependencies. Any glue? Thanks to all who gave a share of their mighty wisdom. Why this have to be so hard? We are programmers, we should make programs that flow like a river stream, eih?

        The problem is that something that works fine on one system breaks in another OS. It's pretty much like languages -- what's easy to write in Perl might not be so easy to write in Ruby, and visa-versa. The same with expressing ideas in French vs. English.

        With systems, it's one thing to deal with a fresh install, and yet another to deal with a system that'd been used for years, with whatever's been installed, a few major OS updates, etc. In theory with MacOSX, it should just be a matter of installing the dev tools, and issuing the command 'sudo cpan'.

        If you're manually installing the modules, it _will_not_ install dependancies, they might 'make' but they'll give errors when you 'make test'. (assuming the module author put in the appropriate tests).

        Check if you have cpan configured to use 'your' make.

        sudo perl -MCPAN -eshell ... cpan[1]> o conf

        and check if you have something like

        make               [/usr/bin/make]

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://746355]
Approved by olus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2014-09-19 08:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (133 votes), past polls