localrc with network install

Is there a method for performing a network install of PGI Server that does not require each client writing its localrc.machinename to the network installation directory? I would prefer to instruct the compilers to consult a local filesystem localrc[.machinename] file before trying the network share.

For example if I installed pgi on the NFS shared /opt/pgi and use /usr/pgi/ as my local directory can I have the clients place their localrc in their /usr/pgi and have pgcc, etc consult that file?

I noticed that most the compile commands look for a PG*RC variable that can point to a specific localrc path but would prefer a more general solution.


Network installations are for multiple machines with different Linux versions
and gcc versions to use a common installation area. localrc.hostname
contains the host specific gcc pointers and other things that can change from one Linux system to the next.
You run makelocalrc on each host to create the localrc.hostname for that host.

If you are running the compilers on a single platform, you do not need to
use a network install. If all the platforms running the compilers use the same Linux version and gcc version, you do not need to do a network install.

If you run multiple versions of gcc and Linux on multiple platforms, and you want to run the compilers from a single installation, the localrc.hostname file
will contain those individual differences. maklocalrc run on that host creates
the localrc that makes that host work, and calls it localrc.hostname

If localrc.hostname does not exist, the drivers then look use the localrc file.


I am trying to support both Red Hat Entperise 5 (mostly 32 bit) and 6 (mostly 64 bit) hosts from a single installation point so I expect I will need to run makelocalrc on each host to create a different localrc file for each host. My concern is with where I must store that localrc.hostname file.

My client machines do not have write access to the location storing the network install and I would prefer to not have to grant write access from the clients.

I see my options as
i) run makelocalrc on each host creating the file somewhere outside of the network install location and then manually copying them to the network installation point

ii) run makelocalrc on each host writing the localrc.hostname something like to /usr/pgi/localrc.hostname and point PGCCRC, etc variables to that local file

iii) Some other unknown to me option similar to a PATH that can tell PGI to first try looking in a local directory e.g. /usr/pgi for a localrc.hostname before trying the file located on the the network install.

Related to (iii) I saw this post https://forums.developer.nvidia.com/t/conditionally-include-localrc/133234/1 which mentions an include directive. Could the network install ‘localrc’ file include localrc files stored on the clients?
e.g. ‘cinclude /usr/pgi/localrc.hostname;’ or if localrc.hostname renamed to be the same on everyhost ‘cinclude /usr/pgi/localrc.local;’
(I will try variations on iii today to see if it seems to work but would like the opinions of those who know best)

Thanks for the help,

Convince yourself that if you move localrc.hostname to your home directory,
it will be read AFTER localrc is read.

% cp $PGI/linux86-64/13.10/bin/localrc ~/localrc.yourhostname

for example.

% pgfortran -dryrun x.f
(x.f need not exist) and you will see that the localrc.hostname gets
read AFTER localrc in the $PGI bin directory.

So, if users (or you) runs the ‘makelocalrc’ lines presented at the
end of the ‘Network Install’ to put the localrc.hostname into their
home directories, things should work.

Or you can ‘rsh’ or ‘ssh’ the command lines on the different hosts, and create all the localrc files at once.

In addition, I just did a network install on system X, and wanted system Y and Z to share the network installation. The common local directory I created
for the installation was /tmp/pgi.

After installing 13.10 in /myhomedir/pgi, I then did the following using rsh
from the install machine, to each of the other

% rsh Y ‘cd /tmp; mkdir pgi;’
create the common local install directory

% rsh Y ‘/myhomedir/pgi/linux86/13.10/bin/makelocalrc /myhomedir/pgi/linux86/13.10 -net /tmp/pgi’

% rsh Y ‘/myhomedir/pgi/linux86-64/13.10/bin/makelocalrc /myhomedir/pgi/linux86-64/13.10 -net /tmp/pgi’

and then do the same with Z.

So you can as part of the install process, run the script on each of the
other hosts without much difficulty.

Thanks for the extra details. I didn’t know about the -dryrun option and it has come in handy.

We are using puppet for our configuration management and expect our number of machines to grow quickly so I’m trying to automate the client setup as much as possible within that framework.

What I ended up doing (and it appears to be working according to a couple test users) was the network install to our read-only NFS share. I then prepended the following to the network install location’s localrc file.

cinclude /usr/pgi/localrc;

Then on each machine puppet will create /usr/pgi/shared/13.9 and run the following code once

makelocalrc /opt/pgi/ -net /usr/pgi/shared/13.9 -d /usr/pgi -x -o > /usr/pgi/localrc

After that when I run ‘pgfortran -dryrun’ it reports what I had hoped for

Reading rcfile /opt/pgi/linux86-64/13.9/bin/localrc
Reading rcfile /usr/pgi/localrc

I will have more users test this and report back any problems thanks for your suggestions.