Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hello Monks,

The release of Perl 5.14.0 left me with a desire to try it out. However, I am using Mac OS X, Snow Leopard (10.6.7), and I had a bit of trouble getting all of the goodies to work. I got things working, but there may be a better way! I would be interested to see if others have solved this or similar problems in other ways.

I wanted to use an up-to-date version of Padre (which requires a perl with thread support and wxWidgets). I am making this post, since this information is scattered around in various places and maybe this will help others.

I have taken the advice of the Monastery, and I never mess with the system perl. I currently have a 5.12.1 installation in my /usr/local. However, I have now learned how to use perlbrew (http://www.perlbrew.pl) and I think I will be using it for all of my non-system perl needs in the future.

In my attempts to get a working installation of Padre (from CPAN), I encountered various problems. The installation would succeed, but then I would get crashes when running Padre (for example, Padre would crash whenever I attempted a 'File->Save As'). I think some of the problems I encountered were related to issues with the system wxWidgets supplied with Snow Leopard. Also, the mixed 32-bit and 64-bit nature of Snow Leopard was making it difficult to troubleshoot the problems that I was having. There are 64-bit compatible wxWidgets versions out now (2.9 and higher), but when I attempted to use them with Padre I was running into problems. So to minimize the pain...I decided on 32-bit all the way.

I installed a 32-bit version of fink (http://www.finkproject.org/), and then I installed the wxgtk2.8 package (there are other wx packages, but I still encountered problems in Padre with those so I settled on wxgtk2.8). After the installation you need to be sure that the first wx in your path is the one from fink. If the fink installation directory is in your path you should get the fink version of wx-config. Use 'which' to see which installation of wx is first in your path:

which wx-config

Then you should get output similar to this (/sw is the default installation directory for fink):

/sw/bin/wx-config

I googled and found instructions for building a 32-bit perl on Snow Leopard in an article at http://ecocode.net - "Installing wxPerl on Snow Leopard (works also for 64bit processors)". However, the original link is now 404 (I happened to save a local copy). Using the command line args that I took from that article, I was able to get perlbrew to install a 32-bit, threaded, Perl 5.14.0.

perlbrew install perl-5.14.0 -Dusethreads -Dcc="gcc -m32" -Uloclibpth -Dlibpth=/usr/lib -Accflags="-arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include" -Aldflags="-arch i386 -L/usr/local/lib" -Alddlflags="-arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib" -d

Switch to the newly installed perl:

perlbrew switch perl-5.14.0

Now, you should be able to install the Alien::wxWidgets and Wx modules using cpan.

cpan install Alien::wxWidgets install Wx
Then, you should be able to install Padre.
cpan install Padre
Now that I have made this post, I can't forget how I got things working...and hopefully others find this information helpful.

UPDATE: Instructions for building Padre on Snow Leopard can be found here: http://wildperl.com/2011/07/padre-on-osx-dmg-now-on-leopard-snow-leopard-and-lion/. It also seems that the cause of the File->Save As.. crash has been identified (as detailed in this bug report, http://padre.perlide.org/trac/ticket/1272). I applied this patch (http://padre.perlide.org/trac/attachment/ticket/1272/diff.patch) and things seem to be working with perl 5.14.1, wxWidgets 2.8.12 for Mac OS X (no need for the gtk version of wx any longer), and Mac OS X 10.6.8. I assume this patch will make it into an upcoming version of Padre.


In reply to Getting a working Padre and Wx on Mac OS X (Snow Leopard) with Perl 5.14.0 by kevbot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (6)
    As of 2014-10-25 18:34 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (147 votes), past polls