When compiling a large C++ shared library I encounter the following error at link time:
/usr/bin/ld: /tmp/pgcudafatFKVdDBx3zswD.o: relocation R_X86_64_PC32 against symbol `__pgi_uacc_set_ctxrel' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value pgacclnk: child process exit status 1: /usr/bin/ld
The error is a bit or a red herring as I have confirmed that all sources included in this library already is built with -fPIC. My acc specific compilation flags are “-acc -ta=tesla:ccall,nordc”. With previous versions of the PGI compiler I found that the nordc option is necessary for correct results. Everything worked well with PGI19.10, but I am attempting to upgrade to PGI 20.9 due to a blocking bug in another one of our tools. Do you have any ideas of what could be causing this?