Skip to content

Commit 1050509

Browse files
committed
docs: Add explicit docs about --with-mpi-moduledir
As a follow on to 7338594, add some additional information about the --with-mpi-moduledir configure CLI option, especially as it pertains to making relocatable Open MPI installations. Also, remove an errant space that crept into the mpifort wrapper compiler flags in 7338594. Signed-off-by: Jeff Squyres <jeff@squyres.com>
1 parent 76458b0 commit 1050509

File tree

3 files changed

+73
-2
lines changed

3 files changed

+73
-2
lines changed

config/opal_setup_wrappers.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[
541541
OMPI_WRAPPER_FCFLAGS='-I${includedir}'" ${wrapper_extra_fcflags} ${with_wrapper_fcflags}"
542542
AS_IF([test -n "${OMPI_FC_MODULE_FLAG}"],
543543
[dnl deal with some interesting expansion behavior in OPAL_APPEND
544-
wrapper_tmp_arg="${OMPI_FC_MODULE_FLAG} ${OMPI_FORTRAN_MODULEDIR}"
544+
wrapper_tmp_arg="${OMPI_FC_MODULE_FLAG}${OMPI_FORTRAN_MODULEDIR}"
545545
OPAL_APPEND([OMPI_WRAPPER_FCFLAGS], [${wrapper_tmp_arg}])])
546546
AC_SUBST([OMPI_WRAPPER_FCFLAGS])
547547
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS])
@@ -780,7 +780,7 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[
780780
OSHMEM_WRAPPER_FCFLAGS='-I${includedir}'" ${wrapper_extra_fcflags} ${with_wrapper_fcflags}"
781781
AS_IF([test -n "${OMPI_FC_MODULE_FLAG}"],
782782
[dnl deal with some interesting expansion behavior in OPAL_APPEND
783-
wrapper_tmp_arg="${OMPI_FC_MODULE_FLAG} ${OMPI_FORTRAN_MODULEDIR}"
783+
wrapper_tmp_arg="${OMPI_FC_MODULE_FLAG}${OMPI_FORTRAN_MODULEDIR}"
784784
OPAL_APPEND([OSHMEM_WRAPPER_FCFLAGS], [${wrapper_tmp_arg}])])
785785
AC_SUBST([OSHMEM_WRAPPER_FCFLAGS])
786786
AC_MSG_RESULT([$OSHMEM_WRAPPER_EXTRA_FCFLAGS])

docs/installing-open-mpi/configure-cli-options/misc.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,35 @@ above categories that can be used with ``configure``:
6363
See the section on :ref:`customizing wrapper compiler behavior
6464
<label-customizing-wrapper-compiler>` to see how to alter the
6565
wrapper compiler behavior at run time.
66+
67+
* ``--with-mpi-moduledir``: Specify the directory where the Fortran
68+
MPI module files are installed.
69+
70+
For historical reasons, Open MPI's Fortran MPI modulefiles are
71+
installed into ``$libdir`` by default. This option lets you change
72+
where they are installed; some users prefer Fortran module files
73+
installed into ``$installdir``, for example.
74+
75+
.. note:: If you intend to make your Open MPI installation
76+
relocatable :ref:`via the OPAL_PREFIX mechanism
77+
<install-location-opal-prefix>`, you will want to ensure
78+
to specify the module directory relative to the
79+
``prefix``. For example:
80+
81+
.. code-block::
82+
83+
$ ./configure --prefix=/opt/openmpi --with-mpi-moduledir='${includedir}/modules`...
84+
85+
Note the additional shell quoting that is likely necessary
86+
to prevent shell variable expansion, and the additional
87+
``${}`` around ``includedir`` that is necessary for Open MPI
88+
to recognize that it is a special name that needs to be
89+
expanded.
90+
91+
Finally, note that the Fortran module installation
92+
directory is *not* one of the :ref:`recognized directories
93+
that can be specified via environment variable at run time
94+
<install-location-overriding-individual-directories>`.
95+
Instead, to make the Fortran module directory relocatable,
96+
it needs to be relative to one of the other recognized
97+
directories.

docs/installing-open-mpi/installation-location.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ variables to the new location where Open MPI now resides).
162162

163163
There are three methods.
164164

165+
.. _install-location-opal-prefix:
166+
165167
Move 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
172174
enable 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
190227
that Open MPI can function properly.
191228

229+
.. _install-location-overriding-individual-directories:
230+
192231
Overriding individual directories
193232
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194233

0 commit comments

Comments
 (0)