Saturday, July 25, 2009

Sunday, July 12, 2009

Year in review

It's been just over a year since I started this blog. I posted a LOT more than I thought I would. Also, I apparently dropped the tradition of reviewing beers. So I'll start by reviewing some beers!

Mountain Sun Hummingbird - a strong honey-ale (meade-beer?) brewed with orange blossom honey. Slightly darker than a typical Belgian Golden but similar in style. The beer is mildly sweet but very drinkable. Hmm... there are flavors I should mention but they escape me.

Mountain Sun/Avery Van Diemens - brewed with Tasmanian Pepper Berry, this is a very curious, semi-dark beer. When I first sampled it, I tasted a little bit of pepper kick at the end, but couldn't really identify any other flavors. Yesterday I sampled it next to a burrito with some somewhat spicy salsa. Somehow, since my mouth was already sensitized to spiciness, the flavor I got was root beer (sassafras?). It was... odd. Pretty good, but I didn't end up purchasing a glass.

Moving on to code. I don't know why I haven't mentioned this, but with my discovery of svn, I started uploading my code to the webternets: agpy is my Google Code page and includes a number of useful python codes, especially readcol and gaussfitter, which I have tested and used extensively since writing them. Python is still a long way from a cohesive astrolib code base, but with individual contributions, the STSCI development group, and APLpy underway, we're getting closer.

Wednesday, July 8, 2009

SUCCESS! 64 bit python with 64 bit tcl/tk!!!

After a long, tedious process (see previous posts), I got 64 bit python, 64 bit tcl/tk, and 64 bit tkinter all to work! I can now use the TkAgg backend in matplotlib!

Python 64 bit on Mac OS X: Sam Skillman's post

Tcl/Tk 64 bit: a post on the tcl/tk forums

tkinter 64 bit: python bug report 4017 (last two posts give the solution) and my posted solution

Sunday, July 5, 2009

Failure to compile 64 bit gtk on mac os

Attempted to install gtk+-2.17.2 on my mac. Had to install:
glib-2.21.2
which would not let me compile with multiple architectures, and
pkgconfig-0.9.0,
which won't configure because:

configure: configuring in glib-1.2.8
configure: running /bin/sh './configure' --prefix=/usr/local CC= CFLAGS= LDFLAGS= --cache-file=/dev/null --srcdir=.
configure: warning: CC=: invalid host type
configure: warning: CFLAGS=: invalid host type
configure: error: can only configure for one host and one target at a time
configure: error: /bin/sh './configure' failed for glib-1.2.8


which is bs because I don't have any compiler flags set.

So, gtk+ seems hopeless.

UPDATE: 0.9.0 is not the latest version, 0.23.0 is. Dumb version numbering.


GTK is absurd to install. You need:
pkg-config
glib
cairo
pixman
pango (MUST be installed AFTER cairo)
atk
libtiff
libjpg
jpeg2000 - but I just passed a flag to not do this because it didn't install right. --without-libjasper
fontconfig I mean, really? at this point it's just ridiculous....

and finally, it died with this:
checking Pango flags... configure: error:
*** Pango not found. Pango built with Cairo support is required
*** to build GTK+. See http://www.pango.org for Pango information.

which meant that I had to reinstall Pango because I had installed it before Cairo.

I believe this is where the term dependency hell comes from.

Also, I don't think any of these are x86-64 compatible.


Then I'm STILL not done.

PyGTK dies with an import error on dsextras, which a painful google search traces to pygobject. pygobject makes and installs fine.... but then I find out it installed to /usr/local/lib/python2.6/site-packages/gtk-2.0/, which is obviously not on my python path since I installed a framework.

So:
./configure --prefix=/Library/Frameworks/Python.framework/Versions/2.6/
in both pygobject and pygtk.

Oh, guess what? Need pycairo too. What happens there? What you'd guess:
ld warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libcairo.dylib, file is not of required architecture

so when I configure pygtk:

The following modules will be built:

atk
pango

The following modules will NOT be built:

pangocairo
gtk
gtk.glade
gtk.unixprint

Damn. That blows.

python-64 -c "import gtk"
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so: mach-o, but wrong architecture

FAIL.

Thursday, July 2, 2009

Installing 64 bit tcl/tk on Mac OS X

Everything is described in this post:
http://www.nabble.com/Error-compiling-tk-8.5.7-on-Mac-OS-X-10.5-td23790967.html


But here's a script too:

curl -O 'http://osdn.dl.sourceforge.net/sourceforge/tcl/t{cl,k}8.5.7-src.tar.gz'
for f in t*8.5.7*.gz; do tar zxf $f; done
cd tcl8.5.7/unix/
./configure --enable-framework --enable-64-bit
cd tk8.5.7/unix/
./configure --enable-framework --enable-64-bit
make -j 4 -C tcl8.5.7/unix
make -j 4 -C tk8.5.7/unix
sudo make install -C tcl8.5.7/unix
sudo make install -C tk8.5.7/unix


Concerns:
-might be necessary to do this in the macosx directory for some reason, though Aqua doesn't support 64 bits
-have to recompile python to get _tkinter to work (see a later post)