@@ -162,6 +162,8 @@ variables to the new location where Open MPI now resides).
162162
163163There are three methods.
164164
165+ .. _install-location-opal-prefix :
166+
165167Move an existing Open MPI installation to a new prefix
166168^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167169
@@ -171,6 +173,41 @@ MPI. For example, if Open MPI had initially been installed to
171173``/home/openmpi ``, setting ``OPAL_PREFIX `` to ``/home/openmpi `` will
172174enable Open MPI to function properly.
173175
176+ .. note :: The ``OPAL_PREFIX`` mechanism relies on all installation
177+ directories being specified as relative to the ``prefix ``
178+ directory specified during ``configure ``.
179+
180+ For example, if Open MPI is configured the following way:
181+
182+ .. code-block ::
183+
184+ $ ./configure --prefix=/opt/openmpi --libdir=/usr/lib ...
185+
186+ Then setting ``OPAL_PREFIX `` will not affect the run-time
187+ implications of ``libdir ``, since ``/usr/lib `` is not
188+ specified as relative to ``/opt/openmpi ``.
189+
190+ Instead of specifying absolute directories, you can make
191+ them relative to other ``configure ``-recognized directories.
192+ For example:
193+
194+ .. code-block ::
195+
196+ $ ./configure --prefix=/opt/openmpi --libdir='${exec_prefix}/x86_64/lib' ...
197+
198+ Note the additional shell quoting that is likely necessary
199+ to prevent shell variable expansion, and the additional
200+ ``${} `` around ``exec_prefix `` that is necessary for Open MPI
201+ to recognize that it is a special name that needs to be
202+ expanded.
203+
204+ The directory names recognized by Open MPI are listed in the
205+ :ref: `Overriding individual directories
206+ <install-location-overriding-individual-directories>`
207+ section (below), without the ``OPAL_ `` prefix, and in lower
208+ case. For example, the ``OPAL_SYSCONFDIR `` environment
209+ variable corresponds to ``${sysconfdir} ``.
210+
174211"Stage" an Open MPI installation in a temporary location
175212^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176213
@@ -189,6 +226,8 @@ environment variable can be used; setting ``OPAL_DESTDIR`` to
189226``/var/rpm/build.1234 `` will automatically prefix every directory such
190227that Open MPI can function properly.
191228
229+ .. _install-location-overriding-individual-directories :
230+
192231Overriding individual directories
193232^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194233
0 commit comments