Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Redistribute Libraries When Deploying Applications

When you deploy your application to systems that do not have a compiler installed, you need to redistribute certain Intel® libraries which your application has dependency on. You can address this in one of the following ways:

  • Statically link your application:

    An application built with statically-linked libraries eliminates the need to distribute runtime libraries with the application executable. By linking the application to the static libraries, you are not dependent on the dynamic shared libraries.

  • Dynamically link your application:

    If you build your application with dynamically linked (or shared) compiler libraries, you should address the following requirements:

    • Determine which shared or dynamic libraries your application needs.

    • Build your application with shared or dynamic libraries that are redistributable.

    • Pay attention to the directory where the redistributables are installed and how the OS finds them.

The redistributable library installation packages are available at the following locations:

Shared Library Deployment

If your application relies on shared libraries distributed with Intel® oneAPI tools, you must make sure that your users have these shared libraries on their systems. You have two options for deploying the shared libraries from the Intel oneAPI toolkit that your application depends on:

Private Model

Copy the shared libraries from the Intel oneAPI toolkit into your application environment, and then package and deploy them with your application. Review the license and third-party files associated with the Intel oneAPI toolkits and/or components you have installed to determine which files that you can redistribute.

  • The advantage to this model is that you have control over your library and version choice, so you only package and deploy the libraries that you have tested.
  • The disadvantage is that the end users may see multiple libraries installed on their system if multiple installed applications all use the private model. You are also responsible for updating these libraries whenever updates are required.

See Resolve Shared Library Dependencies for Private Model for details.

Public Model

You direct your users to download and install runtime library packages provided by Intel. Your users install these packages on their system when they install your application. The runtime packages install to a fixed, accessible location, so all applications built with Intel oneAPI tools can find the libraries on which they depend.

  • The advantage is that one copy of each library is shared by all applications. You can rely on updates to the runtime packages to resolve issues with libraries independently from when you update your application.
  • The disadvantage is that the footprint of the runtime package is larger than the selected subset of libraries used in the private model. Another disadvantage is that your tested versions of the runtime libraries may not be the same as your end user's versions.

See Resolve Shared Library Dependencies for Public Model for details.

Select the model that best fits your environment, your needs, and the needs of your users.

NOTE:
Intel ensures that newer compiler-support libraries work with older versions of generated compiler objects, but newer versioned objects require newer versioned compiler-support libraries. If an incompatibility is introduced that causes newer compiler-support libraries not to work with older compilers, you will have sufficient warning and the library will be versioned so that deployed applications continue to work.

Resolve Shared Library Dependencies for Private Model

Use these general steps to resolve application references to shared libraries in preparation for deployment using the private model.

  1. Determine runtime dependencies.

    Use one of the following commands for each of your programs and components to list the shared libraries your application depends on:

    Linux

    ldd programOrComponentName

    Windows

    dumpbin /DEPENDENTS programOrComponentName

    NOTE:
    These commands are adequate to list dependencies for most programs.

    For applications that use SYCL or OpenMP offload, additionally refer to the list of offload dependencies in Shared Library Dependencies for Device Offload to complete your list of application dependencies.

  2. Locate the shared libraries for redistribution. The compiler runtime package installs the shared libraries at the following locations.

    Runtime libraries for applications targeting CPU natively:

    Linux

    Component directory layout:

    <oneAPI-install-dir>/compiler/<version>/

    Unified directory layout:

    <oneAPI-install-dir>/<toolkit_version>/<install>/<version>/lib/ 

    Windows Component directory layout:

    C:\Program Files (x86)\Common Files\intel\Shared Libraries
    Unified directory layout:
    <oneAPI-install-dir>\bin\share\doc\compiler\

    Runtime libraries for applications using SYCL or OpenMP offload:

    Linux Component directory layout

    <oneAPI-install-dir>/compiler/<version>/lib/

    Unified directory layout:

    <oneAPI-install-dir>/<toolkit_version>/lib/

    Windows Component directory layout:

    <oneAPI-install-dir>\compiler\<version>\lib\
    Unified directory layout:
    <oneAPI-install-dir>\<toolkit_version>\lib\

  3. Decide where to package your dependencies. The main requirement for this decision is to consider the ability to resolve the dependencies during the run of the application. This can be dependent on the OS and on any defined search paths that are embedded in the application or resolved with environment variables.

Resolve Shared Library Dependencies for Public Model

The following information is useful to help your users install the runtime packages provided by Intel when using the public model of deployment.

  • Runtime packages are available from the oneAPI Standalone Components page
  • Runtime packages install to a fixed location:

    Linux

    /opt/intel/oneapi/libor /opt/intel/oneapi/<toolkit_version>/lib

    Windows

    C:\Program Files (x 86)\Common Files\intel\Shared Libraries

  • Set application environment variables.

    Linux

    Depending on the location determined by the installed package, the dependencies can be resolved by setting the LD_LIBRARY_PATH environment variable or embedding the search locations via RPATH related constructs.

    Windows

    Resolution of a given dll is typically done by setting the appropriate PATH or locating the dll in the executable location. System registration is also an option.

Shared Library Dependencies for Device Offload

If your application uses offload, you need to:

  1. Redistribute the shared libraries that your application depends on (listed as a result of step one in section Resolve Shared Library Dependencies for Private Model).
  2. Redistribute the shared libraries for each target that you are programming for.

Compatibility in the Minor Releases of the Intel oneAPI Products

For Intel oneAPI products, each minor version of the product is compatible with the other minor version from the same release (for example, 2021). When there are breaking changes in API or ABI, the major version is increased. For example, if you tested your application with an Intel oneAPI product with a 2021.1 version, it will work with all 2021.x versions. It is not guaranteed that it will work with 2022.x or 19.x versions.