Installing gcc 2.8.* on a Dec ev56 running Linux

Because ATLAS gets much better performance using gcc 2.8.* or 2.7.* than with current gcc or egcs, I have created this page detailing how I was able to install gcc 2.8.1 on my Dec ev56 running Linux. You can't just follow the normal directions, due to a mismatch between gcc 2.8.1 and as. I hacked around this by providing a wrapper around as that fixes the problem (note that I am not a system administrator; I am sure there are many more elegant ways to do this). You do not have to be root to install this, as the following example shows.

In order to fix the aforementioned as/gcc mismatch, I wrote the following as wrapper, which I saved as the file as56.c:

#include <stdio.h>

main(int nargs, char **args)
{
   char ln[1024];
   int i, j;
   i = sprintf(ln, "/usr/local/bin/as -mev56");
   for (j=1; j < nargs; j++) i += sprintf(ln+i, " %s", args[j]);
   ln[i] = '\n';
   ln[i+1] = '\0';
   system(ln);
}
You need to change my as and path to yours (which as should show the correct path if you are using one of the csh derivitive shells), and use the appropriate machine settings. Do an info as if you are unsure what the machine settings should be.

You then need to download gcc 2.8.* or 2.7.*. If you can't find any this old sitting around, I have made it available for ftp here.

After this, you can essentially follow the install instructions given with gcc, except use the above as instead of the system. Here are the commands I executed to complete the install:

   gunzip -c gcc-2.8.1.tar.gz | tar xvf - 
   cd gcc-2.8.1
   mkdir objs 
   cd objs
   ../configure --prefix=/home/rwhaley/local/gnu/gcc2.8.1
   cp ~/as56.c as56.c
   gcc -O -o as as56.c
   make LANGUAGES=c
   make CC="stage1/xgcc -Bstage1/" CFLAGS="-O2" LANGUAGES="c"
   make install CC="stage2/xgcc -Bstage2/" CFLAGS="-O2" LANGUAGES="c"
   cp as /home/rwhaley/local/gnu/gcc2.8.1/bin/.
   set path = (/home/rwhaley/local/gnu/gcc2.8.1/bin $path)
   alphageek.home.net. which gcc
   /home/rwhaley/local/gnu/gcc2.8.1/bin/gcc
Obviously, you will want to replace my install path, /home/rwhaley/local/gnu/gcc2.8.1/bin with your own, and probably put the set path in your .cshrc.

After you run ATLAS configure, and before you start the install, examine the generated Make.ARCH file, and make sure all mentions of gcc point to your newly install gcc. You should then be good to finish the ATLAS install.