Usage of Dynamic Libraries
The general recommendation is to avoid the usage of dynamic libraries in operational FESA software. The reason behind is that dynamic libraries allow the replacement in the background, especially if they are not versioned at all. In this case it can not be guaranteed that the operational FESA software is still functional as expected after a reboot.
Therefore the usage of static libraries should be preferred over dynamic libraries within operational FESA software.
However in some cases the usage of dynamic libraries can not be avoided if the producer of such libraries does not provide static versions of their driver software.
The following describes how to use dynamic libraries on a 64-bit front-end that is designed to run FESA software that binds its libraries statically. It is recommened to avoid such special cases wherever possible.
Recipe to provide and use dynamic libraries on a 64-bit FEC
- provide the dynamic library in /common/export/nfsinit/<FEC name>
- design a script that initializes the 64-bit FEC to your needs and store it in /common/export/nfsinit/<FEC name>
- in this script make sure the library is copied to /usr/lib or adjust your FEC to adapt the LD_LIBRARY_PATH environment variable to hold your directory
- call ldconfig
- make sure this script is called before the FESA script by adjusting the script name. Numbers at the beginning of the script names are treated in ascending order during FEC launch.
A minimal example for such a script is given below:
#!/bin/sh
echo copy dynamic library dynamicLibrary.so to /usr/lib
BASE=$(dirname $0)
cp $BASE/dynamicLibrary.so /usr/lib/
ldconfig
--
SolveighMatthies - 08 Apr 2015