首页 > 系统相关 >[Linux] Compile and Build h5py with MPI

[Linux] Compile and Build h5py with MPI

时间:2023-09-28 19:12:16浏览次数:51  
标签:code Run HDF5 MPI Compile following install h5py

How to Install H5PY-MPI

0. Preparation

  • linux system
  • gcc
  • anaconda/miniconda

1. Install open-mpi

Go to "https://www.open-mpi.org/software/".

Download the lastest release (ended with ".tar.gz").

Open the terminal and change dir to the download destination.

Suppose the pack's name is "openmpi-4.1.5.tar.gz".

Run following command to decompress:

tar xvzf openmpi-4.1.5.tar.gz

You will get a folder named "openmpi-4.1.5" under the current dir.
Remember the path of the folder. We will get back here when testing.

In terminal, change dir into the folder.

Run following command to compile (Without --prefix argument, openmpi would be installed in a default location. MAKE SURE it is installed in the default location):

./configure

Run following command to install:

sudo make all install

Run following command to open .bashrc (If you do not want to use vim, use another text editor such as nano or gredit instead.):

sudo vim ~/.bashrc

Add following command at the bottom of .bashrc:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Run following command to activate changes immediately:

source ~/.bashrc

Change terminal dir to the example folder of the previous decompressed folder.
In my case, I should run following command:

cd ~/Downloads/openmpi-4.1.5/examples

Run following command to build:

make

Run following command to run test file

mpirun -np 4 hello_c

If the ouput is 4 lines of "Hello World", then you have successfully installed open-mpi.

2. Install HDF5

Go to "https://www.hdfgroup.org/downloads/hdf5/source-code" to download the latest release of HDF5 (which in my case is "hdf5-1.14.2.tar.gz)

Open ternimal. Change dir to the download dest. Run following code to decompress:

tar xvzf hdf5-1.14.2.tar.gz

Change dir into the decompressed folder.

Run following code to set MPI-C as compiler:

export CC=mpicc

Run following code to turn on HDF5_MPI:

export HDF5_MPI="ON"

Run following code to change build config:

./configure --enable-shared --enable-parallel --prefix=/usr/local/hdf5

Run following code to set default HDF5_dir:

export HDF5_DIR="/usr/local/hdf5"

Run following code to compile:

make

Run following code to install HDF5:

sudo make install

Run following code to install some other things (Sry. I'm not sure what "other things" are.):

sudo make check-install

3. Install h5py with MPI and HDF5 build

Create a new env.

Activate the new env and run following command:

conda install openmpi

Install tree additional packages:

conda install gcc_linux-64
conda install gxx_linux-64
conda install gfortran_linux-64

Run following code to set MPI-C as compiler:

export CC=mpicc

Run following code to turn on HDF5_MPI:

export HDF5_MPI="ON"

Run following code to set default HDF5_dir:

export HDF5_DIR="/usr/local/hdf5"

Run following code to build h5py from source:

pip install --no-binary=h5py h5py -i https://pypi.tuna.tsinghua.edu.cn/simple

标签:code,Run,HDF5,MPI,Compile,following,install,h5py
From: https://www.cnblogs.com/jamesnulliu/p/Linux-Compile-and-Build-h5py-with-MPI.html

相关文章

  • 使用maven-compiler-plugin打包lombok代码出错
    错误信息无法识别lombok生成的方法[ERROR]Failedtoexecutegoalorg.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile(default-compile)onprojectlifeonline-service-blog:Compilationfailure:Compilationfailure:[ERROR]xxx/xx/XxxService.java:[31,......
  • Japanese Student Championship 2019 Qualification
    A-TakahashiCalendar枚举\(m\),再枚举\(d_1\),判断一下是否合法即可。#include<iostream>#include<cstdio>usingnamespacestd;intm,d;intmain(){ scanf("%d%d",&m,&d); intans=0; for(inti=1;i<=m;i++) { for(intd10=2;d10<......
  • MPI
    1#include<mpi.h>2intmyrank,numprocs;34MPI_Init(&argc,&argv);//并行开始5MPI_Comm_size(MPI_COMM_WORLD,&numprocs);//获取总线程数6MPI_Comm_rank(MPI_COMM_WORLD,&myrank);//获取线程id7MPI_Statusstatus;89bA=newdou......
  • org/springframework/boot/maven/RepackageMojo has been compiled by a more recent
    项目场景:项目中执行clean,再执行install时报错,错误如下org/springframework/boot/maven/RepackageMojohasbeencompiledbyamorerecentversionoftheJavaRuntime(classfileversion61.0),thisversionoftheJavaRuntimeonlyrecognizesclassfileversionsupt......
  • EMPIRE: LUPINONE
    Download:https://download.vulnhub.com/empire/01-Empire-Lupin-One.zipDescriptionDifficulty:MediumThisboxwascreatedtobemedium,butitcanbehardifyougetlost.CTFlikebox.Youhavetoenumerateasmuchasyoucan.ForhintsdiscordServer(h......
  • EMPIRE: BREAKOUT
    Download:https://download.vulnhub.com/empire/02-Breakout.zipDescriptionDifficulty:EasyThisboxwascreatedtobeanEasybox,butitcanbeMediumifyougetlost.ForhintsdiscordServer(https://discord.gg/7asvAhCEhe)一:信息收集netdiscover探测IPC......
  • Compile、Make和Build的区别
    Compile、Make和Build的区别 针对Java的开发工具,一般都有Compile、Make和Build三个菜单项,完成的功能的都差不多,但是又有区别。 编译,是将源代码转换为可执行代码的过程。编译需要指定源文件和编译输出的文件路径(输出目录)。Java的编译会将java编译为class文件,将非java的文件(一般成......
  • android中的VERSION和VERSION_CODES和compileSdkVersion, minSdkVersion 和 targetSdk
    一背景经常会有代码中用到  Build.VERSION.SDK_INT<Build.VERSION_CODES.O,这是指什么意思。在app项目中,经常会看到android{compileSdkVersion30buildToolsVersion"30.0.3"defaultConfig{applicationId"com.yl.qrcode"minSdkVersio......
  • .NET 程序员的调试神器-Dumpify
    DumpifyDumpify是一个使用C#开发的开源库,它通过向控制台应用程序添加.Dump()扩展方法来提高工作效率和可调试性。可以Dump任何对象并以结构化且丰富多彩的方式输出到控制台、跟踪、调试事件。支持属性、字段和非公共成员,支持设置最大嵌套层数,支持循环依赖和引用,支持......
  • Unity 性能优化之Shader分析处理函数 ShaderUtil.GetAvailableShaderCompilerPlatform
    Unity性能优化之Shader分析处理函数ShaderUtil.GetAvailableShaderCompilerPlatforms用法点击封面跳转到Unity国际版下载页面简介在Unity中,性能优化是游戏开发过程中非常重要的一环。其中,ShaderUtil.GetAvailableShaderCompilerPlatforms函数是一个内部函数,它可以帮助......