Building 64-bit
AFNI for a G5
What is AFNI?
NIH's
opensource FMRI analysis and visualization package.
Why 64-bit
AFNI?
Neuroimaging data sets can get quite large. AFNI's
3dDeconvolve, for instance, will crash with malloc errors if your
dataset requires allocating more than about 2GB of memory, which is not
uncommon. In order to compile and link 3dDeconvolve, you need to compile
a large part of AFNI as well as zlib, X11, and lesstif or openmotif. So
I tried to build all of AFNI for 64-bit while I was at it, for the G5
processor on Mac OS X Tiger (10.4.x), which has a 64-bit unix
foundation.
Why on the G5? Why not x86-64?
We have a cluster of 64 Xserve
G5's, so it is important to us. We do have some Opteron machines as
well, so stay tuned for x86-64 information.
UPDATE: AFNI is now
provided in binary form for x86-64. See the download
section on the AFNI website.
Does it work?
I haven't
done much more than build it. It builds successfully with the provided
Makefile after building 64-bit
versions of zlib, X11, and lesstif, according to provided instructions. The main AFNI program, "afni" launches
successfully but I haven't fooled with it much. The main SUMA program,
"suma" does not launch successfully. "3dDeconvolve" displays its help
when I run it.
Warning: It is completely untested at this
point and should not be used for any serious work! I don't expect it to
work without modifications to the source code. Transitioning to 64-bit
requires vetting source code for any implicit assumptions that pointers
can be cast from 32-bit integers. GCC warnings during the compile
process lead me to believe this is the case with the AFNI source code--
not an unexpected situation in any large software package.
UPDATE
July 9, 2005 from the AFNI authors bodes well! :
The cases where AFNI casts 32 bit ints to/from pointers (which will be 64
bits on some newer systems) are not errors. In all cases, they are a
mechanism for
passing small integer values around through a generic
pointer device.
There are no errors here. AFNI has been working on a
64-bit Linux
system here, and on a 64-bit Altix system, for quite some
time. The
messages you get are just compiler warnings, which are intended
to
signal potential problems.
We are testing 3dDeconvolve64
now.
UPDATE DECEMBER 2005: Been using the 64-bit version for analysis without
incident, so the warning may not be necessary.
How do I build
it?
- To build, you'll need a Mac with Tiger
installed. To run, you'll need a G5-based Mac with Tiger
installed.
- Install the latest Developer
Tools from Apple, which is currently Xcode 2.1. This contains gcc
4.0 which can build 64-bit PowerPC binaries for the G5 under 10.4.x via
the "-arch ppc64" flag.
- Build zlib and X11 for 64-bit. Fortunately,
there's already info on how to do that on Tiger here,
and in my instructions.
- Build 64-bit lesstif or openmotif. I couldn't get openmotif
to work, so I used lesstif. Info on both is in the instructions. Since AFNI (32-bit at least) prefers
openmotif, it would be good to get openmotif to work in the
future.
- Download the latest AFNI sources ("AFNI_latest.tgz") from
this directory.
- Copy
this Makefile into the same
directory as the tgz file. Edit the Makefile to specify where your zlib,
X11, and lesstif libraries are installed from the previous steps. You
can either expand the archive, save a copy of the Makefile as "Makefile"
into afni_src, and then type "make totality", or you can run this compile script from the same directory as the
archive to do it all from scratch, but in stages. The compile script
also saves logs of gcc warnings which can be used as a guide to update
source code. The AFNI binaries will be installed into
afni_src/macosx_10.4_ppc64 after
building.