Thursday, November 23rd, 2006

XFig running on Mac OS X thanks to Fink

Filed under: — Daniel Lemire @ 14:44

After all the bad mouthing I did over Fink and X11, I got to my office and did this:

cp /private/etc/X11/xinit/xinitrc ~/.xinitrc
chmod +w ~/.xinitrc
vim ~/.xinitrc (add . /sw/bin/init.sh as the first line)

Then, a bit later, I got this (click to enlarge):

Wednesday, November 22nd, 2006

Why Fink is broken for anything but non-X applications

Filed under: — Daniel Lemire @ 23:44

Update. Since I wrote what follows, I’ve managed to find ways to install X11 and KDE and all my favorite software with minimal pain. So Fink is not broken, but it could be friendlier. Same holds for Apple’s X11. In fact, Fink is an incredibly powerful tool when combined with something like KDE. It extends Mac OS X in incredible ways.

Fink is a tool to install most common Unix applications (gnuplot, Xfig, you name it!) on MacOS. It has a nice and simple command line interface which I love.

My friend Scott Flinn seems to maintain that Fink is a good solution, even if you want to run X applications (such as XFig, but he went so far as to include KDE appllications!!! Daring!!!).

Ok. One wasted afternoon and one wasted evening later, I beg to differ with Scott.

(Disclaimer: I think that MacOS X is about 10 times better than Windows XP. I’m very happy I bought Apple gear. But when things are poorly layed out, poorly organized, someone has to say it. Even when volunteers do the work.)

