Free PGI 16.4 on OSX 10.11 (El Capitan)

Hello,
thank You for providing a good free C++/Fortran compiler!

As I didn’t find any messages/pointers on these errors I saw with Free PGI 16.4 on OSX 10.11, I wanted to share them here.
First of all, the compier invocation does work in the Terminal started by the Free PGI.app; these failures only occur when trying to invoke from a normal shell (which in my case is required, or when building from an IDE…), where certain env-variables are not set.

\

  1. Compiling fails in the Linking step:
pgcc -v -o stub stub.c
...
/usr/bin/ld /usr/lib/crt1.o /Applications/Free\ PGI.app/Contents/Resources/pgi/osx86-64/16.4/lib/pgimainmx.o -L/Applications/FreePGI.app/Contents/Resources/pgi/osx86-64/16.4/lib -L/usr/lib stub.o -macosx_version_min -rpath /Applications/FreePGI.app/Contents/Resources/pgi/osx86-64/16.4/lib -o stub -framework Security -framework IOKit -framework CoreFoundation -arch x86_64 -no_pie -no_new_main -lpgmp -lpthread -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc -lSystem
ld: -macosx_version_min value malformed: '-rpath'
  1. The linker then continous to complain about not finding gcc…

  2. The compiler-wrapper warns about:

pgcc-Warning-Malformed $expr(), nonnumeric value >
pgcc-Warning-Malformed $expr(), nonnumeric value >=
pgcc-Warning-Malformed $expr(), nonnumeric value >=
pgcc-Warning-Malformed $expr(), nonnumeric value >=
pgcc-Warning-Malformed $expr(), nonnumeric value >=

Now all of these one could charmlessly handle by adding fixed values into the corresponding osxrc / osx64rc.


However, the proper solution is creating a localrc; so
go to

cd /Applications/Free\ PGI.app/Contents/Resources/pgi/osx86-64/16.4/bin

and create the localrc file:

./makelocalrc -x .

One may observe, that the localrc file is being consumed by running

pgcc -dry-run ...

Best regards
Rainer Keller