Suppose you encounter an error such as
appname: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory
when attempting to run an application on RHEL 9.
Create a VCL reservation for HPC (CentOS 7 64 bit VM) image. Then search /usr/lib64 for the shared object libreadline.so.6. Note that there may be several links with similar names in addition to the actual shared object file.
vclvm179-209 ~]$ ls -l /usr/lib64 | grep readline lrwxrwxrwx. 1 root root 28 Oct 7 2019 libreadline.so -> ../../lib64/lireadline.so.6 lrwxrwxrwx. 1 root root 18 Oct 7 2019 libreadline.so.6 -> libreadline.so.6.2 -rwxr-xr-x. 1 root root 285136 Aug 8 2019 libreadline.so.6.2In a permanent location where you have write access create a directory named something like my_lib, for example in your home directory:
cd mkdir my_lib cd my_libThen copy the shared object from the VCL image - take care to copy the actual shared object, not one of the symbolic links.
cp /usr/lib64/libreadline.so.6.2 . ln -s libreadline.so.6.2 libreadline.so.6 ln -s libreadline.so.6 libreadline.soFor the application to find the shared object you copied, add the path to the link to LD_LIBRARY_PATH environment variable.
export LD_LIBRARY_PATH=/home/$USER/my_lib:$LD_LIBRARY_PATHIf there is a module file for the application this setting should be included in the module file. Otherwise include this line in batch script prior to invoking application.