I've been having a PM exchange with Danne over compiling raw2dng and mlv_dump command line tools on the Mac and thought I'd share our success and failures with others on the forum. This seemed to be the appropriate forum topic to post this.
Apparently raw2dng, mlv_dump and cr2hdr can be compiled without having to install a cross platform ARM environment in order to build ML.
Starting with a virgin Mac, here's how to compile raw2dng
1. Install Xcode. This is fairly easy because it is an Apple app.
2. Install the command line tools. This is a part of Xcode but apparently it isn't installed automatically. MacPorts has the instructions on how to get the command line tools working: https://www.macports.org/
3. Install MacPorts. Again, the MacPorts instructions are fairly easy to follow.
4. Install mercurial and dcraw via MacPorts. This is really easy:
sudo port install mercurial
sudo port install dcraw
5. Now using the terminal go into a directory where you would like to put the Magic Lantern source code and run this:
hg clone -r unified https://bitbucket.org/hudson/magic-lantern
Note that there are lots of other ways to do this that will get you the same results. This works too:
hg clone https://bitbucket.org/hudson/magic-lantern
hg update unified
6. cd into the directory where raw2dng.c and the Makefile for it is located:
cd [PATH TO YOUR WORKING DIRECTORY]/magic-lantern/modules/lv_rec
7. Now simply type this in the terminal.
You will get some warning messages but don't worry, in that directory you will find the compiled raw2dng command line tool. It is easy to spot because it doesn't have a file extension.
By the way, what I wanted was a version of raw2dng with chroma smoothing turned on in order to take care of the pink focus pixels on EOS-M raw video. This was very simple to do because it is spelled out very clearly in the raw2dng.c code starting on line 33:
/* useful to clean pink dots, may also help with color aliasing, but it's best turned off if you don't have these problems */
//~ #define CHROMA_SMOOTH
I just removed the "//~" and it worked!
Next up, mlv_dump
Trying to figure this one out on the forum topic was confusing because people were trying all sorts of things but the issue seems to be that the code was written on Linux systems and Apple Xcode sets up the developing environment differently. Long story short:
sudo port install gcc47 +universal; sudo port select --set gcc mp-gcc47; hash gcc
It takes a long time to run this, about a couple of hours on my system, so patience! Once it finishes you should be able to compile mlv_dump as well as raw2dng without having to make any source code tweaks.
Running "make cr2hdr" in the magic-lantern/modules/dual_iso directory gave me this error:
/bin/sh: rst2html: command not found
It looks like the Mac doesn't have rst2html installed. From what I found out that is a part of docutils but there is no docutils in MacPorts. I tried installing py-docutils. That didn't get me rst2html but it did install /opt/local/bin/rst2html-2.7.py so I made a soft link to it like this:
sudo ln -s /opt/local/bin/rst2html-2.7.py /opt/local/bin/rst2html
That did it--whew!
Hope this helps other ML users who want these command line tools running on their Macs. During my many attempts at compiling these tools I ended up installing some unnecessary components--hope I didn't leave out any necessary ones! Maybe one of them is truncate? If so, it can also be installed through MacPorts.