MIA+EWS on the Mac

MIA+EWS 2.0 works perfectly fine on the Mac with operating systems up to 10.7. It has not been tested with OS X 10.8 However, you need to take care of two things before installation

  1. You must use a case-sensitive file-system (e.g. HFS+ case-sensitive). Unfortunately the default Mac file system is not case-sensitive, so you either have to reformat your hard disk or create a case-sensitive disk image. To do the latter, go to Applications > Disk Utility and create a new disk image (File > New > Blank Disk Image...) and make sure the "Format" is case-sensitive. Unpack the tar.gz file on this disk image and proceed to step (2).
  2. A couple of files live somewhere else on the Mac than on a Linux machine: in c/src/table_col.c, table_gen.c, table_row.c, util.c, util/dft.c and in c/include/DRfit.h, FLUORfsub.h, FOfit.h, simulate.h replace malloc.h by sys/malloc.h. Alternatively, copy the following lines into a text file and run it in the top-level directory of MIA+EWS (called drsRoot):

    #!/bin/bash
    #
    # This script replace every instance of malloc.h by sys/malloc.h so that
    # MIA+EWS compiles on the Mac. It must be run in MIDI's drsRoot directory
    # Note that you also need a case-sensitive file-system (e.g. HFS+
    # case-sensitive) in order to compile MIA+EWS on a Mac.
    #
    # Run this script by calling sh macifiy.sh in a bash console.
    #
    for file in $(grep -lR malloc.h c/*)
    do
    sed -e "s/malloc.h/sys\/malloc.h/g" $file > tmpfile.tmp
    mv tmpfile.tmp $file
    echo "Modified: " $file
    done