|
1 |
| -.. This file is included by building-open-mpi.rst |
2 |
| -
|
3 | 1 | Installation options
|
4 | 2 | ^^^^^^^^^^^^^^^^^^^^
|
5 | 3 |
|
@@ -32,48 +30,100 @@ be used with ``configure``:
|
32 | 30 | Be sure to read the description of ``--without-memory-manager``,
|
33 | 31 | below; it may have some effect on ``--enable-static``.
|
34 | 32 |
|
35 |
| -* ``--disable-wrapper-rpath``: |
36 |
| - By default, the wrapper compilers (e.g., ``mpicc``) will enable |
37 |
| - "rpath" support in generated executables on systems that support it. |
38 |
| - That is, they will include a file reference to the location of Open |
39 |
| - MPI's libraries in the application executable itself. This means |
40 |
| - that the user does not have to set ``LD_LIBRARY_PATH`` to find Open |
41 |
| - MPI's libraries (e.g., if they are installed in a location that the |
42 |
| - run-time linker does not search by default). |
43 |
| - |
44 |
| - On systems that utilize the GNU ``ld`` linker, recent enough versions |
45 |
| - will actually utilize "runpath" functionality, not "rpath". There |
46 |
| - is an important difference between the two: |
47 |
| - |
48 |
| - #. "rpath": the location of the Open MPI libraries is hard-coded into |
49 |
| - the MPI/OpenSHMEM application and cannot be overridden at |
50 |
| - run-time. |
51 |
| - #. "runpath": the location of the Open MPI libraries is hard-coded into |
52 |
| - the MPI/OpenSHMEM application, but can be overridden at run-time |
53 |
| - by setting the ``LD_LIBRARY_PATH`` environment variable. |
| 33 | +* ``--disable-wrapper-runpath`` / ``--disable-wrapper-rpath``: By |
| 34 | + default, the wrapper compilers (e.g., ``mpicc``) will enable |
| 35 | + "runpath" or "rpath" support in generated executables on systems |
| 36 | + that support it. That is, they will include a filesystem path |
| 37 | + reference to the location of Open MPI's libraries in the application |
| 38 | + executable itself. This means that the user does not have to set |
| 39 | + ``LD_LIBRARY_PATH`` to find Open MPI's libraries, which can be |
| 40 | + helpful if they are installed in a location that the run-time linker |
| 41 | + does not search by default. |
| 42 | + |
| 43 | + .. note:: By default, the wrapper compilers prefer "runpath" |
| 44 | + behavior over "rpath" behavior. |
| 45 | + |
| 46 | + * Using ``--disable-wrapper-runpath`` alters this |
| 47 | + preference: "runpath" behavior will never be used. |
| 48 | + Instead, the wrapper compilers will use "rpath" behavior |
| 49 | + if it is supported. |
| 50 | + * Using ``--disable-wrapper-rpath`` will disable *both* |
| 51 | + "runpath" and "rpath" behavior in the wrapper compilers. |
| 52 | + |
| 53 | + .. important:: Note that the ``--disable-wrapper-runpath`` and |
| 54 | + ``--disable-wrapper-rpath`` CLI options *only* affect |
| 55 | + the flags that the wrapper compilers use when |
| 56 | + building MPI/OpenSHMEM applications. These options |
| 57 | + do not affect how Open MPI or OpenSHMEM are built (to |
| 58 | + include the wrapper compilers themselves). |
| 59 | + |
| 60 | + See the :ref:`Linker "rpath" and "runpath" |
| 61 | + functionality |
| 62 | + <building-ompi-cli-options-rpath-and-runpath-label>` |
| 63 | + section for details on how "rpath" and "runpath" |
| 64 | + affect the building and linking of Open MPI itself. |
| 65 | + |
| 66 | + When either of "runpath" or "rpath" behaviors are enabled, the |
| 67 | + wrapper compilers will hard-code the filesystem path location of the |
| 68 | + Open MPI libraries into the Open MPI/OpenSHMEM application. The |
| 69 | + most notable differences between "runpath" and "rpath" behavior are: |
| 70 | + |
| 71 | + * runpath |
| 72 | + |
| 73 | + #. The run-time linker first searches the paths in the |
| 74 | + ``LD_LIBRARY_PATH`` environment variable for the relevant Open |
| 75 | + MPI/OpenSHMEM libraries. |
| 76 | + #. If not found there, the run-time linker falls back to checking |
| 77 | + the hard-coded location for the relevant Open MPI/OpenSHMEM |
| 78 | + libraries. |
| 79 | + |
| 80 | + * rpath |
| 81 | + |
| 82 | + #. The run-time linker first checks the hard-coded location for |
| 83 | + the relevant Open MPI/OpenSHMEM libraries. |
| 84 | + #. If not found there, the run-time linker falls back to |
| 85 | + searching the paths in the ``LD_LIBRARY_PATH`` environment |
| 86 | + variable for the relevant Open MPI/OpenSHMEM libraries. |
| 87 | + |
| 88 | + .. warning:: There are other, subtle differences between "runpath" |
| 89 | + and "rpath" which are out of scope for this |
| 90 | + documentation. You may wish to consult other sources |
| 91 | + for more information. |
| 92 | + |
| 93 | + For example, a decent set of explanations can be found |
| 94 | + in the slides for a Linux course entitled "Building and |
| 95 | + Using Shared Libraries on Linux // `Shared Libraries: |
| 96 | + The Dynamic Linker |
| 97 | + <https://man7.org/training/download/shlib_dynlinker_slides.pdf>`_". |
54 | 98 |
|
55 | 99 | For example, consider that you install Open MPI vA.B.0 and
|
56 | 100 | compile/link your MPI/OpenSHMEM application against it. Later, you
|
57 | 101 | install Open MPI vA.B.1 to a different installation prefix (e.g.,
|
58 |
| - ``/opt/openmpi/A.B.1`` vs. ``/opt/openmpi/A.B.0``), and you leave the old |
59 |
| - installation intact. |
| 102 | + ``/opt/openmpi/A.B.1`` vs. ``/opt/openmpi/A.B.0``), and you leave |
| 103 | + the old installation intact. |
| 104 | + |
| 105 | + In the runpath case, you can set the ``LD_LIBRARY_PATH`` environment |
| 106 | + variable to point to the A.B.1 installation, and then your MPI |
| 107 | + application will use those libraries, since the runtime will search |
| 108 | + the paths in ``LD_LIBRARY_PATH`` first. |
60 | 109 |
|
61 |
| - In the rpath case, your MPI application will always use the |
62 |
| - libraries from your A.B.0 installation. In the runpath case, you |
63 |
| - can set the ``LD_LIBRARY_PATH`` environment variable to point to the |
64 |
| - A.B.1 installation, and then your MPI application will use those |
65 |
| - libraries. |
| 110 | + In the rpath case, since the run-time linker searches the |
| 111 | + ``/opt/openmpi/A.B.0`` location that is hard-coded in your MPI |
| 112 | + application first, your application will use the libraries from your |
| 113 | + A.B.0 installation (regardless of the value of the |
| 114 | + ``LD_LIBRARY_PATH`` environment variable). |
66 | 115 |
|
67 | 116 | Note that in both cases, however, if you remove the original A.B.0
|
68 | 117 | installation and set ``LD_LIBRARY_PATH`` to point to the A.B.1
|
69 | 118 | installation, your application will use the A.B.1 libraries.
|
70 | 119 |
|
71 |
| - This rpath/runpath behavior can be disabled via |
| 120 | + As noted above, both runpath/rpath behaviors can be disabled via |
72 | 121 | ``--disable-wrapper-rpath``.
|
73 | 122 |
|
74 |
| - If you would like to keep the rpath option, but not enable runpath |
75 |
| - a different ``configure`` option is avalabile |
76 |
| - ``--disable-wrapper-runpath``. |
| 123 | + .. note:: You can also :ref:`customize the compiler/linker flags |
| 124 | + that are used by the wrapper compilers |
| 125 | + <label-customizing-wrapper-compiler>` to build Open |
| 126 | + MPI/OpenSHMEM applications. |
77 | 127 |
|
78 | 128 | * ``--enable-dlopen``: Enable Open MPI to load components as
|
79 | 129 | standalone Dynamic Shared Objects (DSOs) at run-time. This option
|
|
0 commit comments