Forum Discussion

FICO's avatar
FICO
Community Manager
5 years ago

Using Xpress Optimizer 8.12.3 in Docker Container

Hi,

We are using Xpress 8.12.3 within the docker container. We are using Xpress with .net core C#.

We ran into a problem when we wanted to use Azure Service Bus + Masstransit in the same container. Both are not working together. It seems to be an issue with some environment variable settings.

It would be very helpful if you can share recommended way to use Xpress in the docker container.

Thanks,

Shamsher

6 Replies

  • FICO's avatar
    FICO
    Community Manager

    Could you please elaborate on what are the exact problems you are facing? What exactly does not work and what of this is related to Xpress?

    Usually, for programs using the Xpress optimizer, there should be no difference between running them inside a Docker container or from a local host.

  • FICO's avatar
    FICO
    Community Manager

    So in the container, we are keeping the express installation files (full xpressmp folder). After that, we need to set some environmental variables.

    Is this the right way to use Xpress Optimizer in docker?

    Some of these env variables making Service Bus not usable. If we do not set those then we are getting dll not found error for Xpress.

  • FICO's avatar
    FICO
    Community Manager

    One of the Errors we got.

    2021-09-30 15:17:20.3281|Unable to load shared library 'xprs' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libxprs: cannot open shared object file: No such file or directory System.DllNotFoundException: Unable to load shared library 'xprs' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libxprs: cannot open shared object file: No such file or directory

    at Optimizer.DLLImports.XPRSbeginlicensing(Int32& p_notyet)

    at Optimizer.XPRSglobalenv.BeginLicensing(Boolean& p_notyet)

    at Optimizer.XPRS.BeginLicensing(Boolean& p_notyet)

    at Optimizer.XPRS.BeginLicensing()

  • FICO's avatar
    FICO
    Community Manager

    Hello Daniel,

    After some investigation we have found setting LD_LIBRARY_PATH env variable is causing the problem. Is there a way to not set env variables for Xpress?

    Thanks,

    Shamsher

  • FICO's avatar
    FICO
    Community Manager

    I guess the problem is then that setting LD_LIBRARY_PATH causes some of your other applications to pull in 3rd party shared libraries from the Xpress distribution and these libraries are not compatible with your other applications?

    Unfortunately, the Xpress application needs to know the place at which it can find the Xpress shared libraries, so you are more or less stuck with setting LD_LIBRARY_PATH.

    Depending on how exactly you invoke the application that uses Xpress, there are different ways to work around this issue:

    1. Do not set LD_LIBRARY_PATH *globally*. Instead that it *only* for the application.
    2. If the LD_LIBRARY_PATH must be set globally (or if setting it only for the application does not fix the issue), you can try to figure out which of the 3rd party libraries shipped with Xpress cause the problems. Then figure out in which directory the respective 3rd party library is installed on your system and add that directory to the LD_LIBRARY_PATH *before* the path to Xpress libraries.

    Another alternative would be to just rename the 3rd party libraries in the Xpress installation directory one by one and see whether this fixes the problem.

    If possible, I recommend setting the LD_LIBRARY_PATH only for the application.

  • FICO's avatar
    FICO
    Community Manager

    Thanks, Daniel for the information.