MIDAS on Mac OS X
Keywords:
MIDAS, Mac OS X 10.4, Tiger, Intel
This page primarily describes my experiences getting ESO's MIDAS
to run on my MacBook Pro. But I have tried to generalise it as much as possible.
There are several ways to get MIDAS up and running on Mac OS X:
SciSoft
The official SciSoft for Mac is here.
For Power PC SciSoft has been working well for many years.
For Intel a (almost) full SciSoft release was announced on Monday,
October 2, 2006 after 5months of development.
Compile locally
I have prepared a script to download all the required source files,
extract, patch, build, setup and finally verify
Dependancies
- gfortran:
To compile MIDAS you need a Fortran compiler which does not come
natively from Apple. There are several ways to get one, either
commercially,
via the MacResearch gfortran Xcode plugin,
as a binary in a tarball from HPC Mac OS X,
or you can use the gfortan compiler which is part of the
gcc package which you can get either directly from the gcc website or via a tool
such as Fink
or MacPorts.
I've had personal experience with MacPorts, the MacResearch Xcode plugin and
the HPC Mac OS X gfortran tarball, with mixed success depending on the Mac
architecture (PPC or Intel) and the OS X version (Tiger or Leopard). Here
are a list of the combinations I've had success with:
- Tiger:
- PPC: All 06 MIDAS versions work with MacPorts gcc42. 07 MIDAS
versions unknown but would probably work...
- Intel: All 06 and 07 MIDAS versions work with MacPorts gcc42.
MacResearch Xcode Plugin (August 2007 build) results in a compilation error
in one of the DAOPHOT libraries, but as long as you don't plan to use
DAOPHOT, everything else seems to be OK.
- Leopard:
Only 07 MIDAS versions have been tested.
- PPC: MacPorts gcc42 apparently compiles successfully but results
in a Bus Error when you actually try to execute inmidas.
- Intel: Works with MacPorts gcc42.
Personally I prefer MacPorts.
Step by step for my Macbook Pro assuming:
- You do this as a user with administrative priveliges
- You are in a bash shell (not necessary except in the
syntax of some of the commands)
From Macports I install gcc42 (earlier versions of gcc fail to install
automatically though I have had some success to compile them manually):
sudo port install gcc42
MIDAS
Download the installation script from here,
then in a terminal:
chmod u+rx macOSX.installMIDAS
./macOSX.installMIDAS --demo --calib --superVerify --sudo
By default this script will try to install MIDAS version 06SEPpl1.3.
Any other version can be specified via the -V command line option, but
it explicitly supports only the following versions:
- 07SEPpl1.1 [default]
- 07FEBpl1.1
- 06SEPpl1.3
- 06SEPpl1.2 (untested)
- 06SEPpl1.1
- 06SEPpl1.0
To get the script to work with another version you will need to prepare a
generic patch file (<SRCDIR>/patch.<MIDVERS>.gen), or else
modify the code directly but then be sure to use the build step options
otherwise the first build step (extraction) will delete the
<MIDVERS> directory and extract the source tar file!
To see all command line options:
./macOSX.installMIDAS -h
Source Files
TBD...
MIDAS source files.
Below are some
of the the details of the script but not all, these details are
obsolete since I started developing the script:
export MIDASHOME=/midas
export MIDVERS=06SEPpl1.0
export SRCDIR=${HOME}/src/midas
wget -O ${SRCDIR}/${MIDVERS}.tar.gz ftp://ftphost.hq.eso.org/pub/midaspub/${MIDVERS:0:5}/sources/${MIDVERS}.tar.gz
[ ! -d ${MIDASHOME} ] && mkdir -pv ${MIDASHOME}
cd ${MIDASHOME}
tar -zxvf ${SRCDIR}/06SEPpl1.0.tar.gz
mkdir ${MIDASHOME}/${MIDVERS}/incl/netat
If you have Mac OSX Developer tools installed, then do:
ln -s /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/netat/sysglue.h ${MIDASHOME}/${MIDVERS}/incl/netat/
...but if not...
wget -O ${MIDASHOME}/${MIDVERS}/incl/netat/sysglue.h http://www.hq.eso.org/~jpritcha/midas/sysglue.h
If the version is 06SEPpl1.0 apply this patch as follows:
wget -O ${SRCDIR}/patch.06SEP1.0.macOSX-10.4 http://www.hq.eso.org/~jpritcha/midas/patch.06SEP1.0.macOSX-10.4
patch -p0 < ${SRCDIR}/patch.06SEP1.0.macOSX-10.4
If you are using gcc42 from MacPorts then apply this patch as follows:
wget -O ${SRCDIR}/patch.06SEP1.0.gcc-dp-4.2 http://www.hq.eso.org/~jpritcha/midas/patch.06SEP1.0.gcc-dp-4.2
patch -p0 < ${SRCDIR}/patch.06SEP1.0.gcc-dp-4.2
If you are using some other gfortran (and possibly gcc compiler) then
try this patch, then edit the file:
wget -O ${SRCDIR}/patch.06SEP1.0.gcc+gfortran http://www.hq.eso.org/~jpritcha/midas/patch.06SEP1.0.gcc+gfortran
patch -p0 < ${SRCDIR}/patch.06SEP1.0.gcc+gfortran
Warning: The above patch is untested. You may need to edit manully the
file:
${MIDASHOME}/${MIDVERS}/install/unix/systems/Darwin/make_options
Note, be sure to execute step 5 of the MIDAS config script whenenver
you make changes to the above file, otherwise edit the file:
${MIDASHOME}/${MIDVERS}/local/make_options
to have changes applied directly, but note that if you do then execute
step 5 of the MIDAS config script you will loose these changes.
If you do manage to get MIDAS to compile using different C
and/or
Fortran compilers than the MacPorts gcc42 compilers please send
me an email with your make_options file attached.
Then follow the rest of instructions in installunix.ps.gz,
alternatively for the impatient:
cd ${MIDASHOME}/${MIDVERS}/install/unix
./config
3
5 ## follow prompts...
6 ## follow prompts...
q
tail -f `ls -tr1 $MIDASHOME/$MIDVERS/tmp/install.* | tail -n 1`
## When it's finished, Ctrl-C then...
ln -s ${MIDASHOME}/${MIDVERS}/system/unix/{inmidas,gomidas,helpmidas,drs} /usr/local/bin
cd ${MIDASHOME}/${MIDVERS}/tmp
inmidas
And you're done...
Last updated October, 2006 john.pritchard@eso.org