OpenMPI 4.0的编译安装OpenMPI 4.0的编译安装 安装步骤: 下载源码包并解压 wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.0.tar.bz2 tar -xvf openmpi-4.0.0.tar.bz2 根据OpenMPI 4.0的configur帮助说明,集群支持UCX,需要编译UCX 编译安装UCX wget https://github.com/openucx/ucx/releases/download/v1.6.0/ucx-1.6.0.tar.gz tar xvf ucx-1.6.0.tar.gz cd ucx-1.6.0 ./contrib/configure-release --prefix=/data/ucx1.6 make && make install 编译安装 cd openmpi-4.0.0 ./configure --prefix=/data/openmpi4.0 CC=gcc FC=gfortran --enable-openib-control-hdr-padding --with-ucx=/data/ucx1.6 --with-ucx-libdir=/data/ucx1.6/lib make make install 配置环境变量 vi .bashrc 添加以下语句: #OPENMPI4.0 export PATH=/data/openmpi4.0/bin:$PATH export INCLUDE=/data/openmpi4.0/include:$INCLUDE export LD_LIBRARY_PATH=/data/openmpi4.0/lib:$LD_LIBRARY_PATH export MANPATH=$MANPATH:/data/openmpi4.0/share/man 保存退出,并source .bashrc 查看是否导入成功 which mpicc 测试 在源码解压目录/home/baolu/openmpi-4.0.0/examples下 mpicc hello_c.c -o hello.exe 生成可执行文件hello.exe 或者 make 生成可执行文件hello_c 启动并行计算 mpirun --mca btl self -np 12 hello.exe 说明测试正常结束,编译安装成功了。 |