When you run a program that uses Gurobi on some SELinux systems, you may run into the following error message:
error while loading shared libraries: libgurobi120.so:
cannot restore segment prot after reloc: Permission denied
The simplest workaround is to set alloc_execmodon your system (as root):
> setsebool -P allow_execmod on
Theonsetting is the default on most SELinux systems, but it may be off in some cases. Note that this is a system-wide setting, so you should consult your system administrator before making this change.
A more local workaround is to modify the security context for the Gurobi shared library:
> chcon -t textrel_shlib_t libgurobi120.so
You can also use the semanage command to set SELinux policy for this library.
Please consult the SELinux documentation for more information on these commands.
libcrypt.so.1 error
The error message
error while loading shared libraries: libcrypt.so.1:
cannot open shared object file: No such file or directorycan appear on specific Linux systems and indicates that the libcrypt library is missing on that system. You can solve the problem by installing the libxcrypt-compat library using your package manager.