Build and install

To build and install Open MPI with Arm Compiler, follow these steps:

  1. Ensure that your paths are set up appropriately for Arm Compiler for HPC, for example:

    export PATH=/proj/ArmCompiler/bin:$PATH
    export LD_LIBRARY_PATH=/proj/ArmCompiler/lib:$LD_LIBRARY_PATH
  2. Within the openmpi-4.0.1 directory, create a new directory called build and change into it.

    Keeping builds in separate directories is optional when building open source software, but is considered best practice. Having multiple build directories side-by-side is often useful for testing and debugging.

  3. Run the Open MPI v4.0.1 configure script:

    CC=armclang CXX=armclang++ FC=armflang ../configure --prefix=/var/tmp/openmpi_ArmCompiler --enable-mpirun-prefix-by-default --enable-mpi1-compatibility

    The --enable-mpirun-prefix-by-default flag prefixes PATH and LD_LIBRARY_PATH on both local and remote hosts, ensuring the local environment is copied to remote nodes, where applicable.

    Open MPI versions 4.0.0+ remove support for features which were originally deprecated with the release of the MPI-2.0 standard, and later removed entirely from the MPI-3.0 standard. Supplying the --enable-mpi1-compatibility flag to configure enables support for these symbols. For more information, see Removed MPI constructs in Open MPI FAQs.


    The directory for installing the Open MPI build is /var/tmp/openmpi_ArmCompiler, although you can replace this with a directory of choice.
  4. Next, invoke make to build Open MPI with armflang, armclang, and armclang++ for Fortran, C, and C++, respectively.

    Build speed can be improved by parallelizing using the -j flag for make. Common practice is to use 2N+1 parallel jobs, where N=number of threads (or cores) on your system. For example, if the combined total of CPUs on your system is 64 threads, passing -j129 will enable a fast build:

    make -j129 V=1 all

    To show the command lines passed to the compiler for each object file being compiled or linked, the optional V=1 flag is used.

  5. Once built, install the build using:

    make install
  6. Add the --prefix-configured /var/tmp/openmpi_ArmCompiler directory to your $PATH

    export PATH=/var/tmp/openmpi_ArmCompiler/bin:$PATH

    This directory locates where Open MPI was installed.

    The commands mpifort, mpicc and mpicxx are now ready to be used for compiling Fortran, C and C++ MPI code, respectively. The mpiexec command can be used to execute a compiled MPI program.

    Now you are ready to test MPI programs using Arm Compiler for HPC.

Previous Next