Skip to content
Snippets Groups Projects
Commit 78951198 authored by Marty Kandes's avatar Marty Kandes
Browse files

Simplify MLNX and OMPI environment variables

parent 66a4cedf
No related branches found
No related tags found
No related merge requests found
...@@ -16,24 +16,25 @@ From: mkandes/naked-singularity:ubuntu-18.04 ...@@ -16,24 +16,25 @@ From: mkandes/naked-singularity:ubuntu-18.04
%environment %environment
# Set Mellanox OFED version number, operating system, and hardware # Set Mellanox OFED version, operating system, and hardware platform
# platform export MLNX_ROOT_URL='http://www.mellanox.com/downloads/ofed'
export MLNX_OFED_VERSION='4.7-3.2.9.0' export MLNX_OFED_VERSION='4.7-3.2.9.0'
export MLNX_OS_VERSION='ubuntu18.04' export MLNX_OS_VERSION='ubuntu18.04'
export MLNX_PLATFORM='x86_64' export MLNX_PLATFORM='x86_64'
# Set OpenMPI major, minor, and revision versions, root and # Set OpenMPI major, minor, and revision numbers, root and
# installation directories # installation directories
export OPENMPI_MAJOR_VERSION=4 export OMPI_ROOT_URL='https://download.open-mpi.org/release/open-mpi'
export OPENMPI_MINOR_VERSION=0 export OMPI_MAJOR='4'
export OPENMPI_REVISION_VERSION=4 export OMPI_MINOR='0'
export OPENMPI_VERSION="${OPENMPI_MAJOR_VERSION}.${OPENMPI_MINOR_VERSION}.${OPENMPI_REVISION_VERSION}" export OMPI_REVISION='4'
export OPENMPI_ROOT_DIR='/opt/openmpi' export OMPI_VERSION="${OMPI_MAJOR}.${OMPI_MINOR}.${OMPI_REVISION}"
export OPENMPI_INSTALL_DIR="${OPENMPI_ROOT_DIR}/${OPENMPI_VERSION}" export OMPI_ROOT_DIR='/opt/openmpi'
export OMPI_INSTALL_DIR="${OMPI_ROOT_DIR}/${OMPI_VERSION}"
# Set paths to OpenMPI binaries and libraries # Set paths to OpenMPI binaries and libraries
export PATH="${OPENMPI_INSTALL_DIR}/bin:${PATH}" export PATH="${OMPI_INSTALL_DIR}/bin:${PATH}"
export LD_LIBRARY_PATH="${OPENMPI_INSTALL_DIR}/lib:${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH="${OMPI_INSTALL_DIR}/lib:${LD_LIBRARY_PATH}"
%post -c /bin/bash %post -c /bin/bash
...@@ -67,8 +68,8 @@ From: mkandes/naked-singularity:ubuntu-18.04 ...@@ -67,8 +68,8 @@ From: mkandes/naked-singularity:ubuntu-18.04
cd /tmp cd /tmp
# Set Mellanox OFED version number, operating system, and hardware # Set Mellanox OFED version, operating system, and hardware platform
# platform export MLNX_ROOT_URL='http://www.mellanox.com/downloads/ofed'
export MLNX_OFED_VERSION='4.7-3.2.9.0' export MLNX_OFED_VERSION='4.7-3.2.9.0'
export MLNX_OS_VERSION='ubuntu18.04' export MLNX_OS_VERSION='ubuntu18.04'
export MLNX_PLATFORM='x86_64' export MLNX_PLATFORM='x86_64'
...@@ -76,7 +77,7 @@ From: mkandes/naked-singularity:ubuntu-18.04 ...@@ -76,7 +77,7 @@ From: mkandes/naked-singularity:ubuntu-18.04
# Download and install Mellanox OFED drivers and supporting # Download and install Mellanox OFED drivers and supporting
# libraries for userspace access to Ethernet, RDMA, and Infiniband. # libraries for userspace access to Ethernet, RDMA, and Infiniband.
# https://docs.mellanox.com/pages/releaseview.action?pageId=15049785 # https://docs.mellanox.com/pages/releaseview.action?pageId=15049785
wget "http://www.mellanox.com/downloads/ofed/MLNX_OFED-${MLNX_OFED_VERSION}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-${MLNX_OS_VERSION}-${MLNX_PLATFORM}.tgz" wget "${MLNX_ROOT_URL}/MLNX_OFED-${MLNX_OFED_VERSION}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-${MLNX_OS_VERSION}-${MLNX_PLATFORM}.tgz"
tar -xf "MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-${MLNX_OS_VERSION}-${MLNX_PLATFORM}.tgz" tar -xf "MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-${MLNX_OS_VERSION}-${MLNX_PLATFORM}.tgz"
cd "MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-${MLNX_OS_VERSION}-${MLNX_PLATFORM}" cd "MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-${MLNX_OS_VERSION}-${MLNX_PLATFORM}"
./mlnxofedinstall --user-space-only --without-fw-update --force ./mlnxofedinstall --user-space-only --without-fw-update --force
...@@ -96,27 +97,28 @@ From: mkandes/naked-singularity:ubuntu-18.04 ...@@ -96,27 +97,28 @@ From: mkandes/naked-singularity:ubuntu-18.04
cd /tmp cd /tmp
# Set OpenMPI major, minor, and revision versions, root and # Set OpenMPI major, minor, and revision numbers, root and
# installation directories # installation directories
export OPENMPI_MAJOR_VERSION=4 export OMPI_ROOT_URL='https://download.open-mpi.org/release/open-mpi'
export OPENMPI_MINOR_VERSION=0 export OMPI_MAJOR='4'
export OPENMPI_REVISION_VERSION=4 export OMPI_MINOR='0'
export OPENMPI_VERSION="${OPENMPI_MAJOR_VERSION}.${OPENMPI_MINOR_VERSION}.${OPENMPI_REVISION_VERSION}" export OMPI_REVISION='4'
export OPENMPI_ROOT_DIR='/opt/openmpi' export OMPI_VERSION="${OMPI_MAJOR}.${OMPI_MINOR}.${OMPI_REVISION}"
export OPENMPI_INSTALL_DIR="${OPENMPI_ROOT_DIR}/${OPENMPI_VERSION}" export OMPI_ROOT_DIR='/opt/openmpi'
export OMPI_INSTALL_DIR="${OMPI_ROOT_DIR}/${OMPI_VERSION}"
# Download, build, and install OpenMPI # Download, build, and install OpenMPI
wget "https://download.open-mpi.org/release/open-mpi/v${OPENMPI_MAJOR_VERSION}.${OPENMPI_MINOR_VERSION}/openmpi-${OPENMPI_VERSION}.tar.gz" wget "${OMPI_ROOT_URL}/v${OMPI_MAJOR}.${OMPI_MINOR}/openmpi-${OMPI_VERSION}.tar.gz"
tar -xf "openmpi-${OPENMPI_VERSION}.tar.gz" tar -xf "openmpi-${OMPI_VERSION}.tar.gz"
cd "openmpi-${OPENMPI_VERSION}" cd "openmpi-${OMPI_VERSION}"
./configure --prefix="${OPENMPI_INSTALL_DIR}" ./configure --prefix="${OMPI_INSTALL_DIR}"
make all install make all install
cd /tmp cd /tmp
# Remove OpenMPI build directory and source tarball # Remove OpenMPI build directory and source tarball
rm -rf "openmpi-${OPENMPI_VERSION}" rm -rf "openmpi-${OMPI_VERSION}"
rm "openmpi-${OPENMPI_VERSION}.tar.gz" rm "openmpi-${OMPI_VERSION}.tar.gz"
# Cleanup # Cleanup
apt-get -y autoremove --purge apt-get -y autoremove --purge
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment