pgf77 on multiple versions of linux

Hello,
I’m trying to save installation time by centrally locating a pgi install directory. This worked fine with RHEL 3 and FC2. I only had to create a specific localrc file in order to compile on FC2 vs. RHEL3. Now, I need to support FC3 as well. I have installed as a test the 6.0 pgi compilers and I’m having a problem with pgf77. I generated again a localrc file for FC3, then I use the compiler with the -rc flag.
The results for the pgcc compilers work on both RHEL 3 and FC3 however, the pgf77 compiler fails with:

$ pgf77 -rc /usr/local/site/pgitest/linux86/6.0/bin/localrcFC3 test.f
File with unknown suffix passed to linker: /usr/local/site/pgitest/linux86/6.0/bin/localrcFC3
File with unknown suffix passed to linker: test.f
/usr/bin/ld:/usr/local/site/pgitest/linux86/6.0/bin/localrcFC3: file format not recognized; treating as linker script
/usr/bin/ld:/usr/local/site/pgitest/linux86/6.0/bin/localrcFC3:1: syntax error

Is modifying only the localrc file not sufficient to have the pgf77 compiler working on both versions of linux. (RHEL is gcc 3.2.3 and FC3 is gcc 3.4.2.)

Thanks,
Jeff McDonald

It may be useful to know that if the compile and linking steps are separated and the
rc flag is used only in the linking stages, there is no error.

e.g.:
$ pgf77 -c test.f

$ pgf77 -rc /usr/local/site/pgi/linux86/5.2/bin/localrcFC3 -o test
test.o

works fine on FC3 (even on version 5.2). On version 6.0, I found that the same
problems occur if you use the -rc flag in a compile+link step.

Hello Dr. McDonald:
I understand why you want to simplify the installation with a network of workstations; we have quite a diverse network ourselves, and we understand the problem.
I’ll answer the easy questions first:

The line
$ pgf77 -rc /usr/local/site/pgitest/linux86/6.0/bin/localrcFC3 test.f
fails because the driver (pgf77) gets confused about whether localrcFC3 is an argument to the -rc switch (which it is) or whether it is another file on the command line. The workaround is to use an equal sign
$ pgf77 -rc=/usr/local/site/pgitest/linux86/6.0/bin/localrcFC3 test.f

However, this won’t work either, in 6.0 at least, because of another bug in the driver. For reasons too technical (meaning someone goofed) to explain, when a user adds an rc file on the command line, the set of file suffixes gets trashed, so the driver doesn’t recognize .f as a Fortran file anymore. I am really sorry about this. The -rc switch isn’t used very often, in fact almost never, so when a bug like this crept in, it didn’t get detected, for which we have no excuse. The workaround is to change the localrcFC3 to start with the line
include .pgf77rc;
…rest of your stuff…
and to compile with
$ pgf77 -initrc=localrcFC3 test.f
If the localrcFC3 is in the same directory as the pgf77 driver, you shouldn’t need to put in the full path.

Now for the longer questions:
Unfortunately, localrc is not the only difference between different installs of the PGI compilers. The install process moves include files and libraries into the include/ and lib/ directories depending on the version of glibc and gcc installed on that system. Your RHEL and FC2 systems probably have the same glibc and gcc versions, so the same include and library files, as well as the same localrc file, will work. Your FC3 system has an upgraded gcc, perhaps a different glibc, so the libraries and includes are different, and the localrc is different as well. For 6.0, we really have no simpler way to install. This answers your question about whether the localrc is only used in the link step; it is also used by the compiler for include files, but since include files are not common in Fortran, it is less important than for C (for instance).

However, as I mentioned at the start, we really understand the desire for a single install point for a network of workstations, even when (or especially when) they have different versions of other software. Also, it would be much easier to manage if the compilers didn’t have to be reinstalled when upgrading gcc or the operating system or the glibc libraries. We are working on this, and the hope is to have this in place for 6.1. You will have to run a script on each system to generate the equivalent of the ‘localrc’ file for that system, that will identify which version of gcc and glibc (and any other information) is appropriate, but the actual installation can be put on one NFS directory. Also, after an upgrade of the system, simply running the same script will update the PGI compiler installation. It would be even better if the compilers could auto-detect the gcc and glibc versions, but this is a somewhat lengthy process that you probably don’t want to happen each time you run the compilers.

I’m sorry I can’t help with all the problems, but I think the next release will solve these problems in a painless way.

  • Michael Wolfe

Hello,

The problems that I observed with pgi 5.2 (localrc…) still persist with version 6.0. Is there a version which will dynamically figure out the runtime environment?

Regards,
Jeff McDonald

I can only reiterate what I said in my previous reply:
We are working on this, and the hope is to have this in place for 6.1. You (or whoever does the installation) will have to run a script on each system to generate the equivalent of the ‘localrc’ file for that system, that will identify which version of gcc and glibc (and any other information) is appropriate, but the actual installation can be put on one NFS directory. Also, after an upgrade of the system, simply running the same script will update the PGI compiler installation. It would be even better if the compilers could auto-detect the gcc and glibc versions, but this is a somewhat lengthy process that you probably don’t want to happen each time you run the compilers.
-Michael Wolfe