CCP4 4.1 on MacOSX

This is for v4.1, from v4.2 Mac OSX will be just part of the normal CCP4 build.

The ccp4 programs run on MacOSX. There are changes required to the configure scripts, and some of the C routines for machine dependencies. There is the further difficulty in that there is a fault with the fortran start-up file crt1.o which causes linking problems with programs that have large common blocks. This is corrected by linking in MacOSX.o.

Before proceding I would suggest visits to

which are excellent sources of code and information.

Here we go:

  1. Obtain C (Apple developer centre)
    and g77 (10.0.x or 10.1.x , fink has g77 for 10.1 in the source archive),
    and XFree86 (XonX) if X is wanted.
  2. Obtain the CCP4 distribution.
  3. Download and extract darwin.tar.gz over the CCP4 distribution.
  4. Compile lib/src/MacOSX.c (cc -c MacOSX.c).
    This may not be required with future releases of MacOSX, and is, therefore, not going to be part of the CCP4 distribution.
  5. source ccp4.setup
  6. configure Darwin , add --with-x if X is wanted.
  7. edit src/Makefile, unsupported/src/Makefile, and x-windows/Mosflm/mosflm/Makefile so that -lMacOSX.o is included in the LDFLAGS (after -lccp4 will do).
  8. make, make install

If this does not work go to the gnu-darwin ccp4 pages.

TODO: some of the x-programs will not compile. More fiddling is required. xdlmapman will go at -O1 which will will give xdlgjk. This can be worked around by setting the environmental variable xdlmapman_FLAGS prior to compilation:

setenv xdlmapman_FLAGS "-O1 -funroll-loops -ffast-math -fno-second-underscore -fno-globals"

Disclaimer: this works for me, and all/most of this will make its way into the next release.


fink, and probable gnu-darwin, have tcl and tk. If you have these blt should install with some hacking of the Makefile. Just in case here are

these work.

Note: bltwish works with X, not aqua.

etc scripts

the uniquefy, amore-sphere and extractsummary scripts have a test to find the best version of awk to use

# find awk executable
for myawk in nawk gawk awk
  if ( `type $myawk >/dev/null 2>&1` ); then
this fails incorrectly under OSX as there is no type command.
diff -r1.10 uniqueify
<   if ( `type $myawk >/dev/null 2>&1` ); then
<     break
<   fi
>     test -f $myawk && break


Special thanks to Dr. Michael Love and Dr. Martin Noble