This page documents some of my experiences with CASA Development
Creating a Development Environment on OS X 10.5
I needed to create a development environment on OS X that did not exactly follow the suggested path because I did not have space to download the big chunk of 3rd party dependencies, and I had the majority installed already. It was not entirely straightforward...However, this page attempts to stop you following the same blind alleys.
Guiding principles
- Use the Apple supplied compilers whenever possible - download XCode from Apple (you have probably already done this if you are a developer).
- Use MacPorts to manage the 3rd party software as far as possible.
- Compiles from source
- Easy to add custom packages into same framework. (See later)
- Target the "active" branch of CASA
Language tools
- Need a FORTRAN compiler - either
- g77 from HPC OS X or
- gfortran from "R project" - this is better than the version from macports as that introduces another version of the C++ compiler to the system, which can lead to problems (especially if you want to move binaries to other machines), whereas this version is installed alongside the standard apple supplied compilers, and maintains the ability to build multiple architectures.
- Python -from macports - I already had python 2.6 installed, so I used that (mostly with success) despite CASA currently being developed against 2.5.
- Install cmake and scons which are used to make casa and casa core respectively. (Stop press - casa core can be built with cmake also - though it was necessary to add a few missing source file references to the CMakeLists and to modify the master CMakeList to get the installed_name correct for the shared libraries.
Building
- The first major dependency to get working is the casa core library - you need to be sure to get the correct alternative source i.e. not the one from GoogleCode
Packages not available from macports...
There are some dependencies that are just not available from MacPorts, and there are other dependencies that require old versions of the software to compile properly.
PGPLOT - there is a patch to make this work with casa - to do with late_binding_driver - however, despite getting the macports port source from https://svn.cv.nrao.edu/svn/dports/ it did not contain the full source needed - gave up and installed the libpgplot from casa binary distribution.
CCMTOOLS
obtain from https://svn.cv.nrao.edu/svn/ccmtools/trunk/ - this is a special version that does not go through all the confix pain -
libdbus-c++-1.0
the standard places for this do not have the correct source versions - there is a branch in the 3rd party downloads available from https://svn.cv.nrao.edu/casa/osx_distro/developers/10.5/
AATM
to be able to compile this on os X it is necessary to use a macports installed gnu libtool (libtool has another meaning on OS X)
make LIBTOOL="glibtool"
Misc Gotchas
- Had to modify the /opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h header to stop it defining isspace etc. macros if compiled under c++
Local MacPorts Repository
You can set up a local repository (see instructions), which can be used to
- Add ports that are not in the standard repository
- Override standard ports. MacPorts currently has a weakness that you cannot specify exact versions in dependencies, which means that a dependency will always pick up the latest version. You can copy a portfile to your local repository and backdate the version to ensure that an old version is installed if that is necessary...
I have created a port for wcslib that compiles nicely on the mac (and gives precedence to the shared version of the library)