Install with gcc in non-standard location

Hi,
I’m trying to get PGI look up gcc in non-standard location. I’ve been using linuxbrew to build my toolchain in ~/.linuxbrew and I can’t find a way to make pgc++ to look for the gcc version there. Googling around and I found that it has something to do with addlocalrc and makelocalrc hardcoding the search path for gcc to be in the standard location like /usr/bin. How can I change this to make them look for the toolchain in ~/.linuxbrew?

Thanks,
Char

For future reference, I managed to get it to work by manually setting the options in localrc:

set LFC=-lgfortran;
set LINUXBREWHOME=/home/aznb/.linuxbrew;
set LDSO=$LINUXBREWHOME/lib/ld.so;
set GCCDIR=$LINUXBREWHOME/Cellar/gcc@7/7.3.0/lib/gcc/7/gcc/x86_64-pc-linux-gnu/7.3.0/;
set G77DIR=$LINUXBREWHOME/Cellar/gcc@7/7.3.0/lib/gcc/7/gcc/x86_64-pc-linux-gnu/7.3.0/;
set OEM_INFO=64-bit target on x86-64 Linux $INFOTPVAL;
set GNUATOMIC=;
set GCCINC= $LINUXBREWHOME/include  $LINUXBREWHOME/Cellar/gcc@7/7.3.0/lib/gcc/7/gcc/x86_64-pc-linux-gnu/7.3.0/include;
set GPPDIR= $LINUXBREWHOME/Cellar/gcc@7/7.3.0/include/c++/7.3.0 $LINUXBREWHOME/Cellar/gcc@7/7.3.0/include/c++/7.3.0/x86_64-pc-linux-gnu $LINUXBREWHOME/Cellar/gcc@7/7.3.0/include/c++/7.3.0/backward $LINUXBREWHOME/lib/gcc/7/gcc/x86_64-pc-linux-gnu/7.3.0//include $LINUXBREWHOME/lib/gcc/7/gcc/x86_64-pc-linux-gnu/7.3.0/include $LINUXBREWHOME/lib/gcc/7/gcc/x86_64-pc-linux-gnu/7.3.0/include-fixed $LINUXBREWHOME/include;
set LOCALRC=YES;
set EXTENSION=__extension__=;
set COMPGCCINCDIR=include-gcc73;
set LC=$if(-Bstatic,-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc, -lgcc -lc -lgcc -lgcc_s);
set DEFLIBDIR=$LINUXBREWHOME/lib;
set DEFSTDOBJDIR=$LINUXBREWHOME/lib;
set STDRPATHSO=-rpath $LINUXBREWHOME/lib:/usr/lib64;
# GLIBC version 2.23
# GCC version 7.3.0
set GCCVERSION=70300;
set LIBNCURSES=YES;
export PGI=$COMPBASE;

Hi Char_Aznable,

You can also generate a localrc file by running the “makelocalrc” script with the GNU flags pointing to your GCC installation.

Something like:

makelocalrc -x -d . -gcc /home/aznb/.linuxbrew/ellar/gcc@7/7.3.0/lib/gcc/7/gcc/x86_64-pc-linux-gnu/7.3.0/bin/gcc -gpp /home/aznb/.linuxbrew/ellar/gcc@7/7.3.0/lib/gcc/7/gcc/x86_64-pc-linux-gnu/7.3.0/bin/g++  -g77 /home/aznb/.linuxbrew/ellar/gcc@7/7.3.0/lib/gcc/7/gcc/x86_64-pc-linux-gnu/7.3.0/bin/gfortran

This will create a localrc file in your current working directory. You can also create multiple localrc files if you have multiple GNU settings (be sure to rename the files). The you can set the environment variable “PGI_LOCALRC” to the particular localrc file you wish to use.

Hope this helps,
Mat