Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Getting a working Padre and Wx on Mac OS X (Snow Leopard) with Perl 5.14.0

by kevbot (Chaplain)
on Jun 17, 2011 at 23:18 UTC ( #910271=perlmeditation: 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.

Comment on Getting a working Padre and Wx on Mac OS X (Snow Leopard) with Perl 5.14.0
Select or Download Code
Re: Getting a working Padre and Wx on Mac OS X (Snow Leopard) with Perl 5.14.0
by davido (Archbishop) on Jun 18, 2011 at 03:18 UTC

    Thanks for the helpful post. I dismissed Padre as being carelessly buggy when the first time I hit "File->Save As" it simply *poof* terminated without a trace. Your persistence seems to have paid off. I think I'll give it a try again now. I know that it has received a general thumbs-up for those who have it working.

    Good choice on moving over to Perlbrew. I've grown to like it in a short period of time.


    Dave

      hmm, I don't recall that bug being reported. Do you remember which version was that and on what operating system?

        If my recollection is correct, the "File Save As" crash happened when I attempted to use the system Wx supplied with Snow Leopard. On Snow Leopard,

        /usr/bin/wx-config --version

        gives

        2.8.8

        I think this happens with both perl 5.12 and 5.14. Also, I think this happened with the non-gtk versions of Wx that I tried (from fink). I went through many iterations of testing and combinations of perl and Wx in order to get this working so my recollection may not be entirely accurate.

Re: Getting a working Padre and Wx on Mac OS X (Snow Leopard) with Perl 5.14.0
by Anonymous Monk on Jun 18, 2011 at 05:48 UTC
Re: Getting a working Padre and Wx on Mac OS X (Snow Leopard) with Perl 5.14.0
by markwx (Acolyte) on Jun 18, 2011 at 16:57 UTC
    Spooky - I posted to Padre list and put up Wiki entry
    http://wiki.wxperl.info/w/index.php/Mac_OS_X_Platform_Notes
    about 2 / 3 hours after your post. Had worked on getting a usable Perl + Wx from scratch to help with Wx::Scintila so thought I would record it.
      Thanks for the link to your post (which contains instructions for how to build a 32-bit perl on Mac OS X). I was a little surprised how difficult is was for me to find this info (as I mentioned, the link that I had found is now 404). Wx::Scintila installed and worked fine with my setup too.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-11-23 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (134 votes), past polls