ompi-body.txt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. Stage: spython-base
  2. %post
  3. export SINGULARITY_BINDPATH=$SINGULARITY_BINDPATH,$(echo /usr/bin/ | sed -e 's/ /,/g')
  4. MLNX_ARCH=ubuntu18.04-x86_64
  5. MLNX_VERSION=5.2-1.0.4.0
  6. # Python 3.7 is supported by Ubuntu Bionic out of the box
  7. python=3.7
  8. PYTHON_VERSION=${python}
  9. # Set default shell to /bin/bash
  10. #SHELL ["/bin/bash", "-cu"]
  11. TZ="Europe/London"
  12. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  13. apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \
  14. build-essential \
  15. cmake \
  16. g++-7 \
  17. git \
  18. curl \
  19. vim \
  20. wget \
  21. ca-certificates \
  22. python${PYTHON_VERSION} \
  23. python${PYTHON_VERSION}-dev \
  24. python${PYTHON_VERSION}-distutils \
  25. libpython-stdlib \
  26. python \
  27. udev \
  28. automake \
  29. gfortran \
  30. autotools-dev \
  31. chrpath \
  32. pkg-config \
  33. libnl-3-dev \
  34. tcl \
  35. pciutils \
  36. tk \
  37. libnl-route-3-dev \
  38. libltdl-dev \
  39. bison \
  40. autoconf \
  41. flex \
  42. graphviz \
  43. libssl1.0.0 \
  44. kmod \
  45. debhelper \
  46. libgfortran4 \
  47. ethtool \
  48. swig \
  49. lsof \
  50. libnl-route-3-200 \
  51. m4 \
  52. libnl-3-200 \
  53. dpatch \
  54. libnuma-dev \
  55. iputils-ping \
  56. iproute2 \
  57. apt-utils
  58. ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python
  59. curl -O https://bootstrap.pypa.io/get-pip.py && \
  60. python get-pip.py && \
  61. rm get-pip.py
  62. wget http://www.mellanox.com/downloads/ofed/MLNX_OFED-${MLNX_VERSION}/MLNX_OFED_LINUX-${MLNX_VERSION}-${MLNX_ARCH}.tgz && \
  63. tar -xzvf MLNX_OFED_LINUX-${MLNX_VERSION}-${MLNX_ARCH}.tgz --no-same-owner && \
  64. cd MLNX_OFED_LINUX-${MLNX_VERSION}-${MLNX_ARCH} && \
  65. ./mlnxofedinstall --user-space-only --without-fw-update --skip-repo --force && \
  66. cd .. && \
  67. rm -rf MLNX_OFED-LINUX-${MLNX_VERSION}-${MLNX_ARCH} && \
  68. rm -rf *.tgz
  69. # Install Open MPI version 4.1
  70. wget https://www.open-mpi.org/software/ompi/v4.1/downloads/openmpi-4.1.0.tar.gz && \
  71. tar zxf openmpi-4.1.0.tar.gz && \
  72. cd openmpi-4.1.0 && \
  73. ./configure --enable-mpirun-prefix-by-default \
  74. --enable-shared \
  75. --${VERBS} && \
  76. make -j $(nproc) all && \
  77. make install && \
  78. ldconfig && \
  79. rm -rf /tmp/openmpi
  80. cd /
  81. pip --no-cache-dir --disable-pip-version-check install mpi4py
  82. LD_LIBRARY_PATH=/usr/local/lib/:/usr/local/lib/openmpi:$LD_LIBRARY_PATH
  83. %environment
  84. %runscript