DEV Community

Cover image for Hướng dẫn cài đặt OpenMPI trên Ubuntu Linux
Hải Phạm Ngọc
Hải Phạm Ngọc

Posted on

Hướng dẫn cài đặt OpenMPI trên Ubuntu Linux

OpenMPI Image

Bước 1: Cài đặt GCC và các công cụ biên dịch

  sudo apt install build-essential
Enter fullscreen mode Exit fullscreen mode

Bước 2: Tải, biên dịch và cài đặt OpenMPI

  wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.2.tar.gz
  tar -xvf openmpi-5.0.2.tar.gz
  cd openmpi-5.0.2
  ./configure --prefix="/usr/local"
  make
  sudo make all install
Enter fullscreen mode Exit fullscreen mode

Bước 3: Chỉnh sửa file .bashrc

  nano ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Thêm vào cuối file các dòng sau:

  export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
  export MANPATH="${MANPATH}:/usr/local/share/man"
Enter fullscreen mode Exit fullscreen mode

Ctrl+O -> Enter để lưu lại. Ctrl+X để thoát.

Sau đó, tắt Terminal đi và bật lại.

Bước 4: Kiểm tra

  mpiexec --version
  mpirun --version
Enter fullscreen mode Exit fullscreen mode

Nếu kết quả như dưới đây, thì ta đã cài đặt thành công:

  mpiexec (Open MPI) 5.0.2

  Report bugs to https://www.open-mpi.org/community/help/
Enter fullscreen mode Exit fullscreen mode

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay