Multiple architecture compiling (of ruby extensions) on OS X: The Killer -E Flag

At work I’ve had to compile a lot of extremely heavyweight Perl extensions for OS X. I have had a lot of trouble with it when I try to make Universal Binaries. I thought this was a problem with Perl or with the GUI toolkit I was trying to use, but just now I’ve run into some serious trouble trying to compile some simple extensions for a Universal Binary of Ruby. Ruby compiled OK, but I could not for the life of me compile the SQLite extension for it — which was absolutely trivial to compile and install when I was using a non-Universal-Binary Ruby.

I tracked down what was stopping me and it was this:

“gcc -E -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.9.1 -I. -I/usr/local/include -O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -pipe -fno-common conftest.c -o conftest.i”
gcc: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags

I looked up what the -E flag is and it’s “Stop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed source code, which is sent to the standard output.”

Well… as far as I can tell, running GCC with the -E flag is a fairly standard method to determine whether you’ve got a library installed. If I can’t do that with a universal binary Ruby because of the build flags that it carries along with it, I’m not going to be able to build *any* native extensions without huge headaches, and to be honest, if I wanted huge headaches, I’d be using Perl.

I may be missing something here — there may be a way to suppress those flags, and get on with life. But I sure don’t know what it is, and the Ruby extension build mechanism doesn’t know what it is either, so as far as I’m concerned, it’s time to kiss my universal-binary Ruby goodbye, and with it my dreams of putting together RubyCocoa applications which will work equally well on PPC and Intel macs.

Ah well.

“We raised our son to be a warrior.”

Salt Lake Tribune – Dr. Laura son linked to lurid Web page:

Dr. Laura Schlessinger: “We raised our son to be a warrior.”

Dr. Laura’s Son Deryk’s Myspace Page: “Yes . . . F—ING Yes!!! I LOVE MY JOB, it takes everything reckless and deviant and heathenistic and just overall bad about me and hyper focuses these traits into my job of running around this horrid place doing nasty things to people that deserve it . . . and some that don’t.”

From the article:

The MySpace page, publicly available until Friday when it disappeared from the Internet, included cartoon depictions of rape, murder, torture and child molestation; photographs of soldiers with guns in their mouths; a photograph of a bound and blindfolded detainee captioned “My Sweet Little Habib”; accounts of illicit drug use; and a blog entry headlined by a series of obscenities and racial epithets.

An Army spokesperson suggests that “our enemies” may have slyly created a fake myspace page to make Dr. Laura’s son look bad.

Oh great… I can’t watch Shrek now

Every week the local elementary school sends a bag of ten books home with the kids, to borrow for that week. Imagine my surprise when last week we found, among those books, a short story about an ogre, named Shrek!

Shrek, of Shrek!, is green, and has weird suction-cup ears. He meets a donkey on his travels and marries an ugly princess.

I haven’t actually seen the movies of that name, but one can’t help knowing all about something that Disney (or Dreamworks or whatever) want you to know all about. They beam it into your brain at night using cosmic rays, or something.

Anyway, I haven’t actually seen the movie of that name, but I’m pretty sure (thanks to the cosmic rays) that the resemblance ends there. And that’s too bad, because Shrek! is an awesome book about a perfectly horrible monster. So horrible that snakes which bite him go into convulsions and die, and he can handily dispatch a dragon with a puff of “putrid blue flame.” Mike Meyers would be an utterly unsuitable casting choice for this Shrek. I’d cast an angry five year old and pitch-bend his voice down three octaves.

But I’m not sure a five year old could deliver the poetry. Shrek! is full of interesting language and clever verse. Writer William Steig is very good.

The thing is, Shrek! would actually make a great animation. Not a blockbuster CGI animation, or even a deluxe Disneylike animation — an old fashioned, low budget animation where the character of the drawings in the original was preserved.

I don’t imagine that can happen now. Steig has passed away; I hope he died very rich and comfortable on the proceeds of selling out his awful ogre. No biggie for him. His imagination was full of more, I’m sure.

Anyway, now that I’ve read the real Shrek!, I’m pretty sure the animated one would just make me sad.

The Secret

I’m late to the party on this one, but apparently a “if you think it it will come” book called The Secret was on Oprah and spurred a lot of reaction. I’m not going to speak for or against it except to say that if you’re gonna go with that why not go straight back to the classic.

The Secret and similar books piss many people off because if you believe that people can bring fortune into their lives, then you can blame the unfortunate for their misfortune — and you can revere the fortunate for their good fortune, because it’s all to their credit! It’s a very Republican way of thinking, when you take it in that direction — the poor have made themselves poor, and are thereby dragging the rest of us down; the rich have made themselves rich, and are therefore benefitting us all. Let us reward the rich to encourage them to be more rich, and punish the poor to discourage them from being so poor. Tax cuts and welfare reform!

Sorry, got a little carried away there.

So something like The Secret or As A Man Thinketh brings up, in an exaggerated, supernatural way, the difficult question of how much control over one’s situation we ought to attribute to people.

One can go destructively far in the other direction. If you don’t believe people have any control over their lives, you court learned helplessness, which is psychologically devastating.

How do you find the most helpful and most accurate balance in terms of control over one’s fate?

Martin Seligman, who was involved in the original Learned Helplessness research, discovered that the psychologically optimal strategy seemed to be to skew one’s attributions so that one thought of positive developments as having personal, internal, permanent causes — e.g. “I got the job because I’m an intelligent guy” — and negative developments as having impersonal, external, temporary causes — e.g. “I lost the job because of the way the downswing in the economy happened to affect my company this quarter.” People who skewed things that way, Seligman found, seemed to be the happiest and most successful in life.

That’s what’s helpful (at least according to one psychologist), but what’s accurate? I’ve got no idea how to determine that.