NRAO
 

Astronomical Image Processing System

[AIPS]

Why install a compiler?

The information below is very old. The general problem of compilers in RedHat enterprise systems remains. They ship very old versions. The 2018 RedHat 7 contains gfortran 4.8.5 which will work with AIPS but is not desirable. Instead one should now download gcc/gfortran version 6.4. The installation instructions below may work with this version, but it would be better to get installation instructions from gnu. The AIPS changes below are obsolete. 31DEC17 and later AIPS contain correct compilation parameters for gfortran.

RedHat Linux systems 3.7.0-3.7.3 are shipped with a version of the GNU compiler suite called version 2.96. This was a version that was never endorsed by the GNU compiler group and fails in numerous ways when compiling AIPS (and other packages) at the usual levels of optimization. For these (now) older Linux systems we recommend the GNU 2.95.3 compiler with a rather complicated set of OPT2 options give in the $SYSLOCAL/FDEFAULT.SH file.

Compiler versions 3.3.x and 3.4.2 have been found to contain errors when used with AIPS. With minor changes, AIPS now appears to work well with 3.2.3 and preliminary tests of 3.4.4 look good. Version 4.0 should not be used.

You will need root access if you want to install the new compiler in /usr/local (the default) or in some directory beneath /usr/local. You may, as an ordinary user, install in any directory over which you have write privilege. DO NOT INSTALL in /usr - the operating system was built with that version of gcc and you must keep it around.

Installing the compiler

Steps to install GNU 2.95.3 compiler in Linux

Go to http://www.gnu.org/software/gcc/
  • Download instructions.
  • Click link to releases, then the link to 2.95.3, then the link to GNU mirror sites. Choose one.
  • Download gcc-2.95.3.tar.gz 2.95.3 is preferred with RedHat 3.7 systems.
  • Or download the tarball from us at gcc-2.95.3.tar.gz
  • Anonymous ftp to ftp.aoc.nrao.edu, area pub/staff/egreisen, file gcc-2.95.3.ps.gz will also work. Be sure to use binary.
  • Unpack the tarball with tar xzvf gcc-2.95.3.tar.gz (1)
  • cd gcc-2.95.3
  • ./configure
  • make bootstrap
  • make install (2)
Gcc-2.95.3 binaries (such as gcc or g77) can be accessed via /usr/local/bin/gcc or /usr/local/bin/g77.

Notes

  1. Note this will make a subdirectory called gcc-3.2.3 or gcc-2.95.3 in the directory the tar file was downloaded to.
  2. This will install in /usr/local/{bin,lib,include}. If you want the location to be elsewhere you must run configure with the --prefix=dirname argument for instance
    ./configure --prefix=/usr/local/gcc
    In this case you must mkdir /usr/local/gcc first. You will almost certainly need root access to do this step.
  3. Do NOT replace the gcc and g77 in the bin, lib, et al. directories below /usr. These are needed by your operating system and it will not take kindly to being overwritten.
  4. Tests show that gcc-3.0.3 and 3.0.4 produce code that does not work in some tasks, particularly COMB. More recently, we have found that gcc-3.3.x does not work. Code produced by 2.95.3 seemed to run faster on older PIVs, but 2.95.3 is getting pretty old for modern operating systems. Better performance results have been reported recently.

AIPS Changes

If your AIPS has not yet been installed, things are pretty simple. While running install.pl or update.pl you will be asked if the automatically detected compilers are correct. Answer no and then provide the path to where you put the 2.95 compilers. The installaion will then edit the necessary files for you.

If you installed AIPS using the 2.96, 3.0.3, 3.0.4, or 3.3 compilers you have much more work to do. If you use bash then:

  1. cd $AIPS_ROOT or cd to the AIPS root directory if the environment variable is not set yet.
  2. . LOGIN.SH - note the dot.
  3. $CDTST
  4. Edit $SYSLOCAL files named CCOPTS.SH, LDOPTS.SH, and FDEFAULT.SH to change the path to "COMPILER" to the new compiler path.
  5. rm $LIBR/*/SUBLIB
  6. cd $TST/$ARCH/INSTALL
  7. rm *.LIS
  8. ( INSTEP2 >/dev/null 2>>INSTEP2.ERR & )
  9. ( INSTEP4 >/dev/null 2>>INSTEP4.ERR & )
  10. You may follow the progress of these with tail -f INSTEP2.LOG and tail -f INSTEP4.LOG.

If you use csh or tcsh instead, then do:

  1. cd $AIPS_ROOT or cd to the AIPS root directory if the environment variable is not set yet.
  2. source LOGIN.CSH
  3. $CDTST
  4. Edit $SYSLOCAL files named CCOPTS.SH, LDOPTS.SH, and FDEFAULT.SH to change the path to "COMPILER" to the new compiler path.
  5. rm $LIBR/*/SUBLIB
  6. cd $TST/$ARCH/INSTALL
  7. rm *.LIS
  8. ( ( INSTEP2 >/dev/null ) >>&INSTEP2.ERR & )
  9. ( ( INSTEP4 >/dev/null ) >>&INSTEP4.ERR & )
  10. You may follow the progress of these with tail -f INSTEP2.LOG and tail -f INSTEP4.LOG.

The first three steps define the AIPS environment. The next step selects the new compilers. If FDEFAULT.SH is not in $SYSLOCAL change the one in $TST/$ARCH/SYSTEM or, if that is not there, the one in $SYSUNIX (be sure to do the part for your architecture, i.e. LINUX). The next three steps clear away things made during the last installation that will block a new installation. The next step recompiles all of the subroutine libraries and the last step compiles and links all of the programs.


Modified on $Date: 2018/08/29 17:26:50 $
Eric W. Greisen