LLVM code generator with OpenMP requires write permission on source directory

When using the compile-time options “-Mllvm -mp” in a read-only directory then compilation fails even when paths specified for “-o” and “-module” have write permissions:

Compilation succeeds with “-Mnollvm -mp” or “-Mllvm”.

Is this behaviour intended?


mkdir test
cd test
echo end > test.f90
chmod u-w .
pgfortran -Mllvm -mp -o ../test.o test.f90

This looks like a bug, or at least, something that should be looked at a little closer. For our current releases LLVM is the default backend, so it’ll fail with just -mp. -Mnollvm -mp, as you noted, works. TPR #27845 is opened to track the issue.

TPR #27845 has been fixed in the NVIDIA HPC SDK Release 20.7.