Let’s review some of the claims people make:

  • Fink supports X11. This is true, but you end up with a primitive X server, without any sensible integration with the OS. I can have the same deal with cygwin/X for Windows, and who uses that? I read somewhere that MacOS was a Unix platform. If it can’t do better than Windows at emulating a real Unix box, well, I will not be impressed.
  • Apple supports X11. This is true, but not by default, and you need to be clever.

    First of all, do not confuse “MacOS X Server” (which is expensive payware to run MacOS version 10 as a server OS) with “support for X11″. I don’t even want to think about what will happen down the line when Apple comes out with “MacOS XII” (Mac OS 12) and offers “Mac OS XII Server”. If your font is slightly bad, you might be lost at this point. Short story: Apple sells a Server OS which has nothing to do with an X server.

    Second of all, Apple has a nice and convenient download page for its X11 server. Except that it says: Note 10.4 customers can install X11 by using the Tiger DVD installer disk. What this means, in Apple talk, is that if you have 10.4, you need your Tiger DVD. It won’t tell you this even as you try to install the freshly downloaded package on your machine: it will tell you that you already have “more recent software installed” (which wrongly suggested to me that X11 was already installed!). Yes, I know, they don’t say “must install”, they say “can install from DVD”, but apparently, for Apple, if you can do at thing, you must do a thing. Did you lose your DVDs? Too bad. Ok, turns out that in my case, I still have them. I put the “Tiger” DVD in (which, interestingly, is not called “Tiger” at all, but “Mac OS 10.4″). Then a window pops up with a few icons, mostly a README, and two reinstallation option. I try to reinstall the bundled application, reboot. No luck. Ok, now I go for the full reinstall of the whole OS. Still no luck. At this point, I reinstalled my OS and rebooted twice. Now, wait… Oh! When you put the DVD in, in the window that opens, if you scroll all the way to the bottom, you see “optional installs”. Ah! I run this! Ah! X11. Ah! Cool. Looks like I installed it, but there is no instruction, nothing. The installer just quits without telling me anything. Now, where is that X11 thing? It has to be on my machine now! In Finder, under Applications, maybe? No. Nowhere to be found. Hmmm… Did it install the thing? Why won’t it leave a trace? Searching for X11.app in Finder gives me nothing. I search for “X11″. Ok, now, beside a bunch of files derived from Fink, I have something called X11 as an application. Where and how I’m supposed to find it usually is beyond me. (Later on, the X11 application appeared under “Applications / Utilities”, but how was I supposed to guess this?) I launch X11 and it looks good. I get some kind of shell. I can’t test it yet, but it looks hopeful. At this point, my afternoon is completed and I must go home.

  • Fink supports Apple’s X11. This would be the best of both worlds. Fink provides the applications, and Apple provides an X server with a nice integration to the OS. Unfortunately, this is painful and can be a lenghty process.

    Here is what fink tells me when I want to install an X application:

    You have an existing X11 installation in /usr/X11R6 and/or /etc/X11.
    This package refuses to overwrite these. Remove them, then tell Fink to
    install xfree86 again. (The package won’t be recompiled.) If you want
    to keep your X11 installation, please see the FAQ entry at
    http://fink.sourceforge.net/ faq/ usage-packages.php#apple-x11-wants-xfree86
    for more information on how to configure your system.

    The link basically says this:

    If you have a current version of fink (>=0.18.3-1), typically what you need to do is reinstall the X11User package, since the installer application occasionally misses installing a file. You may need to do this multiple times.

    Right there, I have to stop. What is X11User? I’ll save you the trouble and about 3 hours wasted. X11User is the very thing I installed from the “Tiger” DVD. Turns out that you can do the install from a shell, so let’s do it again, and again, and again. (They say to do it multiple times. They say that the application sometimes does not install all files? What a piece of software engineering!!! Way to go Apple!)
    cd "/Volumes/Mac OS X Install Disc 1/System/Installation/Packages"
    sudo installer -pkg X11User.pkg -target /

    Ok. I did it about ten times to be sure. Every time the installer tells me “The upgrade was successful”. Now, I’ll save you the trouble, but later on, we learn that we better have something called X11SDK. It is not clear that I need this, but let’s be safe. (Earlier, I reported, on my blog, that “X code”, which is “Apple talk” for “dev-tools” was installed.)

    cd "/Volumes/Mac OS X Install Disc 1/Xcode Tools/Packages"
    sudo installer -pkg X11SDK.pkg -target /

    Ok, so far so good. I repeat this about ten times, just to be sure given the, apparently well known, randomized behavior in Apple’s installers. Now, I’m told that “fink list -i system-xfree86″ should output some pseudo-packages. It outputs nothing except “Information about 4816 packages read in 1 seconds.” Given that I have two processors in this machine, I’m not impressed that it takes 1 second to parse 4816 packages, but I presume that Fink is not written in assembly. Fine.

    Not all is lost! Fink tells me that if nothing works, I can try to “flush out my X11 installation and remove any old placeholders and partially/fully installed X11-related packages”. Oh! Ok. The command line is long and it remove my precious X11 application (this is scary! what else does it remove?), plus it tries to update Fink using what appears to be a very slow pipe (I have selected the rsync update method after the CVS method just hung there for over two hours doing nothing). What gets to me here is that clearly, Fink is in error, why do I need to remove Apple’s X11 to fix Fink? Can we say “bad engineering”?

    Ok, now I try to rebuild from the ground up:

    cd "/Volumes/Mac OS X Install Disc 1/System/Installation/Packages"
    sudo installer -pkg X11User.pkg -target /
    sudo installer -pkg X11User.pkg -target /
    sudo installer -pkg X11User.pkg -target /
    sudo installer -pkg X11User.pkg -target /
    sudo installer -pkg X11User.pkg -target /
    sudo installer -pkg X11User.pkg -target /
    (repeat many times)
    cd "/Volumes/Mac OS X Install Disc 1/Xcode Tools/Packages"
    sudo installer -pkg X11SDK.pkg -target /
    (repeat many times)

    Now, I run the damned command “fink list -i system-xfree86″ and get…


    i system-xfree86 2:4.4-2 [placeholder for user installed x11]
    i system-xfree86-dev 2:4.4-2 [placeholder for user installed x11 development tools]
    i system-xfree86-s… 2:4.4-2 [placeholder for user installed x11 shared libraries]

    I’m hoping this is good. Short story: Fink is trying too hard to be smart and ends up making you work like a madman.

  • Now, let’s try to install a few things:

    fink install gnuplot
    fink install xfig
    fink install kile

    The first two work, but the last one won’t install. for the following reason:


    dpkg: dependency problems prevent configuration of autoconf2.5:
    autoconf2.5 depends on autoconf (= 2.60-4); however:
    Package autoconf is not installed.
    /sw/bin/dpkg: error processing autoconf2.5 (--install):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    /sw/fink/dists/unstable/main/binary-darwin-i386/devel/autoconf_2.60-4_darwin-i386.deb

    Ok, but so, maybe I have gnuplot working, right? Let’s see…


    > gnuplot
    dyld: Library not loaded: /usr/X11R6/lib/libfontconfig.1.dylib
    Referenced from: /sw/bin/gnuplotx
    Reason: Incompatible library version: gnuplotx requires version 1.0.4 or later, but libfontconfig.1.dylib provides version 1.0.0
    /sw/bin/gnuplot: line 6: 24936 Trace/BPT trap /sw/bin/gnuplotx "$@"

    Hmmm… that can’t be good. For completeness, here’s the content of my proud /sw/etc/fink.conf file.


    Basepath: /sw
    RootMethod: sudo
    Trees: local/main stable/main stable/crypto unstable/main unstable/crypto
    Distribution: 10.4
    ConfFileCompatVersion: 1
    Mirror-apache: http://www.apache.org/dist
    Mirror-apt: http://bindist.finkmirrors.net/bindist
    Mirror-cpan: ftp://ftp.cpan.org/pub/CPAN
    Mirror-ctan: ftp://tug.ctan.org/tex-archive
    Mirror-debian: ftp://ftp.debian.org/debian
    Mirror-gimp: ftp://ftp.gimp.org/pub/gimp
    Mirror-gnome: ftp://ftp.gnome.org/pub/GNOME
    Mirror-gnu: ftp://ftp.gnu.org/gnu
    Mirror-kde: ftp://ftp.kde.org/pub/kde
    Mirror-master: http://distfiles.master.finkmirrors.net/
    Mirror-rsync: rsync://master.us.finkmirrors.net/finkinfo/
    Mirror-sourceforge: http://west.dl.sourceforge.net/sourceforge/
    MirrorContinent: nam
    MirrorCountry: nam-us
    MirrorOrder: MasterFirst
    ProxyPassiveFTP: true
    UseBinaryDist: true
    Verbose: 1
    SelfUpdateMethod: rsync

    Maybe my problem is that I now use a binary distribution? I don’t know where the “UseBinaryDist: true” came from as I remember setting up fink to use a source distribution and seeing packages compile (must be the reinstallation that was required of me earlier that wiped my setting). Ok. I’ve changed the setting to false, but uninstalling and reinstalling packages does not seem to recompile them.

    So, maybe now I should wipe out all of fink and start again from scratch? Will this even work? Maybe I should try “fink cleanup”? Will it help?

    Fink should learn from portage which also has binary packages. By default, portage always rebuilds packages. This should be the sane behavior. Maybe “fink rebuild gnuplot” will do what I want? Here’s what I get…


    New package: dists/unstable/main/binary-darwin-i386/text/ghostscript_8.54-3_darwin-i386.deb
    Failed: phase compiling: readline-4.3-1028 failed
    (...)
    Note that many fink package maintainers do not (yet) have access to OS X on
    Intel hardware, so you may have better luck on the mailing lists.

    What??? You mean the guys who maintain this have no idea if it even builds and no incentive to find out? Gosh! Maybe this explains why none of this works.

    Hours go by…

    Ok, I tried rebuilding various packages in various orders and things eventually build. I’ve got no idea what will end up working tomorrow though. And it is very scary the way the dependencies are not automated. (Gnuplot now works though, but it did work before this whole mess.) Next, I’m trying this before going to be late: “fink rebuild kile gimp gnumeric kopete swig”.

