using same installation tree for suse and redhat

I’d like to share the same pgi installation tree between redhat and suse. The only difference seems to be in the localrc file. Is that file processed by a shell, which would allow me to include some if-then logic ? If not, is there other syntax to allow if-then tests ?

Hi Dave,

The localrc file is used by the drivers (pgcc, pgf90, pgf77, pgCC, pghpf) and is written in it’s own language. While if-then and case statements are not supported, it does have its own if clause. Something like the following should work:

This code sets the internal variable VENDOR to the value of the user’s VENDOR enviroment variable. You’ll need to determine what variable you can use to set the name of the OS.

variable VENDOR is
     environment (VENDOR);

This code sets the driver variable GCCDIR depending upon the value of VENDOR. Of course, change the libpaths to the actual path names.

set GCCDIR = $if($equal($VENDOR, suse), suselibpath)
             $if($equal($VENDOR,redhat), redhatpath);

Repeat for the remaining varaibles. We usually don’t recommend you change your localrc file since this will effect everyone who uses the compilers. Instead consider using “.mypgf90rc” (or other driver name) in your local directory so only your compilation will be effected.

Note that the specific PGI libraries and include files that are installed on a system are based mostly on the glibc version being used. Having SuSE and Red Hat share a common installation might work if they use similar glibc version. Even then however, you might still see undefined references to “ctype_b” or “ctype”.

For our internal development compilers we use a common directory “/usr/pgi/linux86[-64]/dev” on all systems. However, this is really just a link to a particular shared installation on our main server. You might consider doing something like this instead since the compilers do have a lot of dependancies on the particular OS.

  • Mat