環境
- Almalinux
実行手順
OpenMPIのREADMEを参照した。そのときのREADMEも貼っておく。ちなみに該当commitはこちら。
tar.bz2はここから、openmpi-4.1.1.tar.bz2をwget した。
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.1.tar.bz2
READMEのQuick startを見る限りでは、あとは手順通り進めればいいことになるがこれでは失敗する。perlやC, C++などのコンパイラや実行環境が不足しているから。
なので、apt install build-essential
のノリで、いい感じにいろいろ入れてくれるやつをyumで入れる。
sudo yum groupinstall "Development Tools"
sudo yum install kernel-devel kernel-headers
特定の環境のコンパイラや実行環境を求める場合は、これでやらずに一個ずつ丁寧に入れるか、一括して入れたあとにこだわりたいものをいい感じに入れなおせばいいと思う。(やってない)
ここまでこればあとはQuick startの通りにやればいい。最初にわたす--prefix
は/usr/local/package/openmpi/4.1.1
とかでいいんじゃないだろうか。自分はそうした。
というのも、module environmentを使ってスパコンみたいにパッケージとかバージョン管理できたら依存関係とか楽そうでいいよね。なので今度はこれを参考にmodule envirnmentを導入してみようと思う。
module environmentを入れれば、/usr/local/package/openmpi/3.1.1
とか/usr/local/package/openmpi/4.1.1_gcchogehoge
など、いろいろなのを共存できそう。
参考にしたOpenMPI公式のQuick start
Quick start
In many cases, Open MPI can be built and installed by simply
indicating the installation directory on the command line:$ tar xf openmpi-<version>.tar.bz2 $ cd openmpi-<version> $ ./configure --prefix=<path> |& tee config.out ...lots of output... $ make -j 8 |& tee make.out ...lots of output... $ make install |& tee install.out ...lots of output...
Note that there are many, many configuration options to the
./configure
step. Some of them may be needed for your particular
environmnet; see below for desciptions of the options available.If your installation prefix path is not writable by a regular user,
you may need to use sudo or su to run themake install
step. For
example:$ sudo make install |& tee install.out [sudo] password for jsquyres: <enter your password here> ...lots of output...