Unrelated but important nonetheless: My oldest son is 3 years old from now on. No, he can’t help me yet with my computer problems, but he can find the TV remote from time to time which is pretty useful.

Tuesday, November 21st, 2006

Do not think you have to go to college

Filed under: Academia/Research — Daniel Lemire @ 16:57

There was a day when books were expensive. Then they became cheaper during the last century. Getting in touch with peers was still expensive for a time, but now, you can call, message and email people very efficiently for next to no money. But lectures were still expensive for a time too. Except that now, you can watch, online, for free, lectures given out by Turing Award recipients. It is only a matter of time before someone figures out a better way to get an education than attending 3 hours of lecture in a dirty classroom every week. This model came out because books, chats, and lectures were expensive. It is no longer the case. We need to move on.

In fact, the infamous Will Richardson says you don’t have to go college:

For most of your young lives, you’ve heard your mom and I occasionally talk about your futures by saying that someday you’ll travel off to college and get this thing called a degree that will show everyone that you are an expert in something and that will lead you to getting a good job that will make you happy and make you able to raise a family of your own someday. At least, that’s what your mom and I have in our heads when we talk about it. But, and I haven’t told your mom this yet, I’ve changed my mind. I want you to know that you don’t have to go to college if you don’t want to, and that there are other avenues to achieving that future that may be more instructive, more meaningful, and more relevant than getting a degree.

