Skip to content

AFNI and NIfTI Server for NIMH/NIH/PHS/DHHS/USA/Earth

Sections
Personal tools
You are here: Home » Misc Items » afni_build » General Build Instructions

General Build Instructions

Document Actions
The most current information about compiling AFNI is contained HOWTO #00.

First, you will have to choose a Makefile. Some of the versions in the distribution file are

 filename               target system        compiler
------------- --------------- -----------------------
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 hpux_*, sgi_*, and solaris_* Makefiles come in slightly different versions for the different versions of the operating systems and the different cpu classes.

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 Makefile
vi Makefile
make totality
should compile and install all the software into the INSTALLDIR directory specified in Makefile.

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 plugins
followed by
   make install install_plugins install_lib clean
when 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

  

-msse -mmmx -mfpmath=sse -malign-double -march=i686

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.

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: One of these sets of binaries will probably work for you, as long as you don't want to be able to recompile the source code or write your own plugins. Motif source and binaries are now available free from their owner, the Open Group. Go here for more information, or try here or even here. AFNI will also work with the LessTif freeware Motif clone, but it will look and act peculiarly in some places.
  • 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
    export LD_LIBRARY_PATH
    Again, these should go in your startup files (e.g., .cshrc) so that they are executed whenever you login.
  • 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.
Created by Robert Cox
Last modified 2005-08-09 15:35
 

Powered by Plone

This site conforms to the following standards: