Dave Coffin’s dcraw – Getting the latest version working on Mac OS-X Lion 10.7

Recently, I had cause to tinker about with decoding some Camera RAW files that were unsupported by my usual converter, and I decided to try Dave Coffin’s opensource dcraw. Visiting Dave’s dcraw page, there were links to another site that has nightly builds from Dave’s source. The only problem with that was that the binaries available for Mac were not based on the latest source file. (Dave only shares the source code) File dates on the download are 2009.

So, in the absence of a useful working binary, I decided to download the C source file and compile it myself. Apple distributes the development environment for Mac OSX (XCode) at no charge, how hard could it be? 🙂

Well, it turns out it’s not that hard, just complex to achieve, and many false leads to follow that might deter you in the process. I followed a few myself but as it turns out, if you happen to find the right places to look it will come together pretty easily. The object of this blog entry is to point out one way that works (I’m sure there are others) I’ll make this point form with minimal in depth explanations. If you get stuck or need more clarity please leave a comment. (Comments are moderated, but I do check them so don’t be deterred)

Lets get to work:

1) Install XCode.

On Lion, XCode is no longer on the install DVD, it’s in the App Store as a free App. Just purchase it as you would any other app using your AppleID. Be warned, it’s a fair size download! Also, on Lion Apple has changed the install location, older versions were installed in /Developer, this version is installed in /Applications as XCode.app
Unless you want to keep the old versions in /Developer (if you even have them) you can delete them to save disk space.

2) Start XCode and accept the license agreement.

Self explanatory. 🙂

3) In Xcode, install the commandline tools.

Go to the XCode menu, select Preferences, then ‘Downloads’. Select ‘Command Line Tools’ and click the ‘install’ button.

Note that you need an Apple Developer ID to download the command line tools. This is no big deal, and won’t cost anything. You can add the DeveloperID to your existing AppleID. The download will prompt you for your DeveloperID and forward you to Developer registration if you don’t have one. Once you have registered and confirmed the registration via the email that Apple will send you, you will need to restart the Command Line Tools download from within XCode as above. Once installed, head to the next step:

4) Download and install MacPorts

The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system. If you’ve played with Linux, much of the content of MacPorts will be familiar to you.

The Lion MacPorts installer is here. Download the installer disk image and run the installer from the disk image.

5. Use MacPorts to download, build and install dcraw, including dependancies required to run and build dcraw.

If all goes well, this is the last step. Open Terminal and type:

sudo port install dcraw

You will be prompted for your password and then the process of downloading and building dcraw will begin.

Depending on the speed of your computer and your internet connection, this will take a little while, but at the end you should have a functional and up to date dcraw installed at /opt/local/bin/dcraw (v9.12 at this time)


Heysen Trail. Waitpinga Campsite to Victor Harbor

Day 4, Thursday September 15, 2011

Waitpinga was the first campsite with actual rubbish facilities so far and I took great pleasure dumping my rubbish bag and the few pieces I had collected along the trail. Filled up my water from the large masonary water tank and then I was off again a bit after 8am to walk the sandy track out of Waitpinga. It was mostly gently uphill and arrived back at the cliffs via scrubland and erosion reclamation areas in about 3-4km. Awesome views into the sun of King Head and West Island each time the trail re-emerged onto the cliff tops. I had a break at a full size Picnic table installed by the Friends of the Heysen in memory of Peter Hill, a past official in the club and maintainer of this section of the trail.

King Head and West Island
King Head and West Island from the picnic table

From there the walking was easy and pleasant. Mostly downhill and breaking out of the scrub a few times for magnificent views of the southern ocean rolling onto the dark slabs at the base of the cliffs. The scrubland was replaced by grassy hillsides as the trail approached King Head and King beach where the Heysen Trail leaves the coast and heads inland.

West Island and Cliffs
West Island and Cliffs

At this point, I left the Heysen and continued on the coastal track and into Encounter Bay and Victor Harbor stopping at the first restaurant I came across for a feed of fish and chips on the beach washed down by a cold beer! Stayed overnight at the Victor Holiday park where my tent looked quite out of place nestled in between massive caravans and motor homes!

Dinner at the Hotel Victor where they redefine value for money pub meals. The roast of the day, (small) was yummy and more than I could eat and only $14.

Bus home in the morning, thus ending my first Heysen interlude.

Trip Stats:
Day 1: 16.55km, 696m Ascent
Day 2: 19.49km, 801m Ascent
Day 3: 22.21km, 662m Ascent
Day 4: 18.75km, 387m Ascent
Total: 77km, 2546m Ascent

Heysen Trail. Tunkalilla Beach to Waitpinga Campsite

Day 3, Wednesday September 14, 2011

Woke early and rose to witness a pearly sunrise from the beach rock formations below my campsite. Probably the unusually loud ocean noise and the strong moonlight on the tent may have had something to do with that (the waking early). In any case, it was a magnificent place to be at dawn. Also of note re sleeping: my WM Ultralite sleeping bag is too warm for these temps – the weather didn’t get below 10C minimum on any night and I often started the night lying on top of the bag with the temps into the teens.

Tunkalilla Sunrise
Tunkalilla Sunrise

Once packed and fed, I set off down towards the eastern end of Tunkalilla beach (the whole beach is about 4.5km long) and eventually followed the signs leading off the beach and up behind Tunk head. And I do mean up! The sign at the bottom says ‘walkers follow fence’ and the fence goes straight up a grassy slope about as steep as you can reasonably climb. My GPS recorded 110m elevation gain in 300m.

Walkers follow fence
Walkers follow fence 🙂


At the top of the slope I was rewarded with a short downhill section and then a steady uphill climb through cattle pasture with good expansive views of the countryside. Eventually, this bliss was replaced by despair as the path dumped out onto a hard roadwalk for 4-5km and past the Balquhidder campsite. Balquhidder has no facilities or water. (Update: as of December 2011, facilities have been installed, the tank should have water after the next rains) There was a somewhat dirty and slow running creek there, so perhaps you could use it with a filter and steripen, but as it was still too early to camp I just stopped for lunch and pressed on. The camp area itself is pleasant enough, and there are trees so I expect one might hang a hammock there too.

What followed was a long, sometimes steep, grassy track walk through farmland, cow paddocks and alongside a creek to get back to sea level at a rocky beach known as a breeding ground for Hooded Plovers (of which none were in evidence, although I did see some on Parsons beach a bit later)

Peaceful cattle
Peaceful Cattle

Hooded Plover sign
Hooded Plover sign

Some more more cliff edge trail walking followed and then onto Parsons beach, Parsons lookout and Waitpinga beach and then the Waitpinga campsite. Ever since I hit the first beach I had been seeing fresh footprints in the sand, and they got fresher and fresher the further I went. I caught the owners at the Parsons beach lookout – another school group that had started at Balquhidder that morning and were apparently making a hard slog of the beach walking. The lookout had toilets and water. The water tank had 2 taps – the bottom one yielded rusty water and the top one clean and fresh but very slow running, maybe not a lot of water in the tank!

Waitpinga campsite is well laid out in a grassed area behind the dunes. Tank water available and pleasant tasting from a masonry tank. Toilets (a bit smelly) and trees. Yes, probably could hang a hammock here too! I set camp amongst some trees to shade the moon and the lights and had a pleasant nights sleep.