Stephen Downes has nailed it with a very sensible question:

(…) are the positive aspects only possible via traditional schools? Could kids obtain (vs. create) these positive aspects without the need for traditional schools?

The answer, for me, is clearly yes. We absolutely need to sit down and rethink our educational models. They are obselete.

Sunday, November 19th, 2006

A few days with MacOS X

Filed under: — Daniel Lemire @ 13:06

As a newcomer to the Apple world, and an avid Linux user, I thought I would share my impressions after a few days. As a disclaimer, I have spent too much time in meetings this week to actually get to know MacOS X in details, but still…

  • Apple has done a good job at capturing the best of Unix and free software. After installing xcode (provided by Apple for free), you have the GNU compiler and most things you need to do free software work.
  • Fink is useful to get a few Unix tools you miss. Don’t bother with unstable packages. Don’t bother with any X application.
  • Pretty much everything under MacOS X can be done remotely using a shell. Even when Apple only says “double-click on this or that to install”, you pretty much can get away with the shell. However, unlike traditionnal Unix systems, there are many scripts missing in MacOS. For example, you can’t quickly delete or add users by default. You need to create or borrow your own scripts if you want to do this. This is slightly annoying, but would be easily fixable if a bunch of people got together to write scripts and provide an nice installer.

To sum it up, I could see a world where both Linux and MacOS dominate and that would be a beautiful world.

Wednesday, November 15th, 2006

My first Mac

Filed under: — Daniel Lemire @ 20:52

Today I finally received an Apple MacPro I ordered several months (!!!) ago. I thought I would quickly review my first impressions.

  • The machine is sexy. There is no other word for it. My Linux box looks like a russian car (not insult intended toward the russian folks) in comparison.
  • The machine is fast, but it takes forever to boot up. It takes longer to boot than a slow Linux box that has 12,000 boot-level services.
  • Took me some time to find out where the console is, but once you have it, you can create a link on your desktop. The console is good, comparable to what you have under Linux. It looks like it uses bash by default. However, I do not seem to have color support in the shell. No hint anywhere how to turn it on. (Update. Will says to check an article on macosxhints for the color support, but says he prefers iTerm.)
  • The on-disk help is pretty good. Clearly, Apple cares about helping you find a solution to your problems. Unlike Microsoft who is happy to confuse you into depression. (And Linux, well… Linux has Google as documentation…)
  • The machine comes with lots of preinstalled software. I don’t know what any of it does so far, but it looks like Apple is not cheap software-wise.
  • The keyboard French Canadian layout sucks. It differs from the established standard found in both Windows and Linux.
  • I could not find the equivalent of the “Home” and “End” keys. I still don’t know where they are. This means that it takes five minutes to select the content of a text box.
  • Having the menu all the way to the top of the screen is really a drag when you have two screens. When my application is on the second screen and I need to go in its menu, I have to go back to the first screen, move up and click on the menu.
  • It took two of us about 15 minutes to even find out if I had a DVD reader. Turns out I do, but it does not appear anywhere. I can open it by pressing one of the keys on the keyboard (the “eject key”).
  • Setting up a ssh server was not too hard. It looks like I can manage my Mac from home just like a Linux box. So far so good. Though I don’t have gcc up and running yet. My main problem is that the connection speed with my lab. is not great, but the sysadmin, Mihai, says it will get better.
  • You can configure the mouse so that you have an actual right button. Very nice. You can even configure it as a 3-button mouse. Excellent! Those of you who don’t know why you need 3 buttons clearly are missing on some great classical software such as xfig.
  • Installing Firefox (first thing I did) created some kind of “mounted disk” that now resides on my desktop. When trying to put this useless icon in the garbage can, the machine complained that it could not unmount the disk. Which disk? I suppose that what I downloaded was some kind of disk image that MacOS mounts as a virtual disk. Fine. But how do I get rid of it now that Firefox is installed? There must be a trick to it.
  • Security seems weak. It appears that I can install everything using my initial account. No root account? (Or maybe I have both a user and root account? I’m confused.)
  • The second thing I installed was Fink. Fink is the MacOS equivalent of “apt-get” (debian) or “portage” (gentoo) or “rpm” (redhat/mandriva). Took me some doing to get it running, and it seems very useful, though, by default, very few packages are available. I tried moving to CVS access which opens up many more packages, but it said, quite rudely, that I needed something called dev-tools. Alas, doing sudo apt-get install dev-tools fails with a comment to the effect that there is no such package. The command sudo fink install dev-tools is more informative as it tells you to go and register as a developer with Apple. You are supposed to guess that dev-tools is “Apple talk” for a package called xcode. I did find it, sold my soul to Apple, and now I’m downloading a huge image of what I hope is the dev-tools thing. This file is really gigantic (1GiB!). By the way, I do this remotely so I had to do sudo apt-get links to use the links browser (links is really a good browser). So far so good. I just hope I’ll be able to mount the disk image I’m downloading through my ssh access. The command hdiutil attach allows one to mount dmg files. It looks like cd /Volumes/Xcode Tools; sudo installer -pkg XcodeTools.mpkg -target / will install Xcode without any need for a GUI. Oh! And fink install python cvs svn gnuplot gnuplot-py xfig kile tetex transfig anacron numeric wine pdftk imagemagick swig koffice kopete looks like a decent way to start. I still don’t know whether it will work, but there is a detailed page on building KDE on Mac.

