Loading IBM MQ libraries
When deciding how to load IBM® MQ libraries, you need to consider a number of factors, including: your environment, whether you can change your existing applications, whether you want a primary installation, where IBM MQ is installed, and whether the location of IBM MQ is likely to change.
- On AIX® and Linux® systems, if a copy of an IBM MQversion, is installed in the default location, existing applications continue to work in the same way as previous versions. However, if the applications need symbolic links in /usr/lib, you must either select an IBM MQ version installation to be the primary installation, or manually create the symbolic links.
- If IBM MQ is installed in a non-default location, you might need to change your existing applications so that the correct libraries are loaded.
Optimally, you should ensure the IBM MQ library, that is loaded by the operating system, is the one with which the queue manager is associated.
| Platform | Option | Benefits | Drawbacks |
|---|---|---|---|
![]() AIX and Linux systems |
Set or change the embedded runtime search path (RPath) of the application.
This option requires you to recompile and link the application. For more information about compiling and linking applications, see Building a procedural application. |
|
|
| AIX and Linux systems | Set the LD_LIBRARY_PATH environment variable , using setmqenv, or crtmqenv, with the
-k or -l option. (
|
|
|
Windows
systems |
Set the PATH variable using setmqenv, or crtmqenv. |
|
|
AIX, Linux, and Windows
systems |
Set the primary installation to an IBM MQ, or later, installation. See Changing the primary installation.
For more information about the primary installation, see Choosing a primary installation. |
|
|
![[Linux]](nglinux.gif)
Library loading considerations for Linux
Applications compiled using some versions of gcc, for example, version 3.2.x, can have an embedded RPath that cannot be overridden using the LD_LIBRARY_PATH environment variable. You can determine if an application is affected by using the readelf -d applicationName command. The RPath cannot be overridden if the RPATH symbol is present and the RUNPATH symbol is not present.
Operating system library loading mechanisms
- The directory the application is loaded from.
- The current directory.
- The directories in the PATH environment variable, both the global PATH variable and the PATH variable of the current user.
![[AIX]](ngaix.gif)
On AIX and Linux systems, there
are a number of methods that might have been used to locate the libraries to load:- Using the LD_LIBRARY_PATH environment variable (also LIBPATH on AIX). If this variable is set, it defines a set of directories that are searched for the required IBM MQ libraries. If any libraries are found in these directories, they are used in preference of any libraries that might be found using the other methods.
- Using an embedded search path (RPath). The application might contain a set of directories to search for the IBM MQ libraries. If the LD_LIBRARY_PATH is not set, or if the required libraries were not found using the variable, the RPath is searched for the libraries. If your existing applications use an RPath, but you cannot recompile and link the application, you must either install IBM MQ in the default location, or use another method to find the libraries.
- Using the default library path. If the IBM MQ libraries are not found after searching the LD_LIBRARY_PATH variable and RPath locations, the default library path is searched. Usually, this path contains /usr/lib or /usr/lib64. If the libraries are not found after searching the default library path, the application fails to start because of missing dependencies.
AIX:
dump
Linux:
readelf
![[Windows]](ngwin.gif)