github.com/apptainer/singularity@v3.1.1+incompatible/examples/legacy/2.2/contrib/centos7-ompi_master.def (about)

     1  # Copyright (c) 2015-2017, Gregory M. Kurtzer. All rights reserved.
     2  # 
     3  # "Singularity" Copyright (c) 2016, The Regents of the University of California,
     4  # through Lawrence Berkeley National Laboratory (subject to receipt of any
     5  # required approvals from the U.S. Dept. of Energy).  All rights reserved.
     6  
     7  
     8  BootStrap: yum
     9  OSVersion: 7
    10  MirrorURL: http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/os/$basearch/
    11  Include: yum
    12  
    13  %post
    14      echo "Installing Development Tools YUM group"
    15      yum -y groupinstall "Development Tools"
    16      echo "Installing OpenMPI into container..."
    17      mkdir /tmp/git
    18      cd /tmp/git
    19      git clone https://github.com/open-mpi/ompi.git
    20      cd ompi
    21      ./autogen.pl
    22      ./configure --prefix=/usr/local
    23      make
    24      make install
    25      /usr/local/bin/mpicc examples/ring_c.c -o /usr/bin/mpi_ring
    26      cd /
    27      rm -rf /tmp/git
    28      exit 0
    29  
    30  %test
    31      /usr/local/bin/mpirun --allow-run-as-root /usr/bin/mpi_ring