References:

Tuesday, November 14th, 2006

Are Smart People Dumb?

Filed under: — Daniel Lemire @ 12:27

Scott asks whether Smart People Dumb? He tells the tale of when he joined Mensa and found out that, while these people have high IQ, they may not be the winners you expect them to be:

It turns out that the people who join Mensa and attend meetings are, on average, not successful titans of industry. They are instead – and I say this with great affection – huge losers. I was making $735 per month and I was like frickin’ Goldfinger in this crowd. We had a guy who was some sort of poet who hoped to one day start “writing some of them down.” We had people who were literally too smart to hold a job. The rest of the group dressed too much like street people to ever get past security for a job interview. And everyone was always available for meetings on weekend nights.

I don’t know whether I’m a high IQ person, but I can tell you that I’m the typical nerd who has trouble to manage his life. It is a miracle if I have a beautiful wife and great healthy kids (actually, it is really a miracle, but I’ll tell this tale another day). Over time, I have managed to find tricks to manage my life so that it does not suck. But they are just that, tricks. The real me is very bad at the basics of life.

Money for example. I’m really bad with money. Not so much because I spend it all. In fact, spending money is work, so I tend to be very frugal. Still, I can’t manage a budget. I never know how much I have left in my bank account. My wife recently decided to handle our finances and I bet this is making me much richer.

Getting organized for example. I’m terrible at structuring my work in any way, shape or form. I improvise all the time. This, initially, made me a terrible teacher, but I have since learned ways to compensate. This has also made me a terrible researcher, initially, but again, I have found ways to compensate for this weakness.

Now, I sure hope that I have a high IQ, because otherwise, it would be depressing to have all these weaknesses without the brain power that goes with it. It would be like being Superman without the superpowers, but with the kryptonite weakness. But I sure don’t feel supersmart, so I wouldn’t rule it out.

In vitro kids are smarter

Filed under: — Daniel Lemire @ 11:02

This has been know for some time, but in vitro kids have an higher IQ than the average (whether IQ is an accurate measure of intelligence is a debate better left for another day). Even advanced in vitro techniques lead to smarter kids.

So, people, if you want to have smart kids, in vitro is the way to go!

Consider, also, as a factor, that in vitro mothers are more likely to keep their kids at home with them. Some have argued that in vitro kids suffer from delayed social development. Yet, interestingly, they don’t suffer for delayed intellectual development, quite the opposite apparently.

I think we still need to learn a lot about what makes a smart kid.

« Previous PageNext Page »

31 queries. 0.428 seconds. Valid XHTML

Powered by WordPress

Subscribe to this blog in a reader or by Email.