Blog Archives

Installing Hugs98 (Haskell) on Mac 10.6 Snow Leopard

i have to use a program called hugs as part of one of my university modules, getting it installed on my mac proved to be a challenge, but i got it working. here is a brief guide on getting it working on 10.6. NOTE: if you are a 10.5 user the default macports install should be fine for you.

Lets Begin

hugs98 is the package available in macports to install the hugs program, so to get it you need to install macports, i wont go into the detail of that but point you to the instructions available here

to install hugs98 it should be as simple as running this command in

[bash]sudo port install hugs98[/bash]

but it should error out pretty quickly with a build error similar to:

—> Building hugs98
Error: Target returned: shell command ” cd “/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_hugs98/work/hugs98-plus-Sep2006″ && /usr/bin/make -j2 all ” returned error 2
Command output: cd src; /usr/bin/make all
make[1]: Nothing to be done for `all’.
cd libraries; /usr/bin/make all
cd ../cpphs; HUGSFLAGS=-P../libraries/bootlib HUGSDIR=../hugsdir ../src/runhugs -98 ../packages/Cabal/examples/hapax.hs configure –verbose –hugs –prefix=’/opt/local’ –scratchdir=’../hugsdir/packages/cpphs’ –with-compiler=../src/ffihugs
runhugs: Error occurred
ERROR “../libraries/bootlib/Foreign/Ptr.hs” – Error while importing DLL “../libraries/bootlib/Foreign/”:
dlopen(../libraries/bootlib/Foreign/, 9): image not found

make[1]: *** [../hugsdir/programs/cpphs/Main.hs] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.

all is not lost however the macports bug reporter has some patches that fix the issue below are the instructions and files if you dont want to browse to the issue page and manually go and get the files, so you get hugs 98 working on your 10.6 machine:

download the 2 patch files from the issue tracker or here: patch-hugs98-Portfile, patch-libraries-tools-make-bootlib

make sure to download them to your ~/Downloads folder or amend the following instructions with the different path to the files, now run the following commands in

cd $(port dir hugs98)
sudo cp ~/Downloads/patch-libraries-tools-make-bootlib.diff files
sudo patch < ~/Downloads/patch-hugs98-Portfile.diff
sudo port clean hugs98
sudo port install hugs98

this should take a while and your terminal window should look like this:
[bash]anthonysomerset@Anthony-Somersets-MacBook:~$ cd $(port dir hugs98)
ant@ASMB:/opt/local/var/macports/sources/$ sudo cp ~/Downloads/patch-libraries-tools-make-bootlib.diff files
ant@ASMB:/opt/local/var/macports/sources/$ sudo patch < ~/Downloads/patch-hugs98-Portfile.diff patching file Portfile ant@ASMB:/opt/local/var/macports/sources/$ sudo port clean hugs98 —> Cleaning hugs98
ant@ASMB:/opt/local/var/macports/sources/$ sudo port install hugs98
—> Computing dependencies for hugs98
—> Fetching hugs98
—> Verifying checksum(s) for hugs98
—> Extracting hugs98
—> Applying patches to hugs98
—> Configuring hugs98
—> Building hugs98
—> Staging hugs98 into destroot
—> Installing hugs98 @plus-Sep2006_0
—> Activating hugs98 @plus-Sep2006_0
—> Cleaning hugs98
ant@ASMB:/opt/local/var/macports/sources/$ [/bash]

to launch hugs just type the following in the terminal πŸ™‚


now go and enjoy your hugs98 geekery πŸ™‚

So… whats all the big fuss about Snow Leopard?

So Apple released there new operating system a couple of weeks ago now it was labelled as Leopard only better so if you want a direct comparision from microsoft for example windows 7 really should be named Windows Snow Vista or Windows Vista 2.0.

i have had great joy in being able to test both these systems in the last couple of weeks, i have had my gaming machine running the Win 7 RC for a couple of months now just because Vista x64 just was so unstable on my rig, i can say it is a positive improvement, it almost makes me glad i upgraded from Win 98 all those years ago!

so Snow Leopard, what is all the fuss about? for most users you wont reallt notice any difference except for the default desktop image being just that little bit cooler (yes i still have the default desktop image) for the most part from a general perspective, SL feels much snappier than Leopard did which is really helpful as programs such as tweetdeck load in a reasonable time now. there are one or 2 bugs still to be ironed out, proof of which is the fact that Apple released 10.6.1 not even 2 weeks after launch is testiment to that(mind you MS probably would have had Security updates out within days!).

it was quite nice to save a good chunk of hard drive space, but i felt cheated that it was partially due to the change in numbering for hard drives from Base2 (the computing standard) to Base10, the hard drive manufacturer standard to say they have more space than they really do. i am still in 2 minds about this. I am all for reducing user confusion but at the same time i want things to be right and quite simply, computers still speak in Base2 which means that things that relate to that including space calculations should be done in the same format to be consistent, so really the hard drive manufacturers should come into line not the software vendors.

the next point of contention i have seen in various places on the internet is the 64bit debate relating to SL, firstly SL Server runs the 64bit kernel by default while the client runs the 32bit kernel by default, while you can launch SL client in 64 bit kernel mode by holding the 6 and 4 keys down while booting, it really actually isnt a huge deal for most users, you can do everything in 32bit mode still as before and SL will still address more than 4GB of RAM as before, there has been a huge storm in a teacup about this but quite simply, Apple got this right, not every developer will have brought out 64bit drivers for hardware yet (including printer manufacturers) meaning that if you boot 64 bit mode you cant use those devices, where as the most common setup of an xserve or mac mini running SL Server is quite literally more often than not is just the power cable and a network cable plugged into the machine, occasionally external storage via Firewire or USB or even Fibre Channel for the more expensive ends of the spectrum, drivers of which are provided already by Apple (as they design and build all mac hardware) i cant wait until Apple decide that 64 bit kernel should be the default and issue an update setting this, because in my most basic of tests, many applications open even faster than in 32 bit.

i have yet to test OpenCL or Grand Central Dispatch which is supposedly there new graphics processing (or more precisely making use of the graphics card when its not busy playing games to make other stuff run faster) mainly because i haven’t found anything taxing enough on a mac that Leapord struggles with to test on SL, with the exception of huge mailbox processing in mail.

there is still the odd niggle with SL but all in all it has done exactly what Apple set out to do… Refine Leopard and improve the performance, it has done this well, to much hoo hah and the expense of PowerPC users, which is a sensible approach seeing as they stopped selling powerPC machines in 2006, guys i really think you need to upgrade if you want to have the latest software.

SL makes me happy to use MS Word 2008 and spaces at the same time whereas it was unusable before, i can tweet at speed using my favourite program now and i have reclaimed some valuable space for my music collection and for photos. all in all it makes me happy and at Β£25 an upgrade… Absolute Bargain! 5 Stars from me!

hopefully less geeky stuff next time – i think i need to talk about Jesus stuff a bit more!