Cannot Restore Segment Prot After Reloc: Permission Denied

When launching QuantumATK for the first time, you may experience the following kind of error message:

QT (‘Not available’, ‘/home/user/atk/atkpython/lib/python2.6/site-packages/qtext.so: cannot restore segment prot after reloc: Permission denied’) The cause of this error are the new kernel security extensions from the Security-Enhanced Linux (SELinux) project, which are enabled in some newer Linux distributions, to allow finer-grained control over system security and shared library loading.

The solution is to register the relevant libraries in the security module to allow them to be relocated in memory. For each library for which the error appears, do

chcon -t texrel_shlib_t lib.so

where lib.so is the offending file.