General Build Instructions
First, you will have to choose a Makefile. Some of the versions in the distribution file are
filename target system compilerThe hpux_*, sgi_*, and solaris_* Makefiles come in slightly different versions for the different versions of the operating systems and the different cpu classes.
------------- --------------- -----------------------
Makefile.linux* Linux GCC compiler, OpenMotif
Makefile.solaris2?_gcc Solaris 2.? GCC compiler, Sun Motif
Makefile.darwin Mac OS X Apple GCC compiler, OpenMotif
The linux_* Makefiles are for different versions - _rh60 is for Red Hat 6.0, _mdk72 is for Mandrake 7.2, etc. Not all the possibilities are represented here -- just those to which I have easy access.
See the OSX Notes and Cygwin Notes for more information on these systems.
N.B.: You will undoubtedly need to alter the INSTALLDIR macro in the Makefile before you compile. This is the directory into which the binaries will be installed. The flags for the C compiler and loader may need to be changed before anything useful can be done, if you are trying to compile on a system not like one that I have here at the NIH. Once you have figured this part out (what fun!), then the commands
cp Makefile.whatever Makefileshould compile and install all the software into the INSTALLDIR directory specified in Makefile.
vi Makefile
make totality
N.B.: The Makefile will try to make the directory INSTALLDIR if it does not already exist, but if it is a system directory that you don't have permission to create, then the installation will fail. If the directory INSTALLDIR already exists, but you don't have permission to install into it, then the installation will also fail. If you want to compile the executable files but not install them, then the command to use instead of make totality is
make all pluginsfollowed by
make install install_plugins install_lib cleanwhen you are ready to install. (If your system doesn't support plugins, then remove them from these command lines.)
N.B.: On Linux/Intel platforms, the default Makefiles may not contain the optimal combination of compiler flags for your system. For example, with GCC 3.1 and higher, you can use the switches
to get code that is a few percent faster on a Pentium-IV class sytem. But these switches won't work with lower versions of the compiler, or on Pentium-III class computers, so they aren't included in the default Makefiles or in the precompiled binaries. This is one reason that compiling the AFNI package yourself may be a good idea for you.
-msse -mmmx -mfpmath=sse -malign-double -march=i686
Platforms
- Mac OS X: Instructions for compiling AFNI on this platform can be found here.
- Linux: You cannot compile AFNI without some
version of the Motif graphics library, which is not entirely
free software. The tgz directory at the
Web site has the following file that contain AFNI
executables for Intel platforms, statically linked to Motif so you
can run without acquiring Motif:
- linux_gcc32.tgz
- linux_glibc21.tgz
- linux_glibc22.tgz
- linux_mdk72.tgz = Mandrake 7.2
- linux_rh60.tgz = Red Hat 6.0
- Cygwin: Instructions for compiling AFNI on this platform can be found here.
- Solaris: You can compile AFNI with the Motif
stored in /usr/dt, using the Makefile.solaris28_gcc file. I have
found that the gcc compiler produces slower code than the
Sun compiler, but that AFNI is prone to crash with the Sun
compiler (I believe this is due to improper optimization with the
Sun C compiler, since if I turn all optimizations off, this problem
goes away). Be sure that you enable the SOLARIS_DIRENT_ZERO patch,
either in the Makefile or by editing source code file machdep.h.
(The file Makefile.solaris28_gcc already has this patch enabled in
its use of the compiler.) /usr/dt/lib is not included in the
default search path when a program starts. To force this directory
to be searched for libraries at program runtime, you must set the
environment variable LD_LIBRARY_PATH properly. Using the C shell:
setenv LD_LIBRARY_PATH /usr/dt/lib:/usr/openwin/lib:/usr/ucblib
Using the Bourne or Korn shells:
LD_LIBRARY_PATH=/usr/dt/lib:/usr/openwin/lib:/usr/ucblib
Again, these should go in your startup files (e.g., .cshrc) so that they are executed whenever you login.
export LD_LIBRARY_PATH
- SGI IRIX: The volume rendering plugin does not work well at the higher levels of precalculation (it produces images with a "waffle" pattern overlay). This happens on some SGI systems and not others, and as far as I can tell is a compiler problem. This difficulty does not appear on HP-UX with HP's ANSI C compiler, or on Linux or Solaris with gcc.
- IBM RS/6000 under AIX: The Makefile does not include support for plugins. This is because I do not have access to such a machine - the Makefile was given to me by a user in Illinois (Doug Morris). As I understand it, AIX does not support dynamic libraries.