tar -zxvf hdf5-1.10.5.tar.gz
cd hdf5-1.10.5
CC=mpicc CFLAGS="$optflags -fPIC -Wno-incompatible-pointer-types-discards-qualifiers -Wno-non-literal-null-conversion" FC=mpif90 FCFLAGS="$optflags -fPIC" FFLAGS="$optflags -fPIC" LDFLAGS="$ldflags" CXX=mpicxx ./configure --prefix=/path/to/HDF5 --enable-shared --enable-static --enable-fortran --enable-parallel --enable-optimization=high
patch -p1 < libtool.patch
vi libtool.patch
diff -ruN hdf5-1.10.1/libtool hdf5-1.10.1-new/libtool --- hdf5-1.10.1/libtool 2019-12-02 20:02:56.270676503 +0000 +++ hdf5-1.10.1-new/libtool 2019-12-02 20:03:05.062708034 +0000 @@ -11832,7 +11832,7 @@ pic_flag="" # How to pass a linker flag through the compiler. -wl="" +wl="-Wl," # Compiler flag to prevent dynamic linking. link_static_flag=""
make -j$threads
make install
ls /path/to/HDF5/lib ls /path/to/HDF5/bin
回显显示如下信息,则表示安装成功。
export PATH=/path/to/HDF5/bin:$PATH export LD_LIBRARY_PATH=/path/to/HDF5/lib:$LD_LIBRARY_PATH