Here are instructions for compiling and installing the external libraries AFNI/SUMA require, for 64-bit under Mac OS X 10.4.x using gcc 4.x (I used Xcode 2.1 Developer Tools, available from connect.apple.com after you register as a free ADC member). The resulting libraries will only work on a G5 running 10.4.x or higher. Note that this process is the same as will be necessary for the Intel-based Mac asrriving in 2006, just substitute "i386" wherever you see "ppc64". ********* ZLIB ****************************************************************** As per -Downloaded zlib-1.2.2 from gzip.org/zlib. (This directory will be the $(ZLIB) directory in the Makefile) -need to edit line 92 of configure and add -arch ppc64 in the LDSHARED line -run (example as root using bash shell): >CFLAGS='-O3 -arch ppc -arch ppc64 -mtune=G5 -mcpu=G5' ./configure -s --prefix="/usr/csbmb/pkg/ZLIB64/zlib-1.2.2" >make >make install ********* X11R6 ******************************************************************** As per Which say: -------- get latest X11 sources: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg login hit return when asked for password cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg co -P xc create file xc/config/cf/host.def with content: #define ProjectRoot /usr/local/X11 #define NothingOutsideProjectRoot YES #define DarwinQuartzSupport NO #define LibraryCCOptions DefaultCCOptions -fno-common -arch ppc64 -m64 -L/usr/local/lib #define OptimizedCDebugFlags -Os -m64 -arch ppc64 -mtune=G5 -mcpu=G5 -L/usr/local/lib #define BuildServer NO #define SharedLibraryLoadFlags -dynamiclib -m64 -arch ppc64 -L/usr/local/lib #define PositionIndependentCFlags -dynamic -m64 -arch ppc64 -L/usr/local/lib execute: cd xc make World sudo make install ------ CHANGES TO THE ABOVE: I changed the ProjectRoot to the location that will be $(X11R6) in the Makefile. and removed the -L/usr/local/lib lines, so mine looks like: ---- BEGIN /usr/csbmb/pkg/XORG64/xc/config/cf/host.def--- #define ProjectRoot /usr/csbmb/pkg/XORG64 #define NothingOutsideProjectRoot YES #define DarwinQuartzSupport NO #define LibraryCCOptions DefaultCCOptions -fno-common -arch ppc64 -m64 #define OptimizedCDebugFlags -Os -m64 -arch ppc64 -mtune=G5 -mcpu=G5 #define BuildServer NO #define SharedLibraryLoadFlags -dynamiclib -m64 -arch ppc64 #define PositionIndependentCFlags -dynamic -m64 -arch ppc64 ---- END Note that he says "create xc/config/cf/host.def", not "edit". I spent time searching for xc/config/cf/host.def-- it doesn't exist yet, you need to create the file. ********* MOTIF *********************************************************** Two things I tried, lesstif and openmotif. I wanted openmotif to work since it is the official distribution, but ran into both compile and runtime problems. I did get it to compile eventually but afni runs with lesstif while it produces an "Illegal instruction" at the "Initializing X11.." stage with openmotif. suma gives an Xt/Xm runtime error with lesstif, and won't run, and with openmotif gives screenfulls of errors and won't run. --- LESSTIF --- After downloading lesstif-0.94.4.tar.gz from lesstif.org, I copied the configure and test/configure files up to the directory containing the tarball: cp lesstif-0.94.4/configure . cp lesstif-0.94.4/test/configure ./test_configure I then commented out the line (shown commented out): #tagnames=${tagnames+${tagnames},}F77 in both of them. The reason was that the generalized configure was hanging when doing some checks on Fortran 77, which as far as I know lesstif doesn't use anyway. You could keep that line in and see if you hang at the same point-- maybe it was just something specific in my case. After that I removed the extracted archive: rm -rf lesstif-0.94.4 so that the following compile script does everything from scratch, using the modified configure files and the tarball in its same directory (note that it uses fink's tar, but would probably work even if you don't have fink installed and instead used /usr/bin/tar, I'm not sure): ---- BEGIN /usr/csbmb/pkg/LESSTIF64/lesstif/compile_script gzip -dc ./lesstif-0.94.4.tar.gz | /sw/bin/tar -xf - --no-same-owner --no-same-permissions cd lesstif-0.94.4 # something goes wrong with configure where it hangs checking for PIC flag for fort77-- since fort77 # is unnecessary, commented out the line in configure and test/configure that adds it to the taglines cp ../configure . cp ../test_configure ./test/configure # PPC64 STUFF # use ppc64 for configure env CC="gcc -arch ppc64" CXX="g++ -arch ppc64" ./configure --prefix="/usr/csbmb/pkg/LESSTIF64/lesstif-0.94.4" --x-includes="/usr/csbmb/pkg/XORG64/include" --x-libraries="/usr/csbmb/pkg/XORG64/lib" # use ppc64 for make env CC="gcc -arch ppc64" CXX="g++ -arch ppc64" make echo "'cd lesstif-0.94.4; make install' to install lesstif. Note: conflicts with openmotif" ---- END CHANGES TO THE ABOVE: You'll have to use your own prefix, x-includes, and x-libraries options to configure to reflect where you put them. ---- OPENMOTIF ---- I had the most trouble with this one. And it didn't even work once I finally got it to compile! Download openMotif-2.2.3.tar.gz from motifzone.com (or do "fink fetch openmotif3") and the openmotif3.patch from fink at or just create it from these lines: --- BEGIN openmotif3.patch --- openMotif-2.2.3/Makefile.in.orig Sat May 1 11:54:55 2004 +++ openMotif-2.2.3/Makefile.in Sat May 1 11:55:12 2004 @@ -101,7 +101,7 @@ MAINTAINERCLEANFILES = Makefile.in configure libtool config.guess config.sub config.log ltconfig ltmain.sh aclocal.m4 config.h.in install-sh missing mkinstalldirs -SUBDIRS = bindings bitmaps config localized lib include tools clients doc demos +SUBDIRS = bindings bitmaps config localized lib include tools clients doc AUTOMAKE_OPTIONS = 1.4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ---END (you could remove "tools" from the +SUBDIRS line, since the tools didn't compile for me and we don't need them) (also, note that the patch doesn't really do anything significant except remove demos, so you could skip this) I copied openMotif-2.2.3/ltmain.sh up to the directory containing the tarball, and commented out the following lines (shown commented out): # Mandrake: (gc) It's bad to link C++ code with GCC, so we need to use the compiler name if provided # bdsinger 2005.07.07: removed, since it strips the -arch flag in $CC that we need #if test "$mode" = link && test -n "$archive_cmds" && test -x "/usr/bin/perl"; then # case $nonopt in # *cc | *++ | gcc* | *-gcc* | egcs*) # archive_cmds=`echo $archive_cmds | perl -pe 's/^\S+\s+//'` # archive_cmds="$nonopt $archive_cmds" # archive_expsym_cmds=`echo $archive_expsym_cmds | perl -pe 's/^\S+\s+//'` # archive_expsym_cmds="$nonopt $archive_expsym_cmds" # esac #fi I removed the expanded archive so that the compile_script could start from scratch: ---- BEGIN /usr/csbmb/pkg/OPENMOTIF64/openmotif/compile_script # following from examining fink's build gzip -dc ./openMotif-2.2.3.tar.gz | /sw/bin/tar -xf - --no-same-owner --no-same-permissions cd openMotif-2.2.3 patch < ../openmotif3.patch # Since we define a CC with flags, libtool 1.4.3 included in openmotif 2.2.3 has a # section which will strip flags in link mode-- causing link to fail. Just replace ltmain.sh # with custom one that removes that section cp ../ltmain.sh . # Other preliminary steps from fink: perl -pi.bak -e 's,need_relink=yes,need_relink=no,g' ltmain.sh perl -pi.bak -e 's,-flat_namespace -undefined suppress,-undefined dynamic_lookup,g' configure perl -pi.bak -e "s;recipient's;recipients;" tools/wml/motif.wml # use ppc64 for configure env CC="gcc -arch ppc64" ./configure --prefix="/usr/csbmb/pkg/OPENMOTIF64/openmotif-2.2.3" --x-includes="/usr/csbmb/pkg/XORG64/include" --x-libraries="/usr/csbmb/pkg/XORG64/lib" # use ppc64 for make env CC="gcc -arch ppc64" make # note-- tools/wml subdir doesn't compile, but we mostly want the libs anyway ---- END Again, you'll need to edit the prefix,x-includes, and x-libraries to reflect where you install/installed things. Again, openmotif built this way didn't work for me, so I went with lesstif. Okay, now I wait for emails asking me to just post the binaries! -- Ben Singer CSBMB, Princeton University July 8